ATLAS Offline Software
L1CaloCondAlg.cxx
Go to the documentation of this file.
1 // Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
4 
5 
6 #include <iomanip>
11 
12 
13 L1CaloCondAlg :: L1CaloCondAlg ( const std::string &name,ISvcLocator *pSvcLocator): AthAlgorithm( name, pSvcLocator )
14 
15 
16 
17 {
18 
19 }
20 
21 
22 
23 
24 
26 {
27 
28  ATH_MSG_DEBUG( "initialize " << name() );
29 
30 
31 
32  // Disabled Towers
35 
36 
37  // Derived Run Pars
40 
41  // Ppr Channel Calib
43 
44  // Cond Container
46 
47 
48  // Ppr Defaults Calib
51 
52  // Ppr FineTime Refs
55 
56  // Run Parameters
59 
60  // PprChanStrategy
63 
64 
65  // Ppm Dead Channels
68 
69 
70  // Disabled Channel
72 
73  // Readout Config
76 
77  // Readout Config JSON (Run 3)
80 
81  static const std::string pprFolderBase = "/TRIGGER/L1Calo/V2/Calibration/";
82  // Should correspond with the PprKeys enum.
83  for (const std::string s : { "PprChanCalib", "PprChanCommon",
84  "PprChanHighMu", "PprChanLowMu" })
85  {
86  m_physicsKeys.push_back (pprFolderBase + "Physics/" + s);
87  m_calib1Keys.push_back (pprFolderBase + "Calib1/" + s);
88  m_calib2Keys.push_back (pprFolderBase + "Calib2/" + s);
89  }
93 
94  return StatusCode::SUCCESS;
95 
96 }
97 
98 
100 {
101 
102  ATH_MSG_DEBUG( "start execute " << name() );
103  ATH_MSG_DEBUG("readConditions() ");
104 
105 
106 
107 
108  // Defining condition container to be saved
109 
111 
113 
115 
117 
119 
121 
123 
125 
127 
129 
131 
133 
134 
135 
136 
137  // Reading timing regime from database, and defining cool database folder for reading FIR coefficients
138 
140  const CondAttrListCollection* readCdo_DerRunPars(*readHandleDerRunPars);
141  if (readCdo_DerRunPars == 0) {
142  ATH_MSG_ERROR("Null pointer to the read conditions object");
143  return StatusCode::FAILURE;
144  }
145 
146  auto writeCdoDerRunPars = std::make_unique<L1CaloDerivedRunParsContainer>();
147 
148  std::map<std::string, const CondAttrListCollection*> condAttrListCollectionMapDerRunPars;
149  if (readCdo_DerRunPars) {
150  ATH_MSG_DEBUG("AttrListCollection for Derivated Run Parameters= "<<readCdo_DerRunPars);
151  condAttrListCollectionMapDerRunPars[ m_derivedRunPars.key() ] = readCdo_DerRunPars;
152  writeCdoDerRunPars->makeTransient(condAttrListCollectionMapDerRunPars);
153 
154  }
155 
156  std::string timingRegime ;
157  if (m_timingRegime.empty()) {
158  timingRegime = std::cbegin(*writeCdoDerRunPars)->timingRegime();
159  }
160  else {
161  timingRegime = m_timingRegime;
162  }
163 
164  ATH_MSG_DEBUG("timing regime --> "<< timingRegime );
165 
167  if (timingRegime == "Physics") {
168  pprKeys = &m_physicsKeys;
169  }
170  else if (timingRegime == "Calib1") {
171  pprKeys = &m_calib1Keys;
172  }
173  else if (timingRegime == "Calib2") {
174  pprKeys = &m_calib2Keys;
175  }
176  else {
177  ATH_MSG_ERROR( "Bad timing regime " << timingRegime <<
178  "; must be one of Physics, Calib1, Calib2" );
179  return StatusCode::FAILURE;
180  }
181 
182  // Strategy
183 
185  const CondAttrListCollection* readCdo_PprChanStrategy(*readHandlePprChanStrategy);
186 
187  if (readCdo_PprChanStrategy == 0) {
188  ATH_MSG_ERROR("Null pointer to the read conditions object");
189  return StatusCode::FAILURE;
190  }
191  auto writeCdoPprChanStrategy = std::make_unique<L1CaloPprChanStrategyContainer>();
192 
193  std::map<std::string, const CondAttrListCollection*> condAttrListCollectionMapPprChanStrategy;
194  if (readCdo_PprChanStrategy) {
195  ATH_MSG_DEBUG("AttrListCollection for Ppr Chan Strategy= "<<readCdo_PprChanStrategy);
196  condAttrListCollectionMapPprChanStrategy[ m_pprChanStrategy.key() ] = readCdo_PprChanStrategy;
197  writeCdoPprChanStrategy->makeTransient(condAttrListCollectionMapPprChanStrategy);
198 
199  }
200 
201 
202 
203  std::string strategy;
204 
205 
206  if (m_strategy.empty()) {
207 
208  for(const auto& it: *writeCdoPprChanStrategy){
209  if (it.timingRegime() == timingRegime){
210  strategy = it.strategy();
211 
212  }
213  }}
214 
215  else{
217  }
218 
219  ATH_MSG_DEBUG("strategy selected --> " << strategy);
220 
221  const std::string keyPprChanCalib= (*pprKeys)[PPRCHANCALIB].key();
222 
224  const CondAttrListCollection* readCdo_DisTowers(*readHandleDisTowers);
225 
226  SG::ReadCondHandle<CondAttrListCollection> readHandlePprChanCalib((*pprKeys)[PPRCHANCALIB]);
227  const CondAttrListCollection* readCdo_PprChanCalib(*readHandlePprChanCalib);
228 
230  const CondAttrListCollection* readCdo_PprChanDefaults(*readHandlePprChanDefaults);
231 
233  const CondAttrListCollection* readCdo_PpmFineTimeRefs(*readHandlePpmFineTimeRefs);
234 
236  const CondAttrListCollection* readCdo_RunParameters(*readHandleRunParameters);
237 
239  const CondAttrListCollection* readCdo_PpmDeadChannels(*readHandlePpmDeadChannels);
240 
242  const CondAttrListCollection* readCdo_ReadoutConfig(*readHandleReadoutConfig);
243 
244 
246  const CondAttrListCollection* readCdo_ReadoutConfigJSON(*readHandleReadoutConfigJSON);
248 
249 
250  if (readCdo_DisTowers == 0) {
251  ATH_MSG_ERROR("Null pointer to the read conditions object");
252  return StatusCode::FAILURE;
253  }
254 
255 
256  if (readCdo_PprChanCalib == 0) {
257  ATH_MSG_ERROR("Null pointer to the read conditions object");
258  return StatusCode::FAILURE;
259  }
260 
261  if (readCdo_PprChanDefaults == 0) {
262  ATH_MSG_ERROR("Null pointer to the read conditions object");
263  return StatusCode::FAILURE;
264  }
265 
266  if (readCdo_PpmFineTimeRefs == 0) {
267  ATH_MSG_ERROR("Null pointer to the read conditions object");
268  return StatusCode::FAILURE;
269  }
270 
271 
272  if (readCdo_RunParameters == 0) {
273  ATH_MSG_ERROR("Null pointer to the read conditions object");
274  return StatusCode::FAILURE;
275  }
276 
277  if (readCdo_PpmDeadChannels == 0) {
278  ATH_MSG_ERROR("Null pointer to the read conditions object");
279  return StatusCode::FAILURE;
280  }
281 
282 
283  if (readCdo_ReadoutConfig == 0) {
284  ATH_MSG_ERROR("Null pointer to the read conditions object");
285  return StatusCode::FAILURE;
286  }
287 
288 
289 
290 
291 
292 
293  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandleDisTowers.fullKey() << " readCdo_DisTower->size()= " << readCdo_DisTowers->size());
294  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandleDerRunPars.fullKey() << " readCdo_DerRunPars->size()= " << readCdo_DerRunPars->size());
295  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandlePprChanCalib.fullKey() << " readCdo_PprChanCalib->size()= " << readCdo_PprChanCalib->size());
296  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandlePprChanDefaults.fullKey() << " readCdo_PprChanDefaults->size()= " << readCdo_PprChanDefaults->size());
297  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandlePpmFineTimeRefs.fullKey() << " readCdo_PpmFineTimeRefs->size()= " << readCdo_PpmFineTimeRefs->size());
298  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandleRunParameters.fullKey() << " readCdo_RunParameters->size()= " << readCdo_RunParameters->size());
299  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandlePprChanStrategy.fullKey() << " readCdo_PprChanStrategy->size()= " << readCdo_PprChanStrategy->size());
300  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandlePpmDeadChannels.fullKey() << " readCdo_PpmDeadChannels->size()= " << readCdo_PpmDeadChannels->size());
301  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandleReadoutConfig.fullKey() << " readCdo_ReadoutConfig->size()= " << readCdo_ReadoutConfig->size());
302  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandleReadoutConfigJSON.fullKey() << " readCdo_ReadoutConfigJSON->size()= " << readCdo_ReadoutConfigJSON->size());
303 
304 
305 
306 
307  auto writeCdoDisTowers = std::make_unique<L1CaloDisabledTowersContainer>();
308  auto writeCdoPprChanCalib = std::make_unique<L1CaloPprChanCalibContainer>();
309  auto writeCdoPprChanDefaults = std::make_unique<L1CaloPprChanDefaultsContainer>();
310  auto writeCdoPpmFineTimeRefs = std::make_unique<L1CaloPpmFineTimeRefsContainer>();
311  auto writeCdoRunParameters = std::make_unique<L1CaloRunParametersContainer>();
312  auto writeCdoPpmDeadChannels = std::make_unique<L1CaloPpmDeadChannelsContainer>();
313  auto writeCdoPprConditions = std::make_unique<L1CaloPprConditionsContainerRun2>();
314  auto writeCdoPprDisabledChannel = std::make_unique<L1CaloPprDisabledChannelContainerRun2>();
315  auto writeCdoReadoutConfig = std::make_unique<L1CaloReadoutConfigContainer>();
316  auto writeCdoReadoutConfigJSON = std::make_unique<L1CaloReadoutConfigContainerJSON>();
317 
318 
319 
320 
321  // Filling the condition container
322  std::map<std::string, const CondAttrListCollection*> condAttrListCollectionMapDisTowers;
323  if (readCdo_DisTowers) {
324  ATH_MSG_DEBUG("AttrListCollection for Disabled Towers= "<<readCdo_DisTowers);
325  condAttrListCollectionMapDisTowers[ m_disabledTowers.key() ] = readCdo_DisTowers;
326  writeCdoDisTowers->makeTransient(condAttrListCollectionMapDisTowers);
327  }
328 
329 
330  std::map<std::string, const CondAttrListCollection*> condAttrListCollectionMapPprChanCalib;
331  if (readCdo_PprChanCalib) {
332  ATH_MSG_DEBUG("AttrListCollection for Ppr Channel Calib = "<<readCdo_PprChanCalib);
333  condAttrListCollectionMapPprChanCalib[keyPprChanCalib] = readCdo_PprChanCalib;
334  writeCdoPprChanCalib->makeTransient(condAttrListCollectionMapPprChanCalib);
335 
336  }
337 
338 
339 
340 
341  std::map<std::string, const CondAttrListCollection*> condAttrListCollectionMapPprChanDefaults;
342  if (readCdo_PprChanDefaults) {
343  ATH_MSG_DEBUG("AttrListCollection for Ppr Channel Defaults = "<<readCdo_PprChanDefaults);
344  condAttrListCollectionMapPprChanDefaults[ m_pprChanDefaults.key() ] = readCdo_PprChanDefaults;
345  writeCdoPprChanDefaults->makeTransient(condAttrListCollectionMapPprChanDefaults);
346 
347  }
348 
349 
350  std::map<std::string, const CondAttrListCollection*> condAttrListCollectionMapPpmFineTimeRefs;
351  if (readCdo_PpmFineTimeRefs) {
352  ATH_MSG_DEBUG("AttrListCollection for Ppm FineTime Refs = "<<readCdo_PpmFineTimeRefs);
353  condAttrListCollectionMapPpmFineTimeRefs[ m_ppmFineTimeRefs.key() ] = readCdo_PpmFineTimeRefs;
354  writeCdoPpmFineTimeRefs->makeTransient(condAttrListCollectionMapPpmFineTimeRefs);
355 
356  }
357 
358 
359  std::map<std::string, const CondAttrListCollection*> condAttrListCollectionMapRunParameters;
360  if (readCdo_RunParameters) {
361  ATH_MSG_DEBUG("AttrListCollection for Run Parameters = "<<readCdo_RunParameters);
362  condAttrListCollectionMapRunParameters[ m_runParameters.key() ] = readCdo_RunParameters;
363  writeCdoRunParameters->makeTransient(condAttrListCollectionMapRunParameters);
364 
365  }
366 
367 
368  std::map<std::string, const CondAttrListCollection*> condAttrListCollectionMapPpmDeadChannels;
369  if (readCdo_PpmDeadChannels) {
370  ATH_MSG_DEBUG("AttrListCollection for Ppm Dead Channels= "<<readCdo_PpmDeadChannels);
371  condAttrListCollectionMapPpmDeadChannels[ m_ppmDeadChannels.key() ] = readCdo_PpmDeadChannels;
372  writeCdoPpmDeadChannels->makeTransient(condAttrListCollectionMapPpmDeadChannels);
373 
374  }
375 
376  std::map<std::string, const CondAttrListCollection*> condAttrListCollectionMapReadoutConfig;
377  if (readCdo_ReadoutConfig) {
378  ATH_MSG_DEBUG("AttrListCollection for ReadoutConfig= "<<readCdo_ReadoutConfig);
379  condAttrListCollectionMapReadoutConfig[ m_readoutConfig.key() ] = readCdo_ReadoutConfig;
380  writeCdoReadoutConfig->makeTransient(condAttrListCollectionMapReadoutConfig);
381 
382  }
383 
384  std::map<std::string, const CondAttrListCollection*> condAttrListCollectionMapReadoutConfigJSON;
385  if (readCdo_ReadoutConfigJSON) {
386  ATH_MSG_DEBUG("AttrListCollection for ReadoutConfigJSON= "<<readCdo_ReadoutConfigJSON);
387  condAttrListCollectionMapReadoutConfigJSON[ m_readoutConfigJSON.key() ] = readCdo_ReadoutConfigJSON;
388  writeCdoReadoutConfigJSON->makeTransient(condAttrListCollectionMapReadoutConfigJSON);
389 
390  }
391 
392  // Filling DisableChannels Contianer
393  std::map<std::string, const CondAttrListCollection*> condAttrListCollectionMapDisableChannels;
394  condAttrListCollectionMapDisableChannels[keyPprChanCalib] = readCdo_PprChanCalib;
395  condAttrListCollectionMapDisableChannels[ m_disabledTowers.key() ] = readCdo_DisTowers;
396  condAttrListCollectionMapDisableChannels[ m_ppmDeadChannels.key() ] = readCdo_PpmDeadChannels;
397  writeCdoPprDisabledChannel->makeTransient(condAttrListCollectionMapDisableChannels);
398 
399 
400  // Event range definition
401 
402  EventIDRange range_DisTowers;
403  if ( !readHandleDisTowers.range(range_DisTowers) ) {
404  ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandleDisTowers.key());
405  return StatusCode::FAILURE;
406  }
407 
408  ATH_MSG_DEBUG("Range of input is Disable Towers" << range_DisTowers);
409 
410  EventIDRange range_DerRunPars;
411  if ( !readHandleDerRunPars.range(range_DerRunPars) ) {
412  ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandleDerRunPars.key());
413  return StatusCode::FAILURE;
414  }
415 
416  ATH_MSG_DEBUG("Range of input is DerRunPars" << range_DerRunPars);
417 
418 
419  EventIDRange range_PprChanCalib;
420  if ( !readHandlePprChanCalib.range(range_PprChanCalib) ) {
421  ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandlePprChanCalib.key());
422  return StatusCode::FAILURE;
423  }
424 
425  ATH_MSG_DEBUG("Range of input is PprChanCalib" << range_PprChanCalib);
426 
427 
428 
429 
430  EventIDRange range_PprChanDefaults;
431  if ( !readHandlePprChanDefaults.range(range_PprChanDefaults) ) {
432  ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandlePprChanDefaults.key());
433  return StatusCode::FAILURE;
434  }
435 
436  ATH_MSG_DEBUG("Range of input is PprChanDefaults" << range_PprChanDefaults);
437  writeHandlePprConditions.addDependency( range_PprChanDefaults );
438 
439 
440  EventIDRange range_PpmFineTimeRefs;
441  if ( !readHandlePpmFineTimeRefs.range(range_PpmFineTimeRefs) ) {
442  ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandlePpmFineTimeRefs.key());
443  return StatusCode::FAILURE;
444  }
445 
446  ATH_MSG_DEBUG("Range of input is PpmFineTimeRefs" << range_PpmFineTimeRefs);
447 
448 
449 
450  EventIDRange range_RunParameters;
451  if ( !readHandleRunParameters.range(range_RunParameters) ) {
452  ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandleRunParameters.key());
453  return StatusCode::FAILURE;
454  }
455 
456  ATH_MSG_DEBUG("Range of input is RunParameters" << range_RunParameters);
457 
458 
459  EventIDRange range_PprChanStrategy;
460  if ( !readHandlePprChanStrategy.range(range_PprChanStrategy) ) {
461  ATH_MSG_DEBUG("Failed to retrieve validity range for " << readHandlePprChanStrategy.key());
462  return StatusCode::FAILURE;
463  }
464 
465  ATH_MSG_DEBUG("Range of input is PprChanStrategy" << range_PprChanStrategy);
466 
467 
468  EventIDRange range_PpmDeadChannels;
469  if ( !readHandlePpmDeadChannels.range(range_PpmDeadChannels) ) {
470  ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandlePpmDeadChannels.key());
471  return StatusCode::FAILURE;
472  }
473  ATH_MSG_DEBUG("Range of input is PpmDeadChannels" << range_PpmDeadChannels);
474 
475 
476 
477  EventIDRange range_ReadoutConfig;
478  if ( !readHandleReadoutConfig.range(range_ReadoutConfig) ) {
479  ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandleReadoutConfig.key());
480  return StatusCode::FAILURE;
481  }
482  ATH_MSG_DEBUG("Range of input is Readout Config" << range_ReadoutConfig);
483 
484 
485  EventIDRange range_ReadoutConfigJSON;
486  if ( !readHandleReadoutConfigJSON.range(range_ReadoutConfigJSON) ) {
487  ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandleReadoutConfigJSON.key());
488  return StatusCode::FAILURE;
489  }
490  ATH_MSG_DEBUG("Range of input is Readout Config JSON" << range_ReadoutConfigJSON);
491 
492 
493 
494  // Adding PprDisabledChannel dependencies
495  writeHandlePprDisabledChannel.addDependency(readHandlePpmDeadChannels);
496  writeHandlePprDisabledChannel.addDependency(readHandlePprChanCalib);
497  writeHandlePprDisabledChannel.addDependency(readHandleDisTowers);
498 
499 
500 
501  // Saving condition containers
502 
503 
504  if (writeHandleDisTowers.record(range_DisTowers, std::move(writeCdoDisTowers)).isFailure()) {
505  ATH_MSG_FATAL("Could not record " << writeHandleDisTowers.key()
506  << " with EventRange " << range_DisTowers
507  << " into Conditions Store");
508  return StatusCode::FAILURE;
509  }
510 
511 
512  if (writeHandleDerRunPars.record(range_DerRunPars, std::move(writeCdoDerRunPars)).isFailure()) {
513  ATH_MSG_FATAL("Could not record " << writeHandleDerRunPars.key()
514  << " with EventRange " << range_DerRunPars
515  << " into Conditions Store");
516  return StatusCode::FAILURE;
517  }
518 
519 
520  if (writeHandlePprChanCalib.record(range_PprChanCalib, std::move(writeCdoPprChanCalib)).isFailure()) {
521  ATH_MSG_FATAL("Could not record " << writeHandlePprChanCalib.key()
522  << " with EventRange " << range_PprChanCalib
523  << " into Conditions Store");
524  return StatusCode::FAILURE;
525  }
526 
527 
528 
529 
530  if (writeHandlePprChanDefaults.record(range_PprChanDefaults, std::move(writeCdoPprChanDefaults)).isFailure()) {
531  ATH_MSG_FATAL("Could not record " << writeHandlePprChanDefaults.key()
532  << " with EventRange " << range_PprChanDefaults
533  << " into Conditions Store");
534  return StatusCode::FAILURE;
535  }
536 
537 
538  if (writeHandlePpmFineTimeRefs.record(range_PpmFineTimeRefs, std::move(writeCdoPpmFineTimeRefs)).isFailure()) {
539  ATH_MSG_FATAL("Could not record " << writeHandlePpmFineTimeRefs.key()
540  << " with EventRange " << range_PpmFineTimeRefs
541  << " into Conditions Store");
542  return StatusCode::FAILURE;
543  }
544 
545 
546 
547  if (writeHandleRunParameters.record(range_RunParameters, std::move(writeCdoRunParameters)).isFailure()) {
548  ATH_MSG_FATAL("Could not record " << writeHandleRunParameters.key()
549  << " with EventRange " << range_RunParameters
550  << " into Conditions Store");
551  return StatusCode::FAILURE;
552  }
553 
554 
555 
556  if (writeHandlePprChanStrategy.record(range_PprChanStrategy, std::move(writeCdoPprChanStrategy)).isFailure()) {
557  ATH_MSG_FATAL("Could not record " << writeHandlePprChanStrategy.key()
558  << " with EventRange " << range_PprChanStrategy
559  << " into Conditions Store");
560  return StatusCode::FAILURE;
561  }
562 
563 
564 
565  if (writeHandlePpmDeadChannels.record(range_PpmDeadChannels, std::move(writeCdoPpmDeadChannels)).isFailure()) {
566  ATH_MSG_FATAL("Could not record " << writeHandlePpmDeadChannels.key()
567  << " with EventRange " << range_PpmDeadChannels
568  << " into Conditions Store");
569  return StatusCode::FAILURE;
570  }
571 
572 
573  if (writeHandleReadoutConfig.record(range_ReadoutConfig, std::move(writeCdoReadoutConfig)).isFailure()) {
574  ATH_MSG_FATAL("Could not record " << writeHandleReadoutConfig.key()
575  << " with EventRange " << range_ReadoutConfig
576  << " into Conditions Store");
577  return StatusCode::FAILURE;
578  }
579 
580 
581 
582  if (writeHandleReadoutConfigJSON.record(range_ReadoutConfigJSON, std::move(writeCdoReadoutConfigJSON)).isFailure()) {
583  ATH_MSG_FATAL("Could not record " << writeHandleReadoutConfigJSON.key()
584  << " with EventRange " << range_ReadoutConfigJSON
585  << " into Conditions Store");
586  return StatusCode::FAILURE;
587  }
588 
589 
590 
591 
592  if (writeHandlePprDisabledChannel.record(std::move(writeCdoPprDisabledChannel)).isFailure()) {
593  ATH_MSG_FATAL("Could not record " << writeHandlePprDisabledChannel.key()
594  << " into Conditions Store");
595  return StatusCode::FAILURE;
596  }
597 
598 
599  // Saving L1CaloConditionContianerRun2 depending on the strategy selected (to read FIR coefficients)
600 
601 
602  std::map<std::string, const CondAttrListCollection*> condAttrListCollectionMapCond;
603  if (!strategy.empty()){
604 
605 
606  const std::string keyPprChanCommon = (*pprKeys)[PPRCHANCOMMON].key();
607 
608  SG::ReadCondHandleKey<CondAttrListCollection>* pprChanStrategy = nullptr;
609  if (strategy == "HighMu") {
610  pprChanStrategy = &(*pprKeys)[PPRCHANHIGHMU];
611  }
612  else if (strategy == "LowMu") {
613  pprChanStrategy = &(*pprKeys)[PPRCHANLOWMU];
614  }
615  else {
616  ATH_MSG_ERROR( "Bad strategy " << strategy <<
617  "; should be either HighMu or LowMu" );
618  return StatusCode::FAILURE;
619  }
620  const std::string keyPprChanStrategy = pprChanStrategy->key();
621 
622 
623  ATH_MSG_DEBUG("Entering to !strategy.empty() option --> strategy " << strategy);
624  ATH_MSG_DEBUG("PprChanCommon folder " << keyPprChanCommon );
625  ATH_MSG_DEBUG("PprChanStrategy folder " << keyPprChanStrategy);
626 
627 
628 
629  SG::ReadCondHandle<CondAttrListCollection> readHandlePprChanCommon((*pprKeys)[PPRCHANCOMMON]);
630  const CondAttrListCollection* readCdo_PprChanCommon(*readHandlePprChanCommon);
631 
632  SG::ReadCondHandle<CondAttrListCollection> readHandlePprChanStrategy(*pprChanStrategy);
633  const CondAttrListCollection* readCdo_PprChanStrategy(*readHandlePprChanStrategy);
634 
635  if (readCdo_PprChanCommon == 0) {
636  ATH_MSG_ERROR("Null pointer to the read conditions object");
637  return StatusCode::FAILURE;
638  }
639 
640  if (readCdo_PprChanStrategy == 0) {
641  ATH_MSG_ERROR("Null pointer to the read conditions object");
642  return StatusCode::FAILURE;
643  }
644 
645 
646  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandlePprChanCommon.fullKey() << " readCdo_PprChanCommon->size()= " << readCdo_PprChanCommon->size());
647  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandlePprChanStrategy.fullKey() << " readCdo_PprChanMu->size()= " << readCdo_PprChanStrategy->size());
648 
649  condAttrListCollectionMapCond[ keyPprChanCommon ] = readCdo_PprChanCommon;
650  condAttrListCollectionMapCond[ keyPprChanStrategy ] = readCdo_PprChanStrategy;
651  condAttrListCollectionMapCond[ m_pprChanDefaults.key() ] = readCdo_PprChanDefaults;
652 
653  writeCdoPprConditions->makeTransient(condAttrListCollectionMapCond);
654 
655 
656  EventIDRange range_PprChanCommon;
657  if ( !readHandlePprChanCommon.range(range_PprChanCommon) ) {
658  ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandlePprChanCommon.key());
659  return StatusCode::FAILURE;
660  }
661 
662  ATH_MSG_DEBUG("Range of input is PprChanCommon" << range_PprChanCommon);
663  writeHandlePprConditions.addDependency(range_PprChanCommon);
664 
665 
666  EventIDRange range_PprChanStrategy;
667  if ( !readHandlePprChanStrategy.range(range_PprChanStrategy) ) {
668  ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandlePprChanStrategy.key());
669  return StatusCode::FAILURE;
670  }
671 
672  ATH_MSG_DEBUG("Range of input is PprChanMu" << range_PprChanStrategy);
673  writeHandlePprConditions.addDependency(range_PprChanStrategy);
674 
675 
676 
677  }
678  else {
679 
680 
681 
682 
683  condAttrListCollectionMapCond[ keyPprChanCalib ] = readCdo_PprChanCalib;
684  condAttrListCollectionMapCond[ m_pprChanDefaults.key() ] = readCdo_PprChanDefaults;
685  writeCdoPprConditions->makeTransient(condAttrListCollectionMapCond);
686  writeHandlePprConditions.addDependency(range_PprChanCalib);
687 
688  ATH_MSG_DEBUG("Entering to strategy.empty() option");
689  ATH_MSG_DEBUG("PprChanCalib folder " << keyPprChanCalib );
690 
691 
692  }
693 
694 
695 
696 
697 
698  if (writeHandlePprConditions.record(std::move(writeCdoPprConditions)).isFailure()) {
699  ATH_MSG_FATAL("Could not record " << writeHandlePprConditions.key()
700  << " into Conditions Store");
701  return StatusCode::FAILURE;
702  }
703 
704 
705 
706 
707 
708 
709 
710  ATH_MSG_DEBUG("recorded new " << writeHandleDisTowers.key() << " with range " << writeHandleDisTowers.getRange() << " into Conditions Store");
711  ATH_MSG_DEBUG("recorded new " << writeHandleDerRunPars.key() << " with range " << writeHandleDerRunPars.getRange() << " into Conditions Store");
712  ATH_MSG_DEBUG("recorded new " << writeHandlePprChanCalib.key() << " with range " << writeHandlePprChanCalib.getRange() << " into Conditions Store");
713  ATH_MSG_DEBUG("recorded new " << writeHandlePprChanDefaults.key() << " with range " << writeHandlePprChanDefaults.getRange() << " into Conditions Store");
714  ATH_MSG_DEBUG("recorded new " << writeHandlePpmFineTimeRefs.key() << " with range " << writeHandlePpmFineTimeRefs.getRange() << " into Conditions Store");
715  ATH_MSG_DEBUG("recorded new " << writeHandleRunParameters.key() << " with range " << writeHandleRunParameters.getRange() << " into Conditions Store");
716  ATH_MSG_DEBUG("recorded new " << writeHandlePprChanStrategy.key() << " with range " << writeHandlePprChanStrategy.getRange() << " into Conditions Store");
717  ATH_MSG_DEBUG("recorded new " << writeHandlePpmDeadChannels.key() << " with range " << writeHandlePpmDeadChannels.getRange() << " into Conditions Store");
718  ATH_MSG_DEBUG("recorded new " << writeHandlePprConditions.key() << " with range " << writeHandlePprConditions.getRange() << " into Conditions Store");
719  ATH_MSG_DEBUG("recorded new " << writeHandleReadoutConfig.key() << " with range " << writeHandleReadoutConfig.getRange() << " into Conditions Store");
720  ATH_MSG_DEBUG("recorded new " << writeHandleReadoutConfigJSON.key() << " with range " << writeHandleReadoutConfigJSON.getRange() << " into Conditions Store");
721  ATH_MSG_DEBUG("recorded new " << writeHandlePprDisabledChannel.key() << " with range " << writeHandlePprDisabledChannel.getRange() << " into Conditions Store");
722 
723 
724 
725  return StatusCode::SUCCESS;
726 
727 }
xAOD::strategy
strategy
Definition: L2CombinedMuon_v1.cxx:107
L1CaloCondAlg::m_pprChanCalibContainer
SG::WriteCondHandleKey< L1CaloPprChanCalibContainer > m_pprChanCalibContainer
Definition: L1CaloCondAlg.h:86
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
IL1CaloPersistenceCapable.h
L1CaloCondAlg::m_pprChanDefaultsContainer
SG::WriteCondHandleKey< L1CaloPprChanDefaultsContainer > m_pprChanDefaultsContainer
Definition: L1CaloCondAlg.h:87
L1CaloCondAlg::m_readoutConfigContainerJSON
SG::WriteCondHandleKey< L1CaloReadoutConfigContainerJSON > m_readoutConfigContainerJSON
Definition: L1CaloCondAlg.h:95
SG::ReadCondHandle::fullKey
const DataObjID & fullKey() const
Definition: ReadCondHandle.h:60
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
L1CaloCondAlg::m_readoutConfigJSON
SG::ReadCondHandleKey< CondAttrListCollection > m_readoutConfigJSON
Definition: L1CaloCondAlg.h:80
skel.it
it
Definition: skel.GENtoEVGEN.py:423
L1CaloCondAlg::m_pprChanStrategy
SG::ReadCondHandleKey< CondAttrListCollection > m_pprChanStrategy
Definition: L1CaloCondAlg.h:78
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
L1CaloCondAlg::m_pprDisabledChannelContainer
SG::WriteCondHandleKey< L1CaloPprDisabledChannelContainerRun2 > m_pprDisabledChannelContainer
Definition: L1CaloCondAlg.h:93
SG::ReadCondHandle::range
bool range(EventIDRange &r)
Definition: ReadCondHandle.h:224
L1CaloCondAlg::PPRCHANHIGHMU
@ PPRCHANHIGHMU
Definition: L1CaloCondAlg.h:56
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
L1CaloCondAlg::m_strategy
Gaudi::Property< std::string > m_strategy
Definition: L1CaloCondAlg.h:43
ReadCondHandle.h
L1CaloCondAlg::m_pprChanStrategyContainer
SG::WriteCondHandleKey< L1CaloPprChanStrategyContainer > m_pprChanStrategyContainer
Definition: L1CaloCondAlg.h:90
L1CaloCondAlg::m_useCalib1Regime
Gaudi::Property< bool > m_useCalib1Regime
Definition: L1CaloCondAlg.h:48
L1CaloCondAlg::m_ppmDeadChannelsContainer
SG::WriteCondHandleKey< L1CaloPpmDeadChannelsContainer > m_ppmDeadChannelsContainer
Definition: L1CaloCondAlg.h:91
L1CaloCondAlg::m_pprConditionsContainer
SG::WriteCondHandleKey< L1CaloPprConditionsContainerRun2 > m_pprConditionsContainer
Definition: L1CaloCondAlg.h:92
L1CaloCondAlg::m_timingRegime
Gaudi::Property< std::string > m_timingRegime
Definition: L1CaloCondAlg.h:42
L1CaloCondAlg::m_derivedRunParsContainer
SG::WriteCondHandleKey< L1CaloDerivedRunParsContainer > m_derivedRunParsContainer
Definition: L1CaloCondAlg.h:85
L1CaloCondAlg::m_useCalib2Regime
Gaudi::Property< bool > m_useCalib2Regime
Definition: L1CaloCondAlg.h:50
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
WriteCondHandle.h
L1CaloCondAlg::m_derivedRunPars
SG::ReadCondHandleKey< CondAttrListCollection > m_derivedRunPars
Definition: L1CaloCondAlg.h:69
L1CaloCondAlg::m_calib2Keys
SG::ReadCondHandleKeyArray< CondAttrListCollection > m_calib2Keys
Definition: L1CaloCondAlg.h:65
L1CaloCondAlg::execute
virtual StatusCode execute() override
Definition: L1CaloCondAlg.cxx:99
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
L1CaloCondAlg::m_runParameters
SG::ReadCondHandleKey< CondAttrListCollection > m_runParameters
Definition: L1CaloCondAlg.h:72
L1CaloCondAlg::m_physicsKeys
SG::ReadCondHandleKeyArray< CondAttrListCollection > m_physicsKeys
Definition: L1CaloCondAlg.h:61
L1CaloCondAlg::m_calib1Keys
SG::ReadCondHandleKeyArray< CondAttrListCollection > m_calib1Keys
Definition: L1CaloCondAlg.h:63
L1CaloCondAlg::m_usePhysicsRegime
Gaudi::Property< bool > m_usePhysicsRegime
Definition: L1CaloCondAlg.h:46
AthAlgorithm
Definition: AthAlgorithm.h:47
L1CaloCondAlg.h
L1CaloCondAlg::L1CaloCondAlg
L1CaloCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: L1CaloCondAlg.cxx:13
L1CaloCondAlg::m_disabledTowersContainer
SG::WriteCondHandleKey< L1CaloDisabledTowersContainer > m_disabledTowersContainer
Definition: L1CaloCondAlg.h:84
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
L1CaloCondAlg::PPRCHANCALIB
@ PPRCHANCALIB
Definition: L1CaloCondAlg.h:54
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
L1CaloCondAlg::PPRCHANLOWMU
@ PPRCHANLOWMU
Definition: L1CaloCondAlg.h:57
L1CaloCondAlg::m_readoutConfig
SG::ReadCondHandleKey< CondAttrListCollection > m_readoutConfig
Definition: L1CaloCondAlg.h:79
CondAttrListCollection::size
size_type size() const
number of Chan/AttributeList pairs
Definition: CondAttrListCollection.h:322
SG::ReadCondHandleKey< CondAttrListCollection >
L1CaloCondAlg::m_readoutConfigContainer
SG::WriteCondHandleKey< L1CaloReadoutConfigContainer > m_readoutConfigContainer
Definition: L1CaloCondAlg.h:94
L1CaloCondAlg::m_ppmFineTimeRefs
SG::ReadCondHandleKey< CondAttrListCollection > m_ppmFineTimeRefs
Definition: L1CaloCondAlg.h:71
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition: CondAttrListCollection.h:63
L1CaloCondAlg::m_disabledTowers
SG::ReadCondHandleKey< CondAttrListCollection > m_disabledTowers
Definition: L1CaloCondAlg.h:68
L1CaloCondAlg::m_runParametersContainer
SG::WriteCondHandleKey< L1CaloRunParametersContainer > m_runParametersContainer
Definition: L1CaloCondAlg.h:89
SG::ReadCondHandle::key
const std::string & key() const
Definition: ReadCondHandle.h:59
L1CaloCondAlg::initialize
virtual StatusCode initialize() override
Definition: L1CaloCondAlg.cxx:25
L1CaloCondAlg::m_pprChanDefaults
SG::ReadCondHandleKey< CondAttrListCollection > m_pprChanDefaults
Definition: L1CaloCondAlg.h:77
L1CaloCondAlg::m_ppmDeadChannels
SG::ReadCondHandleKey< CondAttrListCollection > m_ppmDeadChannels
Definition: L1CaloCondAlg.h:70
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
L1CaloCondAlg::PPRCHANCOMMON
@ PPRCHANCOMMON
Definition: L1CaloCondAlg.h:55
L1CaloCondAlg::m_ppmFineTimeRefsContainer
SG::WriteCondHandleKey< L1CaloPpmFineTimeRefsContainer > m_ppmFineTimeRefsContainer
Definition: L1CaloCondAlg.h:88