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

#include <ViewCreatorCentredOnClusterROITool.h>

Inheritance diagram for ViewCreatorCentredOnClusterROITool:
Collaboration diagram for ViewCreatorCentredOnClusterROITool:

Public Member Functions

 ViewCreatorCentredOnClusterROITool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~ViewCreatorCentredOnClusterROITool ()=default
 
virtual StatusCode initialize () override
 
virtual StatusCode attachROILinks (TrigCompositeUtils::DecisionContainer &decisions, const EventContext &ctx) const override
 Tool interface method. More...
 

Public Attributes

SG::WriteHandleKey< TrigRoiDescriptorCollectionm_roisWriteHandleKey
 
Gaudi::Property< std::string > m_clusterLinkName
 
Gaudi::Property< bool > m_allowMultipleClusters
 
Gaudi::Property< double > m_roiEtaWidth
 
Gaudi::Property< double > m_roiPhiWidth
 
Gaudi::Property< double > m_roiZedWidth
 

Detailed Description

Creates a new ROI centred on one or more xAOD::TrigEMCluster contained nominally within a L1 ROI.

By default the highest ET cluster is used (should there be multiple). Alternatively with AllowMultipleClusters, a superROI may be formed if multiple clusters are reconstructed inside the (L1) ROI.

Stores this new ROI in the output container, and links it to the Decision Object

The new EventView spawned by the parent EventViewCreatorAlgorithm of this tool will process in this new ROI.

Definition at line 26 of file ViewCreatorCentredOnClusterROITool.h.

Constructor & Destructor Documentation

◆ ViewCreatorCentredOnClusterROITool()

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

Definition at line 12 of file ViewCreatorCentredOnClusterROITool.cxx.

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

◆ ~ViewCreatorCentredOnClusterROITool()

virtual ViewCreatorCentredOnClusterROITool::~ViewCreatorCentredOnClusterROITool ( )
virtualdefault

Member Function Documentation

◆ attachROILinks()

StatusCode ViewCreatorCentredOnClusterROITool::attachROILinks ( TrigCompositeUtils::DecisionContainer decisions,
const EventContext &  ctx 
) const
overridevirtual

Tool interface method.

should really use some z position from somewhere, since we might be using this function after some tracking, so to always assume that z=0 is maybe not ideal

Definition at line 23 of file ViewCreatorCentredOnClusterROITool.cxx.

23  {
25 
26  for ( Decision* outputDecision : decisions ) {
27  const std::vector<LinkInfo<xAOD::TrigEMClusterContainer>> myClusters = findLinks<xAOD::TrigEMClusterContainer>(outputDecision, m_clusterLinkName, TrigDefs::lastFeatureOfType);
28 
29  if (myClusters.size() == 0) {
30  ATH_MSG_ERROR("Found zero xAOD::TrigEMClusters '" << m_clusterLinkName << "' for Decision object index " << outputDecision->index());
31  return StatusCode::FAILURE;
32  }
33 
34  ATH_MSG_DEBUG("This merged Decision Object has " << myClusters.size() << " TrigEMClusters in its history from a previous Step."
35  << " AllowMultipleClusters=" << (m_allowMultipleClusters ? "TRUE" : "FALSE"));
36 
37  // In NOT m_allowMultipleClusters mode, we centre on the highest et
38  size_t singleClusterIndex = 0;
39  if (!m_allowMultipleClusters && myClusters.size() > 1) {
40  float maxEt = 0;
41  for (const LinkInfo<xAOD::TrigEMClusterContainer>& myCluster : myClusters) {
42  ATH_CHECK(myCluster.isValid());
43  ATH_MSG_VERBOSE("- The TrigEMCluster at index " << myCluster.link.index() << " has Et " << (*myCluster.link)->et() << " MeV.");
44  if ((*myCluster.link)->et() > maxEt) {
45  maxEt = (*myCluster.link)->et();
46  singleClusterIndex = myCluster.link.index();
47  }
48  }
49  ATH_MSG_DEBUG("The TrigEMCluster at index " << singleClusterIndex << " will be used as the centre of the FTF ROI, as this one has the highest ET (" << maxEt << " MeV).");
50  }
51 
52  // In m_allowMultipleClusters mode, they are all collected into a SuperRoI
54  TrigRoiDescriptor* superRoI = new TrigRoiDescriptor();
55  superRoI->setComposite(true);
56  superRoI->manageConstituents(true);
57  roisWriteHandle->push_back(superRoI);
58  }
59 
60  for (const LinkInfo<xAOD::TrigEMClusterContainer>& myCluster : myClusters) {
61  ATH_CHECK(myCluster.isValid());
62  if (!m_allowMultipleClusters && myCluster.link.index() != singleClusterIndex) {
63  continue;
64  }
65 
66  const xAOD::TrigEMCluster* c = *(myCluster.link);
67 
68  const double reta = c->eta();
69  const double retap = reta + m_roiEtaWidth;
70  const double retam = reta - m_roiEtaWidth;
71  const double rphi = c->phi();
72  const double rphip = rphi + m_roiPhiWidth;
73  const double rphim = rphi - m_roiPhiWidth;
74 
75  ATH_MSG_DEBUG( " New ROI for xAOD::TrigEMCluster ET="<< c->et()
76  << " eta="<< c->eta() << " +- " << m_roiEtaWidth
77  << " phi="<< c->phi() << " +- " << m_roiPhiWidth );
78 
79  if ( m_roiZedWidth==0 ) {
80  std::unique_ptr<TrigRoiDescriptor> roi = std::make_unique<TrigRoiDescriptor>(reta, retam, retap, rphi, rphim, rphip);
82  roisWriteHandle->back()->push_back( roi.release() ); // Note: manageConstituents=true, superRoI will handle deletion of roi
83  } else {
84  roisWriteHandle->push_back( roi.release() ); // Note: roi now owned by roisWriteHandle
85  }
86  }
87  else {
90  const double rzed = 0;
91  const double rzedm = rzed - m_roiZedWidth;
92  const double rzedp = rzed + m_roiZedWidth;
93 
94  std::unique_ptr<TrigRoiDescriptor> roi = std::make_unique<TrigRoiDescriptor>(reta, retam, retap, rphi, rphim, rphip, rzed, rzedm, rzedp );
96  roisWriteHandle->back()->push_back( roi.release() ); // Note: manageConstituents=true, superRoI will handle deletion of roi
97  } else {
98  roisWriteHandle->push_back( roi.release() ); // Note: roi now owned by roisWriteHandle
99  }
100  }
101 
102 
103  }
104 
105  // Link this ROI into the navigation. It will be used to spawn the Event View for this Decision Object.
106  const ElementLink<TrigRoiDescriptorCollection> roiEL = ElementLink<TrigRoiDescriptorCollection>(*roisWriteHandle, roisWriteHandle->size() - 1, ctx);
107  outputDecision->setObjectLink(roiString(), roiEL);
108 
109  }
110 
111  return StatusCode::SUCCESS;
112 }

◆ initialize()

StatusCode ViewCreatorCentredOnClusterROITool::initialize ( )
overridevirtual

Definition at line 17 of file ViewCreatorCentredOnClusterROITool.cxx.

17  {
19  return StatusCode::SUCCESS;
20 }

Member Data Documentation

◆ m_allowMultipleClusters

Gaudi::Property< bool > ViewCreatorCentredOnClusterROITool::m_allowMultipleClusters
Initial value:
{this, "AllowMultipleClusters", true,
"If true, the tool will not take the highest energy cluster. Instead it will add them all to a superRoI"}

Definition at line 46 of file ViewCreatorCentredOnClusterROITool.h.

◆ m_clusterLinkName

Gaudi::Property< std::string > ViewCreatorCentredOnClusterROITool::m_clusterLinkName
Initial value:
{this,"ClusterLinkName","feature",
"Name of linked Cluster object to centre the new ROI on. Normally the 'feature' from the previous Step."}

Definition at line 43 of file ViewCreatorCentredOnClusterROITool.h.

◆ m_roiEtaWidth

Gaudi::Property< double > ViewCreatorCentredOnClusterROITool::m_roiEtaWidth
Initial value:
{this,"RoIEtaWidth",0.05,
"Extent of the ROI in eta from its centre"}

Definition at line 49 of file ViewCreatorCentredOnClusterROITool.h.

◆ m_roiPhiWidth

Gaudi::Property< double > ViewCreatorCentredOnClusterROITool::m_roiPhiWidth
Initial value:
{this,"RoIPhiWidth",0.05,
"Extent of the ROI in phi from its centre"}

Definition at line 52 of file ViewCreatorCentredOnClusterROITool.h.

◆ m_roisWriteHandleKey

SG::WriteHandleKey< TrigRoiDescriptorCollection > ViewCreatorCentredOnClusterROITool::m_roisWriteHandleKey
Initial value:
{this,"RoisWriteHandleKey","",
"Name of the ROI collection produced by this tool."}

Definition at line 40 of file ViewCreatorCentredOnClusterROITool.h.

◆ m_roiZedWidth

Gaudi::Property< double > ViewCreatorCentredOnClusterROITool::m_roiZedWidth
Initial value:
{this,"RoIZedWidth",0.0,
"Extent of the ROI in zed from its centre"}

Definition at line 55 of file ViewCreatorCentredOnClusterROITool.h.


The documentation for this class was generated from the following files:
ViewCreatorCentredOnClusterROITool::m_roisWriteHandleKey
SG::WriteHandleKey< TrigRoiDescriptorCollection > m_roisWriteHandleKey
Definition: ViewCreatorCentredOnClusterROITool.h:40
xAOD::et
et
Definition: TrigEMCluster_v1.cxx:25
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
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
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ViewCreatorCentredOnClusterROITool::m_clusterLinkName
Gaudi::Property< std::string > m_clusterLinkName
Definition: ViewCreatorCentredOnClusterROITool.h:43
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
TrigCompositeUtils::createAndStoreNoAux
SG::WriteHandle< CONT > createAndStoreNoAux(const SG::WriteHandleKey< CONT > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Creates and right away records the Container CONT with the key.
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
ViewCreatorCentredOnClusterROITool::m_roiZedWidth
Gaudi::Property< double > m_roiZedWidth
Definition: ViewCreatorCentredOnClusterROITool.h:55
DataVector::back
const T * back() const
Access the last element in the collection as an rvalue.
xAOD::decisions
decisions
Definition: TrigComposite_v1.cxx:81
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::WriteHandle< TrigRoiDescriptorCollection >
TrigCompositeUtils::LinkInfo
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...
Definition: LinkInfo.h:28
ViewCreatorCentredOnClusterROITool::m_roiPhiWidth
Gaudi::Property< double > m_roiPhiWidth
Definition: ViewCreatorCentredOnClusterROITool.h:52
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RoiDescriptor::setComposite
void setComposite(bool b=true)
Definition: RoiDescriptor.h:138
ViewCreatorCentredOnClusterROITool::m_roiEtaWidth
Gaudi::Property< double > m_roiEtaWidth
Definition: ViewCreatorCentredOnClusterROITool.h:49
TrigCompositeUtils::roiString
const std::string & roiString()
Definition: TrigCompositeUtilsRoot.cxx:878
TrigRoiDescriptor
Athena::TPCnvVers::Current TrigRoiDescriptor
Definition: TrigSteeringEventTPCnv.cxx:68
RoiDescriptor::manageConstituents
bool manageConstituents() const
always manage constituents ???
Definition: RoiDescriptor.h:141
ViewCreatorCentredOnClusterROITool::m_allowMultipleClusters
Gaudi::Property< bool > m_allowMultipleClusters
Definition: ViewCreatorCentredOnClusterROITool.h:46
xAOD::TrigEMCluster_v1
Description of a trigger EM cluster.
Definition: TrigEMCluster_v1.h:28
python.compressB64.c
def c
Definition: compressB64.py:93
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.