ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
MET
METReconstruction
Root
METAssociationTool.cxx
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// METAssociationTool.cxx
8
// Implementation file for class METAssociationTool
9
//
10
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11
//
12
// Author: P Loch, S Resconi, TJ Khoo
14
15
// METReconstruction includes
16
#include "
METReconstruction/METAssociationTool.h
"
17
18
// MET EDM
19
#include "
xAODMissingET/MissingET.h
"
20
#include "
xAODMissingET/MissingETContainer.h
"
21
#include "
xAODMissingET/MissingETComposition.h
"
22
#include "
xAODMissingET/MissingETAuxContainer.h
"
23
#include "
xAODMissingET/MissingETAuxComponentMap.h
"
24
25
#include "
xAODCaloEvent/CaloClusterContainer.h
"
26
#include "
xAODCaloEvent/CaloClusterChangeSignalState.h
"
27
28
#include <iomanip>
29
30
namespace
met
{
31
32
using namespace
xAOD;
33
//
34
using
std::string;
35
using
std::setw;
36
using
std::setprecision;
37
using
std::fixed;
38
40
// Public methods:
42
43
// Constructors
45
METAssociationTool::METAssociationTool
(
const
std::string&
name
) :
46
AsgTool
(
name
)
47
{
48
}
49
50
// Athena algtool's Hooks
52
StatusCode
METAssociationTool::initialize
()
53
{
54
ATH_MSG_INFO
(
"Initializing "
<<
name
() <<
"..."
);
55
56
if
(
m_metSuffix
.size()==0 ) {
57
ATH_MSG_ERROR
(
"Output suffix for MET names must be provided."
);
58
return
StatusCode::FAILURE;
59
}
else
{
60
std::string coreName =
"MET_Core_"
+
m_metSuffix
;
61
std::string mapName =
"METAssoc_"
+
m_metSuffix
;
62
ATH_MSG_INFO
(
"Tool configured to build MET with names:"
);
63
ATH_MSG_INFO
(
" Core container ==> "
<< coreName);
64
ATH_MSG_INFO
(
" Association map ==> "
<< mapName);
65
ATH_CHECK
(
m_coreKey
.assign(coreName) );
// FIXME properties should be properly assigned during the configuration
66
ATH_CHECK
(
m_coreKey
.initialize() );
67
ATH_CHECK
(
m_mapKey
.assign(mapName) );
// FIXME properties should be properly assigned during the configuration
68
ATH_CHECK
(
m_mapKey
.initialize() );
69
}
70
71
// retrieve associators
72
ATH_CHECK
(
m_metAssociators
.retrieve());
73
return
StatusCode::SUCCESS;
74
}
75
76
StatusCode
METAssociationTool::execute
(
const
EventContext& ctx)
const
77
{
78
//this section has had a very big re-write, after discussions with TJK...
79
ATH_MSG_DEBUG
(
"In execute: "
<<
name
() <<
"..."
);
80
81
//Create map and core containers
82
83
auto
metHandle =
SG::makeHandle
(
m_coreKey
, ctx);
84
ATH_CHECK
( metHandle.record (std::make_unique<xAOD::MissingETContainer>(), std::make_unique<xAOD::MissingETAuxContainer>()) );
85
xAOD::MissingETContainer
* metCont=metHandle.ptr();
86
87
auto
metMapHandle =
SG::makeHandle
(
m_mapKey
, ctx);
88
ATH_CHECK
( metMapHandle.record (std::make_unique<xAOD::MissingETAssociationMap>(), std::make_unique<xAOD::MissingETAuxAssociationMap>()) );
89
xAOD::MissingETAssociationMap
* metMap=metMapHandle.ptr();
90
91
92
if
(
buildMET
(metCont, metMap, ctx).isFailure() ) {
93
ATH_MSG_DEBUG
(
"Failed in MissingET reconstruction"
);
94
return
StatusCode::SUCCESS;
95
}
96
97
// Lock the containers in SG
98
//ATH_CHECK( evtStore()->setConst(metMap) );
99
//ATH_CHECK( evtStore()->setConst(metCont) );
100
101
return
StatusCode::SUCCESS;
102
}
103
104
StatusCode
METAssociationTool::finalize
()
105
{
106
ATH_MSG_INFO
(
"Finalizing "
<<
name
() <<
"..."
);
107
108
return
StatusCode::SUCCESS;
109
}
110
112
// Protected methods:
114
115
StatusCode
METAssociationTool::buildMET
(
xAOD::MissingETContainer
* metCont,
xAOD::MissingETAssociationMap
* metMap,
const
EventContext& ctx)
const
116
{
117
118
119
// Run the MET reconstruction tools in sequence
120
for
(
auto
tool :
m_metAssociators
) {
121
if
(tool->execute(metCont,metMap,ctx).isFailure()){
122
ATH_MSG_WARNING
(
"Failed to execute tool: "
<< tool->name());
123
return
StatusCode::FAILURE;
124
}
125
}
126
bool
foundOverlaps = metMap->
identifyOverlaps
();
127
ATH_MSG_DEBUG
( (foundOverlaps ?
"Overlaps"
:
"No overlaps"
) <<
" identified!"
);
128
++
m_nevt
;
129
return
StatusCode::SUCCESS;
130
}
131
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CaloClusterChangeSignalState.h
CaloClusterContainer.h
MissingETComposition.h
MissingETContainer.h
MissingET.h
METAssociationTool.h
MissingETAuxComponentMap.h
MissingETAuxContainer.h
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition
AsgTool.cxx:58
met::METAssociationTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition
METAssociationTool.cxx:52
met::METAssociationTool::m_coreKey
SG::WriteHandleKey< xAOD::MissingETContainer > m_coreKey
Definition
METAssociationTool.h:95
met::METAssociationTool::METAssociationTool
METAssociationTool()
Default constructor:
met::METAssociationTool::m_metAssociators
ToolHandleArray< IMETAssocToolBase > m_metAssociators
Definition
METAssociationTool.h:98
met::METAssociationTool::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
METAssociationTool.cxx:76
met::METAssociationTool::buildMET
StatusCode buildMET(xAOD::MissingETContainer *metCont, xAOD::MissingETAssociationMap *metMap, const EventContext &ctx) const
Definition
METAssociationTool.cxx:115
met::METAssociationTool::finalize
virtual StatusCode finalize() override
Definition
METAssociationTool.cxx:104
met::METAssociationTool::m_nevt
std::atomic< unsigned int > m_nevt
Definition
METAssociationTool.h:100
met::METAssociationTool::m_mapKey
SG::WriteHandleKey< xAOD::MissingETAssociationMap > m_mapKey
Definition
METAssociationTool.h:96
met::METAssociationTool::m_metSuffix
Gaudi::Property< std::string > m_metSuffix
Definition
METAssociationTool.h:94
xAOD::MissingETAssociationMap_v1::identifyOverlaps
bool identifyOverlaps()
Do overlap-finding in all associations.
Definition
MissingETAssociationMap_v1.cxx:202
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:269
met
Definition
IMETSignificance.h:24
xAOD::name
name
Definition
TriggerMenuJson_v1.cxx:29
xAOD::MissingETContainer
MissingETContainer_v1 MissingETContainer
Definition
Event/xAOD/xAODMissingET/xAODMissingET/MissingETContainer.h:16
xAOD::MissingETAssociationMap
MissingETAssociationMap_v1 MissingETAssociationMap
Version control by type defintion.
Definition
MissingETAssociationMap.h:16
Generated on
for ATLAS Offline Software by
1.17.0