ATLAS Offline Software
FsrPhotonTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef FSRUTILS_FsrPhotonTool_H
6 #define FSRUTILS_FsrPhotonTool_H
7 
8 // Framework include(s):
9 #include "AsgTools/AsgTool.h"
10 #include "AsgTools/ToolHandle.h"
12 
13 
14 // Local include(s):
16 
17 namespace CP
18 {
19  class IIsolationSelectionTool;
20  class IIsolationCorrectionTool;
21  class IEgammaCalibrationAndSmearingTool;
22 }
23 
24 namespace FSR {
25 
30  class FsrPhotonTool : public virtual IFsrPhotonTool,
31  public asg::AsgTool {
32 
35 
36  public:
38  FsrPhotonTool( const std::string& name );
39 
42 
45 
47  virtual StatusCode initialize();
48 
50 
53 
56  xAOD::PhotonContainer* photons,
58 
61  virtual std::vector<FsrCandidate>* getFsrCandidateList(const xAOD::IParticle* part,
62  xAOD::PhotonContainer* photons,
64 
66  virtual std::vector<FsrCandidate>* getFarFsrCandidateList(const xAOD::IParticle* part,
67  xAOD::PhotonContainer* photons_cont);
68 
70  virtual std::vector<FsrCandidate>* getNearFsrCandidateList(const xAOD::Muon* part,
71  const xAOD::PhotonContainer* photons_cont,
72  const xAOD::ElectronContainer* electrons_cont);
73 
75  private:
77  std::vector<FsrCandidate>* sortFsrCandidates( const std::vector< std::pair <const xAOD::IParticle*, double> >& FsrCandList,
78  const std::string& option="ET");
79  bool isOverlap(const xAOD::Electron_v1* electron, const std::vector< std::pair <const xAOD::IParticle*, double> >& phfsr,
80  unsigned int nofPhFsr);
81  double deltaR(float muonEta, float muonPhi, float phEta, float phPhi) const;
82  double deltaPhi(float phi1, float phi2) const;
83  static bool compareEt(const FsrCandidate& c1, const FsrCandidate& c2) { return (c1.Et > c2.Et); }
84 
85  // Note: selecion originally had separate cuts for sliding window clusters and topo clusters
86  // where the min Et threshold for SW clusters was higher than for topoclusters
87  // TODO: remove this distinction since there are only topo clusters in the reconstruction since 2017
88  Gaudi::Property<double> m_high_et_min {this, "high_et_min", 3500. , "Minimum Et cut for higg Et photons" };
89  Gaudi::Property<double> m_overlap_el_ph{this, "overlap_el_ph", 0.01 , "Overlap dR for electrons and photons" };
90  Gaudi::Property<double> m_overlap_el_mu{this, "overlap_el_mu", 0.001 , "Overlap dR for electrons and muons" };
91  Gaudi::Property<double> m_far_fsr_drcut{this, "far_fsr_drcut", 0.15 , "Minimum dR cut for far fsr" };
92  Gaudi::Property<double> m_far_fsr_etcut{this, "far_fsr_etcut", 10000.0 , "Minimum et cut for far fsr" };
93  Gaudi::Property<double> m_drcut {this, "drcut", 0.15 , "Maximun dR cut to be near fsr" };
94  Gaudi::Property<double> m_etcut {this, "etcut", 1000.0 , "Minimum Et cut for near fsr" };
95  Gaudi::Property<double> m_f1cut {this, "f1cut", 0.1 , "f1 cut for high Et clusters" };
96  Gaudi::Property<double> m_topo_drcut{this, "topo_drcut", 0.08 , "Maximum dR cut for low Et clusters" };
97  Gaudi::Property<double> m_topo_f1cut{this, "topo_f1cut", 0.2 , "Minimum f1 cut for low Et clusters" };
98  Gaudi::Property<std::string> m_far_fsr_isoWorkingPoint{this, "far_fsr_isoWorkingPoint", "FixedCutLoose", "Far fsr isolation working point" };
99  Gaudi::Property<std::string> m_energyRescalerName{this, "egCalibToolName", "" , "EnergyRescale tool to calibrate photons as electrons" };
100  Gaudi::Property<bool> m_AFII_corr{this, "AFII_corr", false , "Is AFII for isolation correction" };
101  Gaudi::Property<bool> m_is_mc{this, "IsMC", true , "Is MC" };
102  //Flag to use isolation variables with 'CloseByCorr' suffix which have been corrected for close-by leptons and photons. If false, the uncorrected variables are used
103  Gaudi::Property<bool> m_doCloseByIso{this, "DoCloseByCorrection", true , "flag to use isolation variables with 'CloseByCorr' suffix " };
104 
105  std::vector<FsrCandidate> m_fsrPhotons;
107 
108  ToolHandle<CP::IIsolationSelectionTool> m_isoSelTool;
109  ToolHandle<CP::IIsolationCorrectionTool> m_isoCorrTool;
110  ToolHandle<CP::IEgammaCalibrationAndSmearingTool> m_energyRescaler;
111 
112  }; // class FsrPhotonTool
113 
114 } // namespace FSR
115 
116 #endif // FSRUTILS_FsrPhotonTool_H
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
FSR
Definition: FsrPhotonTool.h:24
FSR::FsrPhotonTool::m_f1cut
Gaudi::Property< double > m_f1cut
Definition: FsrPhotonTool.h:95
FSR::FsrCandidate::FsrType
FsrType
Definition: IFsrPhotonTool.h:29
FSR::FsrPhotonTool::m_overlap_el_ph
Gaudi::Property< double > m_overlap_el_ph
Definition: FsrPhotonTool.h:89
extractSporadic.c1
c1
Definition: extractSporadic.py:134
FSR::FsrPhotonTool::compareEt
static bool compareEt(const FsrCandidate &c1, const FsrCandidate &c2)
Definition: FsrPhotonTool.h:83
FSR::FsrPhotonTool
Implementation for the "FSR" provider tool.
Definition: FsrPhotonTool.h:31
FSR::IFsrPhotonTool
Definition: IFsrPhotonTool.h:47
FSR::FsrPhotonTool::m_fsrPhotons
std::vector< FsrCandidate > m_fsrPhotons
Definition: FsrPhotonTool.h:105
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:49
IFsrPhotonTool.h
FSR::FsrPhotonTool::m_is_mc
Gaudi::Property< bool > m_is_mc
Definition: FsrPhotonTool.h:101
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
FSR::FsrPhotonTool::m_far_fsr_isoWorkingPoint
Gaudi::Property< std::string > m_far_fsr_isoWorkingPoint
Definition: FsrPhotonTool.h:98
FSR::FsrPhotonTool::getFsrPhoton
virtual CP::CorrectionCode getFsrPhoton(const xAOD::IParticle *part, FsrCandidate &candidate, xAOD::PhotonContainer *photons, const xAOD::ElectronContainer *electrons)
Get the "FSR candidate" as a return value for a muon (collinar and far FSR)
Definition: FsrPhotonTool.cxx:101
FSR::FsrPhotonTool::m_energyRescalerName
Gaudi::Property< std::string > m_energyRescalerName
Definition: FsrPhotonTool.h:99
FSR::FsrPhotonTool::m_etcut
Gaudi::Property< double > m_etcut
Definition: FsrPhotonTool.h:94
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
FSR::FsrPhotonTool::initialize
virtual StatusCode initialize()
Function initialising the tool.
Definition: FsrPhotonTool.cxx:32
FSR::FsrPhotonTool::~FsrPhotonTool
~FsrPhotonTool()
Create a destructor.
Definition: FsrPhotonTool.cxx:28
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
FSR::FsrPhotonTool::deltaR
double deltaR(float muonEta, float muonPhi, float phEta, float phPhi) const
Definition: FsrPhotonTool.cxx:468
FSR::FsrPhotonTool::m_doCloseByIso
Gaudi::Property< bool > m_doCloseByIso
Definition: FsrPhotonTool.h:103
FSR::FsrPhotonTool::m_isoCorrTool
ToolHandle< CP::IIsolationCorrectionTool > m_isoCorrTool
Definition: FsrPhotonTool.h:109
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
FSR::FsrPhotonTool::m_AFII_corr
Gaudi::Property< bool > m_AFII_corr
Definition: FsrPhotonTool.h:100
xAOD::Electron_v1
Definition: Electron_v1.h:34
FSR::FsrPhotonTool::isOverlap
bool isOverlap(const xAOD::Electron_v1 *electron, const std::vector< std::pair< const xAOD::IParticle *, double > > &phfsr, unsigned int nofPhFsr)
Definition: FsrPhotonTool.cxx:445
FSR::FsrPhotonTool::getFarFsrCandidateList
virtual std::vector< FsrCandidate > * getFarFsrCandidateList(const xAOD::IParticle *part, xAOD::PhotonContainer *photons_cont)
Find and Return ALL FAR FSR candidates.
Definition: FsrPhotonTool.cxx:184
FSR::FsrPhotonTool::m_overlap_el_mu
Gaudi::Property< double > m_overlap_el_mu
Definition: FsrPhotonTool.h:90
python.DataFormatRates.c2
c2
Definition: DataFormatRates.py:123
FSR::FsrPhotonTool::m_high_et_min
Gaudi::Property< double > m_high_et_min
Definition: FsrPhotonTool.h:88
FSR::FsrCandidate
Simple interface for searching the FSR candidate.
Definition: IFsrPhotonTool.h:27
FSR::FsrPhotonTool::m_topo_f1cut
Gaudi::Property< double > m_topo_f1cut
Definition: FsrPhotonTool.h:97
FSR::FsrPhotonTool::FsrPhotonTool
FsrPhotonTool(const std::string &name)
Create a proper constructor for Athena.
Definition: FsrPhotonTool.cxx:20
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
FSR::FsrPhotonTool::m_energyRescaler
ToolHandle< CP::IEgammaCalibrationAndSmearingTool > m_energyRescaler
Definition: FsrPhotonTool.h:110
FSR::FsrPhotonTool::sortFsrCandidates
std::vector< FsrCandidate > * sortFsrCandidates(const std::vector< std::pair< const xAOD::IParticle *, double > > &FsrCandList, const std::string &option="ET")
Need for the FSR search.
Definition: FsrPhotonTool.cxx:358
FSR::FsrPhotonTool::getFsrCandidateList
virtual std::vector< FsrCandidate > * getFsrCandidateList(const xAOD::IParticle *part, xAOD::PhotonContainer *photons, const xAOD::ElectronContainer *electrons)
Find ALL FSR candidates for a given particle (electron or muon) providing newly calibrated photon and...
Definition: FsrPhotonTool.cxx:135
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
FSR::FsrPhotonTool::m_drcut
Gaudi::Property< double > m_drcut
Definition: FsrPhotonTool.h:93
FSR::FsrPhotonTool::m_fsr_type
FsrCandidate::FsrType m_fsr_type
Definition: FsrPhotonTool.h:106
FSR::FsrPhotonTool::m_far_fsr_etcut
Gaudi::Property< double > m_far_fsr_etcut
Definition: FsrPhotonTool.h:92
ToolHandle.h
AsgTool.h
FSR::FsrPhotonTool::m_topo_drcut
Gaudi::Property< double > m_topo_drcut
Definition: FsrPhotonTool.h:96
FSR::FsrPhotonTool::m_far_fsr_drcut
Gaudi::Property< double > m_far_fsr_drcut
Definition: FsrPhotonTool.h:91
FSR::FsrPhotonTool::deltaPhi
double deltaPhi(float phi1, float phi2) const
Definition: FsrPhotonTool.cxx:460
InDetDD::electrons
@ electrons
Definition: InDetDD_Defs.h:17
FSR::FsrPhotonTool::getNearFsrCandidateList
virtual std::vector< FsrCandidate > * getNearFsrCandidateList(const xAOD::Muon *part, const xAOD::PhotonContainer *photons_cont, const xAOD::ElectronContainer *electrons_cont)
Find and Return ALL NEAR FSR candidates.
Definition: FsrPhotonTool.cxx:251
FSR::FsrPhotonTool::m_isoSelTool
ToolHandle< CP::IIsolationSelectionTool > m_isoSelTool
Definition: FsrPhotonTool.h:108