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

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

◆ initialize()

StatusCode InDet::FileRoISeedTool::initialize ( )
overridevirtual

Definition at line 36 of file FileRoISeedTool.cxx.

37 {
39 
41 
43  ATH_MSG_ERROR( "RoI File DOES NOT Exist!");
44  return StatusCode::FAILURE;
45  }
46 
47  return sc;
48 }

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

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

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


The documentation for this class was generated from the following files:
python.utils.AtlRunQueryDQUtils.runnum
runnum
Definition: AtlRunQueryDQUtils.py:214
checkFileSG.line
line
Definition: checkFileSG.py:75
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
initialize
void initialize()
Definition: run_EoverP.cxx:894
makeTOC.inFile
string inFile
Definition: makeTOC.py:5
InDet::FileRoISeedTool::m_z0Window
FloatProperty m_z0Window
Definition: FileRoISeedTool.h:65
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
InDet::IZWindowRoISeedTool::ZWindow::zWindow
float zWindow[2]
Definition: IZWindowRoISeedTool.h:49
InDet::FileRoISeedTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: FileRoISeedTool.h:67
InDet::FileRoISeedTool::m_filename
StringProperty m_filename
Definition: FileRoISeedTool.h:64
python.dummyaccess.exists
def exists(filename)
Definition: dummyaccess.py:9
InDet::IZWindowRoISeedTool::ZWindow::zReference
float zReference
Definition: IZWindowRoISeedTool.h:51