ATLAS Offline Software
IIsolationCloseByCorrectionTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef ISOLATIONSELECTION_IISOLATIONCLOSEBYCORRECTIONTOOL_H
6 #define ISOLATIONSELECTION_IISOLATIONCLOSEBYCORRECTIONTOOL_H
7 
9 #include <AsgTools/IAsgTool.h>
13 #include <PATCore/AcceptData.h>
14 #include <PATCore/AcceptInfo.h>
18 #include <xAODMuon/MuonContainer.h>
20 
21 class EventContext;
22 
23 namespace CP {
26  public:
27  // This function calculates and applies (the particle is not redecorated) the corrections for close-by objects for each isolation
28  // variables and tests whether the particle passes the isolation working point after the corrections. Note that to use this
29  // functionality, a IsolationSelectionTool must have been passed to the tool (which must have been intialised indicating which
30  // isolation working point to use). The result returned is a AcceptData object which is the decision made by the tool with respect
31  // to the particle passing the working point.
32  virtual asg::AcceptData acceptCorrected(const xAOD::IParticle& x, const xAOD::IParticleContainer& closePar) const = 0;
33 
34  // This function calculates the values of the corrections for close-by objects to be applied to the isolation variables (without
35  // redecorating the particles). The corrections are returned in a vector (one correction per isolation type provided). This function
36  // is intended for experts only who want to check the effects of the corrections.
37  virtual CorrectionCode getCloseByCorrection(std::vector<float>& corrections, const xAOD::IParticle& par,
38  const std::vector<xAOD::Iso::IsolationType>& types,
39  const xAOD::IParticleContainer& closePar) const = 0;
40 
41  // This function calculates the values of the corrections for close-by objects and applies them to the isolation variables and
42  // writes them out as a new decoration of the particles. This requires a suffix to be specified for the new decoration, otherwise
43  // an ERROR will be returned.
45  const EventContext& ctx,
46  const xAOD::ElectronContainer* Electrons = nullptr,
47  const xAOD::MuonContainer* Muons = nullptr,
48  const xAOD::PhotonContainer* Photons = nullptr
49  ) const = 0;
50  virtual float getOriginalIsolation(const xAOD::IParticle& P, IsoType type) const = 0;
51  virtual float getOriginalIsolation(const xAOD::IParticle* P, IsoType type) const = 0;
52 
54  virtual void associateCluster(const xAOD::IParticle* particle, float& eta, float& phi, float& energy) const = 0;
55 
56  virtual void associateFlowElement(const EventContext& ctx, const xAOD::IParticle* particle, float& eta, float& phi,
57  float& energy) const = 0;
58 
61  virtual TrackSet getTrackCandidates(const EventContext& ctx, const xAOD::IParticle* particle) const = 0;
62 
64  virtual const xAOD::IParticle* isoRefParticle(const xAOD::IParticle* particle) const = 0;
65 
66  virtual ~IIsolationCloseByCorrectionTool() = default;
67  };
68 
69 } // namespace CP
70 #endif
CP::IIsolationCloseByCorrectionTool::getOriginalIsolation
virtual float getOriginalIsolation(const xAOD::IParticle &P, IsoType type) const =0
CP::IIsolationCloseByCorrectionTool::getOriginalIsolation
virtual float getOriginalIsolation(const xAOD::IParticle *P, IsoType type) const =0
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
FlowElementContainer.h
CP::IIsolationCloseByCorrectionTool::~IIsolationCloseByCorrectionTool
virtual ~IIsolationCloseByCorrectionTool()=default
CurrentContext.h
DMTest::P
P_v1 P
Definition: P.h:23
CP::IIsolationCloseByCorrectionTool::associateCluster
virtual void associateCluster(const xAOD::IParticle *particle, float &eta, float &phi, float &energy) const =0
Retrieve the associated clusters from the Particle and calculate the average eta/phi/energy.
asg::IAsgTool
Base class for the dual-use tool interface classes.
Definition: IAsgTool.h:41
CP::IIsolationCloseByCorrectionTool::acceptCorrected
virtual asg::AcceptData acceptCorrected(const xAOD::IParticle &x, const xAOD::IParticleContainer &closePar) const =0
CP::TrackSet
std::set< TrackPtr > TrackSet
Definition: PhysicsAnalysis/AnalysisCommon/IsolationSelection/IsolationSelection/Defs.h:72
CP::IIsolationCloseByCorrectionTool::getCloseByIsoCorrection
virtual CorrectionCode getCloseByIsoCorrection(const EventContext &ctx, const xAOD::ElectronContainer *Electrons=nullptr, const xAOD::MuonContainer *Muons=nullptr, const xAOD::PhotonContainer *Photons=nullptr) const =0
Defs.h
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
x
#define x
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
CP::IIsolationCloseByCorrectionTool::isoRefParticle
virtual const xAOD::IParticle * isoRefParticle(const xAOD::IParticle *particle) const =0
Retrieve the reference particle to define the cone axis in which the track particles contributing to ...
CP::IIsolationCloseByCorrectionTool::getCloseByCorrection
virtual CorrectionCode getCloseByCorrection(std::vector< float > &corrections, const xAOD::IParticle &par, const std::vector< xAOD::Iso::IsolationType > &types, const xAOD::IParticleContainer &closePar) const =0
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
ElectronContainer.h
CP::IIsolationCloseByCorrectionTool::associateFlowElement
virtual void associateFlowElement(const EventContext &ctx, const xAOD::IParticle *particle, float &eta, float &phi, float &energy) const =0
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
xAOD::Iso::IsolationType
IsolationType
Overall enumeration for isolation types in xAOD files.
Definition: IsolationType.h:26
ASG_TOOL_INTERFACE
#define ASG_TOOL_INTERFACE(CLASSNAME)
Definition: AsgToolMacros.h:40
CP::IIsolationCloseByCorrectionTool
Definition: IIsolationCloseByCorrectionTool.h:24
IAsgTool.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
AcceptData.h
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
MuonContainer.h
AcceptInfo.h
CP::IIsolationCloseByCorrectionTool::getTrackCandidates
virtual TrackSet getTrackCandidates(const EventContext &ctx, const xAOD::IParticle *particle) const =0
Retrieve the track particles associated with the primary particle.
Muons
Definition: Muons.py:1
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
CorrectionCode.h
asg::AcceptData
Definition: AcceptData.h:30
checker_macros.h
Define macros for attributes used to control the static checker.
PhotonContainer.h