ATLAS Offline Software
Loading...
Searching...
No Matches
AsgForwardElectronLikelihoodTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Dear emacs, this is -*-c++-*-
6
7#ifndef __ASGFORWARDELECTRONLIKELIHOODTOOL__
8#define __ASGFORWARDELECTRONLIKELIHOODTOOL__
9
10// Atlas includes
12#include "AsgTools/AsgTool.h"
14#include "PATCore/AcceptData.h"
18
19class EventContext;
20
21namespace Root {
23}
24
26 : public asg::AsgTool
27 , virtual public IAsgElectronLikelihoodTool
28{
32
33public:
35 AsgForwardElectronLikelihoodTool(const std::string& myname);
36
39
41 virtual StatusCode initialize() override final;
42
47 virtual const asg::AcceptInfo& getAcceptInfo() const override;
48
50 asg::AcceptData accept(const xAOD::IParticle* part) const override;
51 asg::AcceptData accept(const EventContext& ctx,
52 const xAOD::IParticle* part) const override;
53
56 {
57 return accept(eg, -99); // mu = -99 as input will force accept to grab the
58 // pileup variable from the xAOD object
59 }
60 asg::AcceptData accept(const EventContext& ctx,
61 const xAOD::Electron* eg) const override
62 {
63 return accept(ctx, eg, -99); // mu = -99 as input will force accept to grab
64 // the pileup variable from the xAOD object
65 }
66
69 {
70 return accept(eg, -99); // mu = -99 as input will force accept to grab the
71 // pileup variable from the xAOD object
72 }
73 asg::AcceptData accept(const EventContext& ctx,
74 const xAOD::Egamma* eg) const override
75 {
76 return accept(ctx, eg, -99); // mu = -99 as input will force accept to grab
77 // the pileup variable from the xAOD object
78 }
79
81 asg::AcceptData accept(const xAOD::Electron* eg, double mu) const;
82 asg::AcceptData accept(const EventContext& ctx,
83 const xAOD::Electron* eg,
84 double mu) const override;
85
87 asg::AcceptData accept(const xAOD::Egamma* eg, double mu) const;
88 asg::AcceptData accept(const EventContext& ctx,
89 const xAOD::Egamma* eg,
90 double mu) const override;
91
92 // Main methods for IAsgCalculatorTool interface
93public:
95 double calculate(const xAOD::IParticle* part) const;
96 double calculate(const EventContext& ctx,
97 const xAOD::IParticle* part) const override;
98
100 double calculate(const xAOD::Electron* eg) const
101 {
102 return calculate(eg, -99); // mu = -99 as input will force accept to grab
103 // the pileup variable from the xAOD object
104 }
105 double calculate(const EventContext& ctx,
106 const xAOD::Electron* eg) const override
107 {
108 return calculate(
109 ctx, eg, -99); // mu = -99 as input will force accept to grab the pileup
110 // variable from the xAOD object
111 }
112
114 double calculate(const xAOD::Egamma* eg) const
115 {
116 return calculate(eg, -99); // mu = -99 as input will force accept to grab
117 // the pileup variable from the xAOD object
118 }
119 double calculate(const EventContext& ctx,
120 const xAOD::Egamma* eg) const override
121 {
122 return calculate(
123 ctx, eg, -99); // mu = -99 as input will force accept to grab the pileup
124 // variable from the xAOD object
125 }
126
128 double calculate(const xAOD::Electron* eg, double mu) const;
129 double calculate(const EventContext& ctx,
130 const xAOD::Electron* eg,
131 double mu) const override;
132
134 double calculate(const xAOD::Egamma* eg, double mu) const;
135 double calculate(const EventContext& ctx,
136 const xAOD::Egamma* eg,
137 double mu) const override;
138
141 virtual std::vector<float> calculateMultipleOutputs(const EventContext &ctx,
142 const xAOD::Electron *eg,
143 double mu = -99) const override
144 {
145 return {static_cast<float>(calculate(ctx, eg, mu))};
146 }
147
148 virtual std::string getOperatingPointName() const override;
149
150 // Private methods
151private:
153 unsigned int getNPrimVertices(const EventContext& ctx) const;
154
156
157 // Private member variables
158private:
159 /* The Working Point */
160 std::string m_WorkingPoint;
161
162 // The input config file.
163 std::string m_configFile;
164
167
170
172 unsigned int m_nPVdefault;
173
176 this,
177 "primaryVertexContainer",
178 "PrimaryVertices",
179 "The primary vertex container name"
180 };
181
183 std::string m_pdfFileName;
184
185}; // End: class definition
186
187#endif
188
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Property holding a SG store/key/clid from which a ReadHandle is made.
Electron selector tool to select objects in Asgena using an underlying pure ROOT tool.
unsigned int m_nPVdefault
defualt nPV (when not using PVCont)
asg::AcceptData accept(const EventContext &ctx, const xAOD::Egamma *eg) const override
accept method with pointer to egamma
unsigned int getNPrimVertices(const EventContext &ctx) const
Get the number of primary vertices.
virtual StatusCode initialize() override final
Gaudi Service Interface method implementations.
std::string m_pdfFileName
The input ROOT file name that holds the PDFs.
asg::AcceptData accept(const xAOD::IParticle *part) const override
The main accept method: using the generic interface.
asg::AcceptData accept(const xAOD::Electron *eg) const
The main accept method: the actual cuts are applied here.
virtual ASG_TOOL_CLASS2(AsgForwardElectronLikelihoodTool, IAsgElectronLikelihoodTool, IAsgSelectionTool) public ~AsgForwardElectronLikelihoodTool()
Standard constructor.
virtual std::string getOperatingPointName() const override
Get the name of the current operating point.
double calculate(const EventContext &ctx, const xAOD::Egamma *eg) const override
calculate method: for pointer to egamma
double calculate(const EventContext &ctx, const xAOD::Electron *eg) const override
calculate method: for pointer to electron
asg::AcceptData accept(const xAOD::Egamma *eg) const
The main accept method: the actual cuts are applied here.
double calculate(const xAOD::IParticle *part) const
The main result method: the actual likelihood is calculated here.
std::string m_WorkingPoint
Get the name of the current operating point.
virtual const asg::AcceptInfo & getAcceptInfo() const override
Method to get the plain AcceptInfo.
Root::TForwardElectronLikelihoodTool * m_rootForwardTool
Pointer to the underlying ROOT based tool.
virtual std::vector< float > calculateMultipleOutputs(const EventContext &ctx, const xAOD::Electron *eg, double mu=-99) const override
The result method for multiple outputs: only one output is used so return vector of that output.
SG::ReadHandleKey< xAOD::VertexContainer > m_primVtxContKey
read handle key to primary vertex container
double calculate(const xAOD::Electron *eg) const
The main result method: the actual likelihood is calculated here.
asg::AcceptData accept(const EventContext &ctx, const xAOD::Electron *eg) const override
accept method with pointer to electron
bool m_usePVCont
Whether to use the PV (not available for trigger)
double calculate(const xAOD::Egamma *eg) const
The main result method: the actual likelihood is calculated here.
Interface to tool to select electrons.
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.
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17
Electron_v1 Electron
Definition of the current "egamma version".