ATLAS Offline Software
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 
19 ISF::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 
32 {
33 }
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 
71 bool ISF::CylinderVolumeTruthStrategy::appliesToRegion(unsigned short geoID) const
72 {
73  return std::find( m_regionListProperty.begin(),
74  m_regionListProperty.end(),
75  geoID ) != m_regionListProperty.end();
76 }
ISF::CylinderVolumeTruthStrategy::m_ri
double m_ri
inner cylinder radius
Definition: CylinderVolumeTruthStrategy.h:51
ISF::CylinderVolumeTruthStrategy::initialize
virtual StatusCode initialize() override
Definition: CylinderVolumeTruthStrategy.cxx:36
AtlasDetDescr::fNumAtlasRegions
@ fNumAtlasRegions
Definition: AtlasRegion.h:39
ISF::ITruthIncident::position
virtual const HepMC::FourVector & position() const =0
Return HepMC position of the truth vertex.
beamspotman.r
def r
Definition: beamspotman.py:676
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
ISF::CylinderVolumeTruthStrategy::finalize
virtual StatusCode finalize() override
Definition: CylinderVolumeTruthStrategy.cxx:51
ISF::CylinderVolumeTruthStrategy::m_ro
double m_ro
outer cylinder radius
Definition: CylinderVolumeTruthStrategy.h:52
ISF::CylinderVolumeTruthStrategy::~CylinderVolumeTruthStrategy
~CylinderVolumeTruthStrategy()
Destructor.
Definition: CylinderVolumeTruthStrategy.cxx:31
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
SimpleVector.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ITruthIncident.h
ISF::CylinderVolumeTruthStrategy::CylinderVolumeTruthStrategy
CylinderVolumeTruthStrategy(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
Definition: CylinderVolumeTruthStrategy.cxx:19
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ISF::ITruthIncident
Definition: ITruthIncident.h:45
ISF::CylinderVolumeTruthStrategy::m_regionListProperty
IntegerArrayProperty m_regionListProperty
Definition: CylinderVolumeTruthStrategy.h:54
ISF::CylinderVolumeTruthStrategy::pass
virtual bool pass(ITruthIncident &incident) const override
true if the ITruthStrategy implementation applies to the given ITruthIncident
Definition: CylinderVolumeTruthStrategy.cxx:59
ISF::CylinderVolumeTruthStrategy::appliesToRegion
virtual bool appliesToRegion(unsigned short geoID) const override
Definition: CylinderVolumeTruthStrategy.cxx:71
CylinderVolumeTruthStrategy.h