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

#include <ViewCreatorExtraPrefetchROITool.h>

Inheritance diagram for ViewCreatorExtraPrefetchROITool:
Collaboration diagram for ViewCreatorExtraPrefetchROITool:

Public Member Functions

 ViewCreatorExtraPrefetchROITool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
virtual StatusCode attachROILinks (TrigCompositeUtils::DecisionContainer &decisions, const EventContext &eventContext) const override
 

Private Attributes

SG::WriteHandleKey< TrigRoiDescriptorCollectionm_extraRoiWHK
 
Gaudi::Property< std::string > m_extraRoiLinkName
 
Gaudi::Property< bool > m_mergeWithOriginal
 
ToolHandle< IViewCreatorROIToolm_roiCreator { this, "RoiCreator", "", "The main RoI creator tool" }
 
ToolHandle< IRoiUpdaterToolm_roiUpdater { this, "RoiUpdater", "", "RoI Updater" }
 

Detailed Description

RoI provider wrapper tool which calls another RoI provider tool first, and then uses its output RoI to create a new RoI using the RoiUpdaterTool. This new RoI is saved in a different output container and can be used to prefetch ROBs instead of the original one. This solution was invented to prefetch ROBs for the second Tau reco step already during the first Tau reco step, see ATR-26419.

Definition at line 21 of file ViewCreatorExtraPrefetchROITool.h.

Constructor & Destructor Documentation

◆ ViewCreatorExtraPrefetchROITool()

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

Definition at line 6 of file ViewCreatorExtraPrefetchROITool.cxx.

7 : base_class(type, name, parent) {}

Member Function Documentation

◆ attachROILinks()

StatusCode ViewCreatorExtraPrefetchROITool::attachROILinks ( TrigCompositeUtils::DecisionContainer decisions,
const EventContext &  eventContext 
) const
overridevirtual

Definition at line 16 of file ViewCreatorExtraPrefetchROITool.cxx.

16  {
17  using namespace TrigCompositeUtils;
18 
19  // Call the main RoI creator tool
20  ATH_CHECK(m_roiCreator->attachROILinks(decisions, eventContext));
21 
22  // Record the updated RoI container
24 
25  // Loop over all decisions and create updated RoI for each RoI linked by the main tool
26  for (Decision* decision : decisions) {
27  // Get the original RoI from the main tool
29  ATH_CHECK(roiEL.isValid());
30  const TrigRoiDescriptor* originalRoi = *roiEL;
31 
32  // Execute the updater tool
33  std::unique_ptr<TrigRoiDescriptor> updatedRoi = m_roiUpdater->execute(originalRoi, eventContext);
34 
35  // Add the updated (and merged if requested) RoI to the output container
36  if (m_mergeWithOriginal.value()) {
37  outputRois->push_back(std::make_unique<TrigRoiDescriptor>());
38  outputRois->back()->setComposite(true);
39  outputRois->back()->manageConstituents(true); // take ownership of the two objects added below
40  outputRois->back()->push_back(new TrigRoiDescriptor(*originalRoi));
41  outputRois->back()->push_back(updatedRoi.release());
42  } else {
43  outputRois->push_back(std::move(updatedRoi));
44  }
45 
46  // Link the last element of the output container to the current decision object
47  const ElementLink<TrigRoiDescriptorCollection> newRoiEL{*outputRois, outputRois->size()-1, eventContext};
48  decision->setObjectLink(m_extraRoiLinkName, newRoiEL);
49  }
50 
51  return StatusCode::SUCCESS;
52 }

◆ initialize()

StatusCode ViewCreatorExtraPrefetchROITool::initialize ( )
overridevirtual

Definition at line 9 of file ViewCreatorExtraPrefetchROITool.cxx.

9  {
11  ATH_CHECK(m_roiCreator.retrieve());
12  ATH_CHECK(m_roiUpdater.retrieve());
13  return StatusCode::SUCCESS;
14 }

Member Data Documentation

◆ m_extraRoiLinkName

Gaudi::Property<std::string> ViewCreatorExtraPrefetchROITool::m_extraRoiLinkName
private
Initial value:
{
this, "PrefetchRoIsLinkName", "prefetchRoI", "Name of the link from a decision object to the RoI for prefetching"}

Definition at line 30 of file ViewCreatorExtraPrefetchROITool.h.

◆ m_extraRoiWHK

SG::WriteHandleKey<TrigRoiDescriptorCollection> ViewCreatorExtraPrefetchROITool::m_extraRoiWHK
private
Initial value:
{
this, "ExtraPrefetchRoIsKey", "", "Name of the extra RoI collection to be used for prefetching"}

Definition at line 28 of file ViewCreatorExtraPrefetchROITool.h.

◆ m_mergeWithOriginal

Gaudi::Property<bool> ViewCreatorExtraPrefetchROITool::m_mergeWithOriginal
private
Initial value:
{
this, "MergeWithOriginal", true, "Make the output RoI be a super-RoI combining the original and updated ones"}

Definition at line 32 of file ViewCreatorExtraPrefetchROITool.h.

◆ m_roiCreator

ToolHandle<IViewCreatorROITool> ViewCreatorExtraPrefetchROITool::m_roiCreator { this, "RoiCreator", "", "The main RoI creator tool" }
private

Definition at line 35 of file ViewCreatorExtraPrefetchROITool.h.

◆ m_roiUpdater

ToolHandle<IRoiUpdaterTool> ViewCreatorExtraPrefetchROITool::m_roiUpdater { this, "RoiUpdater", "", "RoI Updater" }
private

Definition at line 36 of file ViewCreatorExtraPrefetchROITool.h.


The documentation for this class was generated from the following files:
ViewCreatorExtraPrefetchROITool::m_roiCreator
ToolHandle< IViewCreatorROITool > m_roiCreator
Definition: ViewCreatorExtraPrefetchROITool.h:35
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
RoiDescriptor::push_back
void push_back(const IRoiDescriptor *roi)
add a RoiDescriptor
Definition: RoiDescriptor.h:157
ViewCreatorExtraPrefetchROITool::m_mergeWithOriginal
Gaudi::Property< bool > m_mergeWithOriginal
Definition: ViewCreatorExtraPrefetchROITool.h:32
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
DataVector::back
const T * back() const
Access the last element in the collection as an rvalue.
xAOD::decisions
decisions
Definition: TrigComposite_v1.cxx:101
ViewCreatorExtraPrefetchROITool::m_roiUpdater
ToolHandle< IRoiUpdaterTool > m_roiUpdater
Definition: ViewCreatorExtraPrefetchROITool.h:36
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ViewCreatorExtraPrefetchROITool::m_extraRoiLinkName
Gaudi::Property< std::string > m_extraRoiLinkName
Definition: ViewCreatorExtraPrefetchROITool.h:30
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::WriteHandle< TrigRoiDescriptorCollection >
TrigRoiDescriptorCollection
Definition: TrigRoiDescriptorCollection.h:21
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigCompositeUtils
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:19
RoiDescriptor::setComposite
void setComposite(bool b=true)
Definition: RoiDescriptor.h:138
TrigCompositeUtils::roiString
const std::string & roiString()
Definition: TrigCompositeUtilsRoot.cxx:876
TrigRoiDescriptor
Athena::TPCnvVers::Current TrigRoiDescriptor
Definition: TrigSteeringEventTPCnv.cxx:68
RoiDescriptor::manageConstituents
bool manageConstituents() const
always manage constituents ???
Definition: RoiDescriptor.h:141
ViewCreatorExtraPrefetchROITool::m_extraRoiWHK
SG::WriteHandleKey< TrigRoiDescriptorCollection > m_extraRoiWHK
Definition: ViewCreatorExtraPrefetchROITool.h:28
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.