CMS 3D CMS Logo

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
unsigned int alctBX_
CSCAnodeDataFrame2006(unsigned short frame)
int init
Definition: HydjetWrapper.h:67
virtual unsigned short int sizeInWords() const
the amount of the input binary buffer read, in 16-bit words
unsigned short theFrame
unsigned tbin() const
time bin
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
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
virtual unsigned short * data()
unsigned short frame() const
unsigned chip() const