ATLAS Offline Software
Loading...
Searching...
No Matches
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
7
8// ISF includes
10
11// HepMC includes
13
15ISF::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
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
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
49{
50 return std::find( m_regionListProperty.begin(),
52 geoID ) != m_regionListProperty.end();
53}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
Gaudi::Property< double > m_ri
inner cylinder radius
virtual StatusCode initialize() override final
virtual bool appliesToRegion(unsigned short geoID) const override final
Gaudi::Property< double > m_ro
outer cylinder radius
CylinderVolumeTruthStrategy(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
virtual bool pass(ITruthIncident &incident) const override final
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