ATLAS Offline Software
FsrPhotonTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 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 IEgammaCalibrationAndSmearingTool;
21 }
22 class IAsgSelectionTool;
23 
24 
25 namespace FSR {
26 
32  class FsrPhotonTool : public virtual IFsrPhotonTool,
33  public asg::AsgTool {
34 
37 
38  public:
40  FsrPhotonTool( const std::string& name );
41 
44 
47 
49  virtual StatusCode initialize();
50 
52 
55 
58  xAOD::PhotonContainer* photons,
60 
63  virtual std::vector<FsrCandidate>* getFsrCandidateList(const xAOD::IParticle* part,
64  xAOD::PhotonContainer* photons,
66 
68  virtual std::vector<FsrCandidate>* getFarFsrCandidateList(const xAOD::IParticle* part,
69  xAOD::PhotonContainer* photons_cont);
70 
72  virtual std::vector<FsrCandidate>* getNearFsrCandidateList(const xAOD::Muon* part,
73  const xAOD::PhotonContainer* photons_cont,
74  const xAOD::ElectronContainer* electrons_cont);
75 
77  private:
79  std::vector<FsrCandidate>* sortFsrCandidates( const std::vector< std::pair <const xAOD::IParticle*, double> >& FsrCandList,
80  const std::string& option="ET");
81  bool isOverlap(const xAOD::Electron_v1* electron, const std::vector< std::pair <const xAOD::IParticle*, double> >& phfsr,
82  unsigned int nofPhFsr);
83  double deltaR(float muonEta, float muonPhi, float phEta, float phPhi) const;
84  double deltaPhi(float phi1, float phi2) const;
85  static bool compareEt(const FsrCandidate& c1, const FsrCandidate& c2) { return (c1.Et > c2.Et); }
86 
87  // Note: selecion originally had separate cuts for sliding window clusters and topo clusters
88  // where the min Et threshold for SW clusters was higher than for topoclusters
89  // TODO: remove this distinction since there are only topo clusters in the reconstruction since 2017
90  Gaudi::Property<double> m_high_et_min {this, "high_et_min", 3500. , "Minimum Et cut for higg Et photons" };
91  Gaudi::Property<double> m_overlap_el_ph{this, "overlap_el_ph", 0.01 , "Overlap dR for electrons and photons" };
92  Gaudi::Property<double> m_overlap_el_mu{this, "overlap_el_mu", 0.001 , "Overlap dR for electrons and muons" };
93  Gaudi::Property<double> m_far_fsr_drcut{this, "far_fsr_drcut", 0.15 , "Minimum dR cut for far fsr" };
94  Gaudi::Property<double> m_far_fsr_etcut{this, "far_fsr_etcut", 10000.0 , "Minimum et cut for far fsr" };
95  Gaudi::Property<double> m_drcut {this, "drcut", 0.15 , "Maximun dR cut to be near fsr" };
96  Gaudi::Property<double> m_etcut {this, "etcut", 1000.0 , "Minimum Et cut for near fsr" };
97  Gaudi::Property<double> m_f1cut {this, "f1cut", 0.1 , "f1 cut for high Et clusters" };
98  Gaudi::Property<double> m_topo_drcut{this, "topo_drcut", 0.08 , "Maximum dR cut for low Et clusters" };
99  Gaudi::Property<double> m_topo_f1cut{this, "topo_f1cut", 0.2 , "Minimum f1 cut for low Et clusters" };
100  Gaudi::Property<std::string> m_far_fsr_isoWorkingPoint{this, "far_fsr_isoWorkingPoint", "FixedCutLoose", "Far fsr isolation working point" };
101  Gaudi::Property<std::string> m_energyRescalerName{this, "egCalibToolName", "" , "EnergyRescale tool to calibrate photons as electrons" };
102  Gaudi::Property<bool> m_suppresEnergyRescaling{this, "SuppressEnergyRescaling", false , "flag to suppress energy rescaling - should only be used for testing purposes, e.g. test w/o calib for PhysLite " };
103  Gaudi::Property<bool> m_AFII_corr{this, "AFII_corr", false , "Is AFII for isolation correction" };
104  Gaudi::Property<bool> m_is_mc{this, "IsMC", true , "Is MC" };
105  //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
106  Gaudi::Property<bool> m_doCloseByIso{this, "DoCloseByCorrection", true , "flag to use isolation variables with 'CloseByCorr' suffix " };
107 
108  std::vector<FsrCandidate> m_fsrPhotons;
110 
111  ToolHandle<CP::IIsolationSelectionTool> m_isoSelTool;
112  ToolHandle<CP::IEgammaCalibrationAndSmearingTool> m_energyRescaler;
113  ToolHandle<IAsgSelectionTool> m_elIsGoodOQSelectionTool;
114  ToolHandle<IAsgSelectionTool> m_phIsGoodOQSelectionTool;
115 
116 
117  }; // class FsrPhotonTool
118 
119 } // namespace FSR
120 
121 #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:25
FSR::FsrPhotonTool::m_f1cut
Gaudi::Property< double > m_f1cut
Definition: FsrPhotonTool.h:97
FSR::FsrCandidate::FsrType
FsrType
Definition: IFsrPhotonTool.h:29
FSR::FsrPhotonTool::m_overlap_el_ph
Gaudi::Property< double > m_overlap_el_ph
Definition: FsrPhotonTool.h:91
extractSporadic.c1
c1
Definition: extractSporadic.py:133
FSR::FsrPhotonTool::compareEt
static bool compareEt(const FsrCandidate &c1, const FsrCandidate &c2)
Definition: FsrPhotonTool.h:85
FSR::FsrPhotonTool
Implementation for the "FSR" provider tool.
Definition: FsrPhotonTool.h:33
FSR::IFsrPhotonTool
Definition: IFsrPhotonTool.h:47
FSR::FsrPhotonTool::m_fsrPhotons
std::vector< FsrCandidate > m_fsrPhotons
Definition: FsrPhotonTool.h:108
IAsgSelectionTool
Definition: IAsgSelectionTool.h:28
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:104
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:100
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:104
FSR::FsrPhotonTool::m_energyRescalerName
Gaudi::Property< std::string > m_energyRescalerName
Definition: FsrPhotonTool.h:101
FSR::FsrPhotonTool::m_etcut
Gaudi::Property< double > m_etcut
Definition: FsrPhotonTool.h:96
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
FSR::FsrPhotonTool::m_phIsGoodOQSelectionTool
ToolHandle< IAsgSelectionTool > m_phIsGoodOQSelectionTool
Definition: FsrPhotonTool.h:114
FSR::FsrPhotonTool::initialize
virtual StatusCode initialize()
Function initialising the tool.
Definition: FsrPhotonTool.cxx:34
FSR::FsrPhotonTool::~FsrPhotonTool
~FsrPhotonTool()
Create a destructor.
Definition: FsrPhotonTool.cxx:30
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:472
FSR::FsrPhotonTool::m_doCloseByIso
Gaudi::Property< bool > m_doCloseByIso
Definition: FsrPhotonTool.h:106
FSR::FsrPhotonTool::m_suppresEnergyRescaling
Gaudi::Property< bool > m_suppresEnergyRescaling
Definition: FsrPhotonTool.h:102
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
FSR::FsrPhotonTool::m_AFII_corr
Gaudi::Property< bool > m_AFII_corr
Definition: FsrPhotonTool.h:103
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:449
FSR::FsrPhotonTool::m_elIsGoodOQSelectionTool
ToolHandle< IAsgSelectionTool > m_elIsGoodOQSelectionTool
Definition: FsrPhotonTool.h:113
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:185
FSR::FsrPhotonTool::m_overlap_el_mu
Gaudi::Property< double > m_overlap_el_mu
Definition: FsrPhotonTool.h:92
python.DataFormatRates.c2
c2
Definition: DataFormatRates.py:123
FSR::FsrPhotonTool::m_high_et_min
Gaudi::Property< double > m_high_et_min
Definition: FsrPhotonTool.h:90
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:99
FSR::FsrPhotonTool::FsrPhotonTool
FsrPhotonTool(const std::string &name)
Create a proper constructor for Athena.
Definition: FsrPhotonTool.cxx:21
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:112
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:361
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:137
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:95
FSR::FsrPhotonTool::m_fsr_type
FsrCandidate::FsrType m_fsr_type
Definition: FsrPhotonTool.h:109
FSR::FsrPhotonTool::m_far_fsr_etcut
Gaudi::Property< double > m_far_fsr_etcut
Definition: FsrPhotonTool.h:94
ToolHandle.h
AsgTool.h
FSR::FsrPhotonTool::m_topo_drcut
Gaudi::Property< double > m_topo_drcut
Definition: FsrPhotonTool.h:98
FSR::FsrPhotonTool::m_far_fsr_drcut
Gaudi::Property< double > m_far_fsr_drcut
Definition: FsrPhotonTool.h:93
FSR::FsrPhotonTool::deltaPhi
double deltaPhi(float phi1, float phi2) const
Definition: FsrPhotonTool.cxx:465
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:247
FSR::FsrPhotonTool::m_isoSelTool
ToolHandle< CP::IIsolationSelectionTool > m_isoSelTool
Definition: FsrPhotonTool.h:111