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 ()
 Destructor.
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
virtual bool appliesToRegion (unsigned short geoID) const override

Private Attributes

double m_ri
 inner cylinder radius
double m_ro
 outer cylinder radius
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}
#define ATH_MSG_VERBOSE(x)

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

◆ 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}
int r
Definition globals.cxx:22

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: