ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
JetTagging
FlavorTagJetDecorators
src
SoftElectronSelectionAlg.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
#include "
SoftElectronSelectionAlg.h
"
6
7
#include "
StoreGate/ReadHandle.h
"
8
#include "
StoreGate/ReadDecorHandle.h
"
9
#include "
StoreGate/WriteDecorHandle.h
"
10
11
#include "
xAODEgamma/Electron.h
"
12
#include "
xAODEgamma/EgammaEnums.h
"
13
#include "
xAODTracking/TrackParticle.h
"
14
15
#include "TLorentzVector.h"
16
17
namespace
FlavorTagJetDecorators
{
18
19
SoftElectronSelectionAlg::SoftElectronSelectionAlg
(
20
const
std::string& name, ISvcLocator* loc)
21
:
AthReentrantAlgorithm
(name, loc) {}
22
23
StatusCode
SoftElectronSelectionAlg::initialize
() {
24
ATH_CHECK
(
m_jetContainerKey
.initialize());
25
ATH_CHECK
(
m_electronContainerKey
.initialize());
26
ATH_CHECK
(
m_ghostElectronsKey
.initialize());
27
ATH_CHECK
(
m_selectedElectronsKey
.initialize());
28
ATH_CHECK
(
m_energyOverPKey
.initialize());
29
ATH_CHECK
(
m_etKey
.initialize());
30
ATH_CHECK
(
m_isoOverPtKey
.initialize());
31
ATH_CHECK
(
m_dpopKey
.initialize());
32
return
StatusCode::SUCCESS;
33
}
34
35
StatusCode
SoftElectronSelectionAlg::execute
(
36
const
EventContext& ctx)
const
37
{
38
SG::ReadHandle<xAOD::JetContainer>
jets(
m_jetContainerKey
, ctx);
39
ATH_CHECK
(jets.isValid());
40
41
SG::ReadHandle<xAOD::ElectronContainer>
electrons(
42
m_electronContainerKey
, ctx);
43
ATH_CHECK
(electrons.isValid());
44
45
SG::WriteDecorHandle<xAOD::JetContainer, std::vector<ElementLink<xAOD::IParticleContainer>
>> selectedOut(
46
m_selectedElectronsKey
, ctx);
47
48
SG::ReadDecorHandle<xAOD::JetContainer, std::vector<ElementLink<xAOD::IParticleContainer>
>> ghostElectrons(
49
m_ghostElectronsKey
, ctx);
50
51
SG::ReadDecorHandle<xAOD::ElectronContainer, float>
energyOverP(
52
m_energyOverPKey
, ctx);
53
SG::ReadDecorHandle<xAOD::ElectronContainer, float>
et
(
54
m_etKey
, ctx);
55
SG::ReadDecorHandle<xAOD::ElectronContainer, float>
isoOverPt(
56
m_isoOverPtKey
, ctx);
57
SG::ReadDecorHandle<xAOD::ElectronContainer, float>
dpop(
58
m_dpopKey
, ctx);
59
60
for
(
const
xAOD::Jet
*
jet
: *jets) {
61
std::vector<ElementLink<xAOD::IParticleContainer>> selected;
62
63
for
(
const
auto
& link : ghostElectrons(*
jet
)) {
64
const
auto
* el =
dynamic_cast<
const
xAOD::Electron
*
>
(*link);
65
if
(!el)
continue
;
66
67
if
(
passedCuts
(*
jet
, *el,
68
energyOverP(*el),
et
(*el),
69
isoOverPt(*el), dpop(*el))) {
70
selected.push_back(
71
ElementLink<xAOD::IParticleContainer>
(
72
*electrons, el->index()));
73
}
74
}
75
76
selectedOut(*
jet
) = selected;
77
}
78
79
return
StatusCode::SUCCESS;
80
}
81
82
bool
SoftElectronSelectionAlg::passedCuts
(
83
const
xAOD::Jet
&
jet
,
84
const
xAOD::Electron
& el,
85
float
energyOverP,
86
float
et
,
87
float
isoOverPt,
88
float
dpop)
const
89
{
90
TLorentzVector jet4;
91
jet4.SetPtEtaPhiE(
jet
.pt(),
jet
.eta(),
jet
.phi(),
jet
.e());
92
TLorentzVector el4;
93
el4.SetPtEtaPhiE(el.pt(), el.eta(), el.phi(), el.e());
94
95
if
(
m_maxDeltaR
> 0. && jet4.DeltaR(el4) >
m_maxDeltaR
)
96
return
false
;
97
98
if
(std::abs(el.eta()) >
m_absEtaMaximum
)
99
return
false
;
100
if
(el.pt() <=
m_ptMinimum
)
101
return
false
;
102
if
(el.pt() >=
m_ptMaximum
)
103
return
false
;
104
105
const
auto
* track = el.trackParticle();
106
if
(!track)
return
false
;
107
108
if
(std::isfinite(
m_d0Maximum
) &&
109
std::abs(track->d0()) >=
m_d0Maximum
)
110
return
false
;
111
112
// E/p and ET from pre-computed decorations (not caloCluster)
113
if
(std::abs(energyOverP) >
m_eopMaximum
)
114
return
false
;
115
if
(std::abs(
et
) >
m_etMaximum
)
116
return
false
;
117
118
if
(std::abs(isoOverPt) >
m_isoptMaximum
)
119
return
false
;
120
121
float
ptrel = el4.Vect().Perp(jet4.Vect());
122
if
(std::abs(ptrel) >
m_ptrelMaximum
)
123
return
false
;
124
125
float
rhad1 = el.showerShapeValue(
xAOD::EgammaParameters::Rhad1
);
126
float
wstot = el.showerShapeValue(
xAOD::EgammaParameters::wtots1
);
127
float
rphi = el.showerShapeValue(
xAOD::EgammaParameters::Rphi
);
128
float
reta = el.showerShapeValue(
xAOD::EgammaParameters::Reta
);
129
float
deta1 = el.trackCaloMatchValue(
130
xAOD::EgammaParameters::deltaEta1
);
131
132
if
(std::abs(rhad1) >
m_rhad1Maximum
)
133
return
false
;
134
if
(std::abs(wstot) >
m_wstotMaximum
)
135
return
false
;
136
if
(std::abs(rphi) >
m_rphiMaximum
)
137
return
false
;
138
if
(std::abs(reta) >
m_retaMaximum
)
139
return
false
;
140
if
(std::abs(deta1) >
m_deta1Maximum
)
141
return
false
;
142
if
(std::abs(dpop) >
m_dpopMaximum
)
143
return
false
;
144
145
return
true
;
146
}
147
148
}
// namespace FlavorTagJetDecorators
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
EgammaEnums.h
Electron.h
TrackParticle.h
et
float et(const xAOD::jFexSRJetRoI *j)
Definition
L1MonitorAdaptors.h:17
SoftElectronSelectionAlg.h
ReadDecorHandle.h
Handle class for reading a decoration on an object.
ReadHandle.h
Handle class for reading from StoreGate.
WriteDecorHandle.h
Handle class for adding a decoration to an object.
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_rphiMaximum
Gaudi::Property< float > m_rphiMaximum
Definition
SoftElectronSelectionAlg.h:101
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_dpopKey
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_dpopKey
Definition
SoftElectronSelectionAlg.h:76
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_ghostElectronsKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_ghostElectronsKey
Definition
SoftElectronSelectionAlg.h:54
FlavorTagJetDecorators::SoftElectronSelectionAlg::initialize
virtual StatusCode initialize() override
Definition
SoftElectronSelectionAlg.cxx:23
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_wstotMaximum
Gaudi::Property< float > m_wstotMaximum
Definition
SoftElectronSelectionAlg.h:99
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_deta1Maximum
Gaudi::Property< float > m_deta1Maximum
Definition
SoftElectronSelectionAlg.h:105
FlavorTagJetDecorators::SoftElectronSelectionAlg::SoftElectronSelectionAlg
SoftElectronSelectionAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
SoftElectronSelectionAlg.cxx:19
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_etMaximum
Gaudi::Property< float > m_etMaximum
Definition
SoftElectronSelectionAlg.h:91
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_retaMaximum
Gaudi::Property< float > m_retaMaximum
Definition
SoftElectronSelectionAlg.h:103
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_ptMaximum
Gaudi::Property< float > m_ptMaximum
Definition
SoftElectronSelectionAlg.h:83
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_etKey
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_etKey
Definition
SoftElectronSelectionAlg.h:68
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_isoOverPtKey
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_isoOverPtKey
Definition
SoftElectronSelectionAlg.h:72
FlavorTagJetDecorators::SoftElectronSelectionAlg::execute
virtual StatusCode execute(const EventContext &) const override
Definition
SoftElectronSelectionAlg.cxx:35
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_isoptMaximum
Gaudi::Property< float > m_isoptMaximum
Definition
SoftElectronSelectionAlg.h:93
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_d0Maximum
Gaudi::Property< float > m_d0Maximum
Definition
SoftElectronSelectionAlg.h:87
FlavorTagJetDecorators::SoftElectronSelectionAlg::passedCuts
bool passedCuts(const xAOD::Jet &jet, const xAOD::Electron &el, float energyOverP, float et, float isoOverPt, float dpop) const
Definition
SoftElectronSelectionAlg.cxx:82
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_eopMaximum
Gaudi::Property< float > m_eopMaximum
Definition
SoftElectronSelectionAlg.h:89
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_rhad1Maximum
Gaudi::Property< float > m_rhad1Maximum
Definition
SoftElectronSelectionAlg.h:97
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_ptMinimum
Gaudi::Property< float > m_ptMinimum
Definition
SoftElectronSelectionAlg.h:81
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_electronContainerKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronContainerKey
Definition
SoftElectronSelectionAlg.h:48
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_selectedElectronsKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_selectedElectronsKey
Definition
SoftElectronSelectionAlg.h:59
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_dpopMaximum
Gaudi::Property< float > m_dpopMaximum
Definition
SoftElectronSelectionAlg.h:107
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_maxDeltaR
Gaudi::Property< float > m_maxDeltaR
Definition
SoftElectronSelectionAlg.h:109
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_ptrelMaximum
Gaudi::Property< float > m_ptrelMaximum
Definition
SoftElectronSelectionAlg.h:95
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_energyOverPKey
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_energyOverPKey
Definition
SoftElectronSelectionAlg.h:64
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_absEtaMaximum
Gaudi::Property< float > m_absEtaMaximum
Definition
SoftElectronSelectionAlg.h:85
FlavorTagJetDecorators::SoftElectronSelectionAlg::m_jetContainerKey
SG::ReadHandleKey< xAOD::JetContainer > m_jetContainerKey
Definition
SoftElectronSelectionAlg.h:44
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition
StoreGate/StoreGate/ReadDecorHandle.h:94
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
FlavorTagJetDecorators
Definition
JetOverlapLeptonDecoratorAlg.cxx:25
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
xAOD::EgammaParameters::deltaEta1
@ deltaEta1
difference between the cluster eta (first sampling) and the eta of the track extrapolated to the firs...
Definition
EgammaEnums.h:185
xAOD::EgammaParameters::wtots1
@ wtots1
shower width is determined in a window detaxdphi = 0,0625 ×~0,2, corresponding typically to 20 strips...
Definition
EgammaEnums.h:141
xAOD::EgammaParameters::Rphi
@ Rphi
e233/e237
Definition
EgammaEnums.h:157
xAOD::EgammaParameters::Reta
@ Reta
e237/e277
Definition
EgammaEnums.h:155
xAOD::EgammaParameters::Rhad1
@ Rhad1
ethad1/et
Definition
EgammaEnums.h:163
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
xAOD::Electron
Electron_v1 Electron
Definition of the current "egamma version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/Electron.h:17
et
Extra patterns decribing particle interation process.
Generated on
for ATLAS Offline Software by
1.17.0