ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
ISF
ISF_FastCaloSim
ISF_FastCaloSimParametrization
src
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
5
#include "
FastCaloSimGeometryHelper.h
"
6
#include "CaloDetDescr/CaloDetDescrElement.h"
7
#include "
CaloDetDescr/CaloDetDescrManager.h
"
8
9
#include "
CaloDetDescrUtils/CaloDetDescrBuilder.h
"
10
#include "
AthenaKernel/getMessageSvc.h
"
11
12
using namespace
std
;
13
15
FastCaloSimGeometryHelper::FastCaloSimGeometryHelper
(
const
std::string& t,
const
std::string& n,
const
IInterface* p) : base_class(t,n,p),
CaloGeometry
()
16
{
17
}
18
19
FastCaloSimGeometryHelper::~FastCaloSimGeometryHelper
()
20
=
default
;
21
22
// Athena algtool's Hooks
23
StatusCode
FastCaloSimGeometryHelper::initialize
()
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()
29
,
Athena::getMessageSvc
());
30
ATH_CHECK
(detStore()->record(std::move(caloMgrPtr),
caloMgrStaticKey
));
31
ATH_CHECK
(detStore()->retrieve(
m_caloMgr
,
caloMgrStaticKey
));
32
}
33
LoadGeometryFromCaloDDM
();
34
return
StatusCode::SUCCESS;
35
}
36
37
StatusCode
FastCaloSimGeometryHelper::finalize
()
38
{
39
ATH_MSG_INFO
(
"Finalizing FastCaloSimGeometryHelper"
);
40
41
return
StatusCode::SUCCESS;
42
}
43
44
bool
FastCaloSimGeometryHelper::LoadGeometryFromCaloDDM
()
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
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CaloDetDescrBuilder.h
buildCaloDetDescrNoAlign
std::unique_ptr< CaloDetDescrManager > buildCaloDetDescrNoAlign(ISvcLocator *svcLocator, IMessageSvc *msgSvc)
Definition
CaloDetDescrBuilder.cxx:791
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
caloMgrStaticKey
static constexpr const char * caloMgrStaticKey
Definition
CaloDetDescrManager.h:43
FastCaloSimGeometryHelper.h
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell.
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
CaloDetDescrElement::identify
Identifier identify() const override final
cell identifier
Definition
CaloDetDescrElement.cxx:63
CaloDetDescrManager_Base::calo_element_const_iterator
CaloConstIteratorAdaptor< calo_element_vec::const_iterator > calo_element_const_iterator
Definition
CaloDetDescrManager.h:182
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition
CaloDetDescrManager.h:469
CaloGeometry::PostProcessGeometry
virtual bool PostProcessGeometry()
Definition
CaloGeometry.cxx:627
CaloGeometry::addcell
virtual void addcell(const CaloDetDescrElement *cell)
Definition
CaloGeometry.cxx:67
CaloGeometry::CaloGeometry
CaloGeometry()
Definition
CaloGeometry.cxx:41
FastCaloSimGeometryHelper::~FastCaloSimGeometryHelper
virtual ~FastCaloSimGeometryHelper()
Destructor.
FastCaloSimGeometryHelper::LoadGeometryFromCaloDDM
bool LoadGeometryFromCaloDDM()
Definition
FastCaloSimGeometryHelper.cxx:44
FastCaloSimGeometryHelper::initialize
virtual StatusCode initialize() override final
Definition
FastCaloSimGeometryHelper.cxx:23
FastCaloSimGeometryHelper::m_caloMgr
const CaloDetDescrManager * m_caloMgr
DetDescr mgr for access to the calo helper.
Definition
FastCaloSimGeometryHelper.h:31
FastCaloSimGeometryHelper::finalize
virtual StatusCode finalize() override final
Definition
FastCaloSimGeometryHelper.cxx:37
FastCaloSimGeometryHelper::FastCaloSimGeometryHelper
FastCaloSimGeometryHelper(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
Definition
FastCaloSimGeometryHelper.cxx:15
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition
getMessageSvc.cxx:20
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0