ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
RoiUpdaterTool Class Reference

#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 More...
 
Gaudi::Property< double > m_etaWidth { this, "EtaWidth", -999, "FS Roi eta half width" }
 don't want these parameters used if not set More...
 
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 More...
 
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 ? More...
 

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

◆ ~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  {
61  return execute( &troi, ctx );
62 }

◆ 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();
116  if ( zedPlus> RoiDescriptor::zedWidthDefault() ) zedPlus = RoiDescriptor::zedWidthDefault();
117 
124  return std::make_unique<TrigRoiDescriptor>( eta, etaMinus, etaPlus, phi, phiMinus, phiPlus, zed, zedMinus, zedPlus );
125 
126 }

◆ 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;
26  }
27 
28  return StatusCode::SUCCESS;
29 }

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.

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

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

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

◆ m_phiWidth

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

Definition at line 43 of file RoiUpdaterTool.h.

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

◆ m_zedWidth

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

Definition at line 44 of file RoiUpdaterTool.h.


The documentation for this class was generated from the following files:
IRoiDescriptor::phi
virtual double phi() const =0
Methods to retrieve data members.
RoiUpdaterTool::m_useBeamspot
Gaudi::Property< bool > m_useBeamspot
Definition: RoiUpdaterTool.h:46
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
RoiUpdaterTool::m_update
bool m_update
whether to update the RoiDescritor or not - determiuned from whether any of update parameters are set
Definition: RoiUpdaterTool.h:37
IRoiDescriptor::etaMinus
virtual double etaMinus() const =0
IRoiDescriptor::etaPlus
virtual double etaPlus() const =0
RoiUpdaterTool::m_phiWidth
Gaudi::Property< double > m_phiWidth
Definition: RoiUpdaterTool.h:43
IRoiDescriptor::eta
virtual double eta() const =0
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
RoiUpdaterTool::m_etaWidth
Gaudi::Property< double > m_etaWidth
don't want these parameters used if not set
Definition: RoiUpdaterTool.h:42
RoiUpdaterTool::m_nsigma
Gaudi::Property< double > m_nsigma
default settings - should be retuned with data
Definition: RoiUpdaterTool.h:48
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IRoiDescriptor::phiMinus
virtual double phiMinus() const =0
RoiDescriptor
Describes the Region of Ineterest geometry It has basically 9 parameters.
Definition: RoiDescriptor.h:40
IRoiDescriptor::phiPlus
virtual double phiPlus() const =0
extreme phi values
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
RoiUpdaterTool::m_zedWidth
Gaudi::Property< double > m_zedWidth
Definition: RoiUpdaterTool.h:44
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
RoiUpdaterTool::m_beamspotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamspotKey
do we need an mm unit here ?
Definition: RoiUpdaterTool.h:51
zrange
void zrange(double nsigma, double fence, double &zed, double &zedMinus, double &zedPlus, const SG::ReadCondHandleKey< InDet::BeamSpotData > &bs, const EventContext &ctx)
Definition: RoiUpdaterTool.cxx:33
RoiUpdaterTool::m_fence
Gaudi::Property< double > m_fence
Definition: RoiUpdaterTool.h:49
IRoiDescriptor::zedPlus
virtual double zedPlus() const =0
the zed and eta values at the most forward and most rear ends of the RoI
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RoiDescriptor::zedWidthDefault
static double zedWidthDefault()
Definition: RoiDescriptor.h:183
RoiDescriptor::FULLSCAN
static constexpr bool FULLSCAN
convenient
Definition: RoiDescriptor.h:45
IRoiDescriptor::zed
virtual double zed() const =0
IRoiDescriptor::zedMinus
virtual double zedMinus() const =0
RoiUpdaterTool::execute
std::unique_ptr< TrigRoiDescriptor > execute(const EventContext &ctx) const override
Definition: RoiUpdaterTool.cxx:58
IRoiDescriptor::composite
virtual bool composite() const =0
Super RoI access methods.