ATLAS Offline Software
Loading...
Searching...
No Matches
ViewCreatorExtraPrefetchROITool Class Reference

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

#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
23 SG::WriteHandle<TrigRoiDescriptorCollection> outputRois = createAndStoreNoAux(m_extraRoiWHK, eventContext);
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
28 const ElementLink<TrigRoiDescriptorCollection> roiEL = decision->objectLink<TrigRoiDescriptorCollection>(roiString());
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
const std::string & roiString()
Athena::TPCnvVers::Current Athena::TPCnvVers::Old TrigRoiDescriptorCollection
Athena::TPCnvVers::Current TrigRoiDescriptor
SG::WriteHandleKey< TrigRoiDescriptorCollection > m_extraRoiWHK
Gaudi::Property< std::string > m_extraRoiLinkName
ToolHandle< IViewCreatorROITool > m_roiCreator
SG::WriteHandle< CONT > createAndStoreNoAux(const SG::WriteHandleKey< CONT > &key, const EventContext &ctx)
Creates and right away records the Container CONT with the key.

◆ initialize()

StatusCode ViewCreatorExtraPrefetchROITool::initialize ( )
overridevirtual

Definition at line 9 of file ViewCreatorExtraPrefetchROITool.cxx.

9 {
10 ATH_CHECK(m_extraRoiWHK.initialize());
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.

30 {
31 this, "PrefetchRoIsLinkName", "prefetchRoI", "Name of the link from a decision object to the RoI for prefetching"};

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

28 {
29 this, "ExtraPrefetchRoIsKey", "", "Name of the extra RoI collection to be used for prefetching"};

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

32 {
33 this, "MergeWithOriginal", true, "Make the output RoI be a super-RoI combining the original and updated ones"};

◆ m_roiCreator

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

Definition at line 35 of file ViewCreatorExtraPrefetchROITool.h.

35{ this, "RoiCreator", "", "The main RoI creator tool" };

◆ m_roiUpdater

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

Definition at line 36 of file ViewCreatorExtraPrefetchROITool.h.

36{ this, "RoiUpdater", "", "RoI Updater" };

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