CMS 3D CMS Logo

CSCCFEBData.h
Go to the documentation of this file.
1 #ifndef EventFilter_CSCRawToDigi_CSCCFEBData_h
2 #define EventFilter_CSCRawToDigi_CSCCFEBData_h
3 
4 class CSCCFEBTimeSlice;
5 class CSCStripDigi;
7 
8 #include <vector>
9 #include <iosfwd>
10 #include <iostream>
11 //#include <boost/cstdint.hpp>
12 
13 class CSCCFEBData {
14 public:
16  CSCCFEBData(unsigned boardNumber, const uint16_t *buf, uint16_t theFormatVersion = 2005, bool fDCFEB = false);
18  CSCCFEBData(unsigned boardNumber, bool sixteenSamples, uint16_t theFormatVersion = 2005, bool fDCFEB = false);
19 
20  unsigned nTimeSamples() const { return theNumberOfSamples; }
21 
23  const CSCCFEBTimeSlice *timeSlice(unsigned i) const;
24 
25  unsigned adcCounts(unsigned layer, unsigned channel, unsigned timeBin) const;
26  unsigned adcOverflow(unsigned layer, unsigned channel, unsigned timeBin) const;
27  unsigned controllerData(unsigned uglay, unsigned ugchan, unsigned timeBin) const;
28  unsigned overlappedSampleFlag(unsigned layer, unsigned channel, unsigned timeBin) const;
29  unsigned errorstat(unsigned layer, unsigned channel, unsigned timeBin) const;
30 
31  void add(const CSCStripDigi &, int layer);
34 
36  void digis(uint32_t idlayer, std::vector<CSCStripDigi> &result) const;
37 
38  std::vector<CSCStripDigi> digis(unsigned idlayer) const;
40  std::vector<std::vector<CSCStripDigi> > stripDigis();
41 
44 
45  uint16_t *data() { return theData; }
46  unsigned sizeInWords() const { return theSize; }
47  unsigned boardNumber() const { return boardNumber_; }
48  void setBoardNumber(int cfeb) { boardNumber_ = cfeb; }
49  void setL1A(unsigned l1a);
50  void setL1A(unsigned sample, unsigned l1a);
51 
52  friend std::ostream &operator<<(std::ostream &os, const CSCCFEBData &);
53  static void selfTest();
54 
56  bool check() const;
57 
58  bool isDCFEB() const { return fDCFEB; }
59 
60 private:
61  CSCCFEBTimeSlice *timeSlice(unsigned i);
62 
63  uint16_t theData[1600];
66  std::vector<std::pair<int, bool> > theSliceStarts;
68  int theSize;
69  unsigned boardNumber_;
71  std::vector<uint16_t> bWords;
72  uint16_t theFormatVersion;
73  bool fDCFEB;
74 };
75 
76 #endif
mps_fire.i
i
Definition: mps_fire.py:428
CSCCFEBData::theNumberOfSamples
unsigned theNumberOfSamples
Definition: CSCCFEBData.h:70
CSCCFEBData::sizeInWords
unsigned sizeInWords() const
Definition: CSCCFEBData.h:46
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
CSCCFEBData::boardNumber_
unsigned boardNumber_
Definition: CSCCFEBData.h:69
CSCCFEBData::statusDigi
CSCCFEBStatusDigi statusDigi() const
returns one status digi per cfeb
Definition: CSCCFEBData.cc:173
CSCCFEBTimeSlice
Definition: CSCCFEBTimeSlice.h:52
CSCCFEBData
Definition: CSCCFEBData.h:13
CSCCFEBData::controllerData
unsigned controllerData(unsigned uglay, unsigned ugchan, unsigned timeBin) const
Definition: CSCCFEBData.cc:127
CSCCFEBData::add
void add(const CSCStripDigi &, int layer)
Definition: CSCCFEBData.cc:82
CSCCFEBData::theSize
int theSize
in words
Definition: CSCCFEBData.h:68
CSCCFEBData::setL1A
void setL1A(unsigned l1a)
Definition: CSCCFEBData.cc:159
CSCCFEBData::boardNumber
unsigned boardNumber() const
Definition: CSCCFEBData.h:47
CSCCFEBData::overlappedSampleFlag
unsigned overlappedSampleFlag(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:142
CSCCFEBData::stripDigis
std::vector< std::vector< CSCStripDigi > > stripDigis()
deprecated. Use the above method.
Definition: CSCCFEBData.cc:323
CSCCFEBData::bWords
std::vector< uint16_t > bWords
Definition: CSCCFEBData.h:71
CSCCFEBData::operator<<
friend std::ostream & operator<<(std::ostream &os, const CSCCFEBData &)
Definition: CSCCFEBData.cc:308
CSCCFEBData::adcCounts
unsigned adcCounts(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:110
CSCCFEBData::theSliceStarts
std::vector< std::pair< int, bool > > theSliceStarts
Definition: CSCCFEBData.h:66
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
CSCCFEBData::data
uint16_t * data()
Definition: CSCCFEBData.h:45
CSCCFEBData::selfTest
static void selfTest()
CSCCFEBData::nTimeSamples
unsigned nTimeSamples() const
Definition: CSCCFEBData.h:20
CSCCFEBData::timeSlice
const CSCCFEBTimeSlice * timeSlice(unsigned i) const
count from 0. User should check if it's a bad slice
Definition: CSCCFEBData.cc:96
visDQMUpload.buf
buf
Definition: visDQMUpload.py:160
CSCCFEBData::theData
uint16_t theData[1600]
Definition: CSCCFEBData.h:63
CSCCFEBData::check
bool check() const
makes sure each time slice has a trailer
Definition: CSCCFEBData.cc:298
CSCStripDigi
Definition: CSCStripDigi.h:17
CSCCFEBData::errorstat
unsigned errorstat(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:150
CSCCFEBData::adcOverflow
unsigned adcOverflow(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:118
CSCCFEBData::fDCFEB
bool fDCFEB
Definition: CSCCFEBData.h:73
CSCCFEBData::theFormatVersion
uint16_t theFormatVersion
Definition: CSCCFEBData.h:72
mps_fire.result
result
Definition: mps_fire.py:311
CSCCFEBData::digis
void digis(uint32_t idlayer, std::vector< CSCStripDigi > &result) const
faster way to get to digis
Definition: CSCCFEBData.cc:202
CSCCFEBData::isDCFEB
bool isDCFEB() const
Definition: CSCCFEBData.h:58
CSCCFEBData::CSCCFEBData
CSCCFEBData(unsigned boardNumber, const uint16_t *buf, uint16_t theFormatVersion=2005, bool fDCFEB=false)
read from an existing data stream.
Definition: CSCCFEBData.cc:11
CSCCFEBStatusDigi
Definition: CSCCFEBStatusDigi.h:17
CSCCFEBData::setBoardNumber
void setBoardNumber(int cfeb)
Definition: CSCCFEBData.h:48