ATLAS Offline Software
Public Member Functions | List of all members
InDet::RandomRoISeedTool Class Referencefinal

#include <RandomRoISeedTool.h>

Inheritance diagram for InDet::RandomRoISeedTool:
Collaboration diagram for InDet::RandomRoISeedTool:

Public Member Functions

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

Disallow default instantiation, copy, assignment

FloatProperty m_z0Window {this, "TrackZ0Window", 1.0, "width of z0 window"}
 
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"}
 
ServiceHandle< IAthRNGSvcm_atRndmSvc {this, "RndmGenSvc", "AthRNGSvc", "multi-thread safe random number generator"}
 
std::string m_rndmEngineName {"SINGLE"}
 
 RandomRoISeedTool ()=delete
 
 RandomRoISeedTool (const RandomRoISeedTool &)=delete
 
RandomRoISeedTooloperator= (const RandomRoISeedTool &)=delete
 

Detailed Description

Definition at line 31 of file RandomRoISeedTool.h.

Constructor & Destructor Documentation

◆ RandomRoISeedTool() [1/3]

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

Definition at line 25 of file RandomRoISeedTool.cxx.

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

◆ ~RandomRoISeedTool()

virtual InDet::RandomRoISeedTool::~RandomRoISeedTool ( )
virtualdefault

◆ RandomRoISeedTool() [2/3]

InDet::RandomRoISeedTool::RandomRoISeedTool ( )
protecteddelete

◆ RandomRoISeedTool() [3/3]

InDet::RandomRoISeedTool::RandomRoISeedTool ( const RandomRoISeedTool )
protecteddelete

Member Function Documentation

◆ getRoIs()

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

Compute RoI.

Definition at line 48 of file RandomRoISeedTool.cxx.

49 {
50 
51  // Prepare output
52  std::vector<InDet::IZWindowRoISeedTool::ZWindow> listRoIs;
53  listRoIs.clear();
54 
55  // Retrieve beamspot information
57  if (not beamSpotHandle.isValid()) {
58  ATH_MSG_ERROR("Cannot retrieve beam spot data. Bailing out with empty RoI list.");
59  return listRoIs;
60  }
61  float bsSigZ = 0.0;
62  bsSigZ = beamSpotHandle->beamSigma(2);
63  ATH_MSG_DEBUG("Beam spot data available!");
64 
65  // Initialize random engine and find z-value of RoI
66  ATHRNG::RNGWrapper *rndmEngine = m_atRndmSvc->getEngine(this, m_rndmEngineName);
67  rndmEngine->setSeed (name(), ctx);
68  CLHEP::HepRandomEngine* engine = rndmEngine->getEngine (ctx);
69  float zVal;
70  zVal = CLHEP::RandGauss::shoot(engine, 0.0, 1.0) * bsSigZ; //This effectively samples from a beamspot with the correct beamspot sigma_z
71 
73  RoI.zReference = zVal;
74  RoI.zWindow[0] = RoI.zReference - m_z0Window;
75  RoI.zWindow[1] = RoI.zReference + m_z0Window;
76  listRoIs.push_back(RoI);
77  ATH_MSG_DEBUG("Random RoI: " << RoI.zReference << " [" << RoI.zWindow[0] << ", " << RoI.zWindow[1] << "]");
78 
79  return listRoIs;
80 
81 }

◆ initialize()

StatusCode InDet::RandomRoISeedTool::initialize ( )
overridevirtual

Definition at line 35 of file RandomRoISeedTool.cxx.

36 {
38 
40 
41  return sc;
42 }

◆ operator=()

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

Member Data Documentation

◆ m_atRndmSvc

ServiceHandle<IAthRNGSvc> InDet::RandomRoISeedTool::m_atRndmSvc {this, "RndmGenSvc", "AthRNGSvc", "multi-thread safe random number generator"}
protected

Definition at line 65 of file RandomRoISeedTool.h.

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> InDet::RandomRoISeedTool::m_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"}
protected

Definition at line 64 of file RandomRoISeedTool.h.

◆ m_rndmEngineName

std::string InDet::RandomRoISeedTool::m_rndmEngineName {"SINGLE"}
protected

Definition at line 67 of file RandomRoISeedTool.h.

◆ m_z0Window

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

Definition at line 63 of file RandomRoISeedTool.h.


The documentation for this class was generated from the following files:
ATHRNG::RNGWrapper::setSeed
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition: RNGWrapper.h:169
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
initialize
void initialize()
Definition: run_EoverP.cxx:894
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
InDet::RandomRoISeedTool::m_atRndmSvc
ServiceHandle< IAthRNGSvc > m_atRndmSvc
Definition: RandomRoISeedTool.h:65
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
InDet::RandomRoISeedTool::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: RandomRoISeedTool.h:64
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
InDet::IZWindowRoISeedTool::ZWindow::zWindow
float zWindow[2]
Definition: IZWindowRoISeedTool.h:49
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
InDet::IZWindowRoISeedTool::ZWindow::zReference
float zReference
Definition: IZWindowRoISeedTool.h:51
InDet::RandomRoISeedTool::m_z0Window
FloatProperty m_z0Window
Definition: RandomRoISeedTool.h:63
InDet::RandomRoISeedTool::m_rndmEngineName
std::string m_rndmEngineName
Definition: RandomRoISeedTool.h:67