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, unsigned short * 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);
38 
39  std::vector<CSCStripDigi> digis(unsigned idlayer);
41  std::vector<std::vector<CSCStripDigi> > stripDigis();
42 
45 
46  unsigned short * 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  unsigned short 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
unsigned adcOverflow(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:127
unsigned overlappedSampleFlag(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:152
unsigned short * data()
Definition: CSCCFEBData.h:46
void digis(uint32_t idlayer, std::vector< CSCStripDigi > &result)
faster way to get to digis
Definition: CSCCFEBData.cc:223
void add(const CSCStripDigi &, int layer)
Definition: CSCCFEBData.cc:85
void setL1A(unsigned l1a)
Definition: CSCCFEBData.cc:170
unsigned adcCounts(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:119
unsigned errorstat(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:160
std::vector< std::pair< int, bool > > theSliceStarts
Definition: CSCCFEBData.h:66
CSCCFEBStatusDigi statusDigi() const
returns one status digi per cfeb
Definition: CSCCFEBData.cc:186
int theSize
in words
Definition: CSCCFEBData.h:68
bool check() const
makes sure each time slice has a trailer
Definition: CSCCFEBData.cc:321
unsigned controllerData(unsigned uglay, unsigned ugchan, unsigned timeBin) const
Definition: CSCCFEBData.cc:136
const CSCCFEBTimeSlice * timeSlice(unsigned i) const
count from 0. User should check if it&#39;s a bad slice
Definition: CSCCFEBData.cc:101
unsigned short theData[1600]
Definition: CSCCFEBData.h:63
unsigned nTimeSamples() const
Definition: CSCCFEBData.h:21
std::vector< std::vector< CSCStripDigi > > stripDigis()
deprecated. Use the above method.
Definition: CSCCFEBData.cc:351
static void selfTest()
std::vector< uint16_t > bWords
Definition: CSCCFEBData.h:71
friend std::ostream & operator<<(std::ostream &os, const CSCCFEBData &)
Definition: CSCCFEBData.cc:332
bool isDCFEB() const
Definition: CSCCFEBData.h:59
CSCCFEBData(unsigned boardNumber, unsigned short *buf, uint16_t theFormatVersion=2005, bool fDCFEB=false)
read from an existing data stream.
Definition: CSCCFEBData.cc:11
unsigned sizeInWords() const
Definition: CSCCFEBData.h:47
uint16_t theFormatVersion
Definition: CSCCFEBData.h:72
unsigned boardNumber() const
Definition: CSCCFEBData.h:48
void setBoardNumber(int cfeb)
Definition: CSCCFEBData.h:49
unsigned boardNumber_
Definition: CSCCFEBData.h:69
unsigned theNumberOfSamples
Definition: CSCCFEBData.h:70