CMS 3D CMS Logo

CSCComparatorDigi.h
Go to the documentation of this file.
1 #ifndef DataFormats_CSCDigi_CSCComparatorDigi_h
2 #define DataFormats_CSCDigi_CSCComparatorDigi_h
3 
12 #include <iosfwd>
13 #include <vector>
14 #include <cstdint>
15 
17 public:
19  CSCComparatorDigi(int strip, int comparator, int timeBinWord);
21 
24 
26  bool operator==(const CSCComparatorDigi& digi) const;
27 
29  bool operator<(const CSCComparatorDigi& digi) const;
30 
32  int getDiStrip() const;
33 
35  int getStrip() const { return strip_; }
36 
38  int getCFEB() const;
39 
41  int getComparator() const { return comparator_; }
42 
44  int getTimeBinWord() const { return timeBinWord_; }
45 
47  int getTimeBin() const;
48 
50  int getHalfStrip() const;
51 
53  float getFractionalStrip() const;
54 
58  std::vector<int> getTimeBinsOn() const;
59 
61  void setStrip(int strip);
62 
64  void setComparator(int comparator);
65 
67  void print() const;
68 
69 private:
70  uint16_t strip_;
71  uint16_t comparator_;
72  uint16_t timeBinWord_;
73 };
74 
76 std::ostream& operator<<(std::ostream& o, const CSCComparatorDigi& digi);
77 
78 #endif
int getComparator() const
Get Comparator readings. Can be 0 or 1.
bool operator==(const CSCComparatorDigi &digi) const
Digis are equal if they are on the same strip and have same Comparator data.
void setComparator(int comparator)
Set Comparator data.
int getTimeBin() const
Return bin number of first time bin which is ON. Counts from 0.
void setStrip(int strip)
Set the strip number.
CSCComparatorDigi()
comparator here can be either 0 or 1 for left or right halfstrip of given strip
float getFractionalStrip() const
Return the fractional half-strip. Counts from 0.25.
int getCFEB() const
Get the CFEB number. Counts from 0.
std::vector< int > getTimeBinsOn() const
int getTimeBinWord() const
Return the word with each bit corresponding to a time bin.
int getHalfStrip() const
Get the associated halfstrip number for this comparator digi. Counts from 0.
bool operator<(const CSCComparatorDigi &digi) const
sort by time first, then by strip
std::ostream & operator<<(std::ostream &o, const CSCComparatorDigi &digi)
Output operator.
int getStrip() const
Get the strip number. Counts from 1.
int getDiStrip() const
Get the distrip number. Counts from 0.
void print() const
Print content of digi.