CMS 3D CMS Logo

CSCCFEBData.h
Go to the documentation of this file.
1 #ifndef CSCCFEBData_h
2 #define 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 
14 class CSCCFEBData {
15  public:
17  CSCCFEBData(unsigned boardNumber, const uint16_t * buf, uint16_t theFormatVersion = 2005, bool fDCFEB = false);
19  CSCCFEBData(unsigned boardNumber, bool sixteenSamples, uint16_t theFormatVersion = 2005, bool fDCFEB = false);
20 
21  unsigned nTimeSamples() const { return theNumberOfSamples;}
22 
24  const CSCCFEBTimeSlice * timeSlice(unsigned i) const;
25 
26  unsigned adcCounts(unsigned layer, unsigned channel, unsigned timeBin) const;
27  unsigned adcOverflow(unsigned layer, unsigned channel, unsigned timeBin) const;
28  unsigned controllerData(unsigned uglay, unsigned ugchan, unsigned timeBin) const;
29  unsigned overlappedSampleFlag(unsigned layer, unsigned channel, unsigned timeBin) const;
30  unsigned errorstat(unsigned layer, unsigned channel, unsigned timeBin) const;
31 
32  void add(const CSCStripDigi &, int layer);
35 
37  void digis(uint32_t idlayer, std::vector<CSCStripDigi> & result) const;
38 
39  std::vector<CSCStripDigi> digis(unsigned idlayer) const;
41  std::vector<std::vector<CSCStripDigi> > stripDigis();
42 
45 
46  uint16_t * data() {return theData;}
47  unsigned sizeInWords() const {return theSize;}
48  unsigned boardNumber() const {return boardNumber_;}
49  void setBoardNumber(int cfeb) {boardNumber_=cfeb;}
50  void setL1A(unsigned l1a);
51  void setL1A(unsigned sample, unsigned l1a);
52 
53  friend std::ostream & operator<<(std::ostream & os, const CSCCFEBData &);
54  static void selfTest();
55 
57  bool check() const;
58 
59  bool isDCFEB() const {return fDCFEB;}
60 
61 
62  private:
63  CSCCFEBTimeSlice * timeSlice(unsigned i);
64 
65  uint16_t theData[1600];
68  std::vector<std::pair<int,bool> > theSliceStarts;
70  int theSize;
71  unsigned boardNumber_;
73  std::vector<uint16_t> bWords;
74  uint16_t theFormatVersion;
75  bool fDCFEB;
76 };
77 
78 #endif
unsigned adcOverflow(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:125
unsigned overlappedSampleFlag(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:150
void add(const CSCStripDigi &, int layer)
Definition: CSCCFEBData.cc:85
void setL1A(unsigned l1a)
Definition: CSCCFEBData.cc:168
unsigned adcCounts(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:117
unsigned errorstat(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:158
std::vector< std::pair< int, bool > > theSliceStarts
Definition: CSCCFEBData.h:68
CSCCFEBStatusDigi statusDigi() const
returns one status digi per cfeb
Definition: CSCCFEBData.cc:184
int theSize
in words
Definition: CSCCFEBData.h:70
bool check() const
makes sure each time slice has a trailer
Definition: CSCCFEBData.cc:319
unsigned controllerData(unsigned uglay, unsigned ugchan, unsigned timeBin) const
Definition: CSCCFEBData.cc:134
const CSCCFEBTimeSlice * timeSlice(unsigned i) const
count from 0. User should check if it&#39;s a bad slice
Definition: CSCCFEBData.cc:101
unsigned nTimeSamples() const
Definition: CSCCFEBData.h:21
uint16_t * data()
Definition: CSCCFEBData.h:46
void digis(uint32_t idlayer, std::vector< CSCStripDigi > &result) const
faster way to get to digis
Definition: CSCCFEBData.cc:221
std::vector< std::vector< CSCStripDigi > > stripDigis()
deprecated. Use the above method.
Definition: CSCCFEBData.cc:349
static void selfTest()
std::vector< uint16_t > bWords
Definition: CSCCFEBData.h:73
friend std::ostream & operator<<(std::ostream &os, const CSCCFEBData &)
Definition: CSCCFEBData.cc:330
bool isDCFEB() const
Definition: CSCCFEBData.h:59
unsigned sizeInWords() const
Definition: CSCCFEBData.h:47
uint16_t theData[1600]
Definition: CSCCFEBData.h:65
uint16_t theFormatVersion
Definition: CSCCFEBData.h:74
unsigned boardNumber() const
Definition: CSCCFEBData.h:48
CSCCFEBData(unsigned boardNumber, const uint16_t *buf, uint16_t theFormatVersion=2005, bool fDCFEB=false)
read from an existing data stream.
Definition: CSCCFEBData.cc:11
void setBoardNumber(int cfeb)
Definition: CSCCFEBData.h:49
unsigned boardNumber_
Definition: CSCCFEBData.h:71
unsigned theNumberOfSamples
Definition: CSCCFEBData.h:72