ATLAS Offline Software
Loading...
Searching...
No Matches
RoiUpdaterTool Class Reference

Tool to create a new RoiDescriptor from an existing input5 RoiDescriptor. More...

#include <RoiUpdaterTool.h>

Inheritance diagram for RoiUpdaterTool:
Collaboration diagram for RoiUpdaterTool:

Public Member Functions

 RoiUpdaterTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~RoiUpdaterTool ()=default
virtual StatusCode initialize () override
std::unique_ptr< TrigRoiDescriptorexecute (const EventContext &ctx) const override
std::unique_ptr< TrigRoiDescriptorexecute (const IRoiDescriptor *iroi, const EventContext &ctx) const override

Public Attributes

bool m_update
 whether to update the RoiDescritor or not - determiuned from whether any of update parameters are set
Gaudi::Property< double > m_etaWidth { this, "EtaWidth", -999, "FS Roi eta half width" }
 don't want these parameters used if not set
Gaudi::Property< double > m_phiWidth { this, "PhiWidth", -999, "FS Roi phi half width" }
Gaudi::Property< double > m_zedWidth { this, "ZedWidth", -999, "FS Roi zed half width" }
Gaudi::Property< bool > m_useBeamspot { this, "useBeamSpot", false, "use beamspot for zed width" }
Gaudi::Property< double > m_nsigma { this, "NSigma", 3, "width (in simga) for the beamspot Roi width" }
 default settings - should be retuned with data
Gaudi::Property< double > m_fence { this, "Fance", 10, "fence width for the beamspot Roi width" }
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamspotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
 do we need an mm unit here ?

Detailed Description

Tool to create a new RoiDescriptor from an existing input5 RoiDescriptor.

Definition at line 21 of file RoiUpdaterTool.h.

Constructor & Destructor Documentation

◆ RoiUpdaterTool()

RoiUpdaterTool::RoiUpdaterTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 11 of file RoiUpdaterTool.cxx.

12 : base_class(type, name, parent), m_update(false)
13{}
bool m_update
whether to update the RoiDescritor or not - determiuned from whether any of update parameters are set

◆ ~RoiUpdaterTool()

virtual RoiUpdaterTool::~RoiUpdaterTool ( )
virtualdefault

Member Function Documentation

◆ execute() [1/2]

std::unique_ptr< TrigRoiDescriptor > RoiUpdaterTool::execute ( const EventContext & ctx) const
override

create initial dummy FS Roi here - used to define the new Roi and is then discarded

Definition at line 58 of file RoiUpdaterTool.cxx.

58 {
60 RoiDescriptor troi( RoiDescriptor::FULLSCAN );
61 return execute( &troi, ctx );
62}
static constexpr bool FULLSCAN
convenient
std::unique_ptr< TrigRoiDescriptor > execute(const EventContext &ctx) const override

◆ execute() [2/2]

std::unique_ptr< TrigRoiDescriptor > RoiUpdaterTool::execute ( const IRoiDescriptor * iroi,
const EventContext & ctx ) const
override

if we don't want to update, why are we even including trhe RoiUIpdater ??? will return a unique_ptr - if that causes issues down the line, so be it

should not update a composite Roi - or do we want the constituents updated ??? or what ??? Return a copy ? Who will own this stuff ?? why are you calling the updater on a composite Roi in any case ? will return a unique_ptr - if that causes issues down the line, so be it

NB: the correct mapping of phi to the range -M_PIF < phi < M_PIF is done in the RoiDescriptor constuctor so we don't bother here

do not prevent the beamspot from increasing the size of the Roi

limit to old range - no point going well outside the interaction region

don't use an actual fullscan Roi, since the parameters have been changed so may not actually include all detector elements - the FS flag, prevents the RegionSelector from actually testing the detector element containment, so could create a "fullscan" Roi with only a small number of detector elements. If you want genuine FS behaviour for the RS, use an FS Roi. If you want a restricted Roi for non RS use, even if it is FS for a specific subdetector, use a restricted Roi

Definition at line 65 of file RoiUpdaterTool.cxx.

65 {
66
67 ATH_MSG_DEBUG( "execute()" );
68
71 if ( !m_update ) return std::make_unique<TrigRoiDescriptor>( *iroi );
72
77 if ( iroi->composite() ) {
78 ATH_MSG_WARNING( "Will not update composite Roi parameters: " << *iroi );
79 return std::make_unique<TrigRoiDescriptor>( *iroi );
80 }
81
82 double eta = iroi->eta();
83 double etaMinus = iroi->etaMinus();
84 double etaPlus = iroi->etaPlus();
85
86 double phi = iroi->phi();
87 double phiMinus = iroi->phiMinus();
88 double phiPlus = iroi->phiPlus();
89
90 double zed = iroi->zed();
91 double zedMinus = iroi->zedMinus();
92 double zedPlus = iroi->zedPlus();
93
94 if ( m_etaWidth!=-999 ) {
95 etaMinus = eta - m_etaWidth;
96 etaPlus = eta + m_etaWidth;
97 }
98
99 if ( m_phiWidth!=-999 ) {
102 phiMinus = phi - m_phiWidth;
103 phiPlus = phi + m_phiWidth;
104 }
105
106 if ( m_zedWidth!=-999 ) {
107 zedMinus = zed - m_zedWidth;
108 zedPlus = zed + m_zedWidth;
109 }
110
112 if ( m_useBeamspot ) zrange( m_nsigma, m_fence, zed, zedMinus, zedPlus, m_beamspotKey, ctx );
113
115 if ( zedMinus<-RoiDescriptor::zedWidthDefault() ) zedMinus = -RoiDescriptor::zedWidthDefault();
117
124 return std::make_unique<TrigRoiDescriptor>( eta, etaMinus, etaPlus, phi, phiMinus, phiPlus, zed, zedMinus, zedPlus );
125
126}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
void zrange(double nsigma, double fence, double &zed, double &zedMinus, double &zedPlus, const SG::ReadCondHandleKey< InDet::BeamSpotData > &bs, const EventContext &ctx)
virtual double eta() const =0
virtual double phiPlus() const =0
extreme phi values
virtual double zedPlus() const =0
the zed and eta values at the most forward and most rear ends of the RoI
virtual double phiMinus() const =0
virtual double phi() const =0
Methods to retrieve data members.
virtual double zedMinus() const =0
virtual double zed() const =0
virtual double etaMinus() const =0
virtual double etaPlus() const =0
virtual bool composite() const =0
Super RoI access methods.
static double zedWidthDefault()
Gaudi::Property< double > m_fence
Gaudi::Property< double > m_zedWidth
Gaudi::Property< double > m_etaWidth
don't want these parameters used if not set
Gaudi::Property< double > m_nsigma
default settings - should be retuned with data
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamspotKey
do we need an mm unit here ?
Gaudi::Property< double > m_phiWidth
Gaudi::Property< bool > m_useBeamspot

◆ initialize()

StatusCode RoiUpdaterTool::initialize ( )
overridevirtual

Definition at line 17 of file RoiUpdaterTool.cxx.

17 {
18
19 ATH_MSG_DEBUG("initialize()");
20
21 if ( m_etaWidth!=-999 || m_phiWidth!=-999 || m_zedWidth!=-999 ) m_update = true;
22
23 if ( m_useBeamspot ) {
24 m_update = true;
25 ATH_CHECK( m_beamspotKey.initialize( m_useBeamspot ) );
26 }
27
28 return StatusCode::SUCCESS;
29}
#define ATH_CHECK
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_beamspotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> RoiUpdaterTool::m_beamspotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }

do we need an mm unit here ?

Definition at line 51 of file RoiUpdaterTool.h.

51{ this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };

◆ m_etaWidth

Gaudi::Property<double> RoiUpdaterTool::m_etaWidth { this, "EtaWidth", -999, "FS Roi eta half width" }

don't want these parameters used if not set

Definition at line 42 of file RoiUpdaterTool.h.

42{ this, "EtaWidth", -999, "FS Roi eta half width" };

◆ m_fence

Gaudi::Property<double> RoiUpdaterTool::m_fence { this, "Fance", 10, "fence width for the beamspot Roi width" }

Definition at line 49 of file RoiUpdaterTool.h.

49{ this, "Fance", 10, "fence width for the beamspot Roi width" };

◆ m_nsigma

Gaudi::Property<double> RoiUpdaterTool::m_nsigma { this, "NSigma", 3, "width (in simga) for the beamspot Roi width" }

default settings - should be retuned with data

Definition at line 48 of file RoiUpdaterTool.h.

48{ this, "NSigma", 3, "width (in simga) for the beamspot Roi width" };

◆ m_phiWidth

Gaudi::Property<double> RoiUpdaterTool::m_phiWidth { this, "PhiWidth", -999, "FS Roi phi half width" }

Definition at line 43 of file RoiUpdaterTool.h.

43{ this, "PhiWidth", -999, "FS Roi phi half width" };

◆ m_update

bool RoiUpdaterTool::m_update

whether to update the RoiDescritor or not - determiuned from whether any of update parameters are set

Definition at line 37 of file RoiUpdaterTool.h.

◆ m_useBeamspot

Gaudi::Property<bool> RoiUpdaterTool::m_useBeamspot { this, "useBeamSpot", false, "use beamspot for zed width" }

Definition at line 46 of file RoiUpdaterTool.h.

46{ this, "useBeamSpot", false, "use beamspot for zed width" };

◆ m_zedWidth

Gaudi::Property<double> RoiUpdaterTool::m_zedWidth { this, "ZedWidth", -999, "FS Roi zed half width" }

Definition at line 44 of file RoiUpdaterTool.h.

44{ this, "ZedWidth", -999, "FS Roi zed half width" };

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