CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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) 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 
34 private:
35  int getPartitionNumber(int address, int nPads) const;
36  int getPartitionStripNumber(int address, int nPads, int etaPart) const;
37 
38 #ifdef LOCAL_UNPACK
39  static bool debug;
40 #else
41  static std::atomic<bool> debug;
42 #endif
43 
44  int ntbins_;
46  int ngems_;
47  int size_;
48  unsigned short theData[8 * 2 * 32 + 2];
49 };
50 
51 #endif
static std::atomic< bool > debug
Definition: CSCGEMData.h:41
int gemFibersMask() const
Definition: CSCGEMData.h:25
int numGEMEnabledFibers() const
Definition: CSCGEMData.h:26
std::vector< GEMPadDigiCluster > etaDigis(int gem_chamber, int eta) const
Definition: CSCGEMData.cc:136
int ngems_
Definition: CSCGEMData.h:46
std::vector< GEMPadDigiCluster > digis(int gem_chamber) const
Definition: CSCGEMData.cc:58
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:16
unsigned short theData[8 *2 *32+2]
Definition: CSCGEMData.h:48
int getPartitionStripNumber(int address, int nPads, int etaPart) const
Definition: CSCGEMData.cc:54
int ntbins_
Definition: CSCGEMData.h:44
int getPartitionNumber(int address, int nPads) const
Definition: CSCGEMData.cc:52
int sizeInWords() const
Definition: CSCGEMData.h:21
int nTbins() const
Definition: CSCGEMData.h:27
bool check() const
Definition: CSCGEMData.h:29
void print() const
Definition: CSCGEMData.cc:45
int gems_enabled_
Definition: CSCGEMData.h:45
int numGEMs() const
Definition: CSCGEMData.h:22