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 <cstdint>
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
CSCCFEBStatusDigi statusDigi() const
returns one status digi per cfeb
Definition: CSCCFEBData.cc:173
unsigned sizeInWords() const
Definition: CSCCFEBData.h:46
unsigned controllerData(unsigned uglay, unsigned ugchan, unsigned timeBin) const
Definition: CSCCFEBData.cc:127
void add(const CSCStripDigi &, int layer)
Definition: CSCCFEBData.cc:82
void setL1A(unsigned l1a)
Definition: CSCCFEBData.cc:159
unsigned adcCounts(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:110
std::vector< std::pair< int, bool > > theSliceStarts
Definition: CSCCFEBData.h:66
int theSize
in words
Definition: CSCCFEBData.h:68
uint16_t * data()
Definition: CSCCFEBData.h:45
std::vector< std::vector< CSCStripDigi > > stripDigis()
deprecated. Use the above method.
Definition: CSCCFEBData.cc:323
unsigned boardNumber() const
Definition: CSCCFEBData.h:47
unsigned overlappedSampleFlag(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:142
static void selfTest()
std::vector< uint16_t > bWords
Definition: CSCCFEBData.h:71
friend std::ostream & operator<<(std::ostream &os, const CSCCFEBData &)
Definition: CSCCFEBData.cc:308
unsigned errorstat(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:150
unsigned adcOverflow(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:118
unsigned nTimeSamples() const
Definition: CSCCFEBData.h:20
void digis(uint32_t idlayer, std::vector< CSCStripDigi > &result) const
faster way to get to digis
Definition: CSCCFEBData.cc:202
uint16_t theData[1600]
Definition: CSCCFEBData.h:63
const CSCCFEBTimeSlice * timeSlice(unsigned i) const
count from 0. User should check if it&#39;s a bad slice
Definition: CSCCFEBData.cc:96
uint16_t theFormatVersion
Definition: CSCCFEBData.h:72
bool isDCFEB() const
Definition: CSCCFEBData.h:58
CSCCFEBData(unsigned boardNumber, const uint16_t *buf, uint16_t theFormatVersion=2005, bool fDCFEB=false)
read from an existing data stream.
Definition: CSCCFEBData.cc:11
bool check() const
makes sure each time slice has a trailer
Definition: CSCCFEBData.cc:298
void setBoardNumber(int cfeb)
Definition: CSCCFEBData.h:48
unsigned boardNumber_
Definition: CSCCFEBData.h:69
unsigned theNumberOfSamples
Definition: CSCCFEBData.h:70