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

#include <FileRoISeedTool.h>

Inheritance diagram for InDet::FileRoISeedTool:
Collaboration diagram for InDet::FileRoISeedTool:

Public Member Functions

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

Protected Member Functions

Disallow default instantiation, copy, assignment
 FileRoISeedTool ()=delete
 FileRoISeedTool (const FileRoISeedTool &)=delete
FileRoISeedTooloperator= (const FileRoISeedTool &)=delete

Protected Attributes

Tool configuration properties
StringProperty m_filename {this, "InputFileName", "", "Input file MUST be specified with LowPtRoIFile job option"}
FloatProperty m_z0Window {this, "TrackZ0Window", 30.0, "Size of RoI along z-axis"}
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey {this, "EventInfoKey", "EventInfo", "xAOD EventInfo object"}

Detailed Description

Definition at line 27 of file FileRoISeedTool.h.

Constructor & Destructor Documentation

◆ FileRoISeedTool() [1/3]

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

Definition at line 26 of file FileRoISeedTool.cxx.

28 : base_class(t,n,p)
29{
30}

◆ ~FileRoISeedTool()

virtual InDet::FileRoISeedTool::~FileRoISeedTool ( )
virtualdefault

◆ FileRoISeedTool() [2/3]

InDet::FileRoISeedTool::FileRoISeedTool ( )
protecteddelete

◆ FileRoISeedTool() [3/3]

InDet::FileRoISeedTool::FileRoISeedTool ( const FileRoISeedTool & )
protecteddelete

Member Function Documentation

◆ getRoIs()

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

Compute RoI.

Compute region(s) of interest for the event.

Returns
vector of regions of interest.

Definition at line 53 of file FileRoISeedTool.cxx.

54{
55
56 // prepare output
57 std::vector<InDet::IZWindowRoISeedTool::ZWindow> listRoIs;
58 listRoIs.clear();
59
60 unsigned long long evtN = 0;
61 int runN = 0;
62
63 SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfoKey, ctx);
64 if ( eventInfo.isValid() ){
65 evtN = eventInfo->eventNumber();
66 runN = eventInfo->runNumber();
67 }
68
69 std::string line;
70 std::ifstream inFile(m_filename.value());
71 if (inFile.is_open()){
72
73 while (std::getline(inFile, line)){
74
75 std::istringstream iss(line);
76
77 int runnum;
78 unsigned long long eventnum;
79 float zref;
80
81 while( iss >> runnum >> eventnum >> zref){
82 //no need to go past the right line
83 if(runnum == runN && eventnum == evtN) break;
84 }
85
86 if(runnum == runN && eventnum == evtN){ //No need to fill if there isn't an ROI
87 InDet::IZWindowRoISeedTool::ZWindow readinref;
88 readinref.zReference = zref;
89 readinref.zWindow[0] = zref -m_z0Window;
90 readinref.zWindow[1] = zref + m_z0Window;
91 listRoIs.push_back(readinref);
92 }
93
94 }
95 }
96
97 inFile.close();
98
99 return listRoIs;
100
101}
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
StringProperty m_filename
str inFile
Definition makeTOC.py:5

◆ initialize()

StatusCode InDet::FileRoISeedTool::initialize ( )
overridevirtual

Definition at line 36 of file FileRoISeedTool.cxx.

37{
38 StatusCode sc = AlgTool::initialize();
39
40 ATH_CHECK( m_eventInfoKey.initialize() );
41
42 if (not std::filesystem::exists(std::filesystem::path(m_filename.value()))) {
43 ATH_MSG_ERROR( "RoI File DOES NOT Exist!");
44 return StatusCode::FAILURE;
45 }
46
47 return sc;
48}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
static Double_t sc
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ operator=()

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

Member Data Documentation

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> InDet::FileRoISeedTool::m_eventInfoKey {this, "EventInfoKey", "EventInfo", "xAOD EventInfo object"}
protected

Definition at line 67 of file FileRoISeedTool.h.

67{this, "EventInfoKey", "EventInfo", "xAOD EventInfo object"};

◆ m_filename

StringProperty InDet::FileRoISeedTool::m_filename {this, "InputFileName", "", "Input file MUST be specified with LowPtRoIFile job option"}
protected

Definition at line 64 of file FileRoISeedTool.h.

64{this, "InputFileName", "", "Input file MUST be specified with LowPtRoIFile job option"};

◆ m_z0Window

FloatProperty InDet::FileRoISeedTool::m_z0Window {this, "TrackZ0Window", 30.0, "Size of RoI along z-axis"}
protected

Definition at line 65 of file FileRoISeedTool.h.

65{this, "TrackZ0Window", 30.0, "Size of RoI along z-axis"};

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