CMS 3D CMS Logo

CSCGEMData.h
Go to the documentation of this file.
1 #ifndef EventFilter_CSCRawToDigi_CSCGEMData_h
2 #define EventFilter_CSCRawToDigi_CSCGEMData_h
3 
4 #include <vector>
5 #ifndef LOCAL_UNPACK
6 #include <atomic>
7 #endif
8 
10 
11 class CSCGEMData {
12 public:
14  CSCGEMData(int ntbins = 12, int gem_fibers_mask = 0xf);
15  // length is in 16-bit words
16  CSCGEMData(const unsigned short *c04buf, int length, int gem_fibers_mask = 0xf);
17 
18  // std::vector<int> BXN() const;
19  std::vector<GEMPadDigiCluster> digis(int gem_chamber) const;
20  std::vector<GEMPadDigiCluster> etaDigis(int gem_chamber, int eta, int correctionToALCTbx) const;
21  int sizeInWords() const { return size_; }
22  int numGEMs() const {
23  return 2; // !!! TODO actual number of GEM chambers in readout
24  }
25  int gemFibersMask() const { return gems_enabled_; }
26  int numGEMEnabledFibers() const { return ngems_; }
27  int nTbins() const { return ntbins_; }
28  void print() const;
29  bool check() const { return ((theData[0] == 0x6C04) && (theData[size_ - 1] == 0x6D04)); }
30 
32  static void setDebug(bool debugValue) { debug = debugValue; }
33 
35  void addEtaPadCluster(const GEMPadDigiCluster &digi, int gem_chamber, int eta_roll);
36 
37  unsigned short *data() { return theData; }
38 
39 private:
40  int getPartitionNumber(int address, int nPads) const;
41  int getPartitionStripNumber(int address, int nPads, int etaPart) const;
42 
43 #ifdef LOCAL_UNPACK
44  static bool debug;
45 #else
46  static std::atomic<bool> debug;
47 #endif
48 
49  int ntbins_;
51  int ngems_;
52  int size_;
53  unsigned short theData[8 * 2 * 32 + 2];
54 };
55 
56 #endif
void addEtaPadCluster(const GEMPadDigiCluster &digi, int gem_chamber, int eta_roll)
Add and pack GEMPadDigiCluster digis.
Definition: CSCGEMData.cc:191
static std::atomic< bool > debug
Definition: CSCGEMData.h:46
int getPartitionNumber(int address, int nPads) const
Definition: CSCGEMData.cc:61
void print() const
Definition: CSCGEMData.cc:54
std::vector< GEMPadDigiCluster > etaDigis(int gem_chamber, int eta, int correctionToALCTbx) const
Definition: CSCGEMData.cc:148
int ngems_
Definition: CSCGEMData.h:51
int numGEMEnabledFibers() const
Definition: CSCGEMData.h:26
std::vector< GEMPadDigiCluster > digis(int gem_chamber) const
Definition: CSCGEMData.cc:67
int nTbins() const
Definition: CSCGEMData.h:27
static void setDebug(bool debugValue)
turns on the debug flag for this class
Definition: CSCGEMData.h:32
CSCGEMData(int ntbins=12, int gem_fibers_mask=0xf)
default constructor
Definition: CSCGEMData.cc:18
bool check() const
Definition: CSCGEMData.h:29
unsigned short theData[8 *2 *32+2]
Definition: CSCGEMData.h:53
int getPartitionStripNumber(int address, int nPads, int etaPart) const
Definition: CSCGEMData.cc:63
unsigned short * data()
Definition: CSCGEMData.h:37
int gemFibersMask() const
Definition: CSCGEMData.h:25
int sizeInWords() const
Definition: CSCGEMData.h:21
int ntbins_
Definition: CSCGEMData.h:49
int numGEMs() const
Definition: CSCGEMData.h:22
int gems_enabled_
Definition: CSCGEMData.h:50