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
CSCAnodeDataFrame2006::CSCAnodeDataFrame2006
CSCAnodeDataFrame2006(unsigned short frame)
Definition: CSCAnodeData2006.h:11
CSCAnodeData2006::add
void add(const CSCWireDigi &, int layer) override
Definition: CSCAnodeData2006.cc:76
CSCAnodeData2006::CSCAnodeData2006
CSCAnodeData2006(const CSCALCTHeader &)
a blank one, for Monte Carlo
Definition: CSCAnodeData2006.cc:13
CSCAnodeDataFormat
Definition: CSCAnodeDataFormat.h:5
CSCAnodeData2006::selfTest
static void selfTest()
Definition: CSCAnodeData2006.cc:119
cms::cuda::assert
assert(be >=bs)
CSCAnodeData2006::addHit
void addHit(int afeb, int tbin, int layer, int halfLayer, unsigned wireBit)
Definition: CSCAnodeData2006.cc:101
CSCAnodeDataFrame2006::data
unsigned short data() const
Definition: CSCAnodeData2006.h:28
CSCAnodeDataFrame2006::CSCAnodeDataFrame2006
CSCAnodeDataFrame2006()
Definition: CSCAnodeData2006.h:10
CSCALCTHeader
Definition: CSCALCTHeader.h:21
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
CSCALCTDigi.h
CSCAnodeData2006::nAFEBs_
int nAFEBs_
in 2007 format the max number of frames is 1860
Definition: CSCAnodeData2006.h:70
CSCAnodeDataFrame2006
Definition: CSCAnodeData2006.h:8
CSCAnodeData2006::data
unsigned short * data() override
Definition: CSCAnodeData2006.h:46
CSCAnodeData2006::wireDigis
std::vector< CSCWireDigi > wireDigis(int layer) const override
input layer is from 1 to 6
Definition: CSCAnodeData2006.cc:44
CSCAnodeData2006::theDataFrames
unsigned short theDataFrames[2700]
we don't know the size at first. Max should be 7 boards * 32 bins * 6 layers * 2
Definition: CSCAnodeData2006.h:68
CSCAnodeDataFrame2006::addHit
void addHit(unsigned wireBit)
sets a bit, from 0 to 7
Definition: CSCAnodeData2006.h:21
CSCAnodeDataFrame2006::isHit
bool isHit(unsigned wireGroup) const
given a wiregroup between 0 and 7, it tells whether this bit was on
Definition: CSCAnodeData2006.h:15
CSCAnodeData2006::sizeInWords
unsigned short int sizeInWords() const override
the amount of the input binary buffer read, in 16-bit words
Definition: CSCAnodeData2006.h:48
CSCAnodeData2006::index
int index(int afeb, int tbin, int layer) const
the index into theDataFrames
Definition: CSCAnodeData2006.cc:112
CSCWireDigi
Definition: CSCWireDigi.h:14
CSCAnodeDataFrame2006::chip
unsigned chip() const
Definition: CSCAnodeData2006.h:27
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
CSCAnodeData2006::alctBX_
unsigned int alctBX_
Definition: CSCAnodeData2006.h:72
CSCAnodeData2006::init
void init()
CSCAnodeData2006::nTimeBins_
int nTimeBins_
Definition: CSCAnodeData2006.h:71
CSCAnodeData2006
Definition: CSCAnodeData2006.h:39
CSCAnodeData2006::rawHit
CSCAnodeDataFrame2006 rawHit(int afeb, int tbin, int layer, int halfLayer) const
Definition: CSCAnodeData2006.cc:108
CSCAnodeDataFrame2006::tbin
unsigned tbin() const
time bin
Definition: CSCAnodeData2006.h:24
CSCAnodeDataFrame2006::frame
unsigned short frame() const
Definition: CSCAnodeData2006.h:29
CSCAnodeDataFrame2006::theFrame
unsigned short theFrame
Definition: CSCAnodeData2006.h:32
CSCAnodeDataFormat.h