ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetMonitoring
src
JetHistoMatchedFiller.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
AthenaMonitoringKernel/GenericMonitoringTool.h
"
6
#include "
JetMonitoring/JetHistoMatchedFiller.h
"
7
#include "
JetMonitoring/JetMonitoringAlg.h
"
8
#include "
AsgDataHandles/ReadDecorHandle.h
"
9
10
JetHistoMatchedFiller::JetHistoMatchedFiller
(
const
std::string&
type
,
const
std::string & name ,
const
IInterface* parent):
11
AthAlgTool
(
type
, name, parent )
12
{
13
declareInterface<IJetHistoFiller>(
this
);
14
declareProperty
(
"JetMatchedKey"
,
m_matchedKey
=
"NONE"
);
15
declareProperty
(
"JetPtDiffKey"
,
m_ptdiffKey
=
"NONE"
);
16
declareProperty
(
"JetEnergyDiffKey"
,
m_energydiffKey
=
"NONE"
);
17
declareProperty
(
"JetMassDiffKey"
,
m_massdiffKey
=
"NONE"
);
18
declareProperty
(
"JetPtRespKey"
,
m_ptrespKey
=
"NONE"
);
19
declareProperty
(
"JetEnergyRespKey"
,
m_energyrespKey
=
"NONE"
);
20
declareProperty
(
"JetMassRespKey"
,
m_massrespKey
=
"NONE"
);
21
declareProperty
(
"JetPtRefKey"
,
m_ptrefKey
=
"NONE"
);
22
declareProperty
(
"JetEtaRefKey"
,
m_etarefKey
=
"NONE"
);
23
}
24
25
26
StatusCode
JetHistoMatchedFiller::initialize
() {
27
ATH_CHECK
(
m_matchedKey
.initialize() );
28
ATH_CHECK
(
m_ptdiffKey
.initialize() );
29
ATH_CHECK
(
m_energydiffKey
.initialize() );
30
ATH_CHECK
(
m_massdiffKey
.initialize() );
31
ATH_CHECK
(
m_ptrespKey
.initialize() );
32
ATH_CHECK
(
m_energyrespKey
.initialize() );
33
ATH_CHECK
(
m_massrespKey
.initialize() );
34
ATH_CHECK
(
m_ptrefKey
.initialize() );
35
ATH_CHECK
(
m_etarefKey
.initialize() );
36
return
StatusCode::SUCCESS;
37
}
38
39
40
StatusCode
JetHistoMatchedFiller::processJetContainer
(
const
JetMonitoringAlg
& parentAlg,
const
xAOD::JetContainer
& jets,
const
EventContext& ctx )
const
{
41
if
(jets.empty())
return
StatusCode::SUCCESS;
42
43
SG::ReadDecorHandle<xAOD::JetContainer, char>
matchedHandle(
m_matchedKey
, ctx);
44
SG::ReadDecorHandle<xAOD::JetContainer, double>
ptdiffHandle(
m_ptdiffKey
, ctx);
45
SG::ReadDecorHandle<xAOD::JetContainer, double>
energydiffHandle(
m_energydiffKey
, ctx);
46
SG::ReadDecorHandle<xAOD::JetContainer, double>
massdiffHandle(
m_massdiffKey
, ctx);
47
SG::ReadDecorHandle<xAOD::JetContainer, double>
ptrespHandle(
m_ptrespKey
, ctx);
48
SG::ReadDecorHandle<xAOD::JetContainer, double>
energyrespHandle(
m_energyrespKey
, ctx);
49
SG::ReadDecorHandle<xAOD::JetContainer, double>
massrespHandle(
m_massrespKey
, ctx);
50
SG::ReadDecorHandle<xAOD::JetContainer, double>
ptrefHandle(
m_ptrefKey
, ctx);
51
SG::ReadDecorHandle<xAOD::JetContainer, double>
etarefHandle(
m_etarefKey
, ctx);
52
53
auto
matched =
Monitored::Collection
(
"matched"
, jets, [matchedHandle](
const
xAOD::Jet
*
jet
) {
return
matchedHandle(*
jet
);});
54
auto
dPt =
Monitored::Scalar
(
"ptdiff"
,0.0);
55
auto
dEnergy =
Monitored::Scalar
(
"energydiff"
,0.0);
56
auto
dMass =
Monitored::Scalar
(
"massdiff"
,0.0);
57
auto
rPt =
Monitored::Scalar
(
"ptresp"
,0.0);
58
auto
rEnergy =
Monitored::Scalar
(
"energyresp"
,0.0);
59
auto
rMass =
Monitored::Scalar
(
"massresp"
,0.0);
60
auto
ptRef =
Monitored::Scalar
(
"ptref"
,0.0);
61
auto
etaRef =
Monitored::Scalar
(
"etaref"
,0.0);
62
63
// Loop over jets and fill pt, energy, mass differences and responses between matched jets, plus reference pT and eta
64
65
for
(
const
xAOD::Jet
*
jet
: jets){
66
bool
matched = matchedHandle(*
jet
);
67
if
(matched){
68
dPt = ptdiffHandle(*
jet
);
69
dEnergy = energydiffHandle(*
jet
);
70
dMass = massdiffHandle(*
jet
);
71
rPt = ptrespHandle(*
jet
);
72
rEnergy = energyrespHandle(*
jet
);
73
rMass = massrespHandle(*
jet
);
74
ptRef = ptrefHandle(*
jet
);
75
etaRef = etarefHandle(*
jet
);
76
parentAlg.
fill
(
m_group
, dPt, dEnergy, dMass, rPt, rEnergy, rMass, ptRef, etaRef);
77
}
78
}
79
parentAlg.
fill
(
m_group
,matched);
80
81
return
StatusCode::SUCCESS;
82
}
83
84
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ReadDecorHandle.h
Handle class for reading a decoration on an object.
GenericMonitoringTool.h
JetHistoMatchedFiller.h
JetMonitoringAlg.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
JetHistoMatchedFiller::JetHistoMatchedFiller
JetHistoMatchedFiller(const std::string &type, const std::string &name, const IInterface *parent)
Definition
JetHistoMatchedFiller.cxx:10
JetHistoMatchedFiller::m_group
Gaudi::Property< std::string > m_group
Definition
JetHistoMatchedFiller.h:26
JetHistoMatchedFiller::processJetContainer
virtual StatusCode processJetContainer(const JetMonitoringAlg &parentAlg, const xAOD::JetContainer &jets, const EventContext &ctx) const
Definition
JetHistoMatchedFiller.cxx:40
JetHistoMatchedFiller::m_massrespKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_massrespKey
Definition
JetHistoMatchedFiller.h:33
JetHistoMatchedFiller::m_ptdiffKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_ptdiffKey
Definition
JetHistoMatchedFiller.h:28
JetHistoMatchedFiller::m_etarefKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_etarefKey
Definition
JetHistoMatchedFiller.h:35
JetHistoMatchedFiller::m_massdiffKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_massdiffKey
Definition
JetHistoMatchedFiller.h:30
JetHistoMatchedFiller::m_energyrespKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_energyrespKey
Definition
JetHistoMatchedFiller.h:32
JetHistoMatchedFiller::initialize
virtual StatusCode initialize()
Definition
JetHistoMatchedFiller.cxx:26
JetHistoMatchedFiller::m_matchedKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_matchedKey
Definition
JetHistoMatchedFiller.h:27
JetHistoMatchedFiller::m_ptrefKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_ptrefKey
Definition
JetHistoMatchedFiller.h:34
JetHistoMatchedFiller::m_energydiffKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_energydiffKey
Definition
JetHistoMatchedFiller.h:29
JetHistoMatchedFiller::m_ptrespKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_ptrespKey
Definition
JetHistoMatchedFiller.h:31
JetMonitoringAlg
A monitoring algorithm in charge of filling histogram for a JetContainer.
Definition
JetMonitoringAlg.h:26
Monitored::Scalar
Declare a monitored scalar variable.
Definition
MonitoredScalar.h:34
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition
StoreGate/StoreGate/ReadDecorHandle.h:94
AthMonitorAlgorithm::fill
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
Fills a vector of variables to a group by reference.
Definition
AthMonitorAlgorithm.cxx:99
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition
MonitoredCollection.h:38
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition
JetContainer.h:17
type
Generated on
for ATLAS Offline Software by
1.17.0