ATLAS Offline Software
Loading...
Searching...
No Matches
RoiSelectionTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
9
10#include "RoiSelectionTool.h"
11
12
17 const std::string& name ) :
18 asg::AsgTool( name ) { }
19
20
25
27
28 ATH_MSG_DEBUG( "Initializing " << name() );
29
30 ATH_CHECK( m_trigDecTool.retrieve() );
31
32 return StatusCode::SUCCESS;
33}
34
35
39std::vector< IDTPM::roiCollection_t > IDTPM::RoiSelectionTool::retrieveRois(
40 const std::string& chainName,
41 const std::string& roiKey,
42 const int& chainLeg ) const {
43
44 unsigned decisionType = TrigDefs::Physics; // TrigDefs::includeFailedDecisions;
45
46 unsigned featureType = ( roiKey.empty() ) ?
49
50 std::vector< roiCollection_t > rois =
53 chainName,
54 decisionType,
55 roiKey,
56 featureType,
58 chainLeg ) );
59
60 ATH_MSG_DEBUG( "Retrieved " << rois.size() <<
61 " RoIs for chain " << chainName <<
62 " , RoI key : " << roiKey <<
63 " , leg = " << chainLeg );
64
65 std::vector< roiCollection_t > selectedRois;
66
68 for( size_t ir=0 ; ir<rois.size() ; ir++ ) {
69
72 if( roiKey == "SuperRoi" && ir > 0 ) continue;
73
74 const ElementLink< TrigRoiDescriptorCollection > thisRoiLink = rois[ir].link;
75
77 if( !roiKey.empty() && thisRoiLink.dataID() != roiKey ) continue;
78
79 const TrigRoiDescriptor* const* thisRoi = thisRoiLink.cptr();
80
82 if( thisRoi == 0 ) continue;
83
84 ATH_MSG_DEBUG( "Retrieved RoI descriptor for chain " <<
85 chainName << " " << **thisRoi );
86
87 selectedRois.push_back( rois[ir] );
88
89 } // close rois loop
90
91 return selectedRois;
92}
93
94
98std::vector< IDTPM::roiCollection_t > IDTPM::RoiSelectionTool::getRoisStandard(
99 const std::string& chainName ) const {
100
101 return retrieveRois( chainName,
102 m_roiKey.value(),
103 m_chainLeg.value() );
104}
105
106
110std::vector< IDTPM::roiCollection_t > IDTPM::RoiSelectionTool::getRoisTnP(
111 const std::string& chainName ) const {
112
114 std::vector< roiCollection_t > selectedRoisTag =
115 retrieveRois( chainName,
116 m_roiKeyTag.value(),
117 m_chainLegTag.value() );
118
120 std::vector< roiCollection_t > selectedRoisProbe =
121 retrieveRois( chainName,
122 m_roiKeyProbe.value(),
123 m_chainLegProbe.value() );
124
126 //std::vector< roiCollection_t > selectedRois =
127 // m_TnPselectionTool( selectedRoisTag, selectedRoisProbe, tracks );
128 std::vector< roiCollection_t > selectedRois = selectedRoisProbe;
129
130 return selectedRois;
131}
132
133
137std::vector< IDTPM::roiCollection_t > IDTPM::RoiSelectionTool::getRois(
138 const std::string& chainName ) const {
139
140 return ( m_doTnP.value() ) ?
141 getRoisTnP( chainName ) :
142 getRoisStandard( chainName );
143}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Athena includes.
RoiSelectionTool(const std::string &name)
Constructor.
std::vector< roiCollection_t > getRois(const std::string &chainName) const
Main method to get selected RoIs.
IntegerProperty m_chainLegProbe
virtual StatusCode initialize() override
RoiSelectionTool methods.
IntegerProperty m_chainLegTag
StringProperty m_roiKey
Properties to fine-tune the tool behaviour.
PublicToolHandle< Trig::TrigDecisionTool > m_trigDecTool
std::vector< roiCollection_t > retrieveRois(const std::string &chainName, const std::string &roiKey, const int &chainLeg=-1) const
Retrieve RoIs.
std::vector< roiCollection_t > getRoisStandard(const std::string &chainName) const
get selected RoIs (non-Tag&Probe selection)
std::vector< roiCollection_t > getRoisTnP(const std::string &chainName) const
get selected RoIs (Tag&Probe selection)
nope - should be used for standalone also, perhaps need to protect the class def bits ifndef XAOD_ANA...
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition AsgTool.h:133
int ir
counter of the current depth
Definition fastadd.cxx:49
const std::string & roiString()
static const unsigned int lastFeatureOfType
Run 3 "enum". Only return the final feature along each route through the navigation.
static const unsigned int allFeaturesOfType
Run 3 "enum". Return all features along legs (still with type and container checks)