ATLAS Offline Software
CaloAlignCondAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "CaloAlignCondAlg.h"
6 
10 
11 #include <memory>
12 
14 {
15  ATH_MSG_DEBUG("initialize " << name());
16 
20 
21  return StatusCode::SUCCESS;
22 }
23 
25 {
26  const EventContext& ctx = Gaudi::Hive::currentContext();
27  // ____________ Construct Write Cond Handle and check its validity ____________
29  if (writeCaloMgrHandle.isValid()) {
30  ATH_MSG_DEBUG("Found valid write handle");
31  return StatusCode::SUCCESS;
32  }
33 
34  // ____________ Get Read Cond Objects ____________
35  // 1. GeoAlignmentStore
36  const GeoAlignmentStore* geoAlign{nullptr};
37  if(!m_readKeyGeoAlign.empty()) {
39  ATH_CHECK(readHandleGeoAlign.isValid());
40  ATH_MSG_DEBUG("Retrieved GeoAlignmentStore object form the Condition Store");
41  writeCaloMgrHandle.addDependency(readHandleGeoAlign);
42  geoAlign = *readHandleGeoAlign;
43  }
44 
45  // 2. CaloCellPositionShift
46  const CaloRec::CaloCellPositionShift* cellPosShift{nullptr};
49  ATH_CHECK(readHandleCellPosShift.isValid());
50  ATH_MSG_DEBUG("Retrieved CaloRec::CaloCellPositionShift object form the Condition Store");
51  writeCaloMgrHandle.addDependency(readHandleCellPosShift);
52  cellPosShift = *readHandleCellPosShift;
53  }
54 
56  writeCaloMgrHandle.addDependency(EventIDRange(IOVInfiniteRange::infiniteRunLB()));
57  }
58 
59  // ____________ Build new CaloDetDescrManager _________________
60  std::unique_ptr<CaloDetDescrManager> caloMgr = buildCaloDetDescr(serviceLocator()
62  , geoAlign
63  , cellPosShift);
64 
65  ATH_CHECK(writeCaloMgrHandle.record(std::move(caloMgr)));
66  ATH_MSG_INFO("recorded new CaloDetDescr Manager condition object with key " << writeCaloMgrHandle.key()
67  << " and range " << writeCaloMgrHandle.getRange());
68 
69  return StatusCode::SUCCESS;
70 }
GeoAlignmentStore
Ensure that the extensions for the Vector3D are properly loaded.
Definition: GeoAlignmentStore.h:24
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloAlignCondAlg.h
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
CaloAlignCondAlg::m_readKeyCellPosShift
SG::ReadCondHandleKey< CaloRec::CaloCellPositionShift > m_readKeyCellPosShift
Definition: CaloAlignCondAlg.h:38
CaloAlignCondAlg::m_writeCaloMgrKey
SG::WriteCondHandleKey< CaloDetDescrManager > m_writeCaloMgrKey
Definition: CaloAlignCondAlg.h:43
CaloRec::CaloCellPositionShift
Container for a cell-level rescaling-factors, typically obtained by Z->ee intercalibration.
Definition: CaloCellPositionShift.h:31
CaloAlignCondAlg::m_readKeyGeoAlign
SG::ReadCondHandleKey< GeoAlignmentStore > m_readKeyGeoAlign
Definition: CaloAlignCondAlg.h:33
CaloAlignCondAlg::execute
virtual StatusCode execute() override
Definition: CaloAlignCondAlg.cxx:24
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
IOVInfiniteRange::infiniteRunLB
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
Definition: IOVInfiniteRange.h:39
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IOVInfiniteRange.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CaloDetDescrBuilder.h
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
CaloAlignCondAlg::initialize
virtual StatusCode initialize() override
Definition: CaloAlignCondAlg.cxx:13
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
buildCaloDetDescr
std::unique_ptr< CaloDetDescrManager > buildCaloDetDescr(ISvcLocator *svcLocator, IMessageSvc *msgSvc, const GeoAlignmentStore *geoAlignStore, const CaloRec::CaloCellPositionShift *cellPosShift)
Definition: CaloDetDescrBuilder.cxx:46