ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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 }

◆ 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
28  m_eta_center_rois.size() != m_half_eta_width_rois.size() or
29  m_eta_center_rois.size() != m_half_phi_width_rois.size()) {
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 }

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.

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

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

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

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

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


The documentation for this class was generated from the following files:
ActsTrk::TestRoICreatorTool::m_phi_center_rois
Gaudi::Property< std::vector< double > > m_phi_center_rois
Definition: TestRoICreatorTool.h:30
test_pyathena.eta
eta
Definition: test_pyathena.py:10
RoiDescriptor::composite
virtual bool composite() const override final
SuperRoI compatability methods.
Definition: RoiDescriptor.h:137
RoiDescriptor::size
virtual unsigned size() const override final
number of constituents
Definition: RoiDescriptor.h:145
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
ActsTrk::TestRoICreatorTool::m_z_center_rois
Gaudi::Property< std::vector< double > > m_z_center_rois
Definition: TestRoICreatorTool.h:31
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
RoiDescriptor::push_back
void push_back(const IRoiDescriptor *roi)
add a RoiDescriptor
Definition: RoiDescriptor.h:157
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
DataVector::back
const T * back() const
Access the last element in the collection as an rvalue.
DeMoUpdate.toAdd
bool toAdd
Definition: DeMoUpdate.py:1304
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ActsTrk::TestRoICreatorTool::m_eta_center_rois
Gaudi::Property< std::vector< double > > m_eta_center_rois
Definition: TestRoICreatorTool.h:29
ActsTrk::TestRoICreatorTool::m_half_eta_width_rois
Gaudi::Property< std::vector< double > > m_half_eta_width_rois
Definition: TestRoICreatorTool.h:33
ActsTrk::TestRoICreatorTool::m_half_phi_width_rois
Gaudi::Property< std::vector< double > > m_half_phi_width_rois
Definition: TestRoICreatorTool.h:34
ActsTrk::TestRoICreatorTool::m_half_z_width_rois
Gaudi::Property< std::vector< double > > m_half_z_width_rois
Definition: TestRoICreatorTool.h:35
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RoiDescriptor::setComposite
void setComposite(bool b=true)
Definition: RoiDescriptor.h:138
TrigRoiDescriptor
Athena::TPCnvVers::Current TrigRoiDescriptor
Definition: TrigSteeringEventTPCnv.cxx:68
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.