ATLAS Offline Software
CaloBCIDLumiCondAlg.cxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration.
3  */
12 #include "CaloBCIDLumiCondAlg.h"
15 
16 
21 {
26 
27  return StatusCode::SUCCESS;
28 }
29 
30 
35 StatusCode CaloBCIDLumiCondAlg::execute (const EventContext& ctx) const
36 {
39 
40  std::unique_ptr<CaloBCIDLumi> lumi;
41  if (m_isMC) {
42  if (outputLumi.isValid()) {
43  ATH_MSG_DEBUG ("Found valid write handle");
44  return StatusCode::SUCCESS;
45  }
46 
48  lumi = std::make_unique<CaloBCIDLumi> (**coeffs, **bccd);
49  outputLumi.addDependency (bccd);
50  }
51  else {
53 
54  // Need to check start of range, since lumi might be extensible.
55  EventIDRange range;
56  if (outputLumi.isValid(range)) {
57  EventIDBase start = range.start();
58  EventIDBase coeffs_start = coeffs.getRange().start();
59  EventIDBase lcd_start = lcd.getRange().start();
60  if ((start.time_stamp() == coeffs_start.time_stamp() &&
61  start.time_stamp_ns_offset() == coeffs_start.time_stamp_ns_offset()) ||
62  (start.time_stamp() == lcd_start.time_stamp() &&
63  start.time_stamp_ns_offset() == lcd_start.time_stamp_ns_offset()))
64  {
65  ATH_MSG_DEBUG ("Found valid write handle");
66  return StatusCode::SUCCESS;
67  }
68  }
69 
70  lumi = std::make_unique<CaloBCIDLumi> (**coeffs, **lcd);
71  outputLumi.addDependency (lcd);
72  }
73 
74  outputLumi.addDependency (coeffs);
75 
76  ATH_CHECK( outputLumi.record (std::move (lumi)) );
77  ATH_MSG_INFO( "recorded new " << outputLumi.key() << " with range " << outputLumi.getRange() );
78  return StatusCode::SUCCESS;
79 }
CaloBCIDLumiCondAlg::m_outputLumiKey
SG::WriteCondHandleKey< CaloBCIDLumi > m_outputLumiKey
Property: Offset correction luminosity-dependent conditions object (output).
Definition: CaloBCIDLumiCondAlg.h:70
SG::ReadCondHandle::getRange
const EventIDRange & getRange()
Definition: ReadCondHandle.h:242
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
CaloBCIDLumiCondAlg::m_isMC
Gaudi::Property< bool > m_isMC
Property; MC flag.
Definition: CaloBCIDLumiCondAlg.h:74
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
SG::WriteCondHandle::getRange
const EventIDRange & getRange() const
Definition: WriteCondHandle.h:89
SG::WriteCondHandle::record
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
Definition: WriteCondHandle.h:157
CaloBCIDLumiCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Execute the algorithm.
Definition: CaloBCIDLumiCondAlg.cxx:35
ReadCondHandle.h
CaloBCIDLumiCondAlg::m_lumiDataKey
SG::ReadCondHandleKey< LuminosityCondData > m_lumiDataKey
Property: Per-bunch luminosity data (data only) conditions input).
Definition: CaloBCIDLumiCondAlg.h:66
perfmonmt-refit.coeffs
coeffs
Definition: perfmonmt-refit.py:105
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
CaloBCIDLumiCondAlg::m_bcDataKey
SG::ReadCondHandleKey< BunchCrossingCondData > m_bcDataKey
Property: Bunch crossing data (MC only) (conditions input).
Definition: CaloBCIDLumiCondAlg.h:62
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloBCIDLumiCondAlg::initialize
virtual StatusCode initialize() override
Gaudi initialize method.
Definition: CaloBCIDLumiCondAlg.cxx:20
SG::WriteCondHandle::key
const std::string & key() const
Definition: WriteCondHandle.h:40
CaloBCIDLumiCondAlg::m_coeffsKey
SG::ReadCondHandleKey< CaloBCIDCoeffs > m_coeffsKey
Property: Coefficients object (conditions input).
Definition: CaloBCIDLumiCondAlg.h:58
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloBCIDLumiCondAlg.h
Conditions algorithm to create CaloBCIDLumi.
lumiFormat.lumi
lumi
Definition: lumiFormat.py:106
SG::WriteCondHandle::isValid
bool isValid() const
Definition: WriteCondHandle.h:248
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
SG::WriteCondHandle::addDependency
void addDependency(const EventIDRange &range)
Definition: WriteCondHandle.h:275