CMS 3D CMS Logo

CSCAnodeData2006.h
Go to the documentation of this file.
1 #ifndef EventFilter_CSCRawToDigi_CSCAnodeData2006_h
2 #define EventFilter_CSCRawToDigi_CSCAnodeData2006_h
5 #include <cassert>
6 class CSCALCTHeader;
7 
9 public:
11  CSCAnodeDataFrame2006(unsigned short frame) : theFrame(frame) {}
12  CSCAnodeDataFrame2006(unsigned chip, unsigned tbin, unsigned data);
13 
15  bool isHit(unsigned wireGroup) const {
16  assert(wireGroup < 8);
17  return ((theFrame >> wireGroup) & 0x1);
18  }
19 
21  void addHit(unsigned wireBit) { theFrame |= (1 << wireBit); }
22 
24  unsigned tbin() const { return (theFrame >> 8) & 0x1F; }
27  unsigned chip() const { return (theFrame >> 13) & 0x3; }
28  unsigned short data() const { return theFrame & 0xFF; }
29  unsigned short frame() const { return theFrame; }
30 
31 private:
32  unsigned short theFrame;
33  //unsigned short data_ : 8;
34  //unsigned short tbin_ : 5;
35  //unsigned short chip_ : 2;
36  //unsigned short ddu_code_ : 1;
37 };
38 
40 public:
44  CSCAnodeData2006(const CSCALCTHeader &, const unsigned short *buf);
45 
46  unsigned short *data() override { return theDataFrames; }
48  unsigned short int sizeInWords() const override { return nAFEBs_ * nTimeBins_ * 6 * 2; }
49 
51  std::vector<CSCWireDigi> wireDigis(int layer) const override;
52 
53  void add(const CSCWireDigi &, int layer) override;
54 
55  static void selfTest();
56 
57 private:
58  void init();
59 
60  CSCAnodeDataFrame2006 rawHit(int afeb, int tbin, int layer, int halfLayer) const;
61 
63  int index(int afeb, int tbin, int layer) const;
64 
65  void addHit(int afeb, int tbin, int layer, int halfLayer, unsigned wireBit);
66 
68  unsigned short theDataFrames[2700];
70  int nAFEBs_;
72  unsigned int alctBX_;
73 };
74 
75 #endif
int index(int afeb, int tbin, int layer) const
the index into theDataFrames
unsigned short * data() override
unsigned chip() const
void addHit(unsigned wireBit)
sets a bit, from 0 to 7
unsigned int alctBX_
unsigned short frame() const
CSCAnodeDataFrame2006(unsigned short frame)
bool isHit(unsigned wireGroup) const
given a wiregroup between 0 and 7, it tells whether this bit was on
unsigned short theDataFrames[2700]
we don&#39;t know the size at first. Max should be 7 boards * 32 bins * 6 layers * 2
unsigned tbin() const
time bin
assert(be >=bs)
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
unsigned short theFrame
unsigned short data() const
static void selfTest()
CSCAnodeDataFrame2006 rawHit(int afeb, int tbin, int layer, int halfLayer) const
CSCAnodeData2006(const CSCALCTHeader &)
a blank one, for Monte Carlo
int nAFEBs_
in 2007 format the max number of frames is 1860
void add(const CSCWireDigi &, int layer) override
void addHit(int afeb, int tbin, int layer, int halfLayer, unsigned wireBit)
unsigned short int sizeInWords() const override
the amount of the input binary buffer read, in 16-bit words
std::vector< CSCWireDigi > wireDigis(int layer) const override
input layer is from 1 to 6