9 #include "CoralBase/AttributeListSpecification.h"
21 "/TRIGGER/L1Calo/V2/Calibration/Physics/PprChanCalib"},
23 "/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults"}}) {
24 this->addSpecification(eBcidDecision1, std::string(
"CR12_BcidDecision1"),
25 std::string(
"Int32"));
26 this->addSpecification(eSatOverride1, std::string(
"CR12_SatOverride1"),
27 std::string(
"Int32"));
28 this->addSpecification(eBcidDecision2, std::string(
"CR13_BcidDecision2"),
29 std::string(
"Int32"));
30 this->addSpecification(eSatOverride2, std::string(
"CR13_SatOverride2"),
31 std::string(
"Int32"));
32 this->addSpecification(eBcidDecision3, std::string(
"CR14_BcidDecision3"),
33 std::string(
"Int32"));
34 this->addSpecification(eSatOverride3, std::string(
"CR14_SatOverride3"),
35 std::string(
"Int32"));
36 this->addSpecification(ePeakFinderCond, std::string(
"CR15_PeakFinderCond"),
37 std::string(
"Int32"));
38 this->addSpecification(eDecisionSource, std::string(
"CR15_DecisionSource"),
39 std::string(
"Int32"));
46 this->addSpecification(eExtBcidThreshold, std::string(
"ExtBcidThreshold"),
47 std::string(
"UInt16"));
48 this->addSpecification(eSatBcidThreshLow, std::string(
"SatBcidThreshLow"),
49 std::string(
"UInt16"));
50 this->addSpecification(eSatBcidThreshHigh, std::string(
"SatBcidThreshHigh"),
51 std::string(
"UInt16"));
52 this->addSpecification(eSatBcidLevel, std::string(
"SatBcidLevel"),
53 std::string(
"UInt16"));
54 this->addSpecification(eBcidEnergyRangeLow, std::string(
"BcidEnergyRangeLow"),
55 std::string(
"UInt16"));
56 this->addSpecification(eBcidEnergyRangeHigh,
57 std::string(
"BcidEnergyRangeHigh"),
58 std::string(
"UInt16"));
60 this->addSpecification(ePedValue, std::string(
"PedValue"),
61 std::string(
"UInt32"));
62 this->addSpecification(ePedMean, std::string(
"PedMean"),
63 std::string(
"Double"));
65 this->addSpecification(eLutCpStrategy, std::string(
"LutCpStrategy"),
66 std::string(
"UInt16"));
68 this->addSpecification(eLutCpScale, std::string(
"LutCpScale"),
69 std::string(
"UInt16"));
70 this->addSpecification(eLutCpPar1, std::string(
"LutCpPar1"),
71 std::string(
"UInt16"));
72 this->addSpecification(eLutCpPar2, std::string(
"LutCpPar2"),
73 std::string(
"UInt16"));
74 this->addSpecification(eLutCpPar3, std::string(
"LutCpPar3"),
75 std::string(
"UInt16"));
76 this->addSpecification(eLutCpPar4, std::string(
"LutCpPar4"),
77 std::string(
"UInt16"));
79 this->addSpecification(eLutJepStrategy, std::string(
"LutJepStrategy"),
80 std::string(
"UInt16"));
82 this->addSpecification(eLutJepScale, std::string(
"LutJepScale"),
83 std::string(
"UInt16"));
84 this->addSpecification(eLutJepPar1, std::string(
"LutJepPar1"),
85 std::string(
"UInt16"));
86 this->addSpecification(eLutJepPar2, std::string(
"LutJepPar2"),
87 std::string(
"UInt16"));
88 this->addSpecification(eLutJepPar3, std::string(
"LutJepPar3"),
89 std::string(
"UInt16"));
90 this->addSpecification(eLutJepPar4, std::string(
"LutJepPar4"),
91 std::string(
"UInt16"));
94 this->addSpecification(ePedFirSum, std::string(
"PedFirSum"),
95 std::string(
"UInt32"));
96 this->addSpecification(eLutCpOffset, std::string(
"LutCpOffset"),
97 std::string(
"UInt16"));
98 this->addSpecification(eLutJepOffset, std::string(
"LutJepOffset"),
99 std::string(
"UInt16"));
103 this->addSpecification(eFirStartBit, std::string(
"FirStartBit"),
104 std::string(
"UInt16"));
105 this->addSpecification(eFirCoeff1, std::string(
"FirCoeff1"),
106 std::string(
"short"));
107 this->addSpecification(eFirCoeff2, std::string(
"FirCoeff2"),
108 std::string(
"short"));
109 this->addSpecification(eFirCoeff3, std::string(
"FirCoeff3"),
110 std::string(
"short"));
111 this->addSpecification(eFirCoeff4, std::string(
"FirCoeff4"),
112 std::string(
"short"));
113 this->addSpecification(eFirCoeff5, std::string(
"FirCoeff5"),
114 std::string(
"short"));
115 this->addSpecification(eLutCpNoiseCut, std::string(
"LutCpNoiseCut"),
116 std::string(
"UInt16"));
117 this->addSpecification(eLutCpSlope, std::string(
"LutCpSlope"),
118 std::string(
"UInt16"));
119 this->addSpecification(eLutJepNoiseCut, std::string(
"LutJepNoiseCut"),
120 std::string(
"UInt16"));
121 this->addSpecification(eLutJepSlope, std::string(
"LutJepSlope"),
122 std::string(
"UInt16"));
125 m_pprConditionsVec.reserve(s_vectorSize);
130 const std::map<L1CaloPprConditionsContainerRun2::eCoolFolders, std::string>&
147 return std::string(
"");
153 std::vector<std::string>
result{
155 std::string calibKey =
158 if (!calibKey.empty()) {
159 result.push_back(calibKey);
183 std::string chanCalibFolderKey;
184 std::string chanCalibCommonFolderKey;
185 std::string chanCalibStrategyFolderKey;
186 std::string chanDefaultsFolderKey;
189 auto it_pprChanCalibAttrListCollection = condAttrListCollectionMap.end();
191 auto it_pprChanCalibStrategyAttrListCollection = condAttrListCollectionMap.end();
195 if (condAttrListCollectionMap.empty())
return;
198 for (
const auto& [
name, coll] : condAttrListCollectionMap) {
199 if (
name.find(
"PprChanDefaults")!=std::string::npos){
200 chanDefaultsFolderKey=
name;}
201 if(
name.find(
"PprChanCalib")!=std::string::npos){
202 chanCalibFolderKey=
name;
204 if(
name.find(
"PprChanCommon")!=std::string::npos){
205 chanCalibCommonFolderKey=
name;
207 if(
name.find(
"Mu")!=std::string::npos){
208 chanCalibStrategyFolderKey=
name;
214 bool isUseStrategy =
false;
215 if (!chanCalibFolderKey.empty()) {
216 it_pprChanCalibAttrListCollection =
217 condAttrListCollectionMap.find(chanCalibFolderKey);
220 isUseStrategy =
true;
221 it_pprChanCalibAttrListCollection = condAttrListCollectionMap.find(chanCalibCommonFolderKey);
222 it_pprChanCalibStrategyAttrListCollection = condAttrListCollectionMap.find(chanCalibStrategyFolderKey);
231 if (it_pprChanCalibStrategyAttrListCollection ==
232 condAttrListCollectionMap.end()) {
233 std::cout <<
"L1CaloPprConditionsContainerRun2 : Could not find "
234 "requested CondAttrListCollection"
235 << chanCalibStrategyFolderKey << std::endl;
240 if (it_pprChanCalibAttrListCollection == condAttrListCollectionMap.end()) {
241 std::cout <<
"L1CaloPprConditionsContainerRun2 : Could not find "
242 "requested CondAttrListCollection "
243 << chanCalibCommonFolderKey << std::endl;
247 if (it_pprChanCalibAttrListCollection == condAttrListCollectionMap.end()) {
248 std::cout <<
"L1CaloPprConditionsContainerRun2 : Could not find "
249 "requested CondAttrListCollection"
250 << chanCalibCommonFolderKey << std::endl;
256 it_pprChanCalibAttrListCollection->second;
259 auto it_pprChanDefaultsAttrListCollection =
260 condAttrListCollectionMap.find(chanDefaultsFolderKey);
261 if (it_pprChanDefaultsAttrListCollection == condAttrListCollectionMap.end()) {
262 std::cout <<
"L1CaloPprConditionsContainerRun2 : Could not find requested "
263 "CondAttrListCollection" << chanDefaultsFolderKey
269 it_pprChanDefaultsAttrListCollection->second;
272 const coral::AttributeList& chanDefaultAttrList = std::cbegin(*chanDefaultsAttrListCollection)->second;
275 chanDefaultAttrList[this->specificationName(
eBcidDecision1)].data<
int>();
292 auto it_AttrListColl = chanCalibAttrListCollection->
begin();
293 auto it_AttrListCollE = chanCalibAttrListCollection->
end();
295 for (; it_AttrListColl != it_AttrListCollE; ++it_AttrListColl) {
307 unsigned short extBcidThreshold =
309 .data<
unsigned short>();
310 unsigned short satBcidThreshLow =
312 .data<
unsigned short>();
313 unsigned short satBcidThreshHigh =
315 .data<
unsigned short>();
316 unsigned short satBcidLevel =
318 .data<
unsigned short>();
320 unsigned short bcidEnergyRangeLow =
322 .data<
unsigned short>();
323 unsigned short bcidEnergyRangeHigh =
325 .data<
unsigned short>();
326 unsigned short lutCpStrategy =
328 .data<
unsigned short>();
338 unsigned short lutJepStrategy =
340 .data<
unsigned short>();
342 unsigned short lutCpScale =
344 .data<
unsigned short>();
345 unsigned short lutJepScale =
347 .data<
unsigned short>();
356 unsigned int pedValue =
358 .data<
unsigned int>();
363 unsigned short lutJepOffset =
367 .data<
unsigned short>();
368 unsigned short lutCpOffset =
371 .data<
unsigned short>();
372 unsigned int pedFirSum =
375 .data<
unsigned int>();
377 unsigned short firStartBit =
380 .data<
unsigned short>();
381 short int firCoeff1 =
385 short int firCoeff2 =
389 short int firCoeff3 =
393 short int firCoeff4 =
397 short int firCoeff5 =
402 unsigned short lutCpSlope =
405 .data<
unsigned short>();
406 unsigned short lutCpNoiseCut =
410 .data<
unsigned short>();
411 unsigned short lutJepSlope =
414 .data<
unsigned short>();
415 unsigned short lutJepNoiseCut =
419 .data<
unsigned short>();
422 extBcidThreshold, satBcidThreshLow, satBcidThreshHigh, satBcidLevel,
423 bcidEnergyRangeLow, bcidEnergyRangeHigh, firStartBit, firCoeff1,
424 firCoeff2, firCoeff3, firCoeff4, firCoeff5, lutCpStrategy, lutCpOffset,
425 lutCpSlope, lutCpNoiseCut, lutCpPar1, lutCpPar2, lutCpPar3, lutCpPar4,
426 lutCpScale, lutJepStrategy, lutJepOffset, lutJepSlope, lutJepNoiseCut,
427 lutJepPar1, lutJepPar2, lutJepPar3, lutJepPar4, lutJepScale, pedValue,
434 it_pprChanCalibStrategyAttrListCollection->second;
435 auto it_AttrListColl = chanCalibAttrListCollection->
begin();
436 auto it_AttrListCollE = chanCalibAttrListCollection->
end();
438 for (; it_AttrListColl != it_AttrListCollE; ++it_AttrListColl) {
450 std::cout <<
"L1CaloPprConditionsContainerRun2 : Could not find channel "
451 <<
" with index " <<
index << std::endl;
455 unsigned short firStartBit =
457 .data<
unsigned short>();
458 short int firCoeff1 =
460 short int firCoeff2 =
462 short int firCoeff3 =
464 short int firCoeff4 =
466 short int firCoeff5 =
469 unsigned short lutCpSlope =
471 .data<
unsigned short>();
472 unsigned short lutCpNoiseCut =
474 .data<
unsigned short>();
475 unsigned short lutJepSlope =
477 .data<
unsigned short>();
478 unsigned short lutJepNoiseCut =
480 .data<
unsigned short>();
482 firStartBit, firCoeff1, firCoeff2, firCoeff3, firCoeff4, firCoeff5,
483 lutCpSlope, lutCpNoiseCut, lutJepSlope, lutJepNoiseCut);
517 std::size_t
index(0);
519 if (
C) std::cout <<
"index " <<
index++ <<
" * item: " << *
C << std::endl;