CMS 3D CMS Logo

EcalRawToDigi.cc
Go to the documentation of this file.
1 /*
2  *\ Class EcalRawToDigi
3  *
4  * This class takes unpacks ECAL raw data
5  * produces digis and raw data format prolblems reports
6  *
7  * \file EcalRawToDigi.h
8  *
9  * \author N. Almeida
10  * \author G. Franzoni
11  *
12 */
13 
14 #include <iostream>
15 
17 
27 
36 #include <sys/time.h>
37 
40 class DCCDataUnpacker;
41 
43 public:
47  explicit EcalRawToDigi(const edm::ParameterSet& ps);
48 
52  void produce(edm::Event& e, const edm::EventSetup& c) override;
53  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
54 
55  // function called at start of each run
56  void beginRun(const edm::Run& run, const edm::EventSetup& es) override;
57 
61  ~EcalRawToDigi() override;
62 
64 
65 private:
66  //list of FEDs to unpack
67  std::vector<int> fedUnpackList_;
68 
69  std::vector<int> orderedFedUnpackList_;
70  std::vector<int> orderedDCCIdList_;
71 
72  unsigned int numbXtalTSamples_;
73  unsigned int numbTriggerTSamples_;
74 
80  bool syncCheck_;
81  bool feIdCheck_;
83  bool first_;
84  bool put_;
85 
90 
91  // -- For regional unacking :
92  bool REGIONAL_;
93 
94  //an electronics mapper class
96 
97  //Ecal unpacker
99 
100  unsigned int nevts_; // NA: for testing
102 };
103 
106 
109 
112 
114  :
115 
116  //define the list of FED to be unpacked
117  fedUnpackList_(conf.getParameter<std::vector<int> >("FEDs")),
118 
119  //define the ordered FED list
120  orderedFedUnpackList_(conf.getParameter<std::vector<int> >("orderedFedList")),
121 
122  //define the ordered DCCId list
123  orderedDCCIdList_(conf.getParameter<std::vector<int> >("orderedDCCIdList")),
124 
125  //get number of Xtal Time Samples
126  numbXtalTSamples_(conf.getParameter<int>("numbXtalTSamples")),
127 
128  //Get number of Trigger Time Samples
129  numbTriggerTSamples_(conf.getParameter<int>("numbTriggerTSamples")),
130 
131  //See if header unpacking is enabled
132  headerUnpacking_(conf.getParameter<bool>("headerUnpacking")),
133 
134  //See if srp unpacking is enabled
135  srpUnpacking_(conf.getParameter<bool>("srpUnpacking")),
136 
137  //See if tcc unpacking is enabled
138  tccUnpacking_(conf.getParameter<bool>("tccUnpacking")),
139 
140  //See if fe unpacking is enabled
141  feUnpacking_(conf.getParameter<bool>("feUnpacking")),
142 
143  //See if fe unpacking is enabled for mem box
144  memUnpacking_(conf.getParameter<bool>("memUnpacking")),
145 
146  //See if syncCheck is enabled
147  syncCheck_(conf.getParameter<bool>("syncCheck")),
148 
149  //See if feIdCheck is enabled
150  feIdCheck_(conf.getParameter<bool>("feIdCheck")),
151 
152  // See if we want to keep data even if we have a mismatch between SR decision and block length
153  forceToKeepFRdata_(conf.getParameter<bool>("forceToKeepFRData")),
154 
155  put_(conf.getParameter<bool>("eventPut")),
156 
157  REGIONAL_(conf.getParameter<bool>("DoRegional")),
158 
159  myMap_(nullptr),
160 
161  theUnpacker_(nullptr)
162 
163 {
164  first_ = true;
165  DCCDataUnpacker::silentMode_ = conf.getUntrackedParameter<bool>("silentMode", false);
166 
167  if (numbXtalTSamples_ < 6 || numbXtalTSamples_ > 64 || (numbXtalTSamples_ - 2) % 4) {
168  std::ostringstream output;
169  output << "\n Unsuported number of xtal time samples : " << numbXtalTSamples_
170  << "\n Valid Number of xtal time samples are : 6,10,14,18,...,62";
171  edm::LogError("IncorrectConfiguration") << output.str();
172  // todo : throw an execption
173  }
174 
176  std::ostringstream output;
177  output << "\n Unsuported number of trigger time samples : " << numbTriggerTSamples_
178  << "\n Valid number of trigger time samples are : 1, 4 or 8";
179  edm::LogError("IncorrectConfiguration") << output.str();
180  // todo : throw an execption
181  }
182 
183  //NA : testing
184  //nevts_=0;
185  //RUNNING_TIME_=0;
186 
187  // if there are FEDs specified to unpack fill the vector of the fedUnpackList_
188  // else fill with the entire ECAL fed range (600-670)
189  if (fedUnpackList_.empty())
191  fedUnpackList_.push_back(i);
192 
193  //print the FEDs to unpack to the logger
194  std::ostringstream loggerOutput_;
195  if (!fedUnpackList_.empty()) {
196  for (unsigned int i = 0; i < fedUnpackList_.size(); i++)
197  loggerOutput_ << fedUnpackList_[i] << " ";
198  edm::LogInfo("EcalRawToDigi") << "EcalRawToDigi will unpack FEDs ( " << loggerOutput_.str() << ")";
199  LogDebug("EcalRawToDigi") << "EcalRawToDigi will unpack FEDs ( " << loggerOutput_.str() << ")";
200  }
201 
202  edm::LogInfo("EcalRawToDigi") << "\n ECAL RawToDigi configuration:"
203  << "\n Header unpacking is " << headerUnpacking_ << "\n SRP Bl. unpacking is "
204  << srpUnpacking_ << "\n TCC Bl. unpacking is " << tccUnpacking_
205  << "\n FE Bl. unpacking is " << feUnpacking_ << "\n MEM Bl. unpacking is "
206  << memUnpacking_ << "\n sync check is " << syncCheck_ << "\n feID check is "
207  << feIdCheck_ << "\n force keep FR data is " << forceToKeepFRdata_ << "\n";
208 
209  edm::InputTag dataLabel = conf.getParameter<edm::InputTag>("InputLabel");
210  edm::InputTag fedsLabel = conf.getParameter<edm::InputTag>("FedLabel");
211 
212  // Producer products
213  if (headerUnpacking_) {
214  produces<EcalRawDataCollection>();
215  }
216 
217  if (feUnpacking_) {
218  produces<EBDigiCollection>("ebDigis");
219  produces<EEDigiCollection>("eeDigis");
220 
221  // Integrity for xtal data
222  produces<EBDetIdCollection>("EcalIntegrityGainErrors");
223  produces<EBDetIdCollection>("EcalIntegrityGainSwitchErrors");
224  produces<EBDetIdCollection>("EcalIntegrityChIdErrors");
225 
226  // Integrity for xtal data - EE specific (to be rivisited towards EB+EE common collection)
227  produces<EEDetIdCollection>("EcalIntegrityGainErrors");
228  produces<EEDetIdCollection>("EcalIntegrityGainSwitchErrors");
229  produces<EEDetIdCollection>("EcalIntegrityChIdErrors");
230 
231  // Integrity Errors
232  produces<EcalElectronicsIdCollection>("EcalIntegrityTTIdErrors");
233  produces<EcalElectronicsIdCollection>("EcalIntegrityZSXtalIdErrors");
234  produces<EcalElectronicsIdCollection>("EcalIntegrityBlockSizeErrors");
235 
236  //
237  produces<EcalPnDiodeDigiCollection>();
238  }
239 
240  if (srpUnpacking_) {
241  produces<EBSrFlagCollection>();
242  produces<EESrFlagCollection>();
243  }
244 
245  if (tccUnpacking_) {
246  produces<EcalTrigPrimDigiCollection>("EcalTriggerPrimitives");
247  produces<EcalPSInputDigiCollection>("EcalPseudoStripInputs");
248  }
249 
250  // Mem channels' integrity
251  if (memUnpacking_) {
252  produces<EcalElectronicsIdCollection>("EcalIntegrityMemTtIdErrors");
253  produces<EcalElectronicsIdCollection>("EcalIntegrityMemBlockSizeErrors");
254  produces<EcalElectronicsIdCollection>("EcalIntegrityMemChIdErrors");
255  produces<EcalElectronicsIdCollection>("EcalIntegrityMemGainErrors");
256  }
257 
258  dataToken_ = consumes<FEDRawDataCollection>(dataLabel);
259  if (REGIONAL_) {
260  fedsToken_ = consumes<EcalListOfFEDS>(fedsLabel);
261  }
262  chStatusToken_ = esConsumes<EcalChannelStatusMap, EcalChannelStatusRcd, edm::Transition::BeginRun>();
263  ecalMappingToken_ = esConsumes<EcalElectronicsMapping, EcalMappingRcd>();
264 
265  // Build a new Electronics mapper and parse default map file
267 
268  // in case of external tsext file (deprecated by HLT environment)
269  // bool readResult = myMap_->readDCCMapFile(conf.getParameter<std::string>("DCCMapFile",""));
270 
271  // use two arrays from cfg to establish DCCId:FedId. If they are empy, than use hard coded correspondence
273  // myMap::makeMapFromVectors() returns "true" always
274  // need to be fixed?
275 
276  if (!readResult) {
277  edm::LogWarning("IncorrectConfiguration") << "Arrays orderedFedList and orderedDCCIdList are emply. "
278  "Hard coded correspondence for DCCId:FedId will be used.";
279  // edm::LogError("EcalRawToDigi")<<"\n unable to read file : "
280  // <<conf.getParameter<std::string>("DCCMapFile");
281  }
282 
283  // Build a new ECAL DCC data unpacker
288  feUnpacking_,
290  syncCheck_,
291  feIdCheck_,
293 }
294 
295 // print list of crystals with non-zero statuses
296 // this functions is only for debug purposes
298  // Endcap
299  std::cout << "===> ENDCAP" << std::endl;
300  for (int i = 0; i < EEDetId::kSizeForDenseIndexing; ++i) {
301  const EEDetId id = EEDetId::unhashIndex(i);
302  if (!id.null()) {
303  // channel status
304  const uint16_t code = unpacker->getChannelValue(id);
305 
306  if (code) {
307  const EcalElectronicsId ei = mapping->getElectronicsId(id);
308 
309  // convert DCC ID (1 - 54) to FED ID (601 - 654)
310  const int fed_id = unpacker->electronicsMapper()->getDCCId(ei.dccId());
311 
312  std::cout << " id " << id.rawId() << " -> (" << id.ix() << ", " << id.iy() << ", " << id.zside() << ") "
313  << "(" << ei.dccId() << " : " << fed_id << ", " << ei.towerId() << ", " << ei.stripId() << ", "
314  << ei.xtalId() << ") "
315  << "status = " << code << std::endl;
316  }
317  }
318  }
319  std::cout << "<=== ENDCAP" << std::endl;
320 
321  std::cout << "===> BARREL" << std::endl;
322  for (int i = 0; i < EBDetId::kSizeForDenseIndexing; ++i) {
323  const EBDetId id = EBDetId::unhashIndex(i);
324  if (!id.null()) {
325  // channel status
326  const uint16_t code = unpacker->getChannelValue(id);
327 
328  if (code) {
329  const EcalElectronicsId ei = mapping->getElectronicsId(id);
330 
331  // convert DCC ID (1 - 54) to FED ID (601 - 654)
332  const int fed_id = unpacker->electronicsMapper()->getDCCId(ei.dccId());
333 
334  std::cout << " id " << id.rawId() << " -> (" << id.ieta() << ", " << id.iphi() << ", " << id.zside() << ") "
335  << "(" << ei.dccId() << " : " << fed_id << ", " << ei.towerId() << ", " << ei.stripId() << ", "
336  << ei.xtalId() << ") "
337  << "status = " << code << std::endl;
338  }
339  }
340  }
341  std::cout << "<=== BARREL" << std::endl;
342 }
343 
346  desc.add<bool>("tccUnpacking", true);
347  desc.add<edm::InputTag>("FedLabel", edm::InputTag("listfeds"));
348  desc.add<bool>("srpUnpacking", true);
349  desc.add<bool>("syncCheck", true);
350  desc.add<bool>("feIdCheck", true);
351  desc.addUntracked<bool>("silentMode", true);
352  desc.add<edm::InputTag>("InputLabel", edm::InputTag("rawDataCollector"));
353  {
354  std::vector<int> temp1;
355  unsigned int nvec = 54;
356  temp1.reserve(nvec);
357  for (unsigned int i = 0; i < nvec; i++)
358  temp1.push_back(601 + i);
359  desc.add<std::vector<int> >("orderedFedList", temp1);
360  }
361  desc.add<bool>("eventPut", true);
362  desc.add<int>("numbTriggerTSamples", 1);
363  desc.add<int>("numbXtalTSamples", 10);
364  {
365  std::vector<int> temp1;
366  unsigned int nvec = 54;
367  temp1.reserve(nvec);
368  for (unsigned int i = 0; i < nvec; i++)
369  temp1.push_back(1 + i);
370  desc.add<std::vector<int> >("orderedDCCIdList", temp1);
371  }
372  {
373  std::vector<int> temp1;
374  unsigned int nvec = 54;
375  temp1.reserve(nvec);
376  for (unsigned int i = 0; i < nvec; i++)
377  temp1.push_back(601 + i);
378  desc.add<std::vector<int> >("FEDs", temp1);
379  }
380  desc.add<bool>("DoRegional", false);
381  desc.add<bool>("feUnpacking", true);
382  desc.add<bool>("forceToKeepFRData", false);
383  desc.add<bool>("headerUnpacking", true);
384  desc.add<bool>("memUnpacking", true);
385  descriptions.add("ecalRawToDigi", desc);
386 }
387 
389  // channel status database
392 
393  // uncomment following line to print list of crystals with bad status
394  //edm::ESHandle<EcalElectronicsMapping> pEcalMapping;
395  //es.get<EcalMappingRcd>().get(pEcalMapping);
396  //const EcalElectronicsMapping* mapping = pEcalMapping.product();
397  //printStatusRecords(theUnpacker_, mapping);
398 }
399 
401  //double TIME_START = clock();
402  //nevts_++; //NUNO
403 
404  if (first_) {
405  watcher_.check(es);
407  myMap_->setEcalElectronicsMapping(ecalmapping.product());
408 
409  first_ = false;
410 
411  } else {
412  if (watcher_.check(es)) {
416  myMap_->setEcalElectronicsMapping(ecalmapping.product());
417  }
418  }
419 
420  // Get list of FEDS :
421  std::vector<int> FEDS_to_unpack;
422  if (REGIONAL_) {
423  edm::Handle<EcalListOfFEDS> listoffeds;
424  e.getByToken(fedsToken_, listoffeds);
425  FEDS_to_unpack = listoffeds->GetList();
426  }
427 
428  // Step A: Get Inputs
429 
431  e.getByToken(dataToken_, rawdata);
432 
433  // Step B: encapsulate vectors in actual collections and set unpacker pointers
434 
435  // create the collection of Ecal Digis
436  auto productDigisEB = std::make_unique<EBDigiCollection>();
437  productDigisEB->reserve(1700);
438  theUnpacker_->setEBDigisCollection(&productDigisEB);
439 
440  // create the collection of Ecal Digis
441  auto productDigisEE = std::make_unique<EEDigiCollection>();
442  theUnpacker_->setEEDigisCollection(&productDigisEE);
443 
444  // create the collection for headers
445  auto productDccHeaders = std::make_unique<EcalRawDataCollection>();
446  theUnpacker_->setDccHeadersCollection(&productDccHeaders);
447 
448  // create the collection for invalid gains
449  auto productInvalidGains = std::make_unique<EBDetIdCollection>();
450  theUnpacker_->setInvalidGainsCollection(&productInvalidGains);
451 
452  // create the collection for invalid gain Switch
453  auto productInvalidGainsSwitch = std::make_unique<EBDetIdCollection>();
454  theUnpacker_->setInvalidGainsSwitchCollection(&productInvalidGainsSwitch);
455 
456  // create the collection for invalid chids
457  auto productInvalidChIds = std::make_unique<EBDetIdCollection>();
458  theUnpacker_->setInvalidChIdsCollection(&productInvalidChIds);
459 
461 
462  // create the collection for invalid gains
463  auto productInvalidEEGains = std::make_unique<EEDetIdCollection>();
464  theUnpacker_->setInvalidEEGainsCollection(&productInvalidEEGains);
465 
466  // create the collection for invalid gain Switch
467  auto productInvalidEEGainsSwitch = std::make_unique<EEDetIdCollection>();
468  theUnpacker_->setInvalidEEGainsSwitchCollection(&productInvalidEEGainsSwitch);
469 
470  // create the collection for invalid chids
471  auto productInvalidEEChIds = std::make_unique<EEDetIdCollection>();
472  theUnpacker_->setInvalidEEChIdsCollection(&productInvalidEEChIds);
473 
475 
476  // create the collection for EB srflags
477  auto productEBSrFlags = std::make_unique<EBSrFlagCollection>();
478  theUnpacker_->setEBSrFlagsCollection(&productEBSrFlags);
479 
480  // create the collection for EB srflags
481  auto productEESrFlags = std::make_unique<EESrFlagCollection>();
482  theUnpacker_->setEESrFlagsCollection(&productEESrFlags);
483 
484  // create the collection for ecal trigger primitives
485  auto productEcalTps = std::make_unique<EcalTrigPrimDigiCollection>();
486  theUnpacker_->setEcalTpsCollection(&productEcalTps);
488 
489  // create the collection for ecal trigger primitives
490  auto productEcalPSs = std::make_unique<EcalPSInputDigiCollection>();
491  theUnpacker_->setEcalPSsCollection(&productEcalPSs);
493 
494  // create the collection for invalid TTIds
495  auto productInvalidTTIds = std::make_unique<EcalElectronicsIdCollection>();
496  theUnpacker_->setInvalidTTIdsCollection(&productInvalidTTIds);
497 
498  // create the collection for invalid TTIds
499  auto productInvalidZSXtalIds = std::make_unique<EcalElectronicsIdCollection>();
500  theUnpacker_->setInvalidZSXtalIdsCollection(&productInvalidZSXtalIds);
501 
502  // create the collection for invalid BlockLengths
503  auto productInvalidBlockLengths = std::make_unique<EcalElectronicsIdCollection>();
504  theUnpacker_->setInvalidBlockLengthsCollection(&productInvalidBlockLengths);
505 
506  // MEMs Collections
507  // create the collection for the Pn Diode Digis
508  auto productPnDiodeDigis = std::make_unique<EcalPnDiodeDigiCollection>();
509  theUnpacker_->setPnDiodeDigisCollection(&productPnDiodeDigis);
510 
511  // create the collection for invalid Mem Tt id
512  auto productInvalidMemTtIds = std::make_unique<EcalElectronicsIdCollection>();
513  theUnpacker_->setInvalidMemTtIdsCollection(&productInvalidMemTtIds);
514 
515  // create the collection for invalid Mem Block Size
516  auto productInvalidMemBlockSizes = std::make_unique<EcalElectronicsIdCollection>();
517  theUnpacker_->setInvalidMemBlockSizesCollection(&productInvalidMemBlockSizes);
518 
519  // create the collection for invalid Mem Block Size
520  auto productInvalidMemChIds = std::make_unique<EcalElectronicsIdCollection>();
521  theUnpacker_->setInvalidMemChIdsCollection(&productInvalidMemChIds);
522 
523  // create the collection for invalid Mem Gain Errors
524  auto productInvalidMemGains = std::make_unique<EcalElectronicsIdCollection>();
525  theUnpacker_->setInvalidMemGainsCollection(&productInvalidMemGains);
526  // double TIME_START = clock();
527 
528  // Step C: unpack all requested FEDs
529  for (std::vector<int>::const_iterator i = fedUnpackList_.begin(); i != fedUnpackList_.end(); i++) {
530  if (REGIONAL_) {
531  std::vector<int>::const_iterator fed_it = find(FEDS_to_unpack.begin(), FEDS_to_unpack.end(), *i);
532  if (fed_it == FEDS_to_unpack.end())
533  continue;
534  }
535 
536  // get fed raw data and SM id
537  const FEDRawData& fedData = rawdata->FEDData(*i);
538  const size_t length = fedData.size();
539 
540  LogDebug("EcalRawToDigi") << "raw data length: " << length;
541  //if data size is not null interpret data
542  if (length >= EMPTYEVENTSIZE) {
543  if (myMap_->setActiveDCC(*i)) {
544  const int smId = myMap_->getActiveSM();
545  LogDebug("EcalRawToDigi") << "Getting FED = " << *i << "(SM = " << smId << ")"
546  << " data size is: " << length;
547 
548  const uint64_t* data = (uint64_t*)fedData.data();
549  theUnpacker_->unpack(data, length, smId, *i);
550 
551  LogDebug("EcalRawToDigi") << " in EE :" << productDigisEE->size() << " in EB :" << productDigisEB->size();
552  }
553  }
554 
555  } // loop on FEDs
556 
557  //if(nevts_>1){ //NUNO
558  // double TIME_END = clock(); //NUNO
559  // RUNNING_TIME_ += TIME_END-TIME_START; //NUNO
560  // }
561 
562  // Add collections to the event
563 
564  if (put_) {
565  if (headerUnpacking_) {
566  e.put(std::move(productDccHeaders));
567  }
568 
569  if (feUnpacking_) {
570  productDigisEB->sort();
571  e.put(std::move(productDigisEB), "ebDigis");
572  productDigisEE->sort();
573  e.put(std::move(productDigisEE), "eeDigis");
574  e.put(std::move(productInvalidGains), "EcalIntegrityGainErrors");
575  e.put(std::move(productInvalidGainsSwitch), "EcalIntegrityGainSwitchErrors");
576  e.put(std::move(productInvalidChIds), "EcalIntegrityChIdErrors");
577  // EE (leaving for now the same names as in EB)
578  e.put(std::move(productInvalidEEGains), "EcalIntegrityGainErrors");
579  e.put(std::move(productInvalidEEGainsSwitch), "EcalIntegrityGainSwitchErrors");
580  e.put(std::move(productInvalidEEChIds), "EcalIntegrityChIdErrors");
581  // EE
582  e.put(std::move(productInvalidTTIds), "EcalIntegrityTTIdErrors");
583  e.put(std::move(productInvalidZSXtalIds), "EcalIntegrityZSXtalIdErrors");
584  e.put(std::move(productInvalidBlockLengths), "EcalIntegrityBlockSizeErrors");
585  e.put(std::move(productPnDiodeDigis));
586  }
587  if (memUnpacking_) {
588  e.put(std::move(productInvalidMemTtIds), "EcalIntegrityMemTtIdErrors");
589  e.put(std::move(productInvalidMemBlockSizes), "EcalIntegrityMemBlockSizeErrors");
590  e.put(std::move(productInvalidMemChIds), "EcalIntegrityMemChIdErrors");
591  e.put(std::move(productInvalidMemGains), "EcalIntegrityMemGainErrors");
592  }
593  if (srpUnpacking_) {
594  e.put(std::move(productEBSrFlags));
595  e.put(std::move(productEESrFlags));
596  }
597  if (tccUnpacking_) {
598  e.put(std::move(productEcalTps), "EcalTriggerPrimitives");
599  e.put(std::move(productEcalPSs), "EcalPseudoStripInputs");
600  }
601  }
602 
603  //if(nevts_>1){ //NUNO
604  // double TIME_END = clock(); //NUNO
605  // RUNNING_TIME_ += TIME_END-TIME_START; //NUNO
606  //}
607 }
608 
610  //cout << "EcalDCCUnpackingModule " << "N events " << (nevts_-1)<<endl;
611  //cout << "EcalDCCUnpackingModule " << " --- SETUP time " << endl;
612  //cout << "EcalDCCUnpackingModule " << "Time (sys) " << SETUP_TIME_ << endl;
613  //cout << "EcalDCCUnpackingModule " << "Time in sec. " << SETUP_TIME_/ CLOCKS_PER_SEC << endl;
614  //cout << "EcalDCCUnpackingModule " << " --- Per event " << endl;
615 
616  //RUNNING_TIME_ = RUNNING_TIME_ / (nevts_-1);
617 
618  //cout << "EcalDCCUnpackingModule "<< "Time (sys) " << RUNNING_TIME_ << endl;
619  //cout << "EcalDCCUnpackingModule "<< "Time in sec. " << RUNNING_TIME_ / CLOCKS_PER_SEC << endl;
620 
621  if (myMap_)
622  delete myMap_;
623  if (theUnpacker_)
624  delete theUnpacker_;
625 }
626 
void setChannelStatusDB(const EcalChannelStatusMap *chdb)
void setInvalidEEChIdsCollection(std::unique_ptr< EEDetIdCollection > *x)
edm::ESWatcher< EcalMappingRcd > watcher_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void setInvalidGainsCollection(std::unique_ptr< EBDetIdCollection > *x)
unsigned int numbXtalTSamples_
double RUNNING_TIME_
~EcalRawToDigi() override
bool forceToKeepFRdata_
void unpack(const uint64_t *buffer, size_t bufferSize, unsigned int smId, unsigned int fedId)
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
void setPnDiodeDigisCollection(std::unique_ptr< EcalPnDiodeDigiCollection > *x)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::vector< int > orderedFedUnpackList_
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
void setInvalidTTIdsCollection(std::unique_ptr< EcalElectronicsIdCollection > *x)
void setInvalidBlockLengthsCollection(std::unique_ptr< EcalElectronicsIdCollection > *x)
void setInvalidGainsSwitchCollection(std::unique_ptr< EBDetIdCollection > *x)
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
void setInvalidZSXtalIdsCollection(std::unique_ptr< EcalElectronicsIdCollection > *x)
Log< level::Error, false > LogError
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
void setEcalElectronicsMapping(const EcalElectronicsMapping *)
std::vector< int > fedUnpackList_
DCCDataUnpacker * theUnpacker_
T getUntrackedParameter(std::string const &, T const &) const
std::vector< int > GetList() const
unsigned int nevts_
const EcalElectronicsMapper * electronicsMapper() const
void setInvalidMemChIdsCollection(std::unique_ptr< EcalElectronicsIdCollection > *x)
T const * product() const
Definition: ESHandle.h:86
void setEBSrFlagsCollection(std::unique_ptr< EBSrFlagCollection > *x)
void setInvalidMemBlockSizesCollection(std::unique_ptr< EcalElectronicsIdCollection > *x)
void setEcalTpsCollection(std::unique_ptr< EcalTrigPrimDigiCollection > *x)
uint16_t getChannelValue(const DetId &id) const
static std::atomic< bool > silentMode_
bool setActiveDCC(unsigned int dccId)
void setInvalidMemTtIdsCollection(std::unique_ptr< EcalElectronicsIdCollection > *x)
void setInvalidEEGainsSwitchCollection(std::unique_ptr< EEDetIdCollection > *x)
int towerId() const
get the tower id
void setEEDigisCollection(std::unique_ptr< EEDigiCollection > *x)
unsigned int numbTriggerTSamples_
bool makeMapFromVectors(std::vector< int > &, std::vector< int > &)
std::vector< int > orderedDCCIdList_
void produce(edm::Event &e, const edm::EventSetup &c) override
EcalRawToDigi(const edm::ParameterSet &ps)
edm::EDGetTokenT< EcalListOfFEDS > fedsToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
void setEcalPSsCollection(std::unique_ptr< EcalPSInputDigiCollection > *x)
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void printStatusRecords(const DCCDataUnpacker *unpacker, const EcalElectronicsMapping *mapping)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Log< level::Info, false > LogInfo
void setEESrFlagsCollection(std::unique_ptr< EESrFlagCollection > *x)
void setInvalidEEGainsCollection(std::unique_ptr< EEDetIdCollection > *x)
unsigned long long uint64_t
Definition: Time.h:13
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > ecalMappingToken_
int stripId() const
get the tower id
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
void setDccHeadersCollection(std::unique_ptr< EcalRawDataCollection > *x)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
int xtalId() const
get the channel id
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
unsigned int getDCCId(unsigned int aSMId) const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
void setInvalidChIdsCollection(std::unique_ptr< EBDetIdCollection > *x)
edm::ESGetToken< EcalChannelStatusMap, EcalChannelStatusRcd > chStatusToken_
void setInvalidMemGainsCollection(std::unique_ptr< EcalElectronicsIdCollection > *x)
Log< level::Warning, false > LogWarning
EcalElectronicsMapper * myMap_
void beginRun(const edm::Run &run, const edm::EventSetup &es) override
void setEBDigisCollection(std::unique_ptr< EBDigiCollection > *x)
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45
#define LogDebug(id)