ATLAS Offline Software
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"
15 #include "xAODEgamma/ElectronFwd.h"
18 
19 class EventContext;
20 
21 namespace Root {
22 class TForwardElectronLikelihoodTool;
23 }
24 
26  : public asg::AsgTool
27  , virtual public IAsgElectronLikelihoodTool
28 {
32 
33 public:
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
93 public:
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
151 private:
153  unsigned int getNPrimVertices(const EventContext& ctx) const;
154 
156 
157  // Private member variables
158 private:
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 
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
AsgForwardElectronLikelihoodTool::getNPrimVertices
unsigned int getNPrimVertices(const EventContext &ctx) const
Get the number of primary vertices.
Definition: AsgForwardElectronLikelihoodTool.cxx:485
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
AsgForwardElectronLikelihoodTool::m_usePVCont
bool m_usePVCont
Whether to use the PV (not available for trigger)
Definition: AsgForwardElectronLikelihoodTool.h:169
Root
Definition: GoodRunsListSelectorTool.h:30
AsgForwardElectronLikelihoodTool::accept
asg::AcceptData accept(const xAOD::Electron *eg) const
The main accept method: the actual cuts are applied here.
Definition: AsgForwardElectronLikelihoodTool.h:55
ParticleTest.eg
eg
Definition: ParticleTest.py:29
AsgForwardElectronLikelihoodTool::getAcceptInfo
virtual const asg::AcceptInfo & getAcceptInfo() const override
Method to get the plain AcceptInfo.
Definition: AsgForwardElectronLikelihoodTool.cxx:195
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition: AsgToolMacros.h:77
AsgForwardElectronLikelihoodTool::getOperatingPointName
virtual std::string getOperatingPointName() const override
Get the name of the current operating point.
Definition: AsgForwardElectronLikelihoodTool.cxx:435
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
AsgForwardElectronLikelihoodTool::~AsgForwardElectronLikelihoodTool
virtual ASG_TOOL_CLASS2(AsgForwardElectronLikelihoodTool, IAsgElectronLikelihoodTool, IAsgSelectionTool) public ~AsgForwardElectronLikelihoodTool()
Standard constructor.
Definition: AsgForwardElectronLikelihoodTool.cxx:85
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
IAsgSelectionTool
Definition: IAsgSelectionTool.h:28
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
AsgForwardElectronLikelihoodTool::m_nPVdefault
unsigned int m_nPVdefault
defualt nPV (when not using PVCont)
Definition: AsgForwardElectronLikelihoodTool.h:172
AsgForwardElectronLikelihoodTool::m_primVtxContKey
SG::ReadHandleKey< xAOD::VertexContainer > m_primVtxContKey
read handle key to primary vertex container
Definition: AsgForwardElectronLikelihoodTool.h:175
AsgForwardElectronLikelihoodTool::accept
asg::AcceptData accept(const EventContext &ctx, const xAOD::Electron *eg) const override
accept method with pointer to electron
Definition: AsgForwardElectronLikelihoodTool.h:60
IAsgElectronLikelihoodTool.h
asg::AcceptInfo
Definition: AcceptInfo.h:28
AsgForwardElectronLikelihoodTool::m_pdfFileName
std::string m_pdfFileName
The input ROOT file name that holds the PDFs.
Definition: AsgForwardElectronLikelihoodTool.h:183
AsgForwardElectronLikelihoodTool::calculate
double calculate(const EventContext &ctx, const xAOD::Electron *eg) const override
calculate method: for pointer to electron
Definition: AsgForwardElectronLikelihoodTool.h:105
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
AsgForwardElectronLikelihoodTool
Electron selector tool to select objects in Asgena using an underlying pure ROOT tool.
Definition: AsgForwardElectronLikelihoodTool.h:28
HIEventShapeContainer.h
ElectronFwd.h
Root::TForwardElectronLikelihoodTool
Definition: TForwardElectronLikelihoodTool.h:89
AsgForwardElectronLikelihoodTool::m_WorkingPoint
std::string m_WorkingPoint
Get the name of the current operating point.
Definition: AsgForwardElectronLikelihoodTool.h:160
AsgForwardElectronLikelihoodTool::initialize
virtual StatusCode initialize() override final
Gaudi Service Interface method implementations.
Definition: AsgForwardElectronLikelihoodTool.cxx:94
AsgForwardElectronLikelihoodTool::m_rootForwardTool
Root::TForwardElectronLikelihoodTool * m_rootForwardTool
Pointer to the underlying ROOT based tool.
Definition: AsgForwardElectronLikelihoodTool.h:166
AcceptData.h
AsgForwardElectronLikelihoodTool::accept
asg::AcceptData accept(const EventContext &ctx, const xAOD::Egamma *eg) const override
accept method with pointer to egamma
Definition: AsgForwardElectronLikelihoodTool.h:73
AsgForwardElectronLikelihoodTool::calculateMultipleOutputs
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.
Definition: AsgForwardElectronLikelihoodTool.h:141
xAOD::Electron_v1
Definition: Electron_v1.h:34
IAsgElectronLikelihoodTool
Interface to tool to select electrons.
Definition: IAsgElectronLikelihoodTool.h:27
VertexContainer.h
AsgForwardElectronLikelihoodTool::calculate
double calculate(const EventContext &ctx, const xAOD::Egamma *eg) const override
calculate method: for pointer to egamma
Definition: AsgForwardElectronLikelihoodTool.h:119
AsgForwardElectronLikelihoodTool::accept
asg::AcceptData accept(const xAOD::Egamma *eg) const
The main accept method: the actual cuts are applied here.
Definition: AsgForwardElectronLikelihoodTool.h:68
AsgForwardElectronLikelihoodTool::calculate
double calculate(const xAOD::Egamma *eg) const
The main result method: the actual likelihood is calculated here.
Definition: AsgForwardElectronLikelihoodTool.h:114
AsgForwardElectronLikelihoodTool::calculate
double calculate(const xAOD::Electron *eg) const
The main result method: the actual likelihood is calculated here.
Definition: AsgForwardElectronLikelihoodTool.h:100
AsgForwardElectronLikelihoodTool::calculate
double calculate(const xAOD::IParticle *part) const
The main result method: the actual likelihood is calculated here.
Definition: AsgForwardElectronLikelihoodTool.cxx:460
AsgForwardElectronLikelihoodTool::accept
asg::AcceptData accept(const xAOD::IParticle *part) const override
The main accept method: using the generic interface.
Definition: AsgForwardElectronLikelihoodTool.cxx:441
AsgTool.h
AsgForwardElectronLikelihoodTool::m_configFile
std::string m_configFile
Definition: AsgForwardElectronLikelihoodTool.h:163
asg::AcceptData
Definition: AcceptData.h:30
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53