CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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);
19  CSCCFEBData(unsigned boardNumber, bool sixteenSamples);
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 
51  friend std::ostream & operator<<(std::ostream & os, const CSCCFEBData &);
52  static void selfTest();
53 
55  bool check() const;
56 
57  private:
58  unsigned short theData[1600];
61  std::vector<std::pair<int,bool> > theSliceStarts;
63  int theSize;
64  unsigned boardNumber_;
66  std::vector<uint16_t> bWords;
67 };
68 
69 #endif
int i
Definition: DBlmapReader.cc:9
unsigned adcOverflow(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:122
unsigned overlappedSampleFlag(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:147
unsigned short * data()
Definition: CSCCFEBData.h:46
CSCCFEBData(unsigned boardNumber, unsigned short *buf)
read from an existing data stream.
Definition: CSCCFEBData.cc:11
void digis(uint32_t idlayer, std::vector< CSCStripDigi > &result)
faster way to get to digis
Definition: CSCCFEBData.cc:202
void add(const CSCStripDigi &, int layer)
Definition: CSCCFEBData.cc:80
unsigned adcCounts(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:114
unsigned errorstat(unsigned layer, unsigned channel, unsigned timeBin) const
Definition: CSCCFEBData.cc:155
std::vector< std::pair< int, bool > > theSliceStarts
Definition: CSCCFEBData.h:61
CSCCFEBStatusDigi statusDigi() const
returns one status digi per cfeb
Definition: CSCCFEBData.cc:165
int theSize
in words
Definition: CSCCFEBData.h:63
bool check() const
makes sure each time slice has a trailer
Definition: CSCCFEBData.cc:290
unsigned controllerData(unsigned uglay, unsigned ugchan, unsigned timeBin) const
Definition: CSCCFEBData.cc:131
const CSCCFEBTimeSlice * timeSlice(unsigned i) const
count from 0. User should check if it&#39;s a bad slice
Definition: CSCCFEBData.cc:96
unsigned short theData[1600]
Definition: CSCCFEBData.h:58
unsigned nTimeSamples() const
Definition: CSCCFEBData.h:21
std::vector< std::vector< CSCStripDigi > > stripDigis()
deprecated. Use the above method.
Definition: CSCCFEBData.cc:320
tuple result
Definition: query.py:137
static void selfTest()
std::vector< uint16_t > bWords
Definition: CSCCFEBData.h:66
friend std::ostream & operator<<(std::ostream &os, const CSCCFEBData &)
Definition: CSCCFEBData.cc:301
unsigned sizeInWords() const
Definition: CSCCFEBData.h:47
unsigned boardNumber() const
Definition: CSCCFEBData.h:48
void setBoardNumber(int cfeb)
Definition: CSCCFEBData.h:49
unsigned boardNumber_
Definition: CSCCFEBData.h:64
unsigned theNumberOfSamples
Definition: CSCCFEBData.h:65