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 "
115 produces<EcalRawDataCollection>();
119 produces<EBDigiCollection>(
"ebDigis");
120 produces<EEDigiCollection>(
"eeDigis");
123 produces<EBDetIdCollection>(
"EcalIntegrityGainErrors");
124 produces<EBDetIdCollection>(
"EcalIntegrityGainSwitchErrors");
125 produces<EBDetIdCollection>(
"EcalIntegrityChIdErrors");
128 produces<EEDetIdCollection>(
"EcalIntegrityGainErrors");
129 produces<EEDetIdCollection>(
"EcalIntegrityGainSwitchErrors");
130 produces<EEDetIdCollection>(
"EcalIntegrityChIdErrors");
133 produces<EcalElectronicsIdCollection>(
"EcalIntegrityTTIdErrors");
134 produces<EcalElectronicsIdCollection>(
"EcalIntegrityZSXtalIdErrors");
135 produces<EcalElectronicsIdCollection>(
"EcalIntegrityBlockSizeErrors");
138 produces<EcalPnDiodeDigiCollection>();
142 produces<EBSrFlagCollection>();
143 produces<EESrFlagCollection>();
147 produces<EcalTrigPrimDigiCollection>(
"EcalTriggerPrimitives");
148 produces<EcalPSInputDigiCollection>(
"EcalPseudoStripInputs");
153 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemTtIdErrors");
154 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemBlockSizeErrors");
155 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemChIdErrors");
156 produces<EcalElectronicsIdCollection>(
"EcalIntegrityMemGainErrors");
159 dataToken_ = consumes<FEDRawDataCollection>(dataLabel);
161 fedsToken_ = consumes<EcalListOfFEDS>(fedsLabel);
163 chStatusToken_ = esConsumes<EcalChannelStatusMap, EcalChannelStatusRcd, edm::Transition::BeginRun>();
178 edm::LogWarning(
"IncorrectConfiguration") <<
"Arrays orderedFedList and orderedDCCIdList are emply. "
179 "Hard coded correspondence for DCCId:FedId will be used.";
213 std::cout <<
" id " <<
id.rawId() <<
" -> (" <<
id.ix() <<
", " <<
id.iy() <<
", " <<
id.zside() <<
") "
214 <<
"(" << ei.
dccId() <<
" : " << fed_id <<
", " << ei.
towerId() <<
", " << ei.
stripId() <<
", "
216 <<
"status = " << code << std::endl;
235 std::cout <<
" id " <<
id.rawId() <<
" -> (" <<
id.ieta() <<
", " <<
id.iphi() <<
", " <<
id.zside() <<
") "
236 <<
"(" << ei.
dccId() <<
" : " << fed_id <<
", " << ei.
towerId() <<
", " << ei.
stripId() <<
", "
238 <<
"status = " << code << std::endl;
247 desc.add<
bool>(
"tccUnpacking",
true);
249 desc.add<
bool>(
"srpUnpacking",
true);
250 desc.add<
bool>(
"syncCheck",
true);
251 desc.add<
bool>(
"feIdCheck",
true);
252 desc.addUntracked<
bool>(
"silentMode",
true);
255 std::vector<int> temp1;
256 unsigned int nvec = 54;
258 for (
unsigned int i = 0;
i < nvec;
i++)
259 temp1.push_back(601 +
i);
260 desc.add<std::vector<int> >(
"orderedFedList", temp1);
262 desc.add<
bool>(
"eventPut",
true);
263 desc.add<
int>(
"numbTriggerTSamples", 1);
264 desc.add<
int>(
"numbXtalTSamples", 10);
266 std::vector<int> temp1;
267 unsigned int nvec = 54;
269 for (
unsigned int i = 0;
i < nvec;
i++)
270 temp1.push_back(1 +
i);
271 desc.add<std::vector<int> >(
"orderedDCCIdList", temp1);
274 std::vector<int> temp1;
275 unsigned int nvec = 54;
277 for (
unsigned int i = 0;
i < nvec;
i++)
278 temp1.push_back(601 +
i);
279 desc.add<std::vector<int> >(
"FEDs", temp1);
281 desc.add<
bool>(
"DoRegional",
false);
282 desc.add<
bool>(
"feUnpacking",
true);
283 desc.add<
bool>(
"forceToKeepFRData",
false);
284 desc.add<
bool>(
"headerUnpacking",
true);
285 desc.add<
bool>(
"memUnpacking",
true);
286 descriptions.
add(
"ecalRawToDigi",
desc);
322 std::vector<int> FEDS_to_unpack;
326 FEDS_to_unpack = listoffeds->
GetList();
337 auto productDigisEB = std::make_unique<EBDigiCollection>();
338 productDigisEB->reserve(1700);
342 auto productDigisEE = std::make_unique<EEDigiCollection>();
346 auto productDccHeaders = std::make_unique<EcalRawDataCollection>();
350 auto productInvalidGains = std::make_unique<EBDetIdCollection>();
354 auto productInvalidGainsSwitch = std::make_unique<EBDetIdCollection>();
358 auto productInvalidChIds = std::make_unique<EBDetIdCollection>();
364 auto productInvalidEEGains = std::make_unique<EEDetIdCollection>();
368 auto productInvalidEEGainsSwitch = std::make_unique<EEDetIdCollection>();
372 auto productInvalidEEChIds = std::make_unique<EEDetIdCollection>();
378 auto productEBSrFlags = std::make_unique<EBSrFlagCollection>();
382 auto productEESrFlags = std::make_unique<EESrFlagCollection>();
386 auto productEcalTps = std::make_unique<EcalTrigPrimDigiCollection>();
391 auto productEcalPSs = std::make_unique<EcalPSInputDigiCollection>();
396 auto productInvalidTTIds = std::make_unique<EcalElectronicsIdCollection>();
400 auto productInvalidZSXtalIds = std::make_unique<EcalElectronicsIdCollection>();
404 auto productInvalidBlockLengths = std::make_unique<EcalElectronicsIdCollection>();
409 auto productPnDiodeDigis = std::make_unique<EcalPnDiodeDigiCollection>();
413 auto productInvalidMemTtIds = std::make_unique<EcalElectronicsIdCollection>();
417 auto productInvalidMemBlockSizes = std::make_unique<EcalElectronicsIdCollection>();
421 auto productInvalidMemChIds = std::make_unique<EcalElectronicsIdCollection>();
425 auto productInvalidMemGains = std::make_unique<EcalElectronicsIdCollection>();
432 std::vector<int>::const_iterator fed_it =
find(FEDS_to_unpack.begin(), FEDS_to_unpack.end(), *
i);
433 if (fed_it == FEDS_to_unpack.end())
439 const size_t length = fedData.
size();
441 LogDebug(
"EcalRawToDigi") <<
"raw data length: " << length;
446 LogDebug(
"EcalRawToDigi") <<
"Getting FED = " << *
i <<
"(SM = " << smId <<
")"
447 <<
" data size is: " << length;
452 LogDebug(
"EcalRawToDigi") <<
" in EE :" << productDigisEE->size() <<
" in EB :" << productDigisEB->size();
471 productDigisEB->sort();
473 productDigisEE->sort();
475 e.put(
std::move(productInvalidGains),
"EcalIntegrityGainErrors");
476 e.put(
std::move(productInvalidGainsSwitch),
"EcalIntegrityGainSwitchErrors");
477 e.put(
std::move(productInvalidChIds),
"EcalIntegrityChIdErrors");
479 e.put(
std::move(productInvalidEEGains),
"EcalIntegrityGainErrors");
480 e.put(
std::move(productInvalidEEGainsSwitch),
"EcalIntegrityGainSwitchErrors");
481 e.put(
std::move(productInvalidEEChIds),
"EcalIntegrityChIdErrors");
483 e.put(
std::move(productInvalidTTIds),
"EcalIntegrityTTIdErrors");
484 e.put(
std::move(productInvalidZSXtalIds),
"EcalIntegrityZSXtalIdErrors");
485 e.put(
std::move(productInvalidBlockLengths),
"EcalIntegrityBlockSizeErrors");
489 e.put(
std::move(productInvalidMemTtIds),
"EcalIntegrityMemTtIdErrors");
490 e.put(
std::move(productInvalidMemBlockSizes),
"EcalIntegrityMemBlockSizeErrors");
491 e.put(
std::move(productInvalidMemChIds),
"EcalIntegrityMemChIdErrors");
492 e.put(
std::move(productInvalidMemGains),
"EcalIntegrityMemGainErrors");
499 e.put(
std::move(productEcalTps),
"EcalTriggerPrimitives");
500 e.put(
std::move(productEcalPSs),
"EcalPseudoStripInputs");