CMS 3D CMS Logo

CSCAnodeData2007.h
Go to the documentation of this file.
1 #ifndef CSCAnodeData2007_h
2 #define CSCAnodeData2007_h
3 
6 #include <cassert>
7 class CSCALCTHeader;
8 
10 public:
11  explicit CSCAnodeDataFrame2007(unsigned short data) { data_ = data; }
13 
15  bool isHit(unsigned wireGroup) const {
16  assert(wireGroup < 12);
17  return ((data_ >> wireGroup) & 0x1);
18  }
19 
20  void addHit(unsigned wireGroup) { data_ |= (1 << wireGroup); }
21 
22  unsigned short data() const { return data_; }
23 
24 private:
25  unsigned short data_ : 12;
26  unsigned short reserved_ : 3;
27  unsigned short flag_ : 1;
28 };
29 
31 public:
33  explicit CSCAnodeData2007(const CSCALCTHeader &);
35  CSCAnodeData2007(const CSCALCTHeader &, const unsigned short *buf);
36 
37  unsigned short *data() override { return theDataFrames; }
39  unsigned short int sizeInWords() const override { return sizeInWords2007_; }
40 
42  std::vector<CSCWireDigi> wireDigis(int layer) const override;
43 
44  void add(const CSCWireDigi &, int layer) override;
45 
46  static void selfTest();
47 
48 private:
49  void init(const CSCALCTHeader &);
50  int index(int tbin, int layer, int layerPart) const;
51  CSCAnodeDataFrame2007 findFrame(int tbin, int layer, int layerPart) const;
52 
54  enum { MAXFRAMES = 2700 };
55  unsigned short theDataFrames[MAXFRAMES];
56  unsigned short int sizeInWords2007_;
57  unsigned short int nAFEBs_;
58  unsigned short int nTimeBins_;
59 
60  unsigned short int layerParts_;
61  unsigned short int maxWireGroups_;
62  unsigned int alctBX_;
63 };
64 
65 #endif
unsigned short reserved_
int init
Definition: HydjetWrapper.h:64
unsigned short int sizeInWords() const override
the amount of the input binary buffer read, in 16-bit words
CSCAnodeDataFrame2007(unsigned short data)
bool isHit(unsigned wireGroup) const
given a wiregroup between 0 and 11, it tells whether this bit was on
unsigned short * data() override
unsigned short int nAFEBs_
unsigned int alctBX_
number of wiregroups in the ALCT
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
unsigned short int sizeInWords2007_
unsigned short int maxWireGroups_
number of layer parts in the ALCT
void addHit(unsigned wireGroup)
unsigned short data() const
unsigned short int nTimeBins_
unsigned short int layerParts_