ATLAS Offline Software
Loading...
Searching...
No Matches
AsgElectronLikelihoodTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Dear emacs, this is -*-c++-*-
6
7#ifndef __ASGELECTRONLIKELIHOODTOOL__
8#define __ASGELECTRONLIKELIHOODTOOL__
9
10// Atlas includes
13#include "AsgTools/AsgTool.h"
15#include "PATCore/AcceptData.h"
20
21class EventContext;
22
23namespace Root {
25}
26
28 : public asg::AsgTool
29 , virtual public IAsgElectronLikelihoodTool
30{
34
35public:
37 AsgElectronLikelihoodTool(const std::string& myname);
38
41
42public:
44 virtual StatusCode initialize() override;
45
46 // Main methods for IAsgSelectorTool interface
47
52 virtual const asg::AcceptInfo& getAcceptInfo() const override;
53
55 virtual asg::AcceptData accept(
56 const xAOD::IParticle* part) const override final;
57
58 virtual asg::AcceptData accept(
59 const EventContext& ctx,
60 const xAOD::IParticle* part) const override final;
61
63 virtual asg::AcceptData accept(const EventContext& ctx,
64 const xAOD::Electron* eg) const override final
65 {
66 return accept(ctx, eg, -99); // mu = -99 as input will force accept to grab
67 // the pileup variable from the xAOD object
68 }
69
71 virtual asg::AcceptData accept(const EventContext& ctx,
72 const xAOD::Egamma* eg) const override final
73 {
74 return accept(ctx, eg, -99); // mu = -99 as input will force accept to grab
75 // the pileup variable from the xAOD object
76 }
77
79 virtual asg::AcceptData accept(const EventContext& ctx,
80 const xAOD::Electron* eg,
81 double mu) const override final;
82
84 virtual asg::AcceptData accept(const EventContext& ctx,
85 const xAOD::Egamma* eg,
86 double mu) const override final;
87
88 // Main methods for IAsgCalculatorTool interface
89public:
90
91 virtual double calculate(const EventContext& ctx,
92 const xAOD::IParticle* part) const override final;
94 virtual double calculate(const EventContext& ctx,
95 const xAOD::Electron* eg) const override final
96 {
97 return calculate(
98 ctx, eg, -99); // mu = -99 as input will force accept to grab the pileup
99 // variable from the xAOD object
100 }
101
102 virtual double calculate(const EventContext& ctx,
103 const xAOD::Egamma* eg) const override final
104 {
105 return calculate(
106 ctx, eg, -99); // mu = -99 as input will force accept to grab the pileup
107 // variable from the xAOD object
108 }
109
111 virtual double calculate(const EventContext& ctx,
112 const xAOD::Electron* eg,
113 double mu) const override final;
114
116 virtual double calculate(const EventContext& ctx,
117 const xAOD::Egamma* eg,
118 double mu) const override final;
119
122 virtual std::vector<float> calculateMultipleOutputs(const EventContext &ctx,
123 const xAOD::Electron *eg,
124 double mu = -99) const override final
125 {
126 return {static_cast<float>(calculate(ctx, eg, mu))};
127 }
128
130 virtual std::string getOperatingPointName() const override final;
131
132 // Private methods
133private:
135 double getIpVariable(double mu, const EventContext& ctx) const;
136
138 unsigned int getNPrimVertices(const EventContext& ctx) const;
139
141 double getAverageMu(const EventContext& ctx) const;
142
144 double getFcalEt(const EventContext& ctx) const;
145
147 bool isForwardElectron(const xAOD::Egamma* eg, const float eta) const;
148
149 // Private member variables
150private:
153
154 // The input config file.
156
158 Root::TElectronLikelihoodTool* m_rootTool;
159
162
164 unsigned int m_nPVdefault;
165
168
171
174
176 bool m_caloOnly = false;
177
180
182 bool m_correctDeltaEta = false;
183
184 // Whether to use average mu instead of NPV
185 bool m_useAverageMu = false;
186
188 SG::ReadHandleKey<xAOD::HIEventShapeContainer> m_HIESContKey{
189 this,
190 "CaloSumsContainer",
191 "CaloSums",
192 "The CaloSums container name"
193 };
194
197 this,
198 "primaryVertexContainer",
199 "PrimaryVertices",
200 "The primary vertex container name"
201 };
202
205 this, "averageInteractionsPerCrossingKey",
206 "EventInfo.averageInteractionsPerCrossing",
207 "Decoration for Average Interaction Per Crossing"
208 };
209}; // End: class definition
210
211#endif
212
Scalar eta() const
pseudorapidity method
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Electron selector tool to select objects in Athena using an underlying pure ROOT tool.
virtual double calculate(const EventContext &ctx, const xAOD::IParticle *part) const override final
calculate method: for pointer to IParticle
double getAverageMu(const EventContext &ctx) const
Get the average mu.
virtual double calculate(const EventContext &ctx, const xAOD::Electron *eg) const override final
The main result method: the actual likelihood is calculated here.
std::string m_pdfFileName
The input ROOT file name that holds the PDFs.
bool isForwardElectron(const xAOD::Egamma *eg, const float eta) const
check for FwdElectron
virtual std::vector< float > calculateMultipleOutputs(const EventContext &ctx, const xAOD::Electron *eg, double mu=-99) const override final
The result method for multiple outputs: only one output is used so return vector of that output.
unsigned int getNPrimVertices(const EventContext &ctx) const
Get the number of primary vertices.
bool m_usePVCont
Whether to use the PV (not available for trigger)
unsigned int m_nPVdefault
defualt nPV (when not using PVCont)
virtual double calculate(const EventContext &ctx, const xAOD::Egamma *eg) const override final
The main result method: the actual likelihood is calculated here.
SG::ReadHandleKey< xAOD::HIEventShapeContainer > m_HIESContKey
read handle key to heavy ion container
virtual const asg::AcceptInfo & getAcceptInfo() const override
Method to get the plain AcceptInfo.
virtual asg::AcceptData accept(const EventContext &ctx, const xAOD::Electron *eg) const override final
The main accept method: the actual cuts are applied here.
bool m_skipDeltaPoverP
Flag for skip the use of deltaPoverP in LH computation (like at HLT)
virtual std::string getOperatingPointName() const override final
Get the name of the current operating point.
virtual asg::AcceptData accept(const xAOD::IParticle *part) const override final
The main accept method: using the generic interface.
virtual asg::AcceptData accept(const EventContext &ctx, const xAOD::Egamma *eg) const override final
The main accept method: the actual cuts are applied here.
bool m_caloOnly
Flag for calo only LH.
virtual ASG_TOOL_CLASS2(AsgElectronLikelihoodTool, IAsgElectronLikelihoodTool, IAsgSelectionTool) public ~AsgElectronLikelihoodTool()
Standard constructor.
double getIpVariable(double mu, const EventContext &ctx) const
Get IP variable based on user configuration.
bool m_useCaloSumsCont
Whether or not to use the CaloSums container in HI events.
SG::ReadHandleKey< xAOD::VertexContainer > m_primVtxContKey
read handle key to primary vertex container
std::string m_WorkingPoint
Working Point.
virtual StatusCode initialize() override
Gaudi Service Interface method implementations.
SG::ReadDecorHandleKey< xAOD::EventInfo > m_avgMuKey
read handle key to averager mu
double m_fcalEtDefault
defualt FCal ET (when not using CaloSums container, in HI events)
bool m_correctDeltaEta
Flag to toggle the correction of deltaEta1 for the pear shape distortion of the LAr.
double getFcalEt(const EventContext &ctx) const
Get the FCal ET for centrality determination (for HI collisions)
Root::TElectronLikelihoodTool * m_rootTool
Pointer to the underlying ROOT based tool.
Interface to tool to select electrons.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Class providing the definition of the 4-vector interface.
Forward declaration.
STL namespace.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17
Electron_v1 Electron
Definition of the current "egamma version".
#define private