ATLAS Offline Software
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"
16 #include "xAODEgamma/ElectronFwd.h"
20 
21 class EventContext;
22 
23 namespace Root {
24 class TElectronLikelihoodTool;
25 }
26 
28  : public asg::AsgTool
29  , virtual public IAsgElectronLikelihoodTool
30 {
34 
35 public:
37  AsgElectronLikelihoodTool(const std::string& myname);
38 
41 
42 public:
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
89 public:
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  }
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
133 private:
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 
148 
149  // Private member variables
150 private:
152  std::string m_WorkingPoint;
153 
154  // The input config file.
155  std::string m_configFile;
156 
158  Root::TElectronLikelihoodTool* m_rootTool;
159 
162 
164  unsigned int m_nPVdefault;
165 
168 
171 
173  std::string m_pdfFileName;
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 
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 
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
AsgElectronLikelihoodTool::m_avgMuKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_avgMuKey
read handle key to averager mu
Definition: AsgElectronLikelihoodTool.h:204
AsgElectronLikelihoodTool::m_usePVCont
bool m_usePVCont
Whether to use the PV (not available for trigger)
Definition: AsgElectronLikelihoodTool.h:161
AsgElectronLikelihoodTool::getIpVariable
double getIpVariable(double mu, const EventContext &ctx) const
Get IP variable based on user configuration.
Definition: AsgElectronLikelihoodTool.cxx:902
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
Root
Definition: GoodRunsListSelectorTool.h:30
ParticleTest.eg
eg
Definition: ParticleTest.py:29
AsgElectronLikelihoodTool::m_pdfFileName
std::string m_pdfFileName
The input ROOT file name that holds the PDFs.
Definition: AsgElectronLikelihoodTool.h:173
AsgElectronLikelihoodTool::m_configFile
std::string m_configFile
Definition: AsgElectronLikelihoodTool.h:155
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition: AsgToolMacros.h:77
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
Egamma
Definition: ClusMomentumPlots.cxx:11
AsgElectronLikelihoodTool::accept
virtual asg::AcceptData accept(const EventContext &ctx, const xAOD::Egamma *eg) const override final
The main accept method: the actual cuts are applied here.
Definition: AsgElectronLikelihoodTool.h:71
AsgElectronLikelihoodTool::m_correctDeltaEta
bool m_correctDeltaEta
Flag to toggle the correction of deltaEta1 for the pear shape distortion of the LAr.
Definition: AsgElectronLikelihoodTool.h:182
AsgElectronLikelihoodTool::accept
virtual asg::AcceptData accept(const xAOD::IParticle *part) const override final
The main accept method: using the generic interface.
Definition: AsgElectronLikelihoodTool.cxx:868
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
AsgElectronLikelihoodTool::calculate
virtual double calculate(const EventContext &ctx, const xAOD::IParticle *part) const override final
calculate method: for pointer to IParticle
Definition: AsgElectronLikelihoodTool.cxx:887
AsgElectronLikelihoodTool::m_caloOnly
bool m_caloOnly
Flag for calo only LH.
Definition: AsgElectronLikelihoodTool.h:176
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
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:40
AsgElectronLikelihoodTool::getFcalEt
double getFcalEt(const EventContext &ctx) const
Get the FCal ET for centrality determination (for HI collisions)
Definition: AsgElectronLikelihoodTool.cxx:952
AsgElectronLikelihoodTool
Electron selector tool to select objects in Athena using an underlying pure ROOT tool.
Definition: AsgElectronLikelihoodTool.h:30
AsgElectronLikelihoodTool::m_rootTool
Root::TElectronLikelihoodTool * m_rootTool
Pointer to the underlying ROOT based tool.
Definition: AsgElectronLikelihoodTool.h:158
AsgElectronLikelihoodTool::getNPrimVertices
unsigned int getNPrimVertices(const EventContext &ctx) const
Get the number of primary vertices.
Definition: AsgElectronLikelihoodTool.cxx:921
AsgElectronLikelihoodTool::m_fcalEtDefault
double m_fcalEtDefault
defualt FCal ET (when not using CaloSums container, in HI events)
Definition: AsgElectronLikelihoodTool.h:170
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
IAsgElectronLikelihoodTool.h
asg::AcceptInfo
Definition: AcceptInfo.h:28
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.
AsgElectronLikelihoodTool::calculate
virtual double calculate(const EventContext &ctx, const xAOD::Electron *eg) const override final
The main result method: the actual likelihood is calculated here.
Definition: AsgElectronLikelihoodTool.h:94
HIEventShapeContainer.h
AsgElectronLikelihoodTool::getOperatingPointName
virtual std::string getOperatingPointName() const override final
Get the name of the current operating point.
Definition: AsgElectronLikelihoodTool.cxx:861
ElectronFwd.h
AcceptData.h
AsgElectronLikelihoodTool::m_nPVdefault
unsigned int m_nPVdefault
defualt nPV (when not using PVCont)
Definition: AsgElectronLikelihoodTool.h:164
AsgElectronLikelihoodTool::m_HIESContKey
SG::ReadHandleKey< xAOD::HIEventShapeContainer > m_HIESContKey
read handle key to heavy ion container
Definition: AsgElectronLikelihoodTool.h:188
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
AsgElectronLikelihoodTool::getAverageMu
double getAverageMu(const EventContext &ctx) const
Get the average mu.
Definition: AsgElectronLikelihoodTool.cxx:940
AsgElectronLikelihoodTool::~AsgElectronLikelihoodTool
virtual ASG_TOOL_CLASS2(AsgElectronLikelihoodTool, IAsgElectronLikelihoodTool, IAsgSelectionTool) public ~AsgElectronLikelihoodTool()
Standard constructor.
Definition: AsgElectronLikelihoodTool.cxx:74
xAOD::Electron_v1
Definition: Electron_v1.h:34
EventInfo.h
IAsgElectronLikelihoodTool
Interface to tool to select electrons.
Definition: IAsgElectronLikelihoodTool.h:27
VertexContainer.h
AsgElectronLikelihoodTool::m_useAverageMu
bool m_useAverageMu
Definition: AsgElectronLikelihoodTool.h:185
AsgElectronLikelihoodTool::accept
virtual asg::AcceptData accept(const EventContext &ctx, const xAOD::Electron *eg) const override final
The main accept method: the actual cuts are applied here.
Definition: AsgElectronLikelihoodTool.h:63
AsgElectronLikelihoodTool::m_useCaloSumsCont
bool m_useCaloSumsCont
Whether or not to use the CaloSums container in HI events.
Definition: AsgElectronLikelihoodTool.h:167
AsgElectronLikelihoodTool::calculateMultipleOutputs
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.
Definition: AsgElectronLikelihoodTool.h:122
AsgElectronLikelihoodTool::getAcceptInfo
virtual const asg::AcceptInfo & getAcceptInfo() const override
Method to get the plain AcceptInfo.
Definition: AsgElectronLikelihoodTool.cxx:258
AsgElectronLikelihoodTool::calculate
virtual double calculate(const EventContext &ctx, const xAOD::Egamma *eg) const override final
The main result method: the actual likelihood is calculated here.
Definition: AsgElectronLikelihoodTool.h:102
AsgElectronLikelihoodTool::initialize
virtual StatusCode initialize() override
Gaudi Service Interface method implementations.
Definition: AsgElectronLikelihoodTool.cxx:80
AsgElectronLikelihoodTool::m_WorkingPoint
std::string m_WorkingPoint
Working Point.
Definition: AsgElectronLikelihoodTool.h:152
xAOD::HIEventShapeContainer
HIEventShapeContainer_v2 HIEventShapeContainer
Define the latest version of the container.
Definition: HIEventShapeContainer.h:17
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
AsgElectronLikelihoodTool::isForwardElectron
bool isForwardElectron(const xAOD::Egamma *eg, const float eta) const
check for FwdElectron
Definition: AsgElectronLikelihoodTool.cxx:969
AsgTool.h
asg::AcceptData
Definition: AcceptData.h:30
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
AsgElectronLikelihoodTool::m_primVtxContKey
SG::ReadHandleKey< xAOD::VertexContainer > m_primVtxContKey
read handle key to primary vertex container
Definition: AsgElectronLikelihoodTool.h:196
AsgElectronLikelihoodTool::m_skipDeltaPoverP
bool m_skipDeltaPoverP
Flag for skip the use of deltaPoverP in LH computation (like at HLT)
Definition: AsgElectronLikelihoodTool.h:179