CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCAnodeData2006.h
Go to the documentation of this file.
1 #ifndef CSCAnodeData2006_h
2 #define CSCAnodeData2006_h
5 #include <cassert>
6 class CSCALCTHeader;
7 
9 public:
11  CSCAnodeDataFrame2006(unsigned short frame):
12  theFrame(frame) {}
13  CSCAnodeDataFrame2006(unsigned chip, unsigned tbin, unsigned data);
14 
16  bool isHit(unsigned wireGroup) const {
17  assert(wireGroup < 8);
18  return ( (theFrame>>wireGroup) & 0x1 );
19  }
20 
22  void addHit(unsigned wireBit) {
23  theFrame |= (1 << wireBit);
24  }
25 
27  unsigned tbin() const {return (theFrame >> 8) & 0x1F;}
30  unsigned chip() const {return (theFrame >>13) & 0x3;}
31  unsigned short data() const {return theFrame & 0xFF;}
32  unsigned short frame() const {return theFrame;}
33 
34 private:
35  unsigned short theFrame;
36  //unsigned short data_ : 8;
37  //unsigned short tbin_ : 5;
38  //unsigned short chip_ : 2;
39  //unsigned short ddu_code_ : 1;
40 };
41 
42 
43 
45 {
46 public:
50  CSCAnodeData2006(const CSCALCTHeader &, const unsigned short *buf);
51 
52  virtual unsigned short * data() {return theDataFrames;}
54  virtual unsigned short int sizeInWords() const {return nAFEBs_ * nTimeBins_ * 6 * 2;}
55 
57  virtual std::vector<CSCWireDigi> wireDigis(int layer) const;
58 
59  virtual void add(const CSCWireDigi &, int layer);
60 
61  static void selfTest();
62 
63 private:
64  void init();
65 
66  CSCAnodeDataFrame2006 rawHit(int afeb, int tbin, int layer, int halfLayer) const;
67 
69  int index(int afeb, int tbin, int layer) const;
70 
71  void addHit(int afeb, int tbin, int layer, int halfLayer, unsigned wireBit);
72 
74  unsigned short theDataFrames[2700];
76  int nAFEBs_;
78  unsigned int alctBX_;
79 };
80 
81 #endif
82 
83 
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
virtual std::vector< CSCWireDigi > wireDigis(int layer) const
input layer is from 1 to 6
virtual unsigned short int sizeInWords() const
the amount of the input binary buffer read, in 16-bit words
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
virtual void add(const CSCWireDigi &, int layer)
unsigned short data() const
int nAFEBs_
in 2007 format the max number of frames is 1860
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)
virtual unsigned short * data()
unsigned short frame() const
unsigned chip() const