CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTDigi.h
Go to the documentation of this file.
1 #ifndef DTDigi_DTDigi_h
2 #define DTDigi_DTDigi_h
3 
17 #include <boost/cstdint.hpp>
18 
19 class DTDigi{
20 
21 public:
22  // typedef uint32_t ChannelType;
23 
26  explicit DTDigi (int wire, int nTDC, int number=0);
27 
28  // Construct from the wire#, the time (ns) and the digi number.
29  // time is converted in TDC counts (1 TDC = 25./32. ns)
30  // number should identify uniquely multiple digis in the same cell.
31  explicit DTDigi (int wire, double tdrift, int number=0);
32 
33  // Construct from channel and counts.
34  // explicit DTDigi (ChannelType channel, int nTDC);
35 
37  DTDigi ();
38 
40  bool operator==(const DTDigi& digi) const;
41 
42  // The channel identifier and the digi number packed together
43  // ChannelType channel() const ;
44 
46  int wire() const;
47 
49  int number() const;
50 
52  double time() const;
53 
55  uint32_t countsTDC() const;
56 
58  void setTime(double time);
59 
61  void setCountsTDC (int nTDC);
62 
64  void print() const;
65 
66 private:
67  friend class testDTDigis;
68 
69  // The value of one TDC count in ns
70  static const double reso;
71 
72  // Masks&shifts for the channel identifier
73 // static const uint32_t wire_mask = 0xffff0000;
74 // static const uint32_t number_mask = 0xffff;
75 // static const uint32_t wire_offset = 16;
76 
77  uint16_t theWire; // channel number
78  uint32_t theCounts; // TDC count, up to 20 bits actually used
79  uint16_t theNumber; // counter for digis in the same cell
80 };
81 
82 #include<iostream>
83 inline std::ostream & operator<<(std::ostream & o, const DTDigi& digi) {
84  return o << " " << digi.wire()
85  << " " << digi.time()
86  << " " << digi.number();
87 }
88 #endif
89 
uint32_t theCounts
Definition: DTDigi.h:78
uint16_t theNumber
Definition: DTDigi.h:79
void print() const
Print content of digi.
Definition: DTDigi.cc:89
bool operator==(const DTDigi &digi) const
Digis are equal if they are on the same cell and have same TDC count.
Definition: DTDigi.cc:52
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
int wire() const
Return wire number.
Definition: DTDigi.cc:69
void setCountsTDC(int nTDC)
Set with a TDC count.
Definition: DTDigi.cc:79
uint16_t theWire
Definition: DTDigi.h:77
double time() const
Get time in ns.
Definition: DTDigi.cc:65
friend class testDTDigis
Definition: DTDigi.h:67
DTDigi()
Default construction.
Definition: DTDigi.cc:43
Definition: DTDigi.h:19
static const double reso
Definition: DTDigi.h:70
uint32_t countsTDC() const
Get raw TDC count.
Definition: DTDigi.cc:67
void setTime(double time)
Set with a time in ns.
Definition: DTDigi.cc:75
int number() const
Identifies different digis within the same.
Definition: DTDigi.cc:71