ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::CaloBasedRoICreatorTool Class Reference

#include <CaloBasedRoICreatorTool.h>

Inheritance diagram for ActsTrk::CaloBasedRoICreatorTool:
Collaboration diagram for ActsTrk::CaloBasedRoICreatorTool:

Public Member Functions

 CaloBasedRoICreatorTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~CaloBasedRoICreatorTool ()=default
virtual StatusCode initialize () override
virtual StatusCode defineRegionsOfInterest (const EventContext &ctx, TrigRoiDescriptorCollection &collectionRoI) const override

Private Attributes

SG::ReadHandleKey< ROIPhiRZContainerm_caloClusterROIKey
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey
Gaudi::Property< double > m_deltaEta {this, "DeltaEtaCaloRoI", .1}
Gaudi::Property< double > m_deltaPhi {this, "DeltaPhiCaloRoI", .25}
Gaudi::Property< double > m_deltaZ {this, "DeltaZCaloRoI", 300.}

Detailed Description

Definition at line 16 of file CaloBasedRoICreatorTool.h.

Constructor & Destructor Documentation

◆ CaloBasedRoICreatorTool()

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

Definition at line 9 of file CaloBasedRoICreatorTool.cxx.

12 : base_class(type, name, parent)
13{}

◆ ~CaloBasedRoICreatorTool()

virtual ActsTrk::CaloBasedRoICreatorTool::~CaloBasedRoICreatorTool ( )
virtualdefault

Member Function Documentation

◆ defineRegionsOfInterest()

StatusCode ActsTrk::CaloBasedRoICreatorTool::defineRegionsOfInterest ( const EventContext & ctx,
TrigRoiDescriptorCollection & collectionRoI ) const
overridevirtual

Definition at line 25 of file CaloBasedRoICreatorTool.cxx.

27{
28 // Define RoI as not a FS RoI
29 collectionRoI.push_back( new TrigRoiDescriptor(false) );
30 // Define RoI as composite RoI
31 collectionRoI.back()->setComposite(true);
32
33 // Retrieve Beam Spot data
34 SG::ReadCondHandle< InDet::BeamSpotData > beamSpotHandle{ m_beamSpotKey, ctx };
35 ATH_CHECK( beamSpotHandle.isValid() );
36 const InDet::BeamSpotData* beamSpotData = beamSpotHandle.cptr();
37
38 // Retrieve the Calo info
39 ATH_MSG_DEBUG("Retrieving Calo info from key " << m_caloClusterROIKey.key());
40 SG::ReadHandle< ROIPhiRZContainer > caloClustersHandle = SG::makeHandle( m_caloClusterROIKey, ctx );
41 ATH_CHECK( caloClustersHandle.isValid() );
42 const ROIPhiRZContainer* caloClusters = caloClustersHandle.cptr();
43 ATH_MSG_DEBUG(" \\__ Retrieved " << caloClusters->size() << " elements");
44
45 // Add component RoIs
46 collectionRoI.back()->reserve(caloClusters->size());
47 double beamZ = beamSpotData->beamVtx().position().z();
48 for (const ROIPhiRZ& calo_roi : *caloClusters) {
49 double phi = calo_roi.phi();
50 // skip duplicates < -pi and >pi
51 if (std::abs(phi) >= M_PI && phi != -M_PI)
52 continue;
53
54 double eta = calo_roi.eta();
55 double z = beamZ;
56 double roiPhiMin = phi - m_deltaPhi;
57 double roiPhiMax = phi + m_deltaPhi;
58 double roiEtaMin = eta - m_deltaEta;
59 double roiEtaMax = eta + m_deltaEta;
60 double roiZMin = beamZ - m_deltaZ;
61 double roiZMax = beamZ + m_deltaZ;
62
63 collectionRoI.back()->push_back( new TrigRoiDescriptor(eta, roiEtaMin, roiEtaMax,
64 phi, roiPhiMin ,roiPhiMax,
65 z, roiZMin, roiZMax ) );
66 }
67
68 ATH_MSG_DEBUG("Created composite RoI from Calo with " << collectionRoI.back()->size() << " RoIs");
69 return StatusCode::SUCCESS;
70}
#define M_PI
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Athena::TPCnvVers::Current TrigRoiDescriptor
#define z
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
SG::ReadHandleKey< ROIPhiRZContainer > m_caloClusterROIKey
const T * back() const
Access the last element in the collection as an rvalue.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const Trk::RecVertex & beamVtx() const noexcept
void push_back(const IRoiDescriptor *roi)
add a RoiDescriptor
void reserve(size_t s)
reserve elements in vector
void setComposite(bool b=true)
virtual unsigned size() const override final
number of constituents
const_pointer_type cptr()
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
const Amg::Vector3D & position() const
return position of vertex
Definition Vertex.cxx:63
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ initialize()

StatusCode ActsTrk::CaloBasedRoICreatorTool::initialize ( )
overridevirtual

Definition at line 15 of file CaloBasedRoICreatorTool.cxx.

16{
17 ATH_MSG_DEBUG("Inizializing " << name() << " ..." );
18
19 ATH_CHECK(m_caloClusterROIKey.initialize());
20 ATH_CHECK(m_beamSpotKey.initialize());
21
22 return StatusCode::SUCCESS;
23}

Member Data Documentation

◆ m_beamSpotKey

SG::ReadCondHandleKey< InDet::BeamSpotData > ActsTrk::CaloBasedRoICreatorTool::m_beamSpotKey
private
Initial value:
{this, "BeamSpotKey", "BeamSpotData",
"SG key for beam spot"}

Definition at line 37 of file CaloBasedRoICreatorTool.h.

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

◆ m_caloClusterROIKey

SG::ReadHandleKey< ROIPhiRZContainer > ActsTrk::CaloBasedRoICreatorTool::m_caloClusterROIKey
private
Initial value:
{this, "CaloClusterRoIContainer", "",
"Name of the calo cluster ROIs in Phi,R,Z parameterization"}

Definition at line 33 of file CaloBasedRoICreatorTool.h.

34 {this, "CaloClusterRoIContainer", "",
35 "Name of the calo cluster ROIs in Phi,R,Z parameterization"};

◆ m_deltaEta

Gaudi::Property< double > ActsTrk::CaloBasedRoICreatorTool::m_deltaEta {this, "DeltaEtaCaloRoI", .1}
private

Definition at line 41 of file CaloBasedRoICreatorTool.h.

42{this, "DeltaEtaCaloRoI", .1};

◆ m_deltaPhi

Gaudi::Property< double > ActsTrk::CaloBasedRoICreatorTool::m_deltaPhi {this, "DeltaPhiCaloRoI", .25}
private

Definition at line 43 of file CaloBasedRoICreatorTool.h.

44{this, "DeltaPhiCaloRoI", .25};

◆ m_deltaZ

Gaudi::Property< double > ActsTrk::CaloBasedRoICreatorTool::m_deltaZ {this, "DeltaZCaloRoI", 300.}
private

Definition at line 45 of file CaloBasedRoICreatorTool.h.

46{this, "DeltaZCaloRoI", 300.};

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