ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::TruthHSRoISeedTool Class Referencefinal

#include <TruthHSRoISeedTool.h>

Inheritance diagram for InDet::TruthHSRoISeedTool:
Collaboration diagram for InDet::TruthHSRoISeedTool:

Public Member Functions

 TruthHSRoISeedTool (const std::string &, const std::string &, const IInterface *)
virtual ~TruthHSRoISeedTool ()=default
virtual StatusCode initialize () override
virtual std::vector< ZWindow > getRoIs (const EventContext &ctx) const override
 Compute RoI.

Disallow default instantiation, copy, assignment

SG::ReadHandleKey< xAOD::TruthEventContainerm_inputTruthEventsKey {this, "InputTruthEventsCollection", "TruthEvents", "Input truth events collection."}
FloatProperty m_z0Window {this, "TrackZ0Window", 1.0, "width of z0 window"}
 TruthHSRoISeedTool ()=delete
 TruthHSRoISeedTool (const TruthHSRoISeedTool &)=delete
TruthHSRoISeedTooloperator= (const TruthHSRoISeedTool &)=delete

Detailed Description

Definition at line 24 of file TruthHSRoISeedTool.h.

Constructor & Destructor Documentation

◆ TruthHSRoISeedTool() [1/3]

InDet::TruthHSRoISeedTool::TruthHSRoISeedTool ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 21 of file TruthHSRoISeedTool.cxx.

23 : base_class(t,n,p)
24{
25}

◆ ~TruthHSRoISeedTool()

virtual InDet::TruthHSRoISeedTool::~TruthHSRoISeedTool ( )
virtualdefault

◆ TruthHSRoISeedTool() [2/3]

InDet::TruthHSRoISeedTool::TruthHSRoISeedTool ( )
protecteddelete

◆ TruthHSRoISeedTool() [3/3]

InDet::TruthHSRoISeedTool::TruthHSRoISeedTool ( const TruthHSRoISeedTool & )
protecteddelete

Member Function Documentation

◆ getRoIs()

std::vector< InDet::IZWindowRoISeedTool::ZWindow > InDet::TruthHSRoISeedTool::getRoIs ( const EventContext & ctx) const
overridevirtual

Compute RoI.

Definition at line 44 of file TruthHSRoISeedTool.cxx.

45{
46
47 // prepare output
48 std::vector<InDet::IZWindowRoISeedTool::ZWindow> listRoIs;
49 listRoIs.clear();
50
51 //retrieve truth collection
52 SG::ReadHandle<xAOD::TruthEventContainer> truthEvents(m_inputTruthEventsKey, ctx);
53 if (not truthEvents.isValid()) {
54 ATH_MSG_ERROR("Cannot retrieve xAOD truth event information. Bailing out with empty RoI list.");
55 return listRoIs;
56 }
57 ATH_MSG_DEBUG("xAOD Truth Event available!");
58
59 //get HS position
60 for (const xAOD::TruthEvent *evt : *truthEvents) {
61 const xAOD::TruthVertex *hsPos = evt->signalProcessVertex();
62 if (hsPos == nullptr) {
63 ATH_MSG_DEBUG("Invalid signal process vertex! Trying next TruthEvent.");
64 continue;
65 }
66 InDet::IZWindowRoISeedTool::ZWindow RoI;
67 RoI.zReference = hsPos->z();
68 RoI.zWindow[0] = RoI.zReference - m_z0Window;
69 RoI.zWindow[1] = RoI.zReference + m_z0Window;
70 listRoIs.push_back(RoI);
71 ATH_MSG_DEBUG("Found RoI: " << RoI.zReference << " [" << RoI.zWindow[0] << ", " << RoI.zWindow[1] << "]");
72 //use only the first one
73 break;
74 }
75
76 return listRoIs;
77
78}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
SG::ReadHandleKey< xAOD::TruthEventContainer > m_inputTruthEventsKey
float z() const
Vertex longitudinal distance along the beam line form the origin.
TruthVertex_v1 TruthVertex
Typedef to implementation.
Definition TruthVertex.h:15
TruthEvent_v1 TruthEvent
Typedef to implementation.
Definition TruthEvent.h:17

◆ initialize()

StatusCode InDet::TruthHSRoISeedTool::initialize ( )
overridevirtual

Definition at line 31 of file TruthHSRoISeedTool.cxx.

32{
33 StatusCode sc = AlgTool::initialize();
34
35 ATH_CHECK( m_inputTruthEventsKey.initialize() );
36
37 return sc;
38}
#define ATH_CHECK
Evaluate an expression and check for errors.
static Double_t sc
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ operator=()

TruthHSRoISeedTool & InDet::TruthHSRoISeedTool::operator= ( const TruthHSRoISeedTool & )
protecteddelete

Member Data Documentation

◆ m_inputTruthEventsKey

SG::ReadHandleKey<xAOD::TruthEventContainer> InDet::TruthHSRoISeedTool::m_inputTruthEventsKey {this, "InputTruthEventsCollection", "TruthEvents", "Input truth events collection."}
protected

Definition at line 56 of file TruthHSRoISeedTool.h.

56{this, "InputTruthEventsCollection", "TruthEvents", "Input truth events collection."};

◆ m_z0Window

FloatProperty InDet::TruthHSRoISeedTool::m_z0Window {this, "TrackZ0Window", 1.0, "width of z0 window"}
protected

Definition at line 57 of file TruthHSRoISeedTool.h.

57{this, "TrackZ0Window", 1.0, "width of z0 window"};

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