ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetValidation
InDetTrackPerfMon
src
RoiSelectionTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
9
10
#include "
RoiSelectionTool.h
"
11
12
16
IDTPM::RoiSelectionTool::RoiSelectionTool
(
17
const
std::string& name ) :
18
asg
::
AsgTool
( name ) { }
19
20
24
StatusCode
IDTPM::RoiSelectionTool::initialize
() {
25
26
ATH_CHECK
(
asg::AsgTool::initialize
() );
27
28
ATH_MSG_DEBUG
(
"Initializing "
<< name() );
29
30
ATH_CHECK
(
m_trigDecTool
.retrieve() );
31
32
return
StatusCode::SUCCESS;
33
}
34
35
39
std::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() ) ?
47
TrigDefs::lastFeatureOfType
:
48
TrigDefs::allFeaturesOfType
;
49
50
std::vector< roiCollection_t > rois =
51
m_trigDecTool
->features<
TrigRoiDescriptorCollection
>(
52
Trig::FeatureRequestDescriptor
(
53
chainName,
54
decisionType,
55
roiKey,
56
featureType,
57
TrigCompositeUtils::roiString
(),
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
98
std::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
110
std::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
129
return
selectedRoisProbe;
130
}
131
132
136
std::vector< IDTPM::roiCollection_t >
IDTPM::RoiSelectionTool::getRois
(
137
const
std::string& chainName )
const
{
138
139
return
(
m_doTnP
.value() ) ?
140
getRoisTnP
( chainName ) :
141
getRoisStandard
( chainName );
142
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
RoiSelectionTool.h
Athena includes.
ElementLink< TrigRoiDescriptorCollection >
ElementLink::dataID
const ID_type & dataID() const
Get the key that we reference, as a string.
ElementLink::cptr
ElementConstPointer cptr() const
Get a constant pointer to the referenced object.
IDTPM::RoiSelectionTool::RoiSelectionTool
RoiSelectionTool(const std::string &name)
Constructor.
Definition
RoiSelectionTool.cxx:16
IDTPM::RoiSelectionTool::m_chainLeg
IntegerProperty m_chainLeg
Definition
RoiSelectionTool.h:72
IDTPM::RoiSelectionTool::getRois
std::vector< roiCollection_t > getRois(const std::string &chainName) const
Main method to get selected RoIs.
Definition
RoiSelectionTool.cxx:136
IDTPM::RoiSelectionTool::m_chainLegProbe
IntegerProperty m_chainLegProbe
Definition
RoiSelectionTool.h:84
IDTPM::RoiSelectionTool::initialize
virtual StatusCode initialize() override
RoiSelectionTool methods.
Definition
RoiSelectionTool.cxx:24
IDTPM::RoiSelectionTool::m_roiKeyTag
StringProperty m_roiKeyTag
Definition
RoiSelectionTool.h:77
IDTPM::RoiSelectionTool::m_roiKeyProbe
StringProperty m_roiKeyProbe
Definition
RoiSelectionTool.h:82
IDTPM::RoiSelectionTool::m_chainLegTag
IntegerProperty m_chainLegTag
Definition
RoiSelectionTool.h:79
IDTPM::RoiSelectionTool::m_roiKey
StringProperty m_roiKey
Properties to fine-tune the tool behaviour.
Definition
RoiSelectionTool.h:70
IDTPM::RoiSelectionTool::m_trigDecTool
PublicToolHandle< Trig::TrigDecisionTool > m_trigDecTool
Definition
RoiSelectionTool.h:87
IDTPM::RoiSelectionTool::retrieveRois
std::vector< roiCollection_t > retrieveRois(const std::string &chainName, const std::string &roiKey, const int &chainLeg=-1) const
Retrieve RoIs.
Definition
RoiSelectionTool.cxx:39
IDTPM::RoiSelectionTool::getRoisStandard
std::vector< roiCollection_t > getRoisStandard(const std::string &chainName) const
get selected RoIs (non-Tag&Probe selection)
Definition
RoiSelectionTool.cxx:98
IDTPM::RoiSelectionTool::getRoisTnP
std::vector< roiCollection_t > getRoisTnP(const std::string &chainName) const
get selected RoIs (Tag&Probe selection)
Definition
RoiSelectionTool.cxx:110
IDTPM::RoiSelectionTool::m_doTnP
BooleanProperty m_doTnP
Definition
RoiSelectionTool.h:75
TrigRoiDescriptorCollection
Definition
TrigRoiDescriptorCollection.h:14
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits ifndef XAOD_ANA...
Definition
TrigRoiDescriptor.h:48
Trig::FeatureRequestDescriptor
Definition
TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h:26
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition
AsgTool.cxx:58
asg::AsgTool::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition
AsgTool.h:133
ir
int ir
counter of the current depth
Definition
fastadd.cxx:49
TrigCompositeUtils::roiString
const std::string & roiString()
Definition
TrigCompositeUtils.h:420
TrigDefs::lastFeatureOfType
static const unsigned int lastFeatureOfType
Run 3 "enum". Only return the final feature along each route through the navigation.
Definition
TrigEvent/TrigDecisionInterface/TrigDecisionInterface/Conditions.h:68
TrigDefs::allFeaturesOfType
static const unsigned int allFeaturesOfType
Run 3 "enum". Return all features along legs (still with type and container checks).
Definition
TrigEvent/TrigDecisionInterface/TrigDecisionInterface/Conditions.h:70
TrigDefs::Physics
static const unsigned int Physics
Definition
TrigEvent/TrigDecisionInterface/TrigDecisionInterface/Conditions.h:43
asg
Definition
DataHandleTestTool.h:28
Generated on
for ATLAS Offline Software by
1.17.0