ATLAS Offline Software
Loading...
Searching...
No Matches
FastCaloSimGeometryHelper.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "CaloDetDescr/CaloDetDescrElement.h"
8
11
12using namespace std;
13
15FastCaloSimGeometryHelper::FastCaloSimGeometryHelper(const std::string& t, const std::string& n, const IInterface* p) : base_class(t,n,p), CaloGeometry()
16{
17}
18
20= default;
21
22// Athena algtool's Hooks
24{
25 ATH_MSG_INFO("Initializing FastCaloSimGeometryHelper");
26 m_caloMgr = detStore()->tryConstRetrieve<CaloDetDescrManager>(caloMgrStaticKey);
27 if(!m_caloMgr) {
28 std::unique_ptr<CaloDetDescrManager> caloMgrPtr = buildCaloDetDescrNoAlign(serviceLocator()
30 ATH_CHECK(detStore()->record(std::move(caloMgrPtr), caloMgrStaticKey));
31 ATH_CHECK(detStore()->retrieve(m_caloMgr, caloMgrStaticKey));
32 }
34 return StatusCode::SUCCESS;
35}
36
38{
39 ATH_MSG_INFO("Finalizing FastCaloSimGeometryHelper");
40
41 return StatusCode::SUCCESS;
42}
43
45{
46 ATH_MSG_INFO("Start LoadGeometryFromCaloDDM()");
47
48 int jentry=0;
49 for(CaloDetDescrManager::calo_element_const_iterator calo_iter=m_caloMgr->element_begin();calo_iter<m_caloMgr->element_end();++calo_iter)
50 {
51 const CaloDetDescrElement* pcell=*calo_iter;
52 addcell(pcell);
53
54 if(jentry%10000==0)
55 {
56 ATH_MSG_DEBUG("Load calo cell "<<jentry<<" : "<<pcell->getSampling()<<", "<<pcell->identify());
57 }
58 ++jentry;
59 }
60
61 bool ok=PostProcessGeometry();
62
63 ATH_MSG_INFO("Done LoadGeometryFromCaloDDM()");
64
65 return ok;
66}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
std::unique_ptr< CaloDetDescrManager > buildCaloDetDescrNoAlign(ISvcLocator *svcLocator, IMessageSvc *msgSvc)
Definition of CaloDetDescrManager.
static constexpr const char * caloMgrStaticKey
This class groups all DetDescr information related to a CaloCell.
CaloCell_ID::CaloSample getSampling() const
cell sampling
Identifier identify() const override final
cell identifier
CaloConstIteratorAdaptor< calo_element_vec::const_iterator > calo_element_const_iterator
This class provides the client interface for accessing the detector description information common to...
virtual bool PostProcessGeometry()
virtual void addcell(const CaloDetDescrElement *cell)
virtual ~FastCaloSimGeometryHelper()
Destructor.
virtual StatusCode initialize() override final
const CaloDetDescrManager * m_caloMgr
DetDescr mgr for access to the calo helper.
virtual StatusCode finalize() override final
FastCaloSimGeometryHelper(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)
STL namespace.