ATLAS Offline Software
Public Member Functions | List of all members
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. More...
 

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

◆ initialize()

StatusCode InDet::TruthHSRoISeedTool::initialize ( )
overridevirtual

Definition at line 31 of file TruthHSRoISeedTool.cxx.

32 {
34 
35  ATH_CHECK( m_inputTruthEventsKey.initialize() );
36 
37  return sc;
38 }

◆ 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.

◆ m_z0Window

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

Definition at line 57 of file TruthHSRoISeedTool.h.


The documentation for this class was generated from the following files:
InDet::TruthHSRoISeedTool::m_inputTruthEventsKey
SG::ReadHandleKey< xAOD::TruthEventContainer > m_inputTruthEventsKey
Definition: TruthHSRoISeedTool.h:56
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
initialize
void initialize()
Definition: run_EoverP.cxx:894
beamspotPlotBcids.evt
evt
Definition: beamspotPlotBcids.py:505
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
InDet::TruthHSRoISeedTool::m_z0Window
FloatProperty m_z0Window
Definition: TruthHSRoISeedTool.h:57
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
InDet::IZWindowRoISeedTool::ZWindow
Definition: IZWindowRoISeedTool.h:46
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::TruthEvent_v1
Class describing a signal truth event in the MC record.
Definition: TruthEvent_v1.h:35
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:41
InDet::IZWindowRoISeedTool::ZWindow::zWindow
float zWindow[2]
Definition: IZWindowRoISeedTool.h:49
xAOD::TruthVertex_v1::z
float z() const
Vertex longitudinal distance along the beam line form the origin.
InDet::IZWindowRoISeedTool::ZWindow::zReference
float zReference
Definition: IZWindowRoISeedTool.h:51