CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DCCDataUnpacker.h
Go to the documentation of this file.
1 #ifndef DCCDATAUNPACKER_HH
2 #define DCCDATAUNPACKER_HH
3 
4 
5 /*
6  *\ Class DCCDataUnpacker
7  *
8  * This class takes care of unpacking ECAL's raw data info.
9  * A gateway for all blocks unpackers and committing collections to the Event
10  * DCCEBEventBlock and DCCEEEventBlock are used here
11  *
12  * \file DCCDataUnpacker.h
13  *
14  * $Date: 2010/06/02 23:46:11 $
15  * $Revision: 1.4 $
16  * \author N. Almeida
17  * \author G. Franzoni
18  *
19 */
20 //C++
21 #include <fstream>
22 #include <iostream>
23 #include <string>
24 #include <vector>
25 #include <map>
26 #include <stdio.h>
27 #include <stdint.h>
28 
29 //DATA DECODER
30 
31 #include "DCCEventBlock.h"
32 
35 
38 
42 
44 
46 class DCCEventBlock;
47 class DCCEBEventBlock;
48 class DCCEEEventBlock;
49 class EcalRawToDigi;
50 
52 
53 public :
54 
55  DCCDataUnpacker(EcalElectronicsMapper *, bool hU,bool srpU, bool tccU, bool feU, bool memU, bool syncCheck, bool feIdCheck, bool forceToKeepFRdata);
60  void unpack( uint64_t * buffer, unsigned int bufferSize, unsigned int smId, unsigned int fedId);
61 
62 
67  void setEBDigisCollection( std::auto_ptr<EBDigiCollection> * x )
68  { ebDigis_ = x; }
69 
70  void setEEDigisCollection( std::auto_ptr<EEDigiCollection> * x )
71  { eeDigis_ = x; }
72 
73  void setDccHeadersCollection( std::auto_ptr<EcalRawDataCollection> * x )
74  { dccHeaders_ = x; }
75 
76  void setEBSrFlagsCollection( std::auto_ptr<EBSrFlagCollection> * x )
77  { ebSrFlags_ = x; }
78 
79  void setEESrFlagsCollection( std::auto_ptr<EESrFlagCollection> * x )
80  { eeSrFlags_ = x; }
81 
82  void setEcalTpsCollection( std::auto_ptr<EcalTrigPrimDigiCollection> * x )
83  { ecalTps_ = x; }
84 
85  void setEcalPSsCollection( std::auto_ptr<EcalPSInputDigiCollection> * x )
86  { ecalPSs_ = x; }
87 
88  void setInvalidGainsCollection( std::auto_ptr<EBDetIdCollection> * x )
89  { invalidGains_ = x; }
90 
91  void setInvalidGainsSwitchCollection( std::auto_ptr<EBDetIdCollection> * x )
92  { invalidGainsSwitch_ = x; }
93 
94  void setInvalidChIdsCollection( std::auto_ptr<EBDetIdCollection> * x )
95  { invalidChIds_ = x; }
96 
97  // EE
98  void setInvalidEEGainsCollection( std::auto_ptr<EEDetIdCollection> * x )
99  { invalidEEGains_ = x; }
100 
101  void setInvalidEEGainsSwitchCollection( std::auto_ptr<EEDetIdCollection> * x )
102  { invalidEEGainsSwitch_ = x; }
103 
104  void setInvalidEEChIdsCollection( std::auto_ptr<EEDetIdCollection> * x )
105  { invalidEEChIds_ = x; }
106  // EE
107 
108  void setInvalidTTIdsCollection( std::auto_ptr<EcalElectronicsIdCollection> * x )
109  { invalidTTIds_ = x; }
110 
111  void setInvalidZSXtalIdsCollection( std::auto_ptr<EcalElectronicsIdCollection> * x )
112  { invalidZSXtalIds_ = x; }
113 
114  void setInvalidBlockLengthsCollection( std::auto_ptr<EcalElectronicsIdCollection> * x )
115  { invalidBlockLengths_ = x; }
116 
117  void setPnDiodeDigisCollection( std::auto_ptr<EcalPnDiodeDigiCollection> * x )
118  { pnDiodeDigis_ = x; }
119 
120  void setInvalidMemTtIdsCollection( std::auto_ptr<EcalElectronicsIdCollection> * x )
121  { invalidMemTtIds_ = x; }
122 
123  void setInvalidMemBlockSizesCollection( std::auto_ptr<EcalElectronicsIdCollection> * x )
124  { invalidMemBlockSizes_ = x; }
125 
126  void setInvalidMemChIdsCollection( std::auto_ptr<EcalElectronicsIdCollection> * x )
127  { invalidMemChIds_ = x; }
128 
129  void setInvalidMemGainsCollection( std::auto_ptr<EcalElectronicsIdCollection> * x )
130  { invalidMemGains_ = x; }
131 
132 
137  std::auto_ptr<EBDigiCollection> * ebDigisCollection()
138  { return ebDigis_; }
139 
140  std::auto_ptr<EEDigiCollection> * eeDigisCollection()
141  { return eeDigis_; }
142 
143  std::auto_ptr<EcalTrigPrimDigiCollection> * ecalTpsCollection()
144  { return ecalTps_; }
145 
146  std::auto_ptr<EcalPSInputDigiCollection> * ecalPSsCollection()
147  { return ecalPSs_; }
148 
149  std::auto_ptr<EBSrFlagCollection> * ebSrFlagsCollection()
150  { return ebSrFlags_; }
151 
152  std::auto_ptr<EESrFlagCollection> * eeSrFlagsCollection()
153  { return eeSrFlags_; }
154 
155  std::auto_ptr<EcalRawDataCollection> * dccHeadersCollection()
156  { return dccHeaders_; }
157 
158  std::auto_ptr<EBDetIdCollection> * invalidGainsCollection()
159  { return invalidGains_; }
160 
161  std::auto_ptr<EBDetIdCollection> * invalidGainsSwitchCollection()
162  { return invalidGainsSwitch_; }
163 
164  std::auto_ptr<EBDetIdCollection> * invalidChIdsCollection()
165  { return invalidChIds_; }
166 
167  //EE
168  std::auto_ptr<EEDetIdCollection> * invalidEEGainsCollection()
169  { return invalidEEGains_; }
170 
171  std::auto_ptr<EEDetIdCollection> * invalidEEGainsSwitchCollection()
172  { return invalidEEGainsSwitch_; }
173 
174  std::auto_ptr<EEDetIdCollection> * invalidEEChIdsCollection()
175  { return invalidEEChIds_; }
176  //EE
177 
178  std::auto_ptr<EcalElectronicsIdCollection> * invalidTTIdsCollection()
179  { return invalidTTIds_; }
180 
181  std::auto_ptr<EcalElectronicsIdCollection> * invalidZSXtalIdsCollection()
182  { return invalidZSXtalIds_; }
183 
184  std::auto_ptr< EcalElectronicsIdCollection> * invalidBlockLengthsCollection()
185  { return invalidBlockLengths_; }
186 
187  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemTtIdsCollection()
188  { return invalidMemTtIds_; }
189 
190  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemBlockSizesCollection()
191  { return invalidMemBlockSizes_; }
192 
193  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemChIdsCollection()
194  { return invalidMemChIds_; }
195 
196  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemGainsCollection()
197  { return invalidMemGains_; }
198 
199  std::auto_ptr<EcalPnDiodeDigiCollection> * pnDiodeDigisCollection()
200  { return pnDiodeDigis_; }
201 
202 
207 
208 
212  void setChannelStatusDB(const EcalChannelStatusMap* chdb) { chdb_ = chdb; }
213  // return status of given crystal
214  // https://twiki.cern.ch/twiki/bin/view/CMS/EcalChannelStatus#Assigning_Channel_status
215  uint16_t getChannelStatus(const DetId& id) const;
216  // return low 5 bits of status word
217  uint16_t getChannelValue(const DetId& id) const;
218  uint16_t getChannelValue(const int fed, const int ccu, const int strip, const int xtal) const;
219  // return status of given CCU
220  uint16_t getCCUValue(const int fed, const int ccu) const;
221 
222 
227 
228  static bool silentMode_;
229 
230 protected :
231 
232  // Data collections pointers
233  std::auto_ptr<EBDigiCollection> * ebDigis_;
234  std::auto_ptr<EEDigiCollection> * eeDigis_;
235  std::auto_ptr<EcalTrigPrimDigiCollection> * ecalTps_;
236  std::auto_ptr<EcalPSInputDigiCollection> * ecalPSs_;
237  std::auto_ptr<EcalRawDataCollection> * dccHeaders_;
238  std::auto_ptr<EBDetIdCollection> * invalidGains_;
239  std::auto_ptr<EBDetIdCollection> * invalidGainsSwitch_;
240  std::auto_ptr<EBDetIdCollection> * invalidChIds_;
241  //EE
242  std::auto_ptr<EEDetIdCollection> * invalidEEGains_;
243  std::auto_ptr<EEDetIdCollection> * invalidEEGainsSwitch_;
244  std::auto_ptr<EEDetIdCollection> * invalidEEChIds_;
245  //EE
246  std::auto_ptr<EBSrFlagCollection> * ebSrFlags_;
247  std::auto_ptr<EESrFlagCollection> * eeSrFlags_;
248  std::auto_ptr<EcalElectronicsIdCollection> * invalidTTIds_;
249  std::auto_ptr<EcalElectronicsIdCollection> * invalidZSXtalIds_;
250  std::auto_ptr<EcalElectronicsIdCollection> * invalidBlockLengths_;
251 
252  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemTtIds_ ;
253  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemBlockSizes_ ;
254  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemChIds_ ;
255  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemGains_ ;
256  std::auto_ptr<EcalPnDiodeDigiCollection> * pnDiodeDigis_;
257 
263 
264 };
265 
266 #endif
void setChannelStatusDB(const EcalChannelStatusMap *chdb)
void unpack(uint64_t *buffer, unsigned int bufferSize, unsigned int smId, unsigned int fedId)
std::auto_ptr< EEDigiCollection > * eeDigis_
std::auto_ptr< EBDetIdCollection > * invalidGainsSwitchCollection()
void setPnDiodeDigisCollection(std::auto_ptr< EcalPnDiodeDigiCollection > *x)
std::auto_ptr< EBSrFlagCollection > * ebSrFlagsCollection()
DCCEventBlock * currentEvent_
std::auto_ptr< EBDetIdCollection > * invalidGainsSwitch_
std::auto_ptr< EcalElectronicsIdCollection > * invalidTTIdsCollection()
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
std::auto_ptr< EcalElectronicsIdCollection > * invalidMemBlockSizesCollection()
std::auto_ptr< EcalElectronicsIdCollection > * invalidMemChIdsCollection()
std::auto_ptr< EBSrFlagCollection > * ebSrFlags_
void setInvalidZSXtalIdsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
std::auto_ptr< EcalElectronicsIdCollection > * invalidMemGains_
void setInvalidMemBlockSizesCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
DCCEBEventBlock * ebEventBlock_
std::auto_ptr< EcalElectronicsIdCollection > * invalidMemChIds_
std::auto_ptr< EEDetIdCollection > * invalidEEChIdsCollection()
std::auto_ptr< EcalElectronicsIdCollection > * invalidTTIds_
void setDccHeadersCollection(std::auto_ptr< EcalRawDataCollection > *x)
void setEcalPSsCollection(std::auto_ptr< EcalPSInputDigiCollection > *x)
uint16_t getChannelStatus(const DetId &id) const
std::auto_ptr< EEDetIdCollection > * invalidEEChIds_
std::auto_ptr< EcalPSInputDigiCollection > * ecalPSsCollection()
std::auto_ptr< EBDetIdCollection > * invalidChIdsCollection()
void setInvalidEEGainsSwitchCollection(std::auto_ptr< EEDetIdCollection > *x)
EcalElectronicsMapper * electronicsMapper_
void setEEDigisCollection(std::auto_ptr< EEDigiCollection > *x)
std::auto_ptr< EESrFlagCollection > * eeSrFlags_
std::auto_ptr< EcalTrigPrimDigiCollection > * ecalTps_
static bool silentMode_
std::auto_ptr< EEDetIdCollection > * invalidEEGainsCollection()
const EcalElectronicsMapper * electronicsMapper() const
void setInvalidMemTtIdsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
std::auto_ptr< EBDetIdCollection > * invalidGainsCollection()
std::auto_ptr< EBDetIdCollection > * invalidChIds_
std::auto_ptr< EcalElectronicsIdCollection > * invalidMemBlockSizes_
DCCDataUnpacker(EcalElectronicsMapper *, bool hU, bool srpU, bool tccU, bool feU, bool memU, bool syncCheck, bool feIdCheck, bool forceToKeepFRdata)
std::auto_ptr< EBDigiCollection > * ebDigis_
void setEBSrFlagsCollection(std::auto_ptr< EBSrFlagCollection > *x)
void setEBDigisCollection(std::auto_ptr< EBDigiCollection > *x)
const EcalChannelStatusMap * chdb_
uint16_t getChannelValue(const DetId &id) const
std::auto_ptr< EcalRawDataCollection > * dccHeadersCollection()
uint16_t getCCUValue(const int fed, const int ccu) const
std::auto_ptr< EcalElectronicsIdCollection > * invalidMemTtIdsCollection()
void setInvalidMemGainsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
DCCEEEventBlock * eeEventBlock_
void setInvalidGainsCollection(std::auto_ptr< EBDetIdCollection > *x)
std::auto_ptr< EcalRawDataCollection > * dccHeaders_
void setInvalidEEChIdsCollection(std::auto_ptr< EEDetIdCollection > *x)
std::auto_ptr< EcalElectronicsIdCollection > * invalidZSXtalIdsCollection()
std::auto_ptr< EcalElectronicsIdCollection > * invalidZSXtalIds_
std::auto_ptr< EcalElectronicsIdCollection > * invalidBlockLengths_
std::auto_ptr< EcalElectronicsIdCollection > * invalidMemGainsCollection()
void setInvalidTTIdsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
Definition: DetId.h:20
void setInvalidGainsSwitchCollection(std::auto_ptr< EBDetIdCollection > *x)
std::auto_ptr< EBDetIdCollection > * invalidGains_
unsigned long long uint64_t
Definition: Time.h:15
void setEESrFlagsCollection(std::auto_ptr< EESrFlagCollection > *x)
std::auto_ptr< EcalElectronicsIdCollection > * invalidMemTtIds_
DCCEventBlock * currentEvent()
std::auto_ptr< EcalTrigPrimDigiCollection > * ecalTpsCollection()
std::auto_ptr< EEDetIdCollection > * invalidEEGains_
std::auto_ptr< EEDigiCollection > * eeDigisCollection()
void setEcalTpsCollection(std::auto_ptr< EcalTrigPrimDigiCollection > *x)
std::auto_ptr< EcalPSInputDigiCollection > * ecalPSs_
std::auto_ptr< EcalPnDiodeDigiCollection > * pnDiodeDigisCollection()
void setInvalidMemChIdsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
void setInvalidBlockLengthsCollection(std::auto_ptr< EcalElectronicsIdCollection > *x)
std::auto_ptr< EcalPnDiodeDigiCollection > * pnDiodeDigis_
std::auto_ptr< EEDetIdCollection > * invalidEEGainsSwitch_
void setInvalidEEGainsCollection(std::auto_ptr< EEDetIdCollection > *x)
std::auto_ptr< EBDigiCollection > * ebDigisCollection()
std::auto_ptr< EESrFlagCollection > * eeSrFlagsCollection()
std::auto_ptr< EcalElectronicsIdCollection > * invalidBlockLengthsCollection()
std::auto_ptr< EEDetIdCollection > * invalidEEGainsSwitchCollection()
void setInvalidChIdsCollection(std::auto_ptr< EBDetIdCollection > *x)