ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAnalysis
TrigEgammaMatchingTool
src
TrigEgammaMatchingToolMTTest.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
#include "
TrigEgammaMatchingToolMTTest.h
"
7
#include "
TrigCompositeUtils/TrigCompositeUtils.h
"
8
9
10
using namespace
TrigCompositeUtils
;
11
12
13
14
TrigEgammaMatchingToolMTTest::TrigEgammaMatchingToolMTTest
(
const
std::string& name, ISvcLocator* pSvcLocator )
15
:
AthMonitorAlgorithm
( name, pSvcLocator ),
16
m_trigdec
(
"Trig::TrigDecisionTool/TrigDecisionTool"
),
17
m_matchTool
(
"Trig::TrigEgammaMatchingTool/TrigEgammaMatchingToolMT"
,this)
18
19
{
20
declareProperty
(
"TrigEgammaMatchingToolMT"
,
m_matchTool
);
21
declareProperty
(
"TriggerList"
,
m_triggerList
);
22
}
23
24
25
26
//**********************************************************************
27
28
StatusCode
TrigEgammaMatchingToolMTTest::initialize
() {
29
30
ATH_MSG_INFO
(
"Initializing "
<< name() <<
"..."
);
31
32
ATH_CHECK
(
m_trigdec
.retrieve() );
33
ATH_CHECK
(
m_matchTool
.retrieve());
34
ATH_CHECK
(
m_electronKey
.initialize());
35
36
37
38
return
StatusCode::SUCCESS;
39
}
40
41
42
43
//**********************************************************************
44
45
void
TrigEgammaMatchingToolMTTest::inspect
(
const
EventContext& ctx,
const
std::string& trigger,
const
xAOD::Egamma
*eg)
const
{
46
47
if
(eg) {
48
49
ATH_MSG_INFO
(
"Getting all associated objects for "
<< trigger);
50
51
const
TrigCompositeUtils::Decision
*dec=
nullptr
;
52
53
m_matchTool
->match( eg, trigger , dec);
54
55
if
( dec )
56
{
57
ATH_MSG_INFO
(
"Matched!"
);
58
59
60
auto
l1_link =
m_matchTool
->getFeature<
TrigRoiDescriptorCollection
>(ctx, dec, trigger);
61
auto
emCluster_link =
m_matchTool
->getFeature<
xAOD::TrigEMClusterContainer
>(ctx, dec , trigger);
62
auto
trig_el_links =
m_matchTool
->getFeatures<
xAOD::TrigElectronContainer
>(ctx, dec, trigger);
63
auto
cl_links =
m_matchTool
->getFeatures<
xAOD::CaloClusterContainer
>(ctx, dec, trigger);
64
auto
el_links =
m_matchTool
->getFeatures<
xAOD::ElectronContainer
>(ctx, dec, trigger);
65
66
if
( l1_link.isValid() ){
67
ATH_MSG_INFO
(
"We found the Roi object link"
);
68
// Let's get the EMTau
69
auto
l1 =
m_matchTool
->getL1Feature( ctx, l1_link.source );
70
if
(l1)
71
ATH_MSG_INFO
(
"We found the EmTau object"
);
72
ATH_MSG_INFO
(
"L1 object state is assigned as "
<< (l1_link.state==
ActiveState::ACTIVE
?
"Active"
:
"Not active"
) );
73
}
74
75
if
( emCluster_link.isValid() ){
76
ATH_MSG_INFO
(
"We found the EmCluster object link"
);
77
ATH_MSG_INFO
(
"L2Calo object state is assigned as "
<< (emCluster_link.state==
ActiveState::ACTIVE
?
"Active"
:
"Not active"
) );
78
}
79
80
if
(trig_el_links.
size
() > 0){
81
ATH_MSG_INFO
(
"We found "
<< trig_el_links.
size
() <<
" TrigElectron link objects for this decision souce."
);
82
for
(
auto
featLinkInfo : trig_el_links ){
83
ATH_MSG_INFO
(
"L2Electron object state is assigned as "
<< (featLinkInfo.state==
ActiveState::ACTIVE
?
"Active"
:
"Not active"
) );
84
}
85
}
86
87
if
(cl_links.
size
() > 0){
88
ATH_MSG_INFO
(
"We found "
<< cl_links.
size
() <<
" CaloCluster link objects for this decision souce."
);
89
for
(
auto
featLinkInfo : cl_links ){
90
ATH_MSG_INFO
(
"EFCalo object state is assigned as "
<< (featLinkInfo.state==
ActiveState::ACTIVE
?
"Active"
:
"Not active"
) );
91
}
92
}
93
94
if
(el_links.
size
() > 0){
95
ATH_MSG_INFO
(
"We found "
<< el_links.
size
() <<
" CaloCluster link objects for this decision souce."
);
96
for
(
auto
featLinkInfo : el_links ){
97
ATH_MSG_INFO
(
"EFCalo object state is assigned as "
<< (featLinkInfo.state==
ActiveState::ACTIVE
?
"Active"
:
"Not active"
) );
98
}
99
}
100
101
102
bool
passedHLT =
m_matchTool
->ancestorPassed<
xAOD::ElectronContainer
> (ctx, dec, trigger ,
"HLT_egamma_Electrons"
);
103
bool
passedEFCalo =
m_matchTool
->ancestorPassed<
xAOD::CaloClusterContainer
> (ctx, dec, trigger ,
"HLT_CaloEMClusters"
);
104
bool
passedL2 =
m_matchTool
->ancestorPassed<
xAOD::TrigElectronContainer
> (ctx, dec, trigger ,
"HLT_FastElectrons"
);
105
bool
passedL2Calo =
m_matchTool
->ancestorPassed<
xAOD::TrigEMClusterContainer
> (ctx, dec, trigger ,
"HLT_FastCaloEMClusters"
);
106
bool
passedL1Calo =
m_matchTool
->ancestorPassed<
TrigRoiDescriptorCollection
> (ctx, dec, trigger ,
"initialRois"
);
107
108
ATH_MSG_INFO
(
"L1Calo passed : "
<< passedL1Calo );
109
ATH_MSG_INFO
(
"L2Calo passed : "
<< passedL2Calo );
110
ATH_MSG_INFO
(
"L2 passed : "
<< passedL2 );
111
ATH_MSG_INFO
(
"EFCalo passed : "
<< passedEFCalo );
112
ATH_MSG_INFO
(
"HLT passed : "
<< passedHLT );
113
114
}
else
{
115
ATH_MSG_INFO
(
"Not Matched! There is no Dec object for this trigger "
<< trigger );
116
}
117
118
}
119
else
ATH_MSG_INFO
(
"REGTEST: eg pointer null!"
);
120
}
121
122
123
//**********************************************************************
124
125
StatusCode
TrigEgammaMatchingToolMTTest::fillHistograms
(
const
EventContext& ctx )
const
{
126
127
ATH_MSG_INFO
(
"Fill histograms "
<< name() <<
"..."
);
128
129
130
SG::ReadHandle<xAOD::ElectronContainer>
el_cont(
m_electronKey
, ctx);
131
132
if
( !el_cont.
isValid
() ){
133
ATH_MSG_WARNING
(
"Container "
<<
m_electronKey
<<
" does not exist or is empty"
);
134
return
StatusCode::SUCCESS;
135
}
136
137
138
ATH_MSG_INFO
(
"Offline Electron container size "
<< el_cont->size());
139
140
for
(
const
auto
&trigger :
m_triggerList
){
141
for
(
const
auto
eg : *el_cont){
142
ATH_MSG_INFO
(
"REGTEST:: Electron offline (eta="
<<eg->eta()<<
",phi="
<<eg->phi()<<
")"
);
143
inspect
(ctx,trigger,eg);
144
145
}
//End loop of offline electrons
146
}
// End loop over trigger list
147
148
149
150
return
StatusCode::SUCCESS;
151
}
// End execute
152
153
154
155
156
157
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
TrigCompositeUtils.h
TrigEgammaMatchingToolMTTest.h
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthMonitorAlgorithm::AthMonitorAlgorithm
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthMonitorAlgorithm.cxx:8
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TrigEgammaMatchingToolMTTest::TrigEgammaMatchingToolMTTest
TrigEgammaMatchingToolMTTest(const std::string &name, ISvcLocator *pSvcLocator)
Definition
TrigEgammaMatchingToolMTTest.cxx:14
TrigEgammaMatchingToolMTTest::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition
TrigEgammaMatchingToolMTTest.cxx:125
TrigEgammaMatchingToolMTTest::m_electronKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronKey
Definition
TrigEgammaMatchingToolMTTest.h:31
TrigEgammaMatchingToolMTTest::initialize
virtual StatusCode initialize() override
initialize
Definition
TrigEgammaMatchingToolMTTest.cxx:28
TrigEgammaMatchingToolMTTest::m_matchTool
ToolHandle< TrigEgammaMatchingToolMT > m_matchTool
Definition
TrigEgammaMatchingToolMTTest.h:34
TrigEgammaMatchingToolMTTest::inspect
void inspect(const EventContext &, const std::string &, const xAOD::Egamma *) const
Definition
TrigEgammaMatchingToolMTTest.cxx:45
TrigEgammaMatchingToolMTTest::m_trigdec
ToolHandle< Trig::TrigDecisionTool > m_trigdec
Definition
TrigEgammaMatchingToolMTTest.h:33
TrigEgammaMatchingToolMTTest::m_triggerList
std::vector< std::string > m_triggerList
Definition
TrigEgammaMatchingToolMTTest.h:37
TrigRoiDescriptorCollection
Definition
TrigRoiDescriptorCollection.h:14
TrigCompositeUtils
Definition
TrigComposite.h:19
TrigCompositeUtils::Decision
xAOD::TrigComposite Decision
Definition
TrigComposite.h:20
TrigCompositeUtils::ACTIVE
@ ACTIVE
The link was still active for one-or-more of the HLT Chains requested in the TDT.
Definition
ActiveState.h:20
xAOD::TrigElectronContainer
TrigElectronContainer_v1 TrigElectronContainer
Declare the latest version of the container.
Definition
Event/xAOD/xAODTrigEgamma/xAODTrigEgamma/TrigElectronContainer.h:17
xAOD::ElectronContainer
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/ElectronContainer.h:17
xAOD::TrigEMClusterContainer
TrigEMClusterContainer_v1 TrigEMClusterContainer
Define the latest version of the trigger EM cluster container.
Definition
Event/xAOD/xAODTrigCalo/xAODTrigCalo/TrigEMClusterContainer.h:17
xAOD::Egamma
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition
Egamma.h:17
xAOD::CaloClusterContainer
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloClusterContainer.h:17
Generated on
for ATLAS Offline Software by
1.17.0