CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CSCALCTDigi.h
Go to the documentation of this file.
1 #ifndef CSCDigi_CSCALCTDigi_h
2 #define CSCDigi_CSCALCTDigi_h
3 
12 #include <cstdint>
13 #include <iosfwd>
14 #include <limits>
15 #include <vector>
16 
17 class CSCALCTDigi {
18 public:
19  enum class Version { Legacy = 0, Run3 };
20 
21  typedef std::vector<std::vector<uint16_t>> WireContainer;
22 
24  CSCALCTDigi(const uint16_t valid,
25  const uint16_t quality,
26  const uint16_t accel,
27  const uint16_t patternb,
28  const uint16_t keywire,
29  const uint16_t bx,
30  const uint16_t trknmb = 0,
31  const uint16_t hmt = 0,
34  CSCALCTDigi();
35 
37  void clear();
38 
40  bool isValid() const { return valid_; }
41 
43  void setValid(const uint16_t valid) { valid_ = valid; }
44 
46  uint16_t getQuality() const { return quality_; }
47 
49  void setQuality(const uint16_t quality) { quality_ = quality; }
50 
53  uint16_t getAccelerator() const { return accel_; }
54 
56  void setAccelerator(const uint16_t accelerator) { accel_ = accelerator; }
57 
61  uint16_t getCollisionB() const { return patternb_; }
62 
64  void setCollisionB(const uint16_t collision) { patternb_ = collision; }
65 
67  uint16_t getKeyWG() const { return keywire_; }
68 
70  void setKeyWG(const uint16_t keyWG) { keywire_ = keyWG; }
71 
73  uint16_t getBX() const { return bx_; }
74 
76  void setBX(const uint16_t BX) { bx_ = BX; }
77 
79  uint16_t getTrknmb() const { return trknmb_; }
80 
82  void setTrknmb(const uint16_t number) { trknmb_ = number; }
83 
85  uint16_t getFullBX() const { return fullbx_; }
86 
88  void setFullBX(const uint16_t fullbx) { fullbx_ = fullbx; }
89 
91  uint16_t getHMT() const;
92 
94  void setHMT(const uint16_t hmt);
95 
98  bool operator>(const CSCALCTDigi&) const;
99 
101  bool operator==(const CSCALCTDigi&) const;
102 
104  bool operator!=(const CSCALCTDigi&) const;
105 
107  void print() const;
108 
110  void setWireGroup(uint16_t wiregroup) { keywire_ = wiregroup; }
111 
113  bool isRun3() const { return version_ == Version::Run3; }
114 
115  void setRun3(const bool isRun3);
116 
117  // wire hits in this ALCT
118  const WireContainer& getHits() const { return hits_.empty() ? emptyContainer() : hits_; }
119 
120  void setHits(const WireContainer& hits) { hits_ = hits; }
121 
122 private:
123  static const WireContainer& emptyContainer();
124  uint16_t valid_;
125  uint16_t quality_;
126  uint16_t accel_;
127  uint16_t patternb_; // not used since 2007
128  uint16_t keywire_;
129  uint16_t bx_;
130  uint16_t trknmb_;
131  uint16_t fullbx_;
132  // In Run-3, CSC trigger data will include the high-multiplicity
133  // bits for a chamber. These bits may indicate the observation of
134  // "exotic" events. This data member was included in a prototype.
135  // Later on, we developed a dedicated object: "CSCShowerDigi<Anode>"
136  uint16_t hmt_;
137 
139  // which hits are in this ALCT?
141 };
142 
143 std::ostream& operator<<(std::ostream& o, const CSCALCTDigi& digi);
144 #endif
uint16_t getCollisionB() const
Definition: CSCALCTDigi.h:61
void setHits(const WireContainer &hits)
Definition: CSCALCTDigi.h:120
void setCollisionB(const uint16_t collision)
set Collision Pattern B bit
Definition: CSCALCTDigi.h:64
uint16_t getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:46
Version version_
Definition: CSCALCTDigi.h:138
uint16_t bx_
Definition: CSCALCTDigi.h:129
void setWireGroup(uint16_t wiregroup)
set wiregroup number
Definition: CSCALCTDigi.h:110
void setValid(const uint16_t valid)
set valid
Definition: CSCALCTDigi.h:43
uint16_t trknmb_
Definition: CSCALCTDigi.h:130
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
uint16_t getFullBX() const
return 12-bit full BX.
Definition: CSCALCTDigi.h:85
uint16_t patternb_
Definition: CSCALCTDigi.h:127
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:73
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:60
uint16_t keywire_
Definition: CSCALCTDigi.h:128
string quality
bool operator!=(const CSCALCTDigi &) const
True if the preceding one is false.
Definition: CSCALCTDigi.cc:114
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
uint16_t valid_
Definition: CSCALCTDigi.h:124
bool operator>(const CSCALCTDigi &) const
Definition: CSCALCTDigi.cc:80
void setAccelerator(const uint16_t accelerator)
set accelerator bit
Definition: CSCALCTDigi.h:56
void setQuality(const uint16_t quality)
set quality
Definition: CSCALCTDigi.h:49
const WireContainer & getHits() const
Definition: CSCALCTDigi.h:118
CSCALCTDigi()
default
Definition: CSCALCTDigi.cc:55
void setHMT(const uint16_t hmt)
set the high multiplicity bits
Definition: CSCALCTDigi.cc:76
uint16_t getHMT() const
return the high multiplicity bits
Definition: CSCALCTDigi.cc:74
uint16_t getTrknmb() const
return track number (1,2)
Definition: CSCALCTDigi.h:79
void setRun3(const bool isRun3)
Definition: CSCALCTDigi.cc:78
void setBX(const uint16_t BX)
set BX
Definition: CSCALCTDigi.h:76
bool isRun3() const
Distinguish Run-1/2 from Run-3.
Definition: CSCALCTDigi.h:113
uint16_t fullbx_
Definition: CSCALCTDigi.h:131
bool operator==(const CSCALCTDigi &) const
True if all members (except the number) of both ALCTs are equal.
Definition: CSCALCTDigi.cc:104
std::vector< std::vector< uint16_t > > WireContainer
Definition: CSCALCTDigi.h:21
uint16_t accel_
Definition: CSCALCTDigi.h:126
uint16_t getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:67
WireContainer hits_
Definition: CSCALCTDigi.h:140
void setKeyWG(const uint16_t keyWG)
set key wire group
Definition: CSCALCTDigi.h:70
static const WireContainer & emptyContainer()
Definition: CSCALCTDigi.cc:29
uint16_t hmt_
Definition: CSCALCTDigi.h:136
uint16_t quality_
Definition: CSCALCTDigi.h:125
void print() const
Print content of digi.
Definition: CSCALCTDigi.cc:123
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting ALCTs.
Definition: CSCALCTDigi.h:82
void setFullBX(const uint16_t fullbx)
Set 12-bit full BX.
Definition: CSCALCTDigi.h:88
uint16_t getAccelerator() const
Definition: CSCALCTDigi.h:53