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  * \author N. Almeida
15  * \author G. Franzoni
16  *
17 */
18 //C++
19 #include <fstream>
20 #include <iostream>
21 #include <string>
22 #include <vector>
23 #include <map>
24 #include <stdio.h>
25 #include <stdint.h>
26 
27 //DATA DECODER
28 
29 #include "DCCEventBlock.h"
30 
33 
36 
40 
42 
44 class DCCEventBlock;
45 class DCCEBEventBlock;
46 class DCCEEEventBlock;
47 class EcalRawToDigi;
48 
50 
51 public :
52 
53  DCCDataUnpacker(EcalElectronicsMapper *, bool hU,bool srpU, bool tccU, bool feU, bool memU, bool syncCheck, bool feIdCheck, bool forceToKeepFRdata);
58  void unpack(const uint64_t* buffer, size_t bufferSize, unsigned int smId, unsigned int fedId);
59 
60 
65  void setEBDigisCollection( std::auto_ptr<EBDigiCollection> * x )
66  { ebDigis_ = x; }
67 
68  void setEEDigisCollection( std::auto_ptr<EEDigiCollection> * x )
69  { eeDigis_ = x; }
70 
71  void setDccHeadersCollection( std::auto_ptr<EcalRawDataCollection> * x )
72  { dccHeaders_ = x; }
73 
74  void setEBSrFlagsCollection( std::auto_ptr<EBSrFlagCollection> * x )
75  { ebSrFlags_ = x; }
76 
77  void setEESrFlagsCollection( std::auto_ptr<EESrFlagCollection> * x )
78  { eeSrFlags_ = x; }
79 
80  void setEcalTpsCollection( std::auto_ptr<EcalTrigPrimDigiCollection> * x )
81  { ecalTps_ = x; }
82 
83  void setEcalPSsCollection( std::auto_ptr<EcalPSInputDigiCollection> * x )
84  { ecalPSs_ = x; }
85 
86  void setInvalidGainsCollection( std::auto_ptr<EBDetIdCollection> * x )
87  { invalidGains_ = x; }
88 
89  void setInvalidGainsSwitchCollection( std::auto_ptr<EBDetIdCollection> * x )
90  { invalidGainsSwitch_ = x; }
91 
92  void setInvalidChIdsCollection( std::auto_ptr<EBDetIdCollection> * x )
93  { invalidChIds_ = x; }
94 
95  // EE
96  void setInvalidEEGainsCollection( std::auto_ptr<EEDetIdCollection> * x )
97  { invalidEEGains_ = x; }
98 
99  void setInvalidEEGainsSwitchCollection( std::auto_ptr<EEDetIdCollection> * x )
100  { invalidEEGainsSwitch_ = x; }
101 
102  void setInvalidEEChIdsCollection( std::auto_ptr<EEDetIdCollection> * x )
103  { invalidEEChIds_ = x; }
104  // EE
105 
106  void setInvalidTTIdsCollection( std::auto_ptr<EcalElectronicsIdCollection> * x )
107  { invalidTTIds_ = x; }
108 
109  void setInvalidZSXtalIdsCollection( std::auto_ptr<EcalElectronicsIdCollection> * x )
110  { invalidZSXtalIds_ = x; }
111 
112  void setInvalidBlockLengthsCollection( std::auto_ptr<EcalElectronicsIdCollection> * x )
113  { invalidBlockLengths_ = x; }
114 
115  void setPnDiodeDigisCollection( std::auto_ptr<EcalPnDiodeDigiCollection> * x )
116  { pnDiodeDigis_ = x; }
117 
118  void setInvalidMemTtIdsCollection( std::auto_ptr<EcalElectronicsIdCollection> * x )
119  { invalidMemTtIds_ = x; }
120 
121  void setInvalidMemBlockSizesCollection( std::auto_ptr<EcalElectronicsIdCollection> * x )
122  { invalidMemBlockSizes_ = x; }
123 
124  void setInvalidMemChIdsCollection( std::auto_ptr<EcalElectronicsIdCollection> * x )
125  { invalidMemChIds_ = x; }
126 
127  void setInvalidMemGainsCollection( std::auto_ptr<EcalElectronicsIdCollection> * x )
128  { invalidMemGains_ = x; }
129 
130 
135  std::auto_ptr<EBDigiCollection> * ebDigisCollection()
136  { return ebDigis_; }
137 
138  std::auto_ptr<EEDigiCollection> * eeDigisCollection()
139  { return eeDigis_; }
140 
141  std::auto_ptr<EcalTrigPrimDigiCollection> * ecalTpsCollection()
142  { return ecalTps_; }
143 
144  std::auto_ptr<EcalPSInputDigiCollection> * ecalPSsCollection()
145  { return ecalPSs_; }
146 
147  std::auto_ptr<EBSrFlagCollection> * ebSrFlagsCollection()
148  { return ebSrFlags_; }
149 
150  std::auto_ptr<EESrFlagCollection> * eeSrFlagsCollection()
151  { return eeSrFlags_; }
152 
153  std::auto_ptr<EcalRawDataCollection> * dccHeadersCollection()
154  { return dccHeaders_; }
155 
156  std::auto_ptr<EBDetIdCollection> * invalidGainsCollection()
157  { return invalidGains_; }
158 
159  std::auto_ptr<EBDetIdCollection> * invalidGainsSwitchCollection()
160  { return invalidGainsSwitch_; }
161 
162  std::auto_ptr<EBDetIdCollection> * invalidChIdsCollection()
163  { return invalidChIds_; }
164 
165  //EE
166  std::auto_ptr<EEDetIdCollection> * invalidEEGainsCollection()
167  { return invalidEEGains_; }
168 
169  std::auto_ptr<EEDetIdCollection> * invalidEEGainsSwitchCollection()
170  { return invalidEEGainsSwitch_; }
171 
172  std::auto_ptr<EEDetIdCollection> * invalidEEChIdsCollection()
173  { return invalidEEChIds_; }
174  //EE
175 
176  std::auto_ptr<EcalElectronicsIdCollection> * invalidTTIdsCollection()
177  { return invalidTTIds_; }
178 
179  std::auto_ptr<EcalElectronicsIdCollection> * invalidZSXtalIdsCollection()
180  { return invalidZSXtalIds_; }
181 
182  std::auto_ptr< EcalElectronicsIdCollection> * invalidBlockLengthsCollection()
183  { return invalidBlockLengths_; }
184 
185  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemTtIdsCollection()
186  { return invalidMemTtIds_; }
187 
188  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemBlockSizesCollection()
189  { return invalidMemBlockSizes_; }
190 
191  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemChIdsCollection()
192  { return invalidMemChIds_; }
193 
194  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemGainsCollection()
195  { return invalidMemGains_; }
196 
197  std::auto_ptr<EcalPnDiodeDigiCollection> * pnDiodeDigisCollection()
198  { return pnDiodeDigis_; }
199 
200 
205 
206 
210  void setChannelStatusDB(const EcalChannelStatusMap* chdb) { chdb_ = chdb; }
211  // return status of given crystal
212  // https://twiki.cern.ch/twiki/bin/view/CMS/EcalChannelStatus#Assigning_Channel_status
213  uint16_t getChannelStatus(const DetId& id) const;
214  // return low 5 bits of status word
215  uint16_t getChannelValue(const DetId& id) const;
216  uint16_t getChannelValue(const int fed, const int ccu, const int strip, const int xtal) const;
217  // return status of given CCU
218  uint16_t getCCUValue(const int fed, const int ccu) const;
219 
220 
225 
226  static bool silentMode_;
227 
228 protected :
229 
230  // Data collections pointers
231  std::auto_ptr<EBDigiCollection> * ebDigis_;
232  std::auto_ptr<EEDigiCollection> * eeDigis_;
233  std::auto_ptr<EcalTrigPrimDigiCollection> * ecalTps_;
234  std::auto_ptr<EcalPSInputDigiCollection> * ecalPSs_;
235  std::auto_ptr<EcalRawDataCollection> * dccHeaders_;
236  std::auto_ptr<EBDetIdCollection> * invalidGains_;
237  std::auto_ptr<EBDetIdCollection> * invalidGainsSwitch_;
238  std::auto_ptr<EBDetIdCollection> * invalidChIds_;
239  //EE
240  std::auto_ptr<EEDetIdCollection> * invalidEEGains_;
241  std::auto_ptr<EEDetIdCollection> * invalidEEGainsSwitch_;
242  std::auto_ptr<EEDetIdCollection> * invalidEEChIds_;
243  //EE
244  std::auto_ptr<EBSrFlagCollection> * ebSrFlags_;
245  std::auto_ptr<EESrFlagCollection> * eeSrFlags_;
246  std::auto_ptr<EcalElectronicsIdCollection> * invalidTTIds_;
247  std::auto_ptr<EcalElectronicsIdCollection> * invalidZSXtalIds_;
248  std::auto_ptr<EcalElectronicsIdCollection> * invalidBlockLengths_;
249 
250  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemTtIds_ ;
251  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemBlockSizes_ ;
252  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemChIds_ ;
253  std::auto_ptr<EcalElectronicsIdCollection> * invalidMemGains_ ;
254  std::auto_ptr<EcalPnDiodeDigiCollection> * pnDiodeDigis_;
255 
261 
262 };
263 
264 #endif
void setChannelStatusDB(const EcalChannelStatusMap *chdb)
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()
std::auto_ptr< EcalElectronicsIdCollection > * invalidMemBlockSizesCollection()
std::auto_ptr< EcalElectronicsIdCollection > * invalidMemChIdsCollection()
void unpack(const uint64_t *buffer, size_t bufferSize, unsigned int smId, unsigned int fedId)
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:18
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_
Definition: DDAxes.h:10
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)