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

#include <TestRoICreatorTool.h>

Inheritance diagram for ActsTrk::TestRoICreatorTool:
Collaboration diagram for ActsTrk::TestRoICreatorTool:

Public Member Functions

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

Private Attributes

Gaudi::Property< std::vector< double > > m_eta_center_rois {this, "EtaCenters", {}, "Center of the RoI - eta coordinate"}
Gaudi::Property< std::vector< double > > m_phi_center_rois {this, "PhiCenters", {}, "Center of the RoI - phi coordinate"}
Gaudi::Property< std::vector< double > > m_z_center_rois {this, "ZCenters", {}, "Center of the RoI - z coordinate"}
Gaudi::Property< std::vector< double > > m_half_eta_width_rois {this, "HalfEtaWidths", {}, "Half width of the RoI - eta coordinate"}
Gaudi::Property< std::vector< double > > m_half_phi_width_rois {this, "HalfPhiWidths", {}, "Half width of the RoI - phi coordinate"}
Gaudi::Property< std::vector< double > > m_half_z_width_rois {this, "HalfZWidths", {}, "Half width of the RoI - z coordinate"}

Detailed Description

Definition at line 13 of file TestRoICreatorTool.h.

Constructor & Destructor Documentation

◆ TestRoICreatorTool()

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

Definition at line 9 of file TestRoICreatorTool.cxx.

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

◆ ~TestRoICreatorTool()

virtual ActsTrk::TestRoICreatorTool::~TestRoICreatorTool ( )
virtualdefault

Member Function Documentation

◆ defineRegionsOfInterest()

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

Definition at line 48 of file TestRoICreatorTool.cxx.

50{
51 bool isComposite = m_eta_center_rois.size() > 1;
52 // Add a composite RoI
53 if (isComposite) {
54 collectionRoI.push_back( new TrigRoiDescriptor() );
55 collectionRoI.back()->setComposite(true);
56 }
57
58 bool useZconstraint = m_z_center_rois.size() != 0;
59
60 for (std::size_t i(0); i<m_eta_center_rois.size(); ++i) {
61 double eta = m_eta_center_rois.value().at(i);
62 double phi = m_phi_center_rois.value().at(i);
63 double eta_half_width = m_half_eta_width_rois.value().at(i);
64 double phi_half_width = m_half_phi_width_rois.value().at(i);
65
66 TrigRoiDescriptor *toAdd = nullptr;
67 if (not useZconstraint) {
68 toAdd = new TrigRoiDescriptor(eta, eta - eta_half_width, eta + eta_half_width,
69 phi, phi - phi_half_width, phi + phi_half_width);
70 } else {
71 double z = m_z_center_rois.value().at(i);
72 double z_half_width = m_half_z_width_rois.value().at(i);
73 toAdd = new TrigRoiDescriptor(eta, eta - eta_half_width, eta + eta_half_width,
74 phi, phi - phi_half_width, phi + phi_half_width,
75 z, z - z_half_width, z + z_half_width);
76 }
77
78 // if composite roi, add the consituent to it (already in the collection)
79 // if not, the collection is empty and we have to add this one to it
80 if (isComposite) {
81 collectionRoI.back()->push_back( std::move(toAdd) );
82 } else {
83 collectionRoI.push_back( std::move(toAdd) );
84 }
85 }
86
87 ATH_MSG_DEBUG("RoI collection size: " << collectionRoI.size());
88 ATH_MSG_DEBUG("Created a test RoI");
89 if (collectionRoI.back()->composite()) {
90 ATH_MSG_DEBUG("This is a composite RoI made from " << collectionRoI.back()->size() << " constituents");
91 }
92
93 return StatusCode::SUCCESS;
94}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_DEBUG(x)
Athena::TPCnvVers::Current TrigRoiDescriptor
#define z
Gaudi::Property< std::vector< double > > m_phi_center_rois
Gaudi::Property< std::vector< double > > m_half_z_width_rois
Gaudi::Property< std::vector< double > > m_half_eta_width_rois
Gaudi::Property< std::vector< double > > m_half_phi_width_rois
Gaudi::Property< std::vector< double > > m_z_center_rois
Gaudi::Property< std::vector< double > > m_eta_center_rois
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.
size_type size() const noexcept
Returns the number of elements in the collection.
void push_back(const IRoiDescriptor *roi)
add a RoiDescriptor
void setComposite(bool b=true)
virtual unsigned size() const override final
number of constituents
virtual bool composite() const override final
SuperRoI compatability methods.

◆ initialize()

StatusCode ActsTrk::TestRoICreatorTool::initialize ( )
overridevirtual

Definition at line 15 of file TestRoICreatorTool.cxx.

16{
17 ATH_MSG_DEBUG("Inizializing " << name() << " ..." );
18
19 // Check consistency
20 // We need at least one entry
21 if (m_eta_center_rois.size() == 0) {
22 ATH_MSG_ERROR("No RoI definition defined, cannot create the test RoI.");
23 return StatusCode::FAILURE;
24 }
25
26 // eta and phi vectors MUST have the same size. z vectors can have 0 size OR the same size as the eta/phi vectors
27 if (m_eta_center_rois.size() != m_phi_center_rois.size() or
30 ATH_MSG_ERROR("Inconsistent definitions for eta/phi vectors. Check their definitions!");
31 return StatusCode::FAILURE;
32 }
33
34 // Now check the z vectors
35 if (m_z_center_rois.size() != m_half_z_width_rois.size()) {
36 ATH_MSG_ERROR("Inconsistent definitions for the z vectors. Check their definitions!");
37 return StatusCode::FAILURE;
38 }
39
40 if (m_z_center_rois.size() != 0 and m_z_center_rois.size() != m_eta_center_rois.size()) {
41 ATH_MSG_ERROR("Z vector is not empty but it is not consistent with the phi/eta counterpart. Check their definitions!");
42 return StatusCode::FAILURE;
43 }
44
45 return StatusCode::SUCCESS;
46}
#define ATH_MSG_ERROR(x)

Member Data Documentation

◆ m_eta_center_rois

Gaudi::Property< std::vector<double> > ActsTrk::TestRoICreatorTool::m_eta_center_rois {this, "EtaCenters", {}, "Center of the RoI - eta coordinate"}
private

Definition at line 29 of file TestRoICreatorTool.h.

29{this, "EtaCenters", {}, "Center of the RoI - eta coordinate"};

◆ m_half_eta_width_rois

Gaudi::Property< std::vector<double> > ActsTrk::TestRoICreatorTool::m_half_eta_width_rois {this, "HalfEtaWidths", {}, "Half width of the RoI - eta coordinate"}
private

Definition at line 33 of file TestRoICreatorTool.h.

33{this, "HalfEtaWidths", {}, "Half width of the RoI - eta coordinate"};

◆ m_half_phi_width_rois

Gaudi::Property< std::vector<double> > ActsTrk::TestRoICreatorTool::m_half_phi_width_rois {this, "HalfPhiWidths", {}, "Half width of the RoI - phi coordinate"}
private

Definition at line 34 of file TestRoICreatorTool.h.

34{this, "HalfPhiWidths", {}, "Half width of the RoI - phi coordinate"};

◆ m_half_z_width_rois

Gaudi::Property< std::vector<double> > ActsTrk::TestRoICreatorTool::m_half_z_width_rois {this, "HalfZWidths", {}, "Half width of the RoI - z coordinate"}
private

Definition at line 35 of file TestRoICreatorTool.h.

35{this, "HalfZWidths", {}, "Half width of the RoI - z coordinate"};

◆ m_phi_center_rois

Gaudi::Property< std::vector<double> > ActsTrk::TestRoICreatorTool::m_phi_center_rois {this, "PhiCenters", {}, "Center of the RoI - phi coordinate"}
private

Definition at line 30 of file TestRoICreatorTool.h.

30{this, "PhiCenters", {}, "Center of the RoI - phi coordinate"};

◆ m_z_center_rois

Gaudi::Property< std::vector<double> > ActsTrk::TestRoICreatorTool::m_z_center_rois {this, "ZCenters", {}, "Center of the RoI - z coordinate"}
private

Definition at line 31 of file TestRoICreatorTool.h.

31{this, "ZCenters", {}, "Center of the RoI - z coordinate"};

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