ATLAS Offline Software
FastCaloSimGeometryHelper.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 #include "CaloDetDescr/CaloDetDescrElement.h"
8 
11 
12 using namespace std;
13 
15 FastCaloSimGeometryHelper::FastCaloSimGeometryHelper(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p), CaloGeometry()
16 {
17  declareInterface<IFastCaloSimGeometryHelper>(this);
18 }
19 
21 = default;
22 
23 // Athena algtool's Hooks
25 {
26  ATH_MSG_INFO("Initializing FastCaloSimGeometryHelper");
27  m_caloMgr = detStore()->tryConstRetrieve<CaloDetDescrManager>(caloMgrStaticKey);
28  if(!m_caloMgr) {
29  std::unique_ptr<CaloDetDescrManager> caloMgrPtr = buildCaloDetDescrNoAlign(serviceLocator()
31  ATH_CHECK(detStore()->record(std::move(caloMgrPtr), caloMgrStaticKey));
32  ATH_CHECK(detStore()->retrieve(m_caloMgr, caloMgrStaticKey));
33  }
35  return StatusCode::SUCCESS;
36 }
37 
39 {
40  ATH_MSG_INFO("Finalizing FastCaloSimGeometryHelper");
41 
42  return StatusCode::SUCCESS;
43 }
44 
46 {
47  ATH_MSG_INFO("Start LoadGeometryFromCaloDDM()");
48 
49  int jentry=0;
50  for(CaloDetDescrManager::calo_element_const_iterator calo_iter=m_caloMgr->element_begin();calo_iter<m_caloMgr->element_end();++calo_iter)
51  {
52  const CaloDetDescrElement* pcell=*calo_iter;
53  addcell(pcell);
54 
55  if(jentry%10000==0)
56  {
57  ATH_MSG_DEBUG("Load calo cell "<<jentry<<" : "<<pcell->getSampling()<<", "<<pcell->identify());
58  }
59  ++jentry;
60  }
61 
62  bool ok=PostProcessGeometry();
63 
64  ATH_MSG_INFO("Done LoadGeometryFromCaloDDM()");
65 
66  return ok;
67 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
CaloGeometry::PostProcessGeometry
virtual bool PostProcessGeometry()
Definition: CaloGeometry.cxx:627
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
FastCaloSimGeometryHelper::LoadGeometryFromCaloDDM
bool LoadGeometryFromCaloDDM()
Definition: FastCaloSimGeometryHelper.cxx:45
CaloGeometry::addcell
virtual void addcell(const CaloDetDescrElement *cell)
Definition: CaloGeometry.cxx:67
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
CaloGeometry
Definition: CaloGeometry.h:27
FastCaloSimGeometryHelper::finalize
virtual StatusCode finalize() override final
Definition: FastCaloSimGeometryHelper.cxx:38
CaloDetDescrElement::identify
Identifier identify() const override final
cell identifier
Definition: CaloDetDescrElement.cxx:64
beamspotman.n
n
Definition: beamspotman.py:731
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
FastCaloSimGeometryHelper.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
FastCaloSimGeometryHelper::~FastCaloSimGeometryHelper
virtual ~FastCaloSimGeometryHelper()
Destructor.
CaloDetDescrBuilder.h
CaloDetDescrManager_Base::element_begin
calo_element_const_iterator element_begin() const
first element
Definition: CaloDetDescrManager.cxx:111
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
FastCaloSimGeometryHelper::FastCaloSimGeometryHelper
FastCaloSimGeometryHelper(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
Definition: FastCaloSimGeometryHelper.cxx:15
AthAlgTool
Definition: AthAlgTool.h:26
buildCaloDetDescrNoAlign
std::unique_ptr< CaloDetDescrManager > buildCaloDetDescrNoAlign(ISvcLocator *svcLocator, IMessageSvc *msgSvc)
Definition: CaloDetDescrBuilder.cxx:791
FastCaloSimGeometryHelper::m_caloMgr
const CaloDetDescrManager * m_caloMgr
DetDescr mgr for access to the calo helper.
Definition: FastCaloSimGeometryHelper.h:30
CaloConstIteratorAdaptor
Tranform iterator over pointers to iterator over const pointers.
Definition: CaloConstIteratorAdaptor.h:47
FastCaloSimGeometryHelper::initialize
virtual StatusCode initialize() override final
Definition: FastCaloSimGeometryHelper.cxx:24