18 fedUnpackList_(conf.getParameter<
std::
vector<
int> >(
"FEDs")),
21 orderedFedUnpackList_(conf.getParameter<
std::
vector<
int> >(
"orderedFedList")),
24 orderedDCCIdList_(conf.getParameter<
std::
vector<
int> >(
"orderedDCCIdList")),
27 numbXtalTSamples_(conf.getParameter<
int>(
"numbXtalTSamples")),
30 numbTriggerTSamples_(conf.getParameter<
int>(
"numbTriggerTSamples")),
33 headerUnpacking_(conf.getParameter<
bool>(
"headerUnpacking")),
36 srpUnpacking_(conf.getParameter<
bool>(
"srpUnpacking")),
39 tccUnpacking_(conf.getParameter<
bool>(
"tccUnpacking")),
42 feUnpacking_(conf.getParameter<
bool>(
"feUnpacking")),
45 memUnpacking_(conf.getParameter<
bool>(
"memUnpacking")),
48 syncCheck_(conf.getParameter<
bool>(
"syncCheck")),
51 feIdCheck_(conf.getParameter<
bool>(
"feIdCheck")),
54 forceToKeepFRdata_(conf.getParameter<
bool>(
"forceToKeepFRData")),
56 put_(conf.getParameter<
bool>(
"eventPut")),
58 REGIONAL_(conf.getParameter<
bool>(
"DoRegional")),
68 if (numbXtalTSamples_ < 6 || numbXtalTSamples_ > 64 || (
numbXtalTSamples_ - 2) % 4) {
71 <<
"\n Valid Number of xtal time samples are : 6,10,14,18,...,62";
79 <<
"\n Valid number of trigger time samples are : 1, 4 or 8";
95 std::ostringstream loggerOutput_;
99 edm::LogInfo(
"EcalRawToDigi") <<
"EcalRawToDigi will unpack FEDs ( " << loggerOutput_.str() <<
")";
100 LogDebug(
"EcalRawToDigi") <<
"EcalRawToDigi will unpack FEDs ( " << loggerOutput_.str() <<
")";
103 edm::LogInfo(
"EcalRawToDigi") <<
"\n ECAL RawToDigi configuration:"
104 <<
"\n Header unpacking is " <<
headerUnpacking_ <<
"\n SRP Bl. unpacking is "
106 <<
"\n FE Bl. unpacking is " <<
feUnpacking_ <<
"\n MEM Bl. unpacking is "
114 produces<EBDigiCollection>(
"ebDigis");
115 produces<EEDigiCollection>(
"eeDigis");
116 produces<EBSrFlagCollection>();
117 produces<EESrFlagCollection>();
118 produces<EcalRawDataCollection>();
119 produces<EcalPnDiodeDigiCollection>();
120 produces<EcalTrigPrimDigiCollection>(
"EcalTriggerPrimitives");
121 produces<EcalPSInputDigiCollection>(
"EcalPseudoStripInputs");
124 produces<EBDetIdCollection>(
"EcalIntegrityGainErrors");
125 produces<EBDetIdCollection>(
"EcalIntegrityGainSwitchErrors");
126 produces<EBDetIdCollection>(
"EcalIntegrityChIdErrors");
129 produces<EEDetIdCollection>(
"EcalIntegrityGainErrors");
130 produces<EEDetIdCollection>(
"EcalIntegrityGainSwitchErrors");
131 produces<EEDetIdCollection>(
"EcalIntegrityChIdErrors");
134 produces<EcalElectronicsIdCollection>(
"EcalIntegrityTTIdErrors");
135 produces<EcalElectronicsIdCollection>(
"EcalIntegrityZSXtalIdErrors");
136 produces<EcalElectronicsIdCollection>(
"EcalIntegrityBlockSizeErrors");
139 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemTtIdErrors");
140 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemBlockSizeErrors");
141 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemChIdErrors");
142 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemGainErrors");
144 dataToken_ = consumes<FEDRawDataCollection>(dataLabel);
146 fedsToken_ = consumes<EcalListOfFEDS>(fedsLabel);
148 chStatusToken_ = esConsumes<EcalChannelStatusMap, EcalChannelStatusRcd, edm::Transition::BeginRun>();
163 edm::LogWarning(
"IncorrectConfiguration") <<
"Arrays orderedFedList and orderedDCCIdList are emply. "
164 "Hard coded correspondence for DCCId:FedId will be used.";
198 std::cout <<
" id " <<
id.rawId() <<
" -> (" <<
id.ix() <<
", " <<
id.iy() <<
", " <<
id.zside() <<
") "
199 <<
"(" << ei.
dccId() <<
" : " << fed_id <<
", " << ei.
towerId() <<
", " << ei.
stripId() <<
", "
201 <<
"status = " << code << std::endl;
220 std::cout <<
" id " <<
id.rawId() <<
" -> (" <<
id.ieta() <<
", " <<
id.iphi() <<
", " <<
id.zside() <<
") "
221 <<
"(" << ei.
dccId() <<
" : " << fed_id <<
", " << ei.
towerId() <<
", " << ei.
stripId() <<
", "
223 <<
"status = " << code << std::endl;
232 desc.add<
bool>(
"tccUnpacking",
true);
234 desc.add<
bool>(
"srpUnpacking",
true);
235 desc.add<
bool>(
"syncCheck",
true);
236 desc.add<
bool>(
"feIdCheck",
true);
237 desc.addUntracked<
bool>(
"silentMode",
true);
240 std::vector<int> temp1;
241 unsigned int nvec = 54;
243 for (
unsigned int i = 0;
i < nvec;
i++)
244 temp1.push_back(601 +
i);
245 desc.add<std::vector<int> >(
"orderedFedList", temp1);
247 desc.add<
bool>(
"eventPut",
true);
248 desc.add<
int>(
"numbTriggerTSamples", 1);
249 desc.add<
int>(
"numbXtalTSamples", 10);
251 std::vector<int> temp1;
252 unsigned int nvec = 54;
254 for (
unsigned int i = 0;
i < nvec;
i++)
255 temp1.push_back(1 +
i);
256 desc.add<std::vector<int> >(
"orderedDCCIdList", temp1);
259 std::vector<int> temp1;
260 unsigned int nvec = 54;
262 for (
unsigned int i = 0;
i < nvec;
i++)
263 temp1.push_back(601 +
i);
264 desc.add<std::vector<int> >(
"FEDs", temp1);
266 desc.add<
bool>(
"DoRegional",
false);
267 desc.add<
bool>(
"feUnpacking",
true);
268 desc.add<
bool>(
"forceToKeepFRData",
false);
269 desc.add<
bool>(
"headerUnpacking",
true);
270 desc.add<
bool>(
"memUnpacking",
true);
271 descriptions.
add(
"ecalRawToDigi",
desc);
307 std::vector<int> FEDS_to_unpack;
311 FEDS_to_unpack = listoffeds->
GetList();
322 auto productDigisEB = std::make_unique<EBDigiCollection>();
323 productDigisEB->reserve(1700);
327 auto productDigisEE = std::make_unique<EEDigiCollection>();
331 auto productDccHeaders = std::make_unique<EcalRawDataCollection>();
335 auto productInvalidGains = std::make_unique<EBDetIdCollection>();
339 auto productInvalidGainsSwitch = std::make_unique<EBDetIdCollection>();
343 auto productInvalidChIds = std::make_unique<EBDetIdCollection>();
349 auto productInvalidEEGains = std::make_unique<EEDetIdCollection>();
353 auto productInvalidEEGainsSwitch = std::make_unique<EEDetIdCollection>();
357 auto productInvalidEEChIds = std::make_unique<EEDetIdCollection>();
363 auto productEBSrFlags = std::make_unique<EBSrFlagCollection>();
367 auto productEESrFlags = std::make_unique<EESrFlagCollection>();
371 auto productEcalTps = std::make_unique<EcalTrigPrimDigiCollection>();
376 auto productEcalPSs = std::make_unique<EcalPSInputDigiCollection>();
381 auto productInvalidTTIds = std::make_unique<EcalElectronicsIdCollection>();
385 auto productInvalidZSXtalIds = std::make_unique<EcalElectronicsIdCollection>();
389 auto productInvalidBlockLengths = std::make_unique<EcalElectronicsIdCollection>();
394 auto productPnDiodeDigis = std::make_unique<EcalPnDiodeDigiCollection>();
398 auto productInvalidMemTtIds = std::make_unique<EcalElectronicsIdCollection>();
402 auto productInvalidMemBlockSizes = std::make_unique<EcalElectronicsIdCollection>();
406 auto productInvalidMemChIds = std::make_unique<EcalElectronicsIdCollection>();
410 auto productInvalidMemGains = std::make_unique<EcalElectronicsIdCollection>();
417 std::vector<int>::const_iterator fed_it =
find(FEDS_to_unpack.begin(), FEDS_to_unpack.end(), *
i);
418 if (fed_it == FEDS_to_unpack.end())
424 const size_t length = fedData.
size();
426 LogDebug(
"EcalRawToDigi") <<
"raw data length: " << length;
431 LogDebug(
"EcalRawToDigi") <<
"Getting FED = " << *
i <<
"(SM = " << smId <<
")"
432 <<
" data size is: " << length;
437 LogDebug(
"EcalRawToDigi") <<
" in EE :" << productDigisEE->size() <<
" in EB :" << productDigisEB->size();
456 productDigisEB->sort();
458 productDigisEE->sort();
460 e.put(
std::move(productInvalidGains),
"EcalIntegrityGainErrors");
461 e.put(
std::move(productInvalidGainsSwitch),
"EcalIntegrityGainSwitchErrors");
462 e.put(
std::move(productInvalidChIds),
"EcalIntegrityChIdErrors");
464 e.put(
std::move(productInvalidEEGains),
"EcalIntegrityGainErrors");
465 e.put(
std::move(productInvalidEEGainsSwitch),
"EcalIntegrityGainSwitchErrors");
466 e.put(
std::move(productInvalidEEChIds),
"EcalIntegrityChIdErrors");
468 e.put(
std::move(productInvalidTTIds),
"EcalIntegrityTTIdErrors");
469 e.put(
std::move(productInvalidZSXtalIds),
"EcalIntegrityZSXtalIdErrors");
470 e.put(
std::move(productInvalidBlockLengths),
"EcalIntegrityBlockSizeErrors");
474 e.put(
std::move(productInvalidMemTtIds),
"EcalIntegrityMemTtIdErrors");
475 e.put(
std::move(productInvalidMemBlockSizes),
"EcalIntegrityMemBlockSizeErrors");
476 e.put(
std::move(productInvalidMemChIds),
"EcalIntegrityMemChIdErrors");
477 e.put(
std::move(productInvalidMemGains),
"EcalIntegrityMemGainErrors");
484 e.put(
std::move(productEcalTps),
"EcalTriggerPrimitives");
485 e.put(
std::move(productEcalPSs),
"EcalPseudoStripInputs");