CMS 3D CMS Logo

DTDigi.h
Go to the documentation of this file.
1 #ifndef DTDigi_DTDigi_h
2 #define DTDigi_DTDigi_h
3 
15 #include <cstdint>
16 
17 class DTDigi {
18 public:
19  // typedef uint32_t ChannelType;
20 
23  explicit DTDigi(int wire, int nTDC, int number = 0, int base = 32);
24 
25  // Construct from the wire#, the time (ns) and the digi number.
26  // time is converted in TDC counts (1 TDC = 25./base ns)
27  // number should identify uniquely multiple digis in the same cell.
28  explicit DTDigi(int wire, double tdrift, int number = 0, int base = 32);
29 
30  // Construct from channel and counts.
31  // explicit DTDigi (ChannelType channel, int nTDC);
32 
34  DTDigi();
35 
37  bool operator==(const DTDigi& digi) const;
38 
39  // The channel identifier and the digi number packed together
40  // ChannelType channel() const ;
41 
43  int wire() const;
44 
46  int number() const;
47 
49  double time() const;
50 
52  int32_t countsTDC() const;
53 
55  double tdcUnit() const;
56 
58  int tdcBase() const;
59 
61  void print() const;
62 
63 private:
64  friend class testDTDigis;
65 
66  // The value of one TDC count in ns
67  static const double reso;
68 
69  int32_t theCounts; // TDC count, in units given by 1/theTDCBase
70  uint16_t theWire; // channel number
71  uint8_t theNumber; // counter for digis in the same cell
72  uint8_t theTDCBase; // TDC base (counts per BX; 32 in Ph1 or 30 in Ph2)
73 };
74 
75 #include <iostream>
76 #include <cstdint>
77 inline std::ostream& operator<<(std::ostream& o, const DTDigi& digi) {
78  return o << " " << digi.wire() << " " << digi.time() << " " << digi.number();
79 }
80 #endif
int32_t theCounts
Definition: DTDigi.h:69
int wire() const
Return wire number.
Definition: DTDigi.cc:41
int32_t countsTDC() const
Get raw TDC count.
Definition: DTDigi.cc:39
double time() const
Get time in ns.
Definition: DTDigi.cc:37
uint16_t theWire
Definition: DTDigi.h:70
friend class testDTDigis
Definition: DTDigi.h:64
int tdcBase() const
Get the TDC base (counts per BX)
Definition: DTDigi.cc:47
DTDigi()
Default construction.
Definition: DTDigi.cc:26
Definition: DTDigi.h:17
static const double reso
Definition: DTDigi.h:67
int number() const
Identifies different digis within the same cell.
Definition: DTDigi.cc:43
uint8_t theTDCBase
Definition: DTDigi.h:72
std::ostream & operator<<(std::ostream &o, const DTDigi &digi)
Definition: DTDigi.h:77
uint8_t theNumber
Definition: DTDigi.h:71
void print() const
Print content of digi.
Definition: DTDigi.cc:49
bool operator==(const DTDigi &digi) const
Digis are equal if they are on the same cell and have same TDC count.
Definition: DTDigi.cc:29
double tdcUnit() const
Get the TDC unit value in ns.
Definition: DTDigi.cc:45