Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:40:05

0001 /****************************************************************************
0002  *
0003  * This is a part of TOTEM offline software.
0004  * Author:
0005  *   Laurent Forthomme
0006  *
0007  ****************************************************************************/
0008 
0009 #ifndef DataFormats_TotemReco_TotemT2Digi_h
0010 #define DataFormats_TotemReco_TotemT2Digi_h
0011 
0012 class TotemT2Digi {
0013 public:
0014   TotemT2Digi() = default;
0015   TotemT2Digi(unsigned short id, unsigned char marker, unsigned short le, unsigned short te, unsigned char status);
0016 
0017   void setLeadingEdge(unsigned short le) { lead_edge_ = le; }
0018   unsigned short leadingEdge() const { return lead_edge_; }
0019   void setTrailingEdge(unsigned short te) { trail_edge_ = te; }
0020   unsigned short trailingEdge() const { return trail_edge_; }
0021   unsigned char status() const { return status_ & 0xF; }
0022   bool hasLE() const { return marker_ & 0x1; }
0023   bool hasTE() const { return marker_ & 0x2; }
0024   bool hasManyLE() const { return marker_ & 0x4; }
0025   bool hasManyTE() const { return marker_ & 0x8; }
0026 
0027 private:
0028   /// New HW ID in ver 2.2
0029   unsigned short id_{0};
0030   /// Channel marker
0031   unsigned char marker_{0};
0032   /// Leading edge time
0033   unsigned short lead_edge_{0};
0034   /// Trailing edge time
0035   unsigned short trail_edge_{0};
0036   /// Header status flags
0037   unsigned char status_{0};
0038 };
0039 
0040 bool operator<(const TotemT2Digi& lhs, const TotemT2Digi& rhs);
0041 
0042 #endif