ATLAS Offline Software
SkimmingToolHIGG1.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SkimmingToolHIGG1.h, (c) ATLAS Detector software
8 
9 #ifndef DERIVATIONFRAMEWORK_SKIMMINGTOOLHSG1_H
10 #define DERIVATIONFRAMEWORK_SKIMMINGTOOLHSG1_H
11 
12 #include <array>
13 #include <optional>
14 #include <string>
15 #include <vector>
16 #include <algorithm>
17 
18 // Gaudi & Athena basics
20 
21 // DerivationFramework includes
23 
24 // xAOD header files
27 #include "xAODJet/JetContainer.h"
28 #include "xAODMuon/MuonContainer.h"
30 
31 
33 
35 
36 namespace DerivationFramework {
37 
46  class SkimmingToolHIGG1 : public AthAlgTool, public ISkimmingTool {
47 
48 
49 
50  public:
52  SkimmingToolHIGG1( const std::string& t, const std::string& n, const IInterface* p );
53 
56 
57  // Athena algtool's Hooks
58  virtual StatusCode initialize() override;
59  virtual StatusCode finalize() override;
60 
62  virtual bool eventPassesFilter() const override;
63 
64  private:
65 
68 
69  ToolHandle<Trig::TrigDecisionTool> m_trigDecisionTool;
70 
71 
72 
73  // CUTS TO APPLY OR NOT
74  bool m_reqGRL;
91 
92 
93  // CUT VALUES/SETTINGS
94 
95  std::string m_goodRunList;
96 
97  std::string m_defaultTrigger;
98  std::vector<std::string> m_triggers;
99  std::vector<std::string> m_mergedtriggers;
100 
103  double m_maxEta;
104 
108 
111 
114  double m_minMuonPt;
115  double m_maxMuonEta;
116 
117 
120 
121  // Cuts
122  bool SubcutOneMergedElectron() const;
123  bool SubcutGoodRunList() const;
124  bool SubcutLArError(const xAOD::EventInfo& eventInfo) const;
125  bool SubcutTrigger() const;
127  using LeadingPhotons_t = std::array<const xAOD::Photon*, 2>;
128  std::optional<LeadingPhotons_t> SubcutPreselect() const;
129  bool SubcutOnePhotonOneElectron() const;
130  bool SubcutTwoElectrons() const;
131  bool SubcutOnePhotonOneMuon() const;
132  bool SubcutOnePhotonTwoElectrons() const;
133  bool SubcutOnePhotonTwoMuons() const;
134  bool SubcutOnePhotonMergedElectrons(const xAOD::EventInfo& eventInfo) const;
136 
137  bool SubcutKinematic(const LeadingPhotons_t& leadingPhotons, double invariantMass) const;
138  bool SubcutQuality(const LeadingPhotons_t& leadingPhotons) const;
139  bool SubcutIsolation() const;
140  bool SubcutInvariantMass(double invariantMass) const;
141 
142  // Calculators
143  bool PhotonPreselect(const xAOD::Photon *ph) const;
144  bool ElectronPreselect(const xAOD::Electron *el) const;
145  bool MergedElectronPreselect(const xAOD::Electron *el) const;
146  bool MuonPreselect(const xAOD::Muon *mu) const;
147  double CalculateInvariantMass(const LeadingPhotons_t& leadingPhotons) const;
148  double GetDiphotonVertex() const;
149  static double CorrectedEnergy(const xAOD::Photon *ph) ;
150  double CorrectedEta(const xAOD::Photon *ph) const;
151  static double ReturnRZ_1stSampling_cscopt2(double eta1) ;
152 
153 
156 
157  mutable std::atomic<unsigned int> m_n_tot{0};
158  mutable std::atomic<unsigned int> m_n_passGRL{0};
159  mutable std::atomic<unsigned int> m_n_passLArError{0};
160  mutable std::atomic<unsigned int> m_n_passTrigger{0};
161  mutable std::atomic<unsigned int> m_n_passPreselect{0};
162  mutable std::atomic<unsigned int> m_n_passSingleElectronPreselect{0};
163  mutable std::atomic<unsigned int> m_n_passDoubleElectronPreselect{0};
164  mutable std::atomic<unsigned int> m_n_passSingleMuonPreselect{0};
165  mutable std::atomic<unsigned int> m_n_passSinglePhotonDoubleMuonPreselect{0};
166  mutable std::atomic<unsigned int> m_n_passSinglePhotonDoubleElectronPreselect{0};
167  mutable std::atomic<unsigned int> m_n_passSinglePhotonMergedElectronPreselect{0};
168  mutable std::atomic<unsigned int> m_n_passHighPtPhotonMergedElectronPreselect{0};
169  mutable std::atomic<unsigned int> m_n_passSingleMergedElectronPreselect{0};
170  mutable std::atomic<unsigned int> m_n_passKinematic{0};
171  mutable std::atomic<unsigned int> m_n_passQuality{0};
172  mutable std::atomic<unsigned int> m_n_passIsolation{0};
173  mutable std::atomic<unsigned int> m_n_passInvariantMass{0};
174  mutable std::atomic<unsigned int> m_n_pass{0};
175 
176 
179 
180  static const double s_MZ;
181 
184 
185  ToolHandle<IAsgElectronIsEMSelector> m_mergedCutTools;
186 
188  m_eventInfoKey { this, "EventInfoKey", "EventInfo", "" };
189 
191  m_photonKey { this, "PhotonKey", "Photons", "" };
192 
194  m_electronKey { this, "ElectronKey", "Electrons", "" };
195 
197  m_muonKey { this, "MuonKey", "Muons", "" };
198 
199  };
200 
201 }
202 
203 #endif // DERIVATIONFRAMEWORK_SKIMMINGTOOLEXAMPLE_H
DerivationFramework::SkimmingToolHIGG1::SubcutTrigger
bool SubcutTrigger() const
Definition: SkimmingToolHIGG1.cxx:227
DerivationFramework::SkimmingToolHIGG1::m_minMergedElectronPt
double m_minMergedElectronPt
Definition: SkimmingToolHIGG1.h:113
DerivationFramework::SkimmingToolHIGG1::initialize
virtual StatusCode initialize() override
Definition: SkimmingToolHIGG1.cxx:82
DerivationFramework::SkimmingToolHIGG1::MergedElectronPreselect
bool MergedElectronPreselect(const xAOD::Electron *el) const
Definition: SkimmingToolHIGG1.cxx:800
DerivationFramework::SkimmingToolHIGG1::SubcutOneMergedElectron
bool SubcutOneMergedElectron() const
Definition: SkimmingToolHIGG1.cxx:497
DerivationFramework::SkimmingToolHIGG1::m_triggers
std::vector< std::string > m_triggers
Definition: SkimmingToolHIGG1.h:98
DerivationFramework::SkimmingToolHIGG1::~SkimmingToolHIGG1
~SkimmingToolHIGG1()
Destructor.
Definition: SkimmingToolHIGG1.cxx:78
DerivationFramework::SkimmingToolHIGG1::SubcutInvariantMass
bool SubcutInvariantMass(double invariantMass) const
Definition: SkimmingToolHIGG1.cxx:375
DerivationFramework::SkimmingToolHIGG1::m_incSingleMuon
bool m_incSingleMuon
Definition: SkimmingToolHIGG1.h:81
DerivationFramework::SkimmingToolHIGG1::m_reqPreselection
bool m_reqPreselection
Definition: SkimmingToolHIGG1.h:77
DerivationFramework::SkimmingToolHIGG1::m_n_passSinglePhotonDoubleElectronPreselect
std::atomic< unsigned int > m_n_passSinglePhotonDoubleElectronPreselect
Definition: SkimmingToolHIGG1.h:166
DerivationFramework::SkimmingToolHIGG1::SkimmingToolHIGG1
SkimmingToolHIGG1(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
Definition: SkimmingToolHIGG1.cxx:22
DerivationFramework::SkimmingToolHIGG1::m_n_passPreselect
std::atomic< unsigned int > m_n_passPreselect
Definition: SkimmingToolHIGG1.h:161
DerivationFramework::SkimmingToolHIGG1::SubcutGoodRunList
bool SubcutGoodRunList() const
Definition: SkimmingToolHIGG1.cxx:209
DerivationFramework::SkimmingToolHIGG1::m_minElectronPt
double m_minElectronPt
Definition: SkimmingToolHIGG1.h:112
DerivationFramework::SkimmingToolHIGG1::m_incTwoPhotons
bool m_incTwoPhotons
Definition: SkimmingToolHIGG1.h:86
DerivationFramework::SkimmingToolHIGG1::m_n_passSingleMergedElectronPreselect
std::atomic< unsigned int > m_n_passSingleMergedElectronPreselect
Definition: SkimmingToolHIGG1.h:169
DerivationFramework::SkimmingToolHIGG1
Definition: SkimmingToolHIGG1.h:46
DerivationFramework::SkimmingToolHIGG1::m_maxMuonEta
double m_maxMuonEta
Definition: SkimmingToolHIGG1.h:115
DerivationFramework::SkimmingToolHIGG1::m_maxEta
double m_maxEta
Definition: SkimmingToolHIGG1.h:103
DerivationFramework::SkimmingToolHIGG1::finalize
virtual StatusCode finalize() override
Definition: SkimmingToolHIGG1.cxx:116
DerivationFramework::SkimmingToolHIGG1::m_n_pass
std::atomic< unsigned int > m_n_pass
Definition: SkimmingToolHIGG1.h:174
DerivationFramework::SkimmingToolHIGG1::m_reqLArError
bool m_reqLArError
Definition: SkimmingToolHIGG1.h:75
DerivationFramework::SkimmingToolHIGG1::m_reqTrigger
bool m_reqTrigger
Definition: SkimmingToolHIGG1.h:76
DerivationFramework::SkimmingToolHIGG1::m_electronKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronKey
Definition: SkimmingToolHIGG1.h:194
xAOD::eta1
setEt setPhi setE277 setWeta2 eta1
Definition: TrigEMCluster_v1.cxx:41
TrigDecisionTool.h
DerivationFramework::ISkimmingTool
Definition: ISkimmingTool.h:25
DerivationFramework::SkimmingToolHIGG1::m_incMergedElectronPhoton
bool m_incMergedElectronPhoton
Definition: SkimmingToolHIGG1.h:84
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::SkimmingToolHIGG1::m_photonKey
SG::ReadHandleKey< xAOD::PhotonContainer > m_photonKey
Definition: SkimmingToolHIGG1.h:191
SG::ReadHandleKey< xAOD::EventInfo >
DerivationFramework::SkimmingToolHIGG1::m_n_passKinematic
std::atomic< unsigned int > m_n_passKinematic
Definition: SkimmingToolHIGG1.h:170
DerivationFramework::SkimmingToolHIGG1::m_n_passGRL
std::atomic< unsigned int > m_n_passGRL
Definition: SkimmingToolHIGG1.h:158
DerivationFramework::SkimmingToolHIGG1::PhotonPreselect
bool PhotonPreselect(const xAOD::Photon *ph) const
Definition: SkimmingToolHIGG1.cxx:295
DerivationFramework::SkimmingToolHIGG1::SubcutOnePhotonTwoMuons
bool SubcutOnePhotonTwoMuons() const
Definition: SkimmingToolHIGG1.cxx:594
DerivationFramework::SkimmingToolHIGG1::m_incSingleElectron
bool m_incSingleElectron
Definition: SkimmingToolHIGG1.h:79
DerivationFramework::SkimmingToolHIGG1::m_subleadingPhotonPt
double m_subleadingPhotonPt
Definition: SkimmingToolHIGG1.h:107
DerivationFramework::SkimmingToolHIGG1::m_muonKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonKey
Definition: SkimmingToolHIGG1.h:197
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
DerivationFramework::SkimmingToolHIGG1::m_incDoubleMuon
bool m_incDoubleMuon
Definition: SkimmingToolHIGG1.h:82
DerivationFramework::SkimmingToolHIGG1::SubcutHighPtOnePhotonOneElectron
bool SubcutHighPtOnePhotonOneElectron() const
Definition: SkimmingToolHIGG1.cxx:725
DerivationFramework::SkimmingToolHIGG1::s_MZ
static const double s_MZ
Definition: SkimmingToolHIGG1.h:180
DerivationFramework::SkimmingToolHIGG1::MuonPreselect
bool MuonPreselect(const xAOD::Muon *mu) const
Definition: SkimmingToolHIGG1.cxx:815
DerivationFramework::SkimmingToolHIGG1::m_mergedCutTools
ToolHandle< IAsgElectronIsEMSelector > m_mergedCutTools
Definition: SkimmingToolHIGG1.h:185
DerivationFramework::SkimmingToolHIGG1::m_n_passIsolation
std::atomic< unsigned int > m_n_passIsolation
Definition: SkimmingToolHIGG1.h:172
DerivationFramework::SkimmingToolHIGG1::SubcutPreselect
std::optional< LeadingPhotons_t > SubcutPreselect() const
Definition: SkimmingToolHIGG1.cxx:247
DerivationFramework::SkimmingToolHIGG1::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: SkimmingToolHIGG1.h:188
DerivationFramework::SkimmingToolHIGG1::m_n_passLArError
std::atomic< unsigned int > m_n_passLArError
Definition: SkimmingToolHIGG1.h:159
DerivationFramework::SkimmingToolHIGG1::m_minInvariantMass
double m_minInvariantMass
Definition: SkimmingToolHIGG1.h:109
DerivationFramework::SkimmingToolHIGG1::CalculateInvariantMass
double CalculateInvariantMass(const LeadingPhotons_t &leadingPhotons) const
Definition: SkimmingToolHIGG1.cxx:388
DerivationFramework::SkimmingToolHIGG1::m_incHighPtElectronPhoton
bool m_incHighPtElectronPhoton
Definition: SkimmingToolHIGG1.h:85
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
DerivationFramework::SkimmingToolHIGG1::m_incMergedElectron
bool m_incMergedElectron
Definition: SkimmingToolHIGG1.h:78
DerivationFramework::SkimmingToolHIGG1::m_mergedtriggers
std::vector< std::string > m_mergedtriggers
Definition: SkimmingToolHIGG1.h:99
DerivationFramework::SkimmingToolHIGG1::SubcutKinematic
bool SubcutKinematic(const LeadingPhotons_t &leadingPhotons, double invariantMass) const
Definition: SkimmingToolHIGG1.cxx:334
ElectronContainer.h
DerivationFramework::SkimmingToolHIGG1::SubcutOnePhotonTwoElectrons
bool SubcutOnePhotonTwoElectrons() const
Definition: SkimmingToolHIGG1.cxx:632
DerivationFramework::SkimmingToolHIGG1::SubcutLArError
bool SubcutLArError(const xAOD::EventInfo &eventInfo) const
Definition: SkimmingToolHIGG1.cxx:217
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework::SkimmingToolHIGG1::m_n_tot
std::atomic< unsigned int > m_n_tot
Definition: SkimmingToolHIGG1.h:157
DerivationFramework::SkimmingToolHIGG1::m_reqQuality
bool m_reqQuality
Definition: SkimmingToolHIGG1.h:88
DerivationFramework::SkimmingToolHIGG1::m_maxInvariantMass
double m_maxInvariantMass
Definition: SkimmingToolHIGG1.h:110
AthAlgTool.h
DerivationFramework::SkimmingToolHIGG1::m_n_passQuality
std::atomic< unsigned int > m_n_passQuality
Definition: SkimmingToolHIGG1.h:171
DerivationFramework::SkimmingToolHIGG1::m_n_passSinglePhotonMergedElectronPreselect
std::atomic< unsigned int > m_n_passSinglePhotonMergedElectronPreselect
Definition: SkimmingToolHIGG1.h:167
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
DerivationFramework::SkimmingToolHIGG1::CorrectedEnergy
static double CorrectedEnergy(const xAOD::Photon *ph)
Definition: SkimmingToolHIGG1.cxx:422
DerivationFramework::SkimmingToolHIGG1::m_n_passSinglePhotonDoubleMuonPreselect
std::atomic< unsigned int > m_n_passSinglePhotonDoubleMuonPreselect
Definition: SkimmingToolHIGG1.h:165
DerivationFramework::SkimmingToolHIGG1::LeadingPhotons_t
std::array< const xAOD::Photon *, 2 > LeadingPhotons_t
Leading and sub-leading photon (in that order)
Definition: SkimmingToolHIGG1.h:127
DerivationFramework::SkimmingToolHIGG1::m_defaultTrigger
std::string m_defaultTrigger
Definition: SkimmingToolHIGG1.h:97
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::SkimmingToolHIGG1::m_reqIsolation
bool m_reqIsolation
Definition: SkimmingToolHIGG1.h:89
DerivationFramework::SkimmingToolHIGG1::m_relativePtCuts
bool m_relativePtCuts
Definition: SkimmingToolHIGG1.h:105
DerivationFramework::SkimmingToolHIGG1::m_n_passDoubleElectronPreselect
std::atomic< unsigned int > m_n_passDoubleElectronPreselect
Definition: SkimmingToolHIGG1.h:163
DerivationFramework::SkimmingToolHIGG1::SubcutOnePhotonOneElectron
bool SubcutOnePhotonOneElectron() const
Definition: SkimmingToolHIGG1.cxx:467
DerivationFramework::SkimmingToolHIGG1::CorrectedEta
double CorrectedEta(const xAOD::Photon *ph) const
Definition: SkimmingToolHIGG1.cxx:431
DerivationFramework::SkimmingToolHIGG1::eventPassesFilter
virtual bool eventPassesFilter() const override
Check that the current event passes this filter.
Definition: SkimmingToolHIGG1.cxx:158
DerivationFramework::SkimmingToolHIGG1::GetDiphotonVertex
double GetDiphotonVertex() const
Definition: SkimmingToolHIGG1.cxx:415
DerivationFramework::SkimmingToolHIGG1::m_n_passHighPtPhotonMergedElectronPreselect
std::atomic< unsigned int > m_n_passHighPtPhotonMergedElectronPreselect
Definition: SkimmingToolHIGG1.h:168
DerivationFramework::SkimmingToolHIGG1::m_reqGRL
bool m_reqGRL
Definition: SkimmingToolHIGG1.h:74
DerivationFramework::SkimmingToolHIGG1::SubcutIsolation
bool SubcutIsolation() const
Definition: SkimmingToolHIGG1.cxx:367
DerivationFramework::SkimmingToolHIGG1::m_goodRunList
std::string m_goodRunList
Definition: SkimmingToolHIGG1.h:95
DerivationFramework::SkimmingToolHIGG1::ElectronPreselect
bool ElectronPreselect(const xAOD::Electron *el) const
Definition: SkimmingToolHIGG1.cxx:766
xAOD::Electron_v1
Definition: Electron_v1.h:34
DerivationFramework::SkimmingToolHIGG1::m_reqInvariantMass
bool m_reqInvariantMass
Definition: SkimmingToolHIGG1.h:90
EventInfo.h
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
MuonContainer.h
DerivationFramework::SkimmingToolHIGG1::m_trigDecisionTool
ToolHandle< Trig::TrigDecisionTool > m_trigDecisionTool
Definition: SkimmingToolHIGG1.h:69
DerivationFramework::SkimmingToolHIGG1::m_leadingPhotonPt
double m_leadingPhotonPt
Definition: SkimmingToolHIGG1.h:106
DerivationFramework::SkimmingToolHIGG1::m_minMuonPt
double m_minMuonPt
Definition: SkimmingToolHIGG1.h:114
DerivationFramework::SkimmingToolHIGG1::SubcutOnePhotonMergedElectrons
bool SubcutOnePhotonMergedElectrons(const xAOD::EventInfo &eventInfo) const
Definition: SkimmingToolHIGG1.cxx:669
JetContainer.h
xAOD::Photon_v1
Definition: Photon_v1.h:37
DerivationFramework::SkimmingToolHIGG1::m_n_passInvariantMass
std::atomic< unsigned int > m_n_passInvariantMass
Definition: SkimmingToolHIGG1.h:173
DerivationFramework::SkimmingToolHIGG1::SubcutTwoElectrons
bool SubcutTwoElectrons() const
Definition: SkimmingToolHIGG1.cxx:543
DerivationFramework::SkimmingToolHIGG1::ReturnRZ_1stSampling_cscopt2
static double ReturnRZ_1stSampling_cscopt2(double eta1)
Definition: SkimmingToolHIGG1.cxx:449
DerivationFramework::SkimmingToolHIGG1::m_minPhotonPt
double m_minPhotonPt
Definition: SkimmingToolHIGG1.h:101
DerivationFramework::SkimmingToolHIGG1::m_n_passSingleMuonPreselect
std::atomic< unsigned int > m_n_passSingleMuonPreselect
Definition: SkimmingToolHIGG1.h:164
DerivationFramework::SkimmingToolHIGG1::m_incDoubleElectron
bool m_incDoubleElectron
Definition: SkimmingToolHIGG1.h:80
DerivationFramework::SkimmingToolHIGG1::SubcutOnePhotonOneMuon
bool SubcutOnePhotonOneMuon() const
Definition: SkimmingToolHIGG1.cxx:565
DerivationFramework::SkimmingToolHIGG1::SubcutQuality
bool SubcutQuality(const LeadingPhotons_t &leadingPhotons) const
Definition: SkimmingToolHIGG1.cxx:350
DerivationFramework::SkimmingToolHIGG1::m_removeCrack
bool m_removeCrack
Definition: SkimmingToolHIGG1.h:102
AthAlgTool
Definition: AthAlgTool.h:26
DerivationFramework::SkimmingToolHIGG1::m_reqKinematic
bool m_reqKinematic
Definition: SkimmingToolHIGG1.h:87
DerivationFramework::SkimmingToolHIGG1::m_n_passSingleElectronPreselect
std::atomic< unsigned int > m_n_passSingleElectronPreselect
Definition: SkimmingToolHIGG1.h:162
IAsgElectronIsEMSelector
Interface to tool to select electrons.
Definition: IAsgElectronIsEMSelector.h:28
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
DerivationFramework::SkimmingToolHIGG1::m_incDoubleElectronPhoton
bool m_incDoubleElectronPhoton
Definition: SkimmingToolHIGG1.h:83
PhotonContainer.h
ISkimmingTool.h
DerivationFramework::SkimmingToolHIGG1::m_n_passTrigger
std::atomic< unsigned int > m_n_passTrigger
Definition: SkimmingToolHIGG1.h:160