Direction

MuonTime

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#ifndef MuonReco_MuonTime_h
#define MuonReco_MuonTime_h

namespace reco {
  struct MuonTime {
    enum Direction { OutsideIn = -1, Undefined = 0, InsideOut = 1 };

    /// number of muon stations used
    int nDof;

    /// time of arrival at the IP for the Beta=1 hypothesis
    ///  a) particle is moving from inside out
    float timeAtIpInOut;
    float timeAtIpInOutErr;
    ///  b) particle is moving from outside in
    float timeAtIpOutIn;
    float timeAtIpOutInErr;

    /// direction estimation based on time dispersion
    Direction direction() const {
      if (nDof < 2)
        return Undefined;
      if (timeAtIpInOutErr > timeAtIpOutInErr)
        return OutsideIn;
      return InsideOut;
    }

    MuonTime() : nDof(0), timeAtIpInOut(0), timeAtIpInOutErr(0), timeAtIpOutIn(0), timeAtIpOutInErr(0) {}
  };
}  // namespace reco
#endif