CMS 3D CMS Logo

CSCAnodeData2007.h
Go to the documentation of this file.
1 #ifndef EventFilter_CSCRawToDigi_CSCAnodeData2007_h
2 #define EventFilter_CSCRawToDigi_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
std::vector< CSCWireDigi > wireDigis(int layer) const override
input layer is from 1 to 6
unsigned short reserved_
void init(const CSCALCTHeader &)
CSCAnodeData2007(const CSCALCTHeader &)
a blank one, for Monte Carlo
assert(be >=bs)
CSCAnodeDataFrame2007(unsigned short data)
bool isHit(unsigned wireGroup) const
given a wiregroup between 0 and 11, it tells whether this bit was on
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
unsigned short int sizeInWords() const override
the amount of the input binary buffer read, in 16-bit words
static void selfTest()
unsigned short * data() override
CSCAnodeDataFrame2007 findFrame(int tbin, int layer, int layerPart) const
unsigned short int nAFEBs_
unsigned int alctBX_
number of wiregroups in the ALCT
unsigned short theDataFrames[MAXFRAMES]
unsigned short int sizeInWords2007_
unsigned short int maxWireGroups_
number of layer parts in the ALCT
void addHit(unsigned wireGroup)
int index(int tbin, int layer, int layerPart) const
void add(const CSCWireDigi &, int layer) override
unsigned short data() const
unsigned short int nTimeBins_
unsigned short int layerParts_