22 fedUnpackList_(conf.getParameter<
std::vector<
int> >(
"FEDs")),
25 orderedFedUnpackList_(conf.getParameter<
std::vector<
int> >(
"orderedFedList")),
28 orderedDCCIdList_(conf.getParameter<
std::vector<
int> >(
"orderedDCCIdList")),
31 numbXtalTSamples_(conf.getParameter<
int>(
"numbXtalTSamples")),
34 numbTriggerTSamples_(conf.getParameter<
int>(
"numbTriggerTSamples")),
37 headerUnpacking_(conf.getParameter<
bool>(
"headerUnpacking")),
40 srpUnpacking_(conf.getParameter<
bool>(
"srpUnpacking")),
43 tccUnpacking_(conf.getParameter<
bool>(
"tccUnpacking")),
46 feUnpacking_(conf.getParameter<
bool>(
"feUnpacking")),
49 memUnpacking_(conf.getParameter<
bool>(
"memUnpacking")),
52 syncCheck_(conf.getParameter<
bool>(
"syncCheck")),
55 feIdCheck_(conf.getParameter<
bool>(
"feIdCheck")),
58 forceToKeepFRdata_(conf.getParameter<
bool>(
"forceToKeepFRData")),
60 put_(conf.getParameter<
bool>(
"eventPut")),
62 REGIONAL_(conf.getParameter<
bool>(
"DoRegional")),
72 if (numbXtalTSamples_ < 6 || numbXtalTSamples_ > 64 || (
numbXtalTSamples_ - 2) % 4) {
75 <<
"\n Valid Number of xtal time samples are : 6,10,14,18,...,62";
83 <<
"\n Valid number of trigger time samples are : 1, 4 or 8";
99 std::ostringstream loggerOutput_;
103 edm::LogInfo(
"EcalRawToDigi") <<
"EcalRawToDigi will unpack FEDs ( " << loggerOutput_.str() <<
")";
104 LogDebug(
"EcalRawToDigi") <<
"EcalRawToDigi will unpack FEDs ( " << loggerOutput_.str() <<
")";
107 edm::LogInfo(
"EcalRawToDigi") <<
"\n ECAL RawToDigi configuration:"
108 <<
"\n Header unpacking is " <<
headerUnpacking_ <<
"\n SRP Bl. unpacking is "
110 <<
"\n FE Bl. unpacking is " <<
feUnpacking_ <<
"\n MEM Bl. unpacking is "
118 produces<EBDigiCollection>(
"ebDigis");
119 produces<EEDigiCollection>(
"eeDigis");
120 produces<EBSrFlagCollection>();
121 produces<EESrFlagCollection>();
122 produces<EcalRawDataCollection>();
123 produces<EcalPnDiodeDigiCollection>();
124 produces<EcalTrigPrimDigiCollection>(
"EcalTriggerPrimitives");
125 produces<EcalPSInputDigiCollection>(
"EcalPseudoStripInputs");
128 produces<EBDetIdCollection>(
"EcalIntegrityGainErrors");
129 produces<EBDetIdCollection>(
"EcalIntegrityGainSwitchErrors");
130 produces<EBDetIdCollection>(
"EcalIntegrityChIdErrors");
133 produces<EEDetIdCollection>(
"EcalIntegrityGainErrors");
134 produces<EEDetIdCollection>(
"EcalIntegrityGainSwitchErrors");
135 produces<EEDetIdCollection>(
"EcalIntegrityChIdErrors");
138 produces<EcalElectronicsIdCollection>(
"EcalIntegrityTTIdErrors");
139 produces<EcalElectronicsIdCollection>(
"EcalIntegrityZSXtalIdErrors");
140 produces<EcalElectronicsIdCollection>(
"EcalIntegrityBlockSizeErrors");
143 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemTtIdErrors");
144 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemBlockSizeErrors");
145 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemChIdErrors");
146 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemGainErrors");
148 dataToken_ = consumes<FEDRawDataCollection>(dataLabel);
150 fedsToken_ = consumes<EcalListOfFEDS>(fedsLabel);
165 edm::LogWarning(
"IncorrectConfiguration") <<
"Arrays orderedFedList and orderedDCCIdList are emply. "
166 "Hard coded correspondence for DCCId:FedId will be used.";
200 std::cout <<
" id " <<
id.rawId() <<
" -> (" <<
id.ix() <<
", " <<
id.iy() <<
", " <<
id.zside() <<
") "
201 <<
"(" << ei.
dccId() <<
" : " << fed_id <<
", " << ei.
towerId() <<
", " << ei.
stripId() <<
", "
203 <<
"status = " << code << std::endl;
222 std::cout <<
" id " <<
id.rawId() <<
" -> (" <<
id.ieta() <<
", " <<
id.iphi() <<
", " <<
id.zside() <<
") "
223 <<
"(" << ei.
dccId() <<
" : " << fed_id <<
", " << ei.
towerId() <<
", " << ei.
stripId() <<
", "
225 <<
"status = " << code << std::endl;
234 desc.
add<
bool>(
"tccUnpacking",
true);
236 desc.
add<
bool>(
"srpUnpacking",
true);
237 desc.
add<
bool>(
"syncCheck",
true);
238 desc.
add<
bool>(
"feIdCheck",
true);
242 std::vector<int> temp1;
243 unsigned int nvec = 54;
245 for (
unsigned int i = 0;
i < nvec;
i++)
246 temp1.push_back(601 +
i);
247 desc.
add<std::vector<int> >(
"orderedFedList", temp1);
249 desc.
add<
bool>(
"eventPut",
true);
250 desc.
add<
int>(
"numbTriggerTSamples", 1);
251 desc.
add<
int>(
"numbXtalTSamples", 10);
253 std::vector<int> temp1;
254 unsigned int nvec = 54;
256 for (
unsigned int i = 0;
i < nvec;
i++)
257 temp1.push_back(1 +
i);
258 desc.
add<std::vector<int> >(
"orderedDCCIdList", temp1);
261 std::vector<int> temp1;
262 unsigned int nvec = 54;
264 for (
unsigned int i = 0;
i < nvec;
i++)
265 temp1.push_back(601 +
i);
266 desc.
add<std::vector<int> >(
"FEDs", temp1);
268 desc.
add<
bool>(
"DoRegional",
false);
269 desc.
add<
bool>(
"feUnpacking",
true);
270 desc.
add<
bool>(
"forceToKeepFRData",
false);
271 desc.
add<
bool>(
"headerUnpacking",
true);
272 desc.
add<
bool>(
"memUnpacking",
true);
273 descriptions.
add(
"ecalRawToDigi", desc);
312 std::vector<int> FEDS_to_unpack;
316 FEDS_to_unpack = listoffeds->
GetList();
327 auto productDigisEB = std::make_unique<EBDigiCollection>();
328 productDigisEB->reserve(1700);
332 auto productDigisEE = std::make_unique<EEDigiCollection>();
336 auto productDccHeaders = std::make_unique<EcalRawDataCollection>();
340 auto productInvalidGains = std::make_unique<EBDetIdCollection>();
344 auto productInvalidGainsSwitch = std::make_unique<EBDetIdCollection>();
348 auto productInvalidChIds = std::make_unique<EBDetIdCollection>();
354 auto productInvalidEEGains = std::make_unique<EEDetIdCollection>();
358 auto productInvalidEEGainsSwitch = std::make_unique<EEDetIdCollection>();
362 auto productInvalidEEChIds = std::make_unique<EEDetIdCollection>();
368 auto productEBSrFlags = std::make_unique<EBSrFlagCollection>();
372 auto productEESrFlags = std::make_unique<EESrFlagCollection>();
376 auto productEcalTps = std::make_unique<EcalTrigPrimDigiCollection>();
381 auto productEcalPSs = std::make_unique<EcalPSInputDigiCollection>();
386 auto productInvalidTTIds = std::make_unique<EcalElectronicsIdCollection>();
390 auto productInvalidZSXtalIds = std::make_unique<EcalElectronicsIdCollection>();
394 auto productInvalidBlockLengths = std::make_unique<EcalElectronicsIdCollection>();
399 auto productPnDiodeDigis = std::make_unique<EcalPnDiodeDigiCollection>();
403 auto productInvalidMemTtIds = std::make_unique<EcalElectronicsIdCollection>();
407 auto productInvalidMemBlockSizes = std::make_unique<EcalElectronicsIdCollection>();
411 auto productInvalidMemChIds = std::make_unique<EcalElectronicsIdCollection>();
415 auto productInvalidMemGains = std::make_unique<EcalElectronicsIdCollection>();
422 std::vector<int>::const_iterator fed_it =
find(FEDS_to_unpack.begin(), FEDS_to_unpack.end(), *
i);
423 if (fed_it == FEDS_to_unpack.end())
429 const size_t length = fedData.
size();
431 LogDebug(
"EcalRawToDigi") <<
"raw data length: " << length;
436 LogDebug(
"EcalRawToDigi") <<
"Getting FED = " << *
i <<
"(SM = " << smId <<
")"
437 <<
" data size is: " << length;
442 LogDebug(
"EcalRawToDigi") <<
" in EE :" << productDigisEE->size() <<
" in EB :" << productDigisEB->size();
461 productDigisEB->sort();
463 productDigisEE->sort();
465 e.put(
std::move(productInvalidGains),
"EcalIntegrityGainErrors");
466 e.put(
std::move(productInvalidGainsSwitch),
"EcalIntegrityGainSwitchErrors");
467 e.put(
std::move(productInvalidChIds),
"EcalIntegrityChIdErrors");
469 e.put(
std::move(productInvalidEEGains),
"EcalIntegrityGainErrors");
470 e.put(
std::move(productInvalidEEGainsSwitch),
"EcalIntegrityGainSwitchErrors");
471 e.put(
std::move(productInvalidEEChIds),
"EcalIntegrityChIdErrors");
473 e.put(
std::move(productInvalidTTIds),
"EcalIntegrityTTIdErrors");
474 e.put(
std::move(productInvalidZSXtalIds),
"EcalIntegrityZSXtalIdErrors");
475 e.put(
std::move(productInvalidBlockLengths),
"EcalIntegrityBlockSizeErrors");
479 e.put(
std::move(productInvalidMemTtIds),
"EcalIntegrityMemTtIdErrors");
480 e.put(
std::move(productInvalidMemBlockSizes),
"EcalIntegrityMemBlockSizeErrors");
481 e.put(
std::move(productInvalidMemChIds),
"EcalIntegrityMemChIdErrors");
482 e.put(
std::move(productInvalidMemGains),
"EcalIntegrityMemGainErrors");
489 e.put(
std::move(productEcalTps),
"EcalTriggerPrimitives");
490 e.put(
std::move(productEcalPSs),
"EcalPseudoStripInputs");