ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
ISF
ISF_HepMC
ISF_HepMC_Tools
src
CylinderVolumeTruthStrategy.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// class header include
6
#include "
CylinderVolumeTruthStrategy.h
"
7
8
// ISF includes
9
#include "
ISF_Event/ITruthIncident.h
"
10
11
// HepMC includes
12
#include "
AtlasHepMC/SimpleVector.h
"
13
15
ISF::CylinderVolumeTruthStrategy::CylinderVolumeTruthStrategy
(
const
std::string& t,
const
std::string& n,
const
IInterface* p) :
16
base_class(t,n,p)
17
{
18
}
19
20
// Athena algtool's Hooks
21
StatusCode
ISF::CylinderVolumeTruthStrategy::initialize
()
22
{
23
ATH_MSG_VERBOSE
(
"Initializing ..."
);
24
25
for
(
auto
region :
m_regionListProperty
.value()) {
26
if
(region < AtlasDetDescr::fFirstAtlasRegion || region >=
AtlasDetDescr::fNumAtlasRegions
) {
27
ATH_MSG_ERROR
(
"Unknown Region ("
<< region <<
") specified. Please check your configuration."
);
28
return
StatusCode::FAILURE;
29
}
30
}
31
32
ATH_MSG_VERBOSE
(
"Initialize successful"
);
33
return
StatusCode::SUCCESS;
34
}
35
36
bool
ISF::CylinderVolumeTruthStrategy::pass
(
ITruthIncident
& ti)
const
37
{
38
// the current truth incident radius
39
auto
t_pos=ti.
position
();
40
double
r
= std::sqrt(t_pos.x()*t_pos.x()+t_pos.y()*t_pos.y()+t_pos.z()*t_pos.z());
41
42
// is the current radius on the surface?
43
bool
onSurf = (
r
>
m_ri
) && (
r
<
m_ro
);
44
45
return
onSurf;
46
}
47
48
bool
ISF::CylinderVolumeTruthStrategy::appliesToRegion
(
unsigned
short
geoID)
const
49
{
50
return
std::find(
m_regionListProperty
.begin(),
51
m_regionListProperty
.end(),
52
geoID ) !=
m_regionListProperty
.end();
53
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
CylinderVolumeTruthStrategy.h
ITruthIncident.h
SimpleVector.h
ISF::CylinderVolumeTruthStrategy::m_ri
Gaudi::Property< double > m_ri
inner cylinder radius
Definition
CylinderVolumeTruthStrategy.h:46
ISF::CylinderVolumeTruthStrategy::initialize
virtual StatusCode initialize() override final
Definition
CylinderVolumeTruthStrategy.cxx:21
ISF::CylinderVolumeTruthStrategy::appliesToRegion
virtual bool appliesToRegion(unsigned short geoID) const override final
Definition
CylinderVolumeTruthStrategy.cxx:48
ISF::CylinderVolumeTruthStrategy::m_regionListProperty
IntegerArrayProperty m_regionListProperty
Definition
CylinderVolumeTruthStrategy.h:49
ISF::CylinderVolumeTruthStrategy::m_ro
Gaudi::Property< double > m_ro
outer cylinder radius
Definition
CylinderVolumeTruthStrategy.h:47
ISF::CylinderVolumeTruthStrategy::CylinderVolumeTruthStrategy
CylinderVolumeTruthStrategy(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
Definition
CylinderVolumeTruthStrategy.cxx:15
ISF::CylinderVolumeTruthStrategy::pass
virtual bool pass(ITruthIncident &incident) const override final
true if the ITruthStrategy implementation applies to the given ITruthIncident
Definition
CylinderVolumeTruthStrategy.cxx:36
ISF::ITruthIncident
ISF interface class for TruthIncidents.
Definition
ITruthIncident.h:45
ISF::ITruthIncident::position
virtual const HepMC::FourVector & position() const =0
Return HepMC position of the truth vertex.
r
int r
Definition
globals.cxx:22
AtlasDetDescr::fNumAtlasRegions
@ fNumAtlasRegions
Definition
AtlasRegion.h:33
Generated on
for ATLAS Offline Software by
1.17.0