CMS 3D CMS Logo

CSCCLCTDigi.h
Go to the documentation of this file.
1 #ifndef DataFormats_CSCDigi_CSCCLCTDigi_h
2 #define DataFormats_CSCDigi_CSCCLCTDigi_h
3 
12 #include <cstdint>
13 #include <iosfwd>
14 #include <vector>
15 #include <limits>
16 
17 class CSCCLCTDigi {
18 public:
19  typedef std::vector<std::vector<uint16_t>> ComparatorContainer;
20 
23  enum class Version { Legacy = 0, Run3 };
24 
26  CSCCLCTDigi(const uint16_t valid,
27  const uint16_t quality,
28  const uint16_t pattern,
29  const uint16_t striptype,
30  const uint16_t bend,
31  const uint16_t strip,
32  const uint16_t cfeb,
33  const uint16_t bx,
34  const uint16_t trknmb = 0,
35  const uint16_t fullbx = 0,
36  const int16_t compCode = -1,
39  CSCCLCTDigi();
40 
42  void clear();
43 
45  bool isValid() const { return valid_; }
46 
48  void setValid(const uint16_t valid) { valid_ = valid; }
49 
51  uint16_t getQuality() const { return quality_; }
52 
54  void setQuality(const uint16_t quality) { quality_ = quality; }
55 
57  uint16_t getPattern() const { return pattern_; }
58 
60  void setPattern(const uint16_t pattern) { pattern_ = pattern; }
61 
63  uint16_t getStripType() const { return striptype_; }
64 
66  void setStripType(const uint16_t stripType) { striptype_ = stripType; }
67 
69  uint16_t getBend() const { return bend_; }
70 
72  void setBend(const uint16_t bend) { bend_ = bend; }
73 
75  uint16_t getStrip() const;
76 
78  void setStrip(const uint16_t strip) { strip_ = strip; }
79 
81  void setQuartStrip(const bool quartStrip);
82 
84  bool getQuartStrip() const;
85 
87  void setEightStrip(const bool eightStrip);
88 
90  bool getEightStrip() const;
91 
93  uint16_t getCFEB() const { return cfeb_; }
94 
96  void setCFEB(const uint16_t cfeb) { cfeb_ = cfeb; }
97 
99  uint16_t getBX() const { return bx_; }
100 
102  void setBX(const uint16_t bx) { bx_ = bx; }
103 
105  uint16_t getTrknmb() const { return trknmb_; }
106 
113  uint16_t getKeyStrip(uint16_t n = 2) const;
114 
116  void setTrknmb(const uint16_t number) { trknmb_ = number; }
117 
119  uint16_t getFullBX() const { return fullbx_; }
120 
122  void setFullBX(const uint16_t fullbx) { fullbx_ = fullbx; }
123 
124  // 12-bit comparator code
125  int16_t getCompCode() const { return (isRun3() ? compCode_ : -1); }
126 
127  void setCompCode(const int16_t code) { compCode_ = code; }
128 
129  // comparator hits in this CLCT
130  ComparatorContainer getHits() const { return hits_; }
131 
133 
137  bool operator>(const CSCCLCTDigi&) const;
138 
140  bool operator==(const CSCCLCTDigi&) const;
141 
143  bool operator!=(const CSCCLCTDigi&) const;
144 
146  void print() const;
147 
149  bool isRun3() const { return version_ == Version::Run3; }
150 
151  void setRun3(bool isRun3);
152 
153 private:
154  uint16_t valid_;
155  uint16_t quality_;
156  // In Run-3, the 4-bit pattern number is reinterpreted as the
157  // 4-bit bending value. There will be 16 bending values * 2 (left/right)
158  uint16_t pattern_;
159  uint16_t striptype_; // not used since mid-2008
160  // Common definition for left/right bending in Run-1, Run-2 and Run-3.
161  // 0: right; 1: left
162  uint16_t bend_;
163  // In Run-3, the strip number receives two additional bits
164  // strip[4:0] -> 1/2 strip value
165  // strip[5] -> 1/4 strip bit
166  // strip[6] -> 1/8 strip bit
167  uint16_t strip_;
168  // There are up to 7 (D)CFEBs in a chamber
169  uint16_t cfeb_;
170  uint16_t bx_;
171  uint16_t trknmb_;
172  uint16_t fullbx_;
173 
174  // new in Run-3: 12-bit comparator code
175  // set by default to -1 for Run-1 and Run-2 CLCTs
176  int16_t compCode_;
177  // which hits are in this CLCT?
179 
181 };
182 
183 std::ostream& operator<<(std::ostream& o, const CSCCLCTDigi& digi);
184 
185 #endif
CSCCLCTDigi::striptype_
uint16_t striptype_
Definition: CSCCLCTDigi.h:159
CSCCLCTDigi::strip_
uint16_t strip_
Definition: CSCCLCTDigi.h:167
CSCCLCTDigi::setTrknmb
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting CLCTs.
Definition: CSCCLCTDigi.h:116
CSCCLCTDigi::setStripType
void setStripType(const uint16_t stripType)
set stripType
Definition: CSCCLCTDigi.h:66
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
CSCCLCTDigi::getTrknmb
uint16_t getTrknmb() const
return track number (1,2)
Definition: CSCCLCTDigi.h:105
CSCCLCTDigi::operator!=
bool operator!=(const CSCCLCTDigi &) const
True if the preceding one is false.
Definition: CSCCLCTDigi.cc:180
CSCCLCTDigi::kEightStripMask
Definition: CSCCLCTDigi.h:21
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
CSCCLCTDigi::getCompCode
int16_t getCompCode() const
Definition: CSCCLCTDigi.h:125
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCCLCTDigi::kHalfStripShift
Definition: CSCCLCTDigi.h:22
CSCCLCTDigi::setEightStrip
void setEightStrip(const bool eightStrip)
set single eight strip bit
Definition: CSCCLCTDigi.cc:116
CSCCLCTDigi::valid_
uint16_t valid_
Definition: CSCCLCTDigi.h:154
CSCCLCTDigi::setBend
void setBend(const uint16_t bend)
set bend
Definition: CSCCLCTDigi.h:72
CSCCLCTDigi::setPattern
void setPattern(const uint16_t pattern)
set pattern
Definition: CSCCLCTDigi.h:60
CSCCLCTDigi::setStrip
void setStrip(const uint16_t strip)
set strip
Definition: CSCCLCTDigi.h:78
CSCCLCTDigi::setQuartStrip
void setQuartStrip(const bool quartStrip)
set single quart strip bit
Definition: CSCCLCTDigi.cc:108
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
validateGeometry_cfg.valid
valid
Definition: validateGeometry_cfg.py:21
operator<<
std::ostream & operator<<(std::ostream &o, const CSCCLCTDigi &digi)
Definition: CSCCLCTDigi.cc:207
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
CSCCLCTDigi::CLCTKeyStripMasks
CLCTKeyStripMasks
Definition: CSCCLCTDigi.h:21
CSCCLCTDigi::pattern_
uint16_t pattern_
Definition: CSCCLCTDigi.h:158
CSCCLCTDigi::hits_
ComparatorContainer hits_
Definition: CSCCLCTDigi.h:178
CSCCLCTDigi::getQuality
uint16_t getQuality() const
return quality of a pattern (number of layers hit!)
Definition: CSCCLCTDigi.h:51
CSCCLCTDigi::getBend
uint16_t getBend() const
return bend
Definition: CSCCLCTDigi.h:69
CSCCLCTDigi::setValid
void setValid(const uint16_t valid)
set valid
Definition: CSCCLCTDigi.h:48
CSCCLCTDigi::isRun3
bool isRun3() const
Distinguish Run-1/2 from Run-3.
Definition: CSCCLCTDigi.h:149
CSCCLCTDigi::bend_
uint16_t bend_
Definition: CSCCLCTDigi.h:162
contentValuesFiles.number
number
Definition: contentValuesFiles.py:53
CSCCLCTDigi::getKeyStrip
uint16_t getKeyStrip(uint16_t n=2) const
Definition: CSCCLCTDigi.cc:87
CSCCLCTDigi::fullbx_
uint16_t fullbx_
Definition: CSCCLCTDigi.h:172
CSCCLCTDigi::setRun3
void setRun3(bool isRun3)
Definition: CSCCLCTDigi.cc:124
CSCCLCTDigi::getFullBX
uint16_t getFullBX() const
return 12-bit full BX.
Definition: CSCCLCTDigi.h:119
CSCCLCTDigi::operator>
bool operator>(const CSCCLCTDigi &) const
Definition: CSCCLCTDigi.cc:126
CSCCLCTDigi::bx_
uint16_t bx_
Definition: CSCCLCTDigi.h:170
CSCCLCTDigi::CSCCLCTDigi
CSCCLCTDigi()
default
Definition: CSCCLCTDigi.cc:48
CSCCLCTDigi::getStrip
uint16_t getStrip() const
return halfstrip that goes from 0 to 31 in a (D)CFEB
Definition: CSCCLCTDigi.cc:102
CSCCLCTDigi::ComparatorContainer
std::vector< std::vector< uint16_t > > ComparatorContainer
Definition: CSCCLCTDigi.h:19
CSCCLCTDigi::cfeb_
uint16_t cfeb_
Definition: CSCCLCTDigi.h:169
CSCCLCTDigi::Version::Run3
CSCCLCTDigi::getEightStrip
bool getEightStrip() const
get single eight strip bit
Definition: CSCCLCTDigi.cc:106
CSCCLCTDigi::getStripType
uint16_t getStripType() const
return striptype
Definition: CSCCLCTDigi.h:63
CSCCLCTDigi::getQuartStrip
bool getQuartStrip() const
get single quart strip bit
Definition: CSCCLCTDigi.cc:104
CSCCLCTDigi::setQuality
void setQuality(const uint16_t quality)
set quality
Definition: CSCCLCTDigi.h:54
CSCCLCTDigi::isValid
bool isValid() const
check CLCT validity (1 - valid CLCT)
Definition: CSCCLCTDigi.h:45
CSCCLCTDigi::setCompCode
void setCompCode(const int16_t code)
Definition: CSCCLCTDigi.h:127
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
CSCCLCTDigi::setCFEB
void setCFEB(const uint16_t cfeb)
set Key CFEB ID
Definition: CSCCLCTDigi.h:96
CSCCLCTDigi::setHits
void setHits(const ComparatorContainer &hits)
Definition: CSCCLCTDigi.h:132
CSCCLCTDigi::setFullBX
void setFullBX(const uint16_t fullbx)
Set 12-bit full BX.
Definition: CSCCLCTDigi.h:122
CSCCLCTDigi::getBX
uint16_t getBX() const
return BX
Definition: CSCCLCTDigi.h:99
CSCCLCTDigi::kEightStripShift
Definition: CSCCLCTDigi.h:22
CSCCLCTDigi::compCode_
int16_t compCode_
Definition: CSCCLCTDigi.h:176
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
trklet::bend
double bend(double r, double rinv, double stripPitch)
Definition: Util.h:160
CSCCLCTDigi::clear
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:68
CSCCLCTDigi::kQuartStripShift
Definition: CSCCLCTDigi.h:22
CSCCLCTDigi::quality_
uint16_t quality_
Definition: CSCCLCTDigi.h:155
CSCCLCTDigi::CLCTKeyStripShifts
CLCTKeyStripShifts
Definition: CSCCLCTDigi.h:22
CSCCLCTDigi::Version::Legacy
CSCCLCTDigi::getCFEB
uint16_t getCFEB() const
return Key CFEB ID
Definition: CSCCLCTDigi.h:93
CSCCLCTDigi::setBX
void setBX(const uint16_t bx)
set bx
Definition: CSCCLCTDigi.h:102
CSCCLCTDigi::kQuartStripMask
Definition: CSCCLCTDigi.h:21
CSCCLCTDigi::trknmb_
uint16_t trknmb_
Definition: CSCCLCTDigi.h:171
CSCCLCTDigi::print
void print() const
Print content of digi.
Definition: CSCCLCTDigi.cc:189
CSCCLCTDigi::operator==
bool operator==(const CSCCLCTDigi &) const
True if the two LCTs have exactly the same members (except the number).
Definition: CSCCLCTDigi.cc:169
CSCCLCTDigi::getPattern
uint16_t getPattern() const
return pattern
Definition: CSCCLCTDigi.h:57
CSCCLCTDigi::version_
Version version_
Definition: CSCCLCTDigi.h:180
CSCCLCTDigi::kHalfStripMask
Definition: CSCCLCTDigi.h:21
Version
Definition: InitMessage.h:39
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
CSCCLCTDigi::getHits
ComparatorContainer getHits() const
Definition: CSCCLCTDigi.h:130