ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
ISF::CylinderVolumeTruthStrategy Class Referencefinal

#include <CylinderVolumeTruthStrategy.h>

Inheritance diagram for ISF::CylinderVolumeTruthStrategy:
Collaboration diagram for ISF::CylinderVolumeTruthStrategy:

Public Member Functions

 CylinderVolumeTruthStrategy (const std::string &t, const std::string &n, const IInterface *p)
 Constructor with parameters. More...
 
 ~CylinderVolumeTruthStrategy ()
 Destructor. More...
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual bool pass (ITruthIncident &incident) const override
 true if the ITruthStrategy implementation applies to the given ITruthIncident More...
 
virtual bool appliesToRegion (unsigned short geoID) const override
 

Private Attributes

double m_ri
 inner cylinder radius More...
 
double m_ro
 outer cylinder radius More...
 
IntegerArrayProperty m_regionListProperty
 

Detailed Description

This ITruthStrategy implementation provides checks on the given ITruthIncident, whether it lies on a defined surface or not. The surfaces currently supported are of cylindrical shape only.

Author
Elmar.Ritsch -at- cern.ch

Definition at line 33 of file CylinderVolumeTruthStrategy.h.

Constructor & Destructor Documentation

◆ CylinderVolumeTruthStrategy()

ISF::CylinderVolumeTruthStrategy::CylinderVolumeTruthStrategy ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Constructor with parameters.

Constructor.

Definition at line 19 of file CylinderVolumeTruthStrategy.cxx.

19  :
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 }

◆ ~CylinderVolumeTruthStrategy()

ISF::CylinderVolumeTruthStrategy::~CylinderVolumeTruthStrategy ( )

Destructor.

Definition at line 31 of file CylinderVolumeTruthStrategy.cxx.

32 {
33 }

Member Function Documentation

◆ appliesToRegion()

bool ISF::CylinderVolumeTruthStrategy::appliesToRegion ( unsigned short  geoID) const
overridevirtual

Definition at line 71 of file CylinderVolumeTruthStrategy.cxx.

72 {
73  return std::find( m_regionListProperty.begin(),
75  geoID ) != m_regionListProperty.end();
76 }

◆ finalize()

StatusCode ISF::CylinderVolumeTruthStrategy::finalize ( )
overridevirtual

Definition at line 51 of file CylinderVolumeTruthStrategy.cxx.

52 {
53  ATH_MSG_VERBOSE("Finalizing ...");
54 
55  ATH_MSG_VERBOSE("Finalize successful");
56  return StatusCode::SUCCESS;
57 }

◆ initialize()

StatusCode ISF::CylinderVolumeTruthStrategy::initialize ( )
overridevirtual

Definition at line 36 of file CylinderVolumeTruthStrategy.cxx.

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 }

◆ pass()

bool ISF::CylinderVolumeTruthStrategy::pass ( ITruthIncident incident) const
overridevirtual

true if the ITruthStrategy implementation applies to the given ITruthIncident

Definition at line 59 of file CylinderVolumeTruthStrategy.cxx.

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 }

Member Data Documentation

◆ m_regionListProperty

IntegerArrayProperty ISF::CylinderVolumeTruthStrategy::m_regionListProperty
private

Definition at line 54 of file CylinderVolumeTruthStrategy.h.

◆ m_ri

double ISF::CylinderVolumeTruthStrategy::m_ri
private

inner cylinder radius

Definition at line 51 of file CylinderVolumeTruthStrategy.h.

◆ m_ro

double ISF::CylinderVolumeTruthStrategy::m_ro
private

outer cylinder radius

Definition at line 52 of file CylinderVolumeTruthStrategy.h.


The documentation for this class was generated from the following files:
ISF::CylinderVolumeTruthStrategy::m_ri
double m_ri
inner cylinder radius
Definition: CylinderVolumeTruthStrategy.h:51
AtlasDetDescr::fNumAtlasRegions
@ fNumAtlasRegions
Definition: AtlasRegion.h:39
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::m_ro
double m_ro
outer cylinder radius
Definition: CylinderVolumeTruthStrategy.h:52
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
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
ISF::CylinderVolumeTruthStrategy::m_regionListProperty
IntegerArrayProperty m_regionListProperty
Definition: CylinderVolumeTruthStrategy.h:54