CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCEventData.h
Go to the documentation of this file.
1 #ifndef CSCEventData_h
2 #define CSCEventData_h
3 
4 class CSCCFEBData;
5 class CLCTData;
6 class TMBScope;
7 class CSCDMBHeader;
8 class CSCDMBTrailer;
9 class CSCStripDigi;
10 class CSCALCTHeader;
11 class CSCALCTHeader2007;
12 class CSCAnodeData;
13 class CSCALCTTrailer;
14 class CSCTMBHeader;
15 class CSCTMBData;
16 class CSCCLCTData;
17 class CSCTMBTrailer;
18 class CSCWireDigi;
19 class CSCStripDigi;
20 class CSCComparatorOutput;
21 #include <map>
22 #include <vector>
34 #include <boost/dynamic_bitset.hpp>
35 
36 class CSCEventData {
37  public:
38  explicit CSCEventData(int chamberType);
40  CSCEventData(unsigned short * buf);
44  ~CSCEventData();
47 
49  unsigned short size() const {return size_;}
50 
52  static void setDebug(const bool value) {debug = value;}
53 
54 
56  bool isALCT(const short unsigned int * buf);
57 
59  bool isTMB(const short unsigned int * buf);
60 
61 
62 
63 
65  CSCCFEBData * cfebData(unsigned icfeb) const;
66 
68  std::vector<CSCStripDigi> stripDigis(const CSCDetId & idlayer) const;
69 
71  std::vector<CSCStripDigi> stripDigis(unsigned idlayer, unsigned icfeb) const;
72 
73 
75  std::vector< std::vector<CSCStripDigi> > stripDigis() const;
76 
77 
78  std::vector<CSCWireDigi> wireDigis(unsigned ilayer) const;
80  std::vector< std::vector<CSCWireDigi> > wireDigis() const;
81 
82 
84  int nalct() const {return theDMBHeader.nalct();}
85 
87  int nclct() const {return theDMBHeader.nclct();}
88 
90  const CSCDMBHeader * dmbHeader() const {return &theDMBHeader;}
92 
94  CSCALCTHeader * alctHeader() const;
95 
97  CSCALCTTrailer * alctTrailer() const;
98 
100  CSCAnodeData * alctData() const;
101 
103  CSCTMBData * tmbData() const;
104 
106  CSCTMBHeader * tmbHeader() const;
107 
109  CSCCLCTData * clctData() const;
110 
112  const CSCDMBTrailer * dmbTrailer() const {return &theDMBTrailer;}
114  void add(const CSCStripDigi &, int layer);
115  void add(const CSCWireDigi &, int layer);
116  void add(const CSCComparatorDigi &, int layer);
118  void add(const std::vector<CSCALCTDigi> &);
119  void add(const std::vector<CSCCLCTDigi> &);
120  void add(const std::vector<CSCCorrelatedLCTDigi> &);
121 
122 
125  void setEventInformation(int bxnum, int lvl1num);
126 
128  boost::dynamic_bitset<> pack();
129 
131  void addALCTStructures();
132 
134  int chamberType() const {return theChamberType;}
135 
136 
137  static bool debug;
138  //uint16_t dataPresent; // 7 bit word which will tell if alct, clct, and 5 cfebs are present
139  static void selfTest();
140 
141 private:
144  void init();
145  void unpack_data(unsigned short * buf);
146  void copy(const CSCEventData &);
147  void destroy();
148 
150  void checkALCTClasses();
152  void checkTMBClasses();
153 
155  void addComparatorInformation(std::vector<CSCStripDigi>&, int layer) const;
156 
158  //these are empty data objects unless filled in CSCEventData.cc
166 
169 
171 
172  int size_;
176 
178  unsigned short * alctZSErecovered;
179  int zseEnable;
180 };
181 
182 std::ostream & operator<<(std::ostream & os, const CSCEventData & evt);
183 #endif
void setEventInformation(int bxnum, int lvl1num)
bool isALCT(const short unsigned int *buf)
if dealing with ALCT data
unsigned short * alctZSErecovered
Auxiliary bufer to recove the ALCT raw payload from zero suppression.
Definition: CSCEventData.h:178
int nclct() const
the number of CLCTs
Definition: CSCEventData.h:87
std::vector< std::vector< CSCStripDigi > > stripDigis() const
deprecated. Use the above methods instead
unsigned nclct() const
Definition: CSCDMBHeader.cc:46
void checkALCTClasses()
makes new ALCT classes, if needed
std::vector< std::vector< CSCWireDigi > > wireDigis() const
deprecated. Use the above method instead.
const CSCDMBTrailer * dmbTrailer() const
DMB trailer.
Definition: CSCEventData.h:112
void addALCTStructures()
adds an empty ALCTHeader, trailer, and anode data
void checkTMBClasses()
makes new TMB classes, if needed
unsigned nalct() const
Definition: CSCDMBHeader.cc:41
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
CSCAnodeData * alctData() const
user must check if nalct &gt; 0
CSCALCTHeader * alctHeader() const
user must check if nalct &gt; 0
int nalct() const
the flag for existence of ALCT data
Definition: CSCEventData.h:84
CSCDMBHeader theDMBHeader
Definition: CSCEventData.h:157
CSCCLCTData * clctData() const
user must check if nclct &gt; 0
CSCTMBData * theTMBData
Definition: CSCEventData.h:165
static bool debug
Definition: CSCEventData.h:137
CSCALCTTrailer * alctTrailer() const
user must check if nalct &gt; 0
CSCALCTHeader * theALCTHeader
Definition: CSCEventData.h:162
CSCTMBData * tmbData() const
user must check in nclct &gt; 0
CSCDMBHeader * dmbHeader()
Definition: CSCEventData.h:91
CSCDMBTrailer theDMBTrailer
Definition: CSCEventData.h:170
void unpack_data(unsigned short *buf)
Definition: CSCEventData.cc:37
CSCEventData operator=(const CSCEventData &data)
CSCALCTTrailer * theALCTTrailer
Definition: CSCEventData.h:164
bool isTMB(const short unsigned int *buf)
if dealing with TMB data
void copy(const CSCEventData &)
unsigned short size() const
size of the data buffer used, in bytes
Definition: CSCEventData.h:49
void add(const CSCStripDigi &, int layer)
routines to add digis to the data
CSCTMBHeader * tmbHeader() const
user must check if nclct &gt; 0
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void addComparatorInformation(std::vector< CSCStripDigi > &, int layer) const
adds the comparators to the strip digis
CSCCFEBData * cfebData(unsigned icfeb) const
unpacked in long mode: has overflow and error bits decoded
int chamberType() const
might not be set in real data
Definition: CSCEventData.h:134
boost::dynamic_bitset pack()
returns the packed event data.
const CSCDMBHeader * dmbHeader() const
the DAQ motherboard header. A good place for event and chamber info
Definition: CSCEventData.h:90
static void setDebug(const bool value)
Definition: CSCEventData.h:52
CSCAnodeData * theAnodeData
Definition: CSCEventData.h:163
CSCCFEBData * theCFEBData[5]
for up to 5 CFEB boards
Definition: CSCEventData.h:168
static void selfTest()