ATLAS Offline Software
CaloSuperCellAlignCondAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
9 
10 #include <memory>
11 
13 {
14  ATH_MSG_DEBUG("initialize " << name());
15 
16  ATH_CHECK(m_scidTool.retrieve());
19 
20  return StatusCode::SUCCESS;
21 }
22 
24 {
25  const EventContext& ctx = Gaudi::Hive::currentContext();
26  // ____________ Construct Write Cond Handle and check its validity ____________
28  if (writeCaloSuperCellMgrHandle.isValid()) {
29  ATH_MSG_DEBUG("Found valid write handle");
30  return StatusCode::SUCCESS;
31  }
32 
33  // ____________ Get Read Cond Object ____________
35  ATH_CHECK(readCaloMgrHandle.isValid());
36  ATH_MSG_DEBUG("Retrieved CaloDetDescrManager object form the Condition Store");
37  writeCaloSuperCellMgrHandle.addDependency(readCaloMgrHandle);
38 
39  // ____________ Build new CaloSuperCellDetDescrManager _________________
40  std::unique_ptr<CaloSuperCellDetDescrManager> mgr = std::make_unique<CaloSuperCellDetDescrManager>();
41 
42  const CaloIdManager* caloId_mgr{nullptr};
43  ATH_CHECK(detStore()->retrieve(caloId_mgr, "CaloIdManager"));
44 
45  mgr->set_helper(caloId_mgr->getCaloCell_SuperCell_ID());
46  mgr->set_helper(caloId_mgr);
47  mgr->initialize();
48 
49  createDescriptors(mgr.get());
50  createElements(mgr.get());
51 
52  // ____________ Apply Alignment Corrections ____________________________
53  ATH_CHECK(updateElements(mgr.get(),*readCaloMgrHandle,m_scidTool.get()));
54  updateDescriptors(mgr.get(),*readCaloMgrHandle,m_scidTool.get());
55 
56  ATH_CHECK(writeCaloSuperCellMgrHandle.record(std::move(mgr)));
57  ATH_MSG_INFO("recorded new CaloSuperCellDetDescr Manager condition object with key " << writeCaloSuperCellMgrHandle.key()
58  << " and range " << writeCaloSuperCellMgrHandle.getRange());
59 
60  return StatusCode::SUCCESS;
61 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
CaloSuperCellUtils.h
This is a collection of helper functions for building Calo Super Cell detector manager,...
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloSuperCellAlignCondAlg::initialize
virtual StatusCode initialize() override
Definition: CaloSuperCellAlignCondAlg.cxx:12
updateDescriptors
void updateDescriptors(CaloSuperCellDetDescrManager *mgr, const CaloDetDescrManager *cellmgr, const ICaloSuperCellIDTool *scidTool)
Definition: CaloSuperCellUtils.cxx:230
createDescriptors
void createDescriptors(CaloSuperCellDetDescrManager *mgr)
Definition: CaloSuperCellUtils.cxx:155
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
createElements
void createElements(CaloSuperCellDetDescrManager *mgr)
Definition: CaloSuperCellUtils.cxx:176
updateElements
StatusCode updateElements(CaloSuperCellDetDescrManager *mgr, const CaloDetDescrManager *cellmgr, const ICaloSuperCellIDTool *scidTool)
Definition: CaloSuperCellUtils.cxx:190
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
CaloIdManager
This class initializes the Calo (LAr and Tile) offline identifiers.
Definition: CaloIdManager.h:45
CaloSuperCellAlignCondAlg::m_scidTool
ToolHandle< ICaloSuperCellIDTool > m_scidTool
Definition: CaloSuperCellAlignCondAlg.h:43
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloSuperCellAlignCondAlg.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloSuperCellAlignCondAlg::execute
virtual StatusCode execute() override
Definition: CaloSuperCellAlignCondAlg.cxx:23
CaloIdManager.h
CaloSuperCellAlignCondAlg::m_writeCaloSuperCellMgrKey
SG::WriteCondHandleKey< CaloSuperCellDetDescrManager > m_writeCaloSuperCellMgrKey
Definition: CaloSuperCellAlignCondAlg.h:38
CaloSuperCellAlignCondAlg::m_readCaloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_readCaloMgrKey
Definition: CaloSuperCellAlignCondAlg.h:33
SG::WriteCondHandle
Definition: WriteCondHandle.h:26