ATLAS Offline Software
Loading...
Searching...
No Matches
CylinderVolumeTruthStrategy.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6// CylinderVolumeTruthStrategy.cxx, (c) ATLAS Detector software
8
9// class header include
11
12// ISF includes
14
15// HepMC includes
17
19ISF::CylinderVolumeTruthStrategy::CylinderVolumeTruthStrategy(const std::string& t, const std::string& n, const IInterface* p) :
20 base_class(t,n,p),
21 m_ri(0.),
22 m_ro(1148.)
23{
24 // cylinder dimensions
25 declareProperty("InnerRadius" , m_ri=0. );
26 declareProperty("OuterRadius" , m_ro=1148. );
27 declareProperty("Regions" , m_regionListProperty );
28}
29
34
35// Athena algtool's Hooks
37{
38 ATH_MSG_VERBOSE("Initializing ...");
39
40 for(auto region : m_regionListProperty.value()) {
41 if(region < AtlasDetDescr::fFirstAtlasRegion || region >= AtlasDetDescr::fNumAtlasRegions) {
42 ATH_MSG_ERROR("Unknown Region (" << region << ") specified. Please check your configuration.");
43 return StatusCode::FAILURE;
44 }
45 }
46
47 ATH_MSG_VERBOSE("Initialize successful");
48 return StatusCode::SUCCESS;
49}
50
52{
53 ATH_MSG_VERBOSE("Finalizing ...");
54
55 ATH_MSG_VERBOSE("Finalize successful");
56 return StatusCode::SUCCESS;
57}
58
60{
61 // the current truth incident radius
62 auto t_pos=ti.position();
63 double r = std::sqrt(t_pos.x()*t_pos.x()+t_pos.y()*t_pos.y()+t_pos.z()*t_pos.z());
64
65 // is the current radius on the surface?
66 bool onSurf = (r>m_ri) && (r<m_ro);
67
68 return onSurf;
69}
70
72{
73 return std::find( m_regionListProperty.begin(),
75 geoID ) != m_regionListProperty.end();
76}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
virtual bool appliesToRegion(unsigned short geoID) const override
CylinderVolumeTruthStrategy(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
virtual bool pass(ITruthIncident &incident) const override
true if the ITruthStrategy implementation applies to the given ITruthIncident
ISF interface class for TruthIncidents.
virtual const HepMC::FourVector & position() const =0
Return HepMC position of the truth vertex.
int r
Definition globals.cxx:22