179 {
181
182
183 std::string chanCalibFolderKey;
184 std::string chanCalibCommonFolderKey;
185 std::string chanCalibStrategyFolderKey;
186 std::string chanDefaultsFolderKey;
187
188
189 auto it_pprChanCalibAttrListCollection = condAttrListCollectionMap.end();
190
191 auto it_pprChanCalibStrategyAttrListCollection = condAttrListCollectionMap.end();
192
193
194
195 if (condAttrListCollectionMap.empty()) return;
196
197
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;
203 }
204 if(
name.find(
"PprChanCommon")!=std::string::npos){
205 chanCalibCommonFolderKey=
name;
206 }
207 if(
name.find(
"Mu")!=std::string::npos){
208 chanCalibStrategyFolderKey=
name;
209 }
210 }
211
212
213
214 bool isUseStrategy = false;
215 if (!chanCalibFolderKey.empty()) {
216 it_pprChanCalibAttrListCollection =
217 condAttrListCollectionMap.find(chanCalibFolderKey);
218 }
219 else {
220 isUseStrategy = true;
221 it_pprChanCalibAttrListCollection = condAttrListCollectionMap.find(chanCalibCommonFolderKey);
222 it_pprChanCalibStrategyAttrListCollection = condAttrListCollectionMap.find(chanCalibStrategyFolderKey);
223 }
224
225
226
227
228
229 if (isUseStrategy) {
230
231 if (it_pprChanCalibStrategyAttrListCollection ==
232 condAttrListCollectionMap.end()) {
233 std::cout << "L1CaloPprConditionsContainerRun2 : Could not find "
234 "requested CondAttrListCollection"
235 << chanCalibStrategyFolderKey << std::endl;
236 return;
237 }
238
239
240 if (it_pprChanCalibAttrListCollection == condAttrListCollectionMap.end()) {
241 std::cout << "L1CaloPprConditionsContainerRun2 : Could not find "
242 "requested CondAttrListCollection "
243 << chanCalibCommonFolderKey << std::endl;
244 return;
245 }
246 } else{
247 if (it_pprChanCalibAttrListCollection == condAttrListCollectionMap.end()) {
248 std::cout << "L1CaloPprConditionsContainerRun2 : Could not find "
249 "requested CondAttrListCollection"
250 << chanCalibCommonFolderKey << std::endl;
251 return;
252 }
253 }
254
255 const CondAttrListCollection* chanCalibAttrListCollection =
256 it_pprChanCalibAttrListCollection->second;
257
258
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
264 << std::endl;
265 return;
266 }
267
268 const CondAttrListCollection* chanDefaultsAttrListCollection =
269 it_pprChanDefaultsAttrListCollection->second;
270
271
272 const coral::AttributeList& chanDefaultAttrList = std::cbegin(*chanDefaultsAttrListCollection)->second;
273
290
291
292 auto it_AttrListColl = chanCalibAttrListCollection->
begin();
293 auto it_AttrListCollE = chanCalibAttrListCollection->
end();
294
295 for (; it_AttrListColl != it_AttrListCollE; ++it_AttrListColl) {
296
297 L1CaloCoolChannelId coolId(it_AttrListColl->first);
298 unsigned int index = (coolId.crate() << 10) + (coolId.module() << 6) +
299 (coolId.subModule() << 2) + coolId.channel();
300
302 continue;
303 }
304
305 const coral::AttributeList& chanCalibAttrList(it_AttrListColl->second);
306
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>();
319
320 unsigned short bcidEnergyRangeLow =
322 .data<unsigned short>();
323 unsigned short bcidEnergyRangeHigh =
325 .data<unsigned short>();
326 unsigned short lutCpStrategy =
328 .data<unsigned short>();
329
330 short lutCpPar1 =
332 short lutCpPar2 =
334 short lutCpPar3 =
336 short lutCpPar4 =
338 unsigned short lutJepStrategy =
340 .data<unsigned short>();
341
342 unsigned short lutCpScale =
344 .data<unsigned short>();
345 unsigned short lutJepScale =
347 .data<unsigned short>();
348 short lutJepPar1 =
350 short lutJepPar2 =
352 short lutJepPar3 =
354 short lutJepPar4 =
356 unsigned int pedValue =
358 .data<unsigned int>();
359 float pedMean =
362
363 unsigned short lutJepOffset =
364 isUseStrategy
365 ? 0
367 .data<unsigned short>();
368 unsigned short lutCpOffset =
369 isUseStrategy ? 0
371 .data<unsigned short>();
372 unsigned int pedFirSum =
373 isUseStrategy ? 0
375 .data<unsigned int>();
376
377 unsigned short firStartBit =
378 isUseStrategy ? 0
380 .data<unsigned short>();
381 short int firCoeff1 =
382 isUseStrategy ? 0
384 .data<short>();
385 short int firCoeff2 =
386 isUseStrategy ? 0
388 .data<short>();
389 short int firCoeff3 =
390 isUseStrategy ? 0
392 .data<short>();
393 short int firCoeff4 =
394 isUseStrategy ? 0
396 .data<short>();
397 short int firCoeff5 =
398 isUseStrategy ? 0
400 .data<short>();
401
402 unsigned short lutCpSlope =
403 isUseStrategy ? 0
405 .data<unsigned short>();
406 unsigned short lutCpNoiseCut =
407 isUseStrategy
408 ? 0
410 .data<unsigned short>();
411 unsigned short lutJepSlope =
412 isUseStrategy ? 0
414 .data<unsigned short>();
415 unsigned short lutJepNoiseCut =
416 isUseStrategy
417 ? 0
419 .data<unsigned short>();
420
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,
428 pedMean, pedFirSum);
429 }
430
431 if (isUseStrategy){
432
433 const CondAttrListCollection* chanCalibAttrListCollection =
434 it_pprChanCalibStrategyAttrListCollection->second;
435 auto it_AttrListColl = chanCalibAttrListCollection->
begin();
436 auto it_AttrListCollE = chanCalibAttrListCollection->
end();
437
438 for (; it_AttrListColl != it_AttrListCollE; ++it_AttrListColl) {
439 L1CaloCoolChannelId coolId(it_AttrListColl->first);
440 unsigned int index = (coolId.crate() << 10) + (coolId.module() << 6) +
441 (coolId.subModule() << 2) + coolId.channel();
442
444 continue;
445 }
446
447 const coral::AttributeList& chanCalibAttrList(it_AttrListColl->second);
448
450 std::cout << "L1CaloPprConditionsContainerRun2 : Could not find channel "
451 <<
" with index " <<
index << std::endl;
452 return;
453 }
454
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 =
468
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);
484
485 }
486
487 }
488
489
490}
std::string specificationName(int specId) const
const_iterator end() const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.