ATLAS Offline Software
Loading...
Searching...
No Matches
ISF::CylinderVolumeTruthStrategy Class Referencefinal

This ITruthStrategy implementation provides checks on the given ITruthIncident, whether it lies on a defined surface or not. More...

#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.
 ~CylinderVolumeTruthStrategy ()=default
 Destructor.
virtual StatusCode initialize () override final
virtual bool pass (ITruthIncident &incident) const override final
 true if the ITruthStrategy implementation applies to the given ITruthIncident
virtual bool appliesToRegion (unsigned short geoID) const override final

Private Attributes

Gaudi::Property< double > m_ri {this, "InnerRadius", 0.0}
 inner cylinder radius
Gaudi::Property< double > m_ro {this, "OuterRadius", 1148.0}
 outer cylinder radius
IntegerArrayProperty m_regionListProperty {this, "Regions", {}}

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 29 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 15 of file CylinderVolumeTruthStrategy.cxx.

15 :
16 base_class(t,n,p)
17{
18}

◆ ~CylinderVolumeTruthStrategy()

ISF::CylinderVolumeTruthStrategy::~CylinderVolumeTruthStrategy ( )
default

Destructor.

Member Function Documentation

◆ appliesToRegion()

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

Definition at line 48 of file CylinderVolumeTruthStrategy.cxx.

49{
50 return std::find( m_regionListProperty.begin(),
52 geoID ) != m_regionListProperty.end();
53}

◆ initialize()

StatusCode ISF::CylinderVolumeTruthStrategy::initialize ( )
finaloverridevirtual

Definition at line 21 of file CylinderVolumeTruthStrategy.cxx.

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}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)

◆ pass()

bool ISF::CylinderVolumeTruthStrategy::pass ( ITruthIncident & incident) const
finaloverridevirtual

true if the ITruthStrategy implementation applies to the given ITruthIncident

Definition at line 36 of file CylinderVolumeTruthStrategy.cxx.

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}
Gaudi::Property< double > m_ri
inner cylinder radius
Gaudi::Property< double > m_ro
outer cylinder radius
int r
Definition globals.cxx:22

Member Data Documentation

◆ m_regionListProperty

IntegerArrayProperty ISF::CylinderVolumeTruthStrategy::m_regionListProperty {this, "Regions", {}}
private

Definition at line 49 of file CylinderVolumeTruthStrategy.h.

49{this, "Regions", {}};

◆ m_ri

Gaudi::Property<double> ISF::CylinderVolumeTruthStrategy::m_ri {this, "InnerRadius", 0.0}
private

inner cylinder radius

Definition at line 46 of file CylinderVolumeTruthStrategy.h.

46{this, "InnerRadius", 0.0};

◆ m_ro

Gaudi::Property<double> ISF::CylinderVolumeTruthStrategy::m_ro {this, "OuterRadius", 1148.0}
private

outer cylinder radius

Definition at line 47 of file CylinderVolumeTruthStrategy.h.

47{this, "OuterRadius", 1148.0};

The documentation for this class was generated from the following files: