CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
unsigned short * data() override
void addHit(unsigned wireBit)
sets a bit, from 0 to 7
CSCAnodeDataFrame2006 rawHit(int afeb, int tbin, int layer, int halfLayer) const
unsigned int alctBX_
CSCAnodeDataFrame2006(unsigned short frame)
unsigned short theDataFrames[2700]
we don&#39;t know the size at first. Max should be 7 boards * 32 bins * 6 layers * 2
assert(be >=bs)
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned short theFrame
static void selfTest()
int index(int afeb, int tbin, int layer) const
the index into theDataFrames
unsigned tbin() const
time bin
CSCAnodeData2006(const CSCALCTHeader &)
a blank one, for Monte Carlo
unsigned short data() const
int nAFEBs_
in 2007 format the max number of frames is 1860
void add(const CSCWireDigi &, int layer) override
bool isHit(unsigned wireGroup) const
given a wiregroup between 0 and 7, it tells whether this bit was on
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
unsigned short frame() const
unsigned chip() const