Skip to content
Snippets Groups Projects

ElectronLikelihood tool : Removing deprecated methods, formatting the code

5 files
+ 1010
738
Compare changes
  • Side-by-side
  • Inline
Files
5
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// Dear emacs, this is -*-c++-*-
@@ -7,35 +7,36 @@
#ifndef __ASGELECTRONLIKELIHOODTOOL__
#define __ASGELECTRONLIKELIHOODTOOL__
// Atlas includes
#include "AsgDataHandles/ReadHandleKey.h"
#include "AsgTools/AsgTool.h"
#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
#include "xAODEgamma/ElectronFwd.h"
#include "PATCore/AcceptData.h"
#include "AsgDataHandles/ReadHandleKey.h"
#include "xAODTracking/VertexContainer.h"
#include "xAODEgamma/ElectronFwd.h"
#include "xAODHIEvent/HIEventShapeContainer.h"
#include "xAODTracking/VertexContainer.h"
class EventContext;
namespace Root{
class TElectronLikelihoodTool;
namespace Root {
class TElectronLikelihoodTool;
}
class AsgElectronLikelihoodTool : public asg::AsgTool,
virtual public IAsgElectronLikelihoodTool
class AsgElectronLikelihoodTool
: public asg::AsgTool
, virtual public IAsgElectronLikelihoodTool
{
ASG_TOOL_CLASS2(AsgElectronLikelihoodTool, IAsgElectronLikelihoodTool, IAsgSelectionTool)
ASG_TOOL_CLASS2(AsgElectronLikelihoodTool,
IAsgElectronLikelihoodTool,
IAsgSelectionTool)
public:
/** Standard constructor */
AsgElectronLikelihoodTool( const std::string& myname);
AsgElectronLikelihoodTool(const std::string& myname);
/** Standard destructor */
virtual ~AsgElectronLikelihoodTool();
public:
/** Gaudi Service Interface method implementations */
virtual StatusCode initialize() override;
@@ -43,84 +44,92 @@ public:
// Main methods for IAsgSelectorTool interface
/** Method to get the plain AcceptInfo.
This is needed so that one can already get the AcceptInfo
and query what cuts are defined before the first object
This is needed so that one can already get the AcceptInfo
and query what cuts are defined before the first object
is passed to the tool. */
virtual const asg::AcceptInfo& getAcceptInfo() const override;
/** The main accept method: using the generic interface */
asg::AcceptData accept( const xAOD::IParticle* part ) const override;
asg::AcceptData accept( const EventContext& ctx, const xAOD::IParticle* part ) const override;
virtual asg::AcceptData accept(
const xAOD::IParticle* part) const override final;
virtual asg::AcceptData accept(
const EventContext& ctx,
const xAOD::IParticle* part) const override final;
/** The main accept method: the actual cuts are applied here */
asg::AcceptData accept( const xAOD::Electron* eg ) const {
return accept (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
}
asg::AcceptData accept( const EventContext& ctx, const xAOD::Electron* eg ) const override {
return accept (ctx, eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
virtual asg::AcceptData accept(const EventContext& ctx,
const xAOD::Electron* eg) const override final
{
return accept(ctx, eg, -99); // mu = -99 as input will force accept to grab
// the pileup variable from the xAOD object
}
/** The main accept method: the actual cuts are applied here */
asg::AcceptData accept( const xAOD::Egamma* eg ) const {
return accept (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
}
asg::AcceptData accept(const EventContext& ctx, const xAOD::Egamma* eg ) const override {
return accept (ctx, eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
virtual asg::AcceptData accept(const EventContext& ctx,
const xAOD::Egamma* eg) const override final
{
return accept(ctx, eg, -99); // mu = -99 as input will force accept to grab
// the pileup variable from the xAOD object
}
/** The main accept method: in case mu not in EventInfo online */
asg::AcceptData accept( const xAOD::Electron* eg, double mu ) const;
asg::AcceptData accept( const EventContext& ctx, const xAOD::Electron* eg, double mu ) const override;
virtual asg::AcceptData accept(const EventContext& ctx,
const xAOD::Electron* eg,
double mu) const override final;
/** The main accept method: in case mu not in EventInfo online */
asg::AcceptData accept( const xAOD::Egamma* eg, double mu ) const;
asg::AcceptData accept( const EventContext& ctx, const xAOD::Egamma* eg, double mu ) const override;
virtual asg::AcceptData accept(const EventContext& ctx,
const xAOD::Egamma* eg,
double mu) const override final;
// Main methods for IAsgCalculatorTool interface
public:
/** The main result method: the actual likelihood is calculated here */
double calculate( const xAOD::IParticle* part ) const;
double calculate( const EventContext &ctx, const xAOD::IParticle* part ) const override;
double calculate(const xAOD::IParticle* part) const;
virtual double calculate(const EventContext& ctx,
const xAOD::IParticle* part) const override final;
/** The main result method: the actual likelihood is calculated here */
double calculate( const xAOD::Electron* eg ) const {
return calculate (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
virtual double calculate(const EventContext& ctx,
const xAOD::Electron* eg) const override final
{
return calculate(
ctx, eg, -99); // mu = -99 as input will force accept to grab the pileup
// variable from the xAOD object
}
double calculate( const EventContext &ctx, const xAOD::Electron* eg ) const override {
return calculate (ctx, eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
}
/** The main result method: the actual likelihood is calculated here */
double calculate( const xAOD::Egamma* eg ) const {
return calculate (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
}
double calculate( const EventContext &ctx, const xAOD::Egamma* eg ) const override {
return calculate (ctx, eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object
virtual double calculate(const EventContext& ctx,
const xAOD::Egamma* eg) const override final
{
return calculate(
ctx, eg, -99); // mu = -99 as input will force accept to grab the pileup
// variable from the xAOD object
}
/** The main result method: the actual likelihood is calculated here */
double calculate( const xAOD::Electron* eg, double mu ) const;
double calculate( const EventContext &ctx, const xAOD::Electron* eg, double mu ) const override;
virtual double calculate(const EventContext& ctx,
const xAOD::Electron* eg,
double mu) const override final;
/** The main result method: the actual likelihood is calculated here */
double calculate( const xAOD::Egamma* eg, double mu ) const;
double calculate( const EventContext &ctx, const xAOD::Egamma* eg, double mu ) const override;
virtual double calculate(const EventContext& ctx,
const xAOD::Egamma* eg,
double mu) const override final;
virtual std::string getOperatingPointName( ) const override;
/// Get the name of the current operating point
virtual std::string getOperatingPointName() const override final;
// Private methods
private:
/// Get the number of primary vertices
unsigned int getNPrimVertices(const EventContext &ctx) const;
unsigned int getNPrimVertices(const EventContext& ctx) const;
/// Get the FCal ET for centrality determination (for HI collisions)
double getFcalEt(const EventContext &ctx) const;
/// Get the name of the current operating point
double getFcalEt(const EventContext& ctx) const;
/// check for FwdElectron
bool isForwardElectron( const xAOD::Egamma* eg, const float eta ) const;
bool isForwardElectron(const xAOD::Egamma* eg, const float eta) const;
// Private member variables
private:
@@ -132,7 +141,7 @@ private:
/** Pointer to the underlying ROOT based tool */
Root::TElectronLikelihoodTool* m_rootTool;
/// Whether to use the PV (not available for trigger)
bool m_usePVCont;
@@ -155,21 +164,22 @@ private:
bool m_skipDeltaPoverP;
/// read handle key to heavy ion container
SG::ReadHandleKey<xAOD::HIEventShapeContainer> m_HIESContKey {
this, "CaloSumsContainer", "CaloSums",
"The CaloSums container name"};
SG::ReadHandleKey<xAOD::HIEventShapeContainer> m_HIESContKey{
this,
"CaloSumsContainer",
"CaloSums",
"The CaloSums container name"
};
/// read handle key to primary vertex container
SG::ReadHandleKey<xAOD::VertexContainer> m_primVtxContKey {
this, "primaryVertexContainer", "PrimaryVertices",
"The primary vertex container name"};
SG::ReadHandleKey<xAOD::VertexContainer> m_primVtxContKey{
this,
"primaryVertexContainer",
"PrimaryVertices",
"The primary vertex container name"
};
}; // End: class definition
#endif
Loading