ATLAS Offline Software
Loading...
Searching...
No Matches
VGammaORTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef GAMMAORTOOLS_VGAMMAORTOOL_H
6#define GAMMAORTOOLS_VGAMMAORTOOL_H
7
8#include <vector>
9#include <map>
10#include <string>
14#include "AsgTools/AsgTool.h"
17
18/****************************************************************************/
36
37class VGammaORTool: public asg::AsgTool, virtual public IVGammaORTool {
39public:
40 VGammaORTool(const std::string& name);
41 virtual ~VGammaORTool() override;
42
50 // four vectors (can be used if the full truth record is not available or broken)
55 virtual StatusCode inOverlap(bool& result,
56 const std::vector<TLorentzVector>* leptons=0,
57 const std::vector<TLorentzVector>* photons=0,
58 const std::vector<int>* lepton_origins=0,
59 const std::vector<int>* photon_origins=0) const override;
60
68 // four vectors (can be used if the full truth record is not available or broken)
73 virtual StatusCode photonPtsOutsideDr(std::vector<float>& result,
74 const std::vector<TLorentzVector>* leptons=0,
75 const std::vector<TLorentzVector>* photons=0,
76 const std::vector<int>* lepton_origins=0,
77 const std::vector<int>* photon_origins=0) const override;
78
86 // four vectors (can be used if the full truth record is not available or broken)
91 virtual StatusCode photonPtsOutsideDrs(std::map<float, std::vector<float> >& result,
92 const std::vector<TLorentzVector>* leptons=0,
93 const std::vector<TLorentzVector>* photons=0,
94 const std::vector<int>* lepton_origins=0,
95 const std::vector<int>* photon_origins=0) const override;
96
99 virtual bool frixioneIsolated(const xAOD::TruthParticle& photon,
100 const xAOD::TruthParticleContainer& truthParticles,
101 float dR0, float exponent, float epsilon) const override;
102
103
107 std::vector<TLorentzVector> getPhotonP4s(const xAOD::TruthParticleContainer& truthParticleContainer) const;
108
111 std::vector<TLorentzVector> getLeptonP4s(const xAOD::TruthParticleContainer& truthParticleContainer) const;
112
113private:
114
115 // This function performs the actual algorithm needed for OR, if one of the public functions is called
116 // It returns a vector of ordered photon pTs for multiple lepton-photon dR cuts
117 StatusCode photonPtsOutsideDrs(std::map<float, std::vector<float> >& result,
118 const std::vector<float>& drCuts,
119 const std::vector<TLorentzVector>* leptons=0,
120 const std::vector<TLorentzVector>* photons=0,
121 const std::vector<int>* lepton_origins=0,
122 const std::vector<int>* photon_origins=0) const;
123
124 // Set the right leptons, get them either from user or the current event
125 StatusCode setInput(std::vector<TLorentzVector>& leptons_out,
126 std::vector<TLorentzVector>& photons_out,
127 const std::vector<TLorentzVector>* lepton_p4s,
128 const std::vector<TLorentzVector>* photon_p4s,
129 const std::vector<int>* lepton_origins,
130 const std::vector<int>* photon_origins) const;
131
132 // Filter out photons whose origin is among the veto origins (typically photons from hadron decays)
133 std::vector<TLorentzVector> filterPhotonOrigins(const std::vector<TLorentzVector>&, const std::vector<int>&) const;
134
135 // Filter out leptons whose origin is among the veto origins (typically photons from hadron decays)
136 // Return list containing all leptons from prefered origins (from hard process) first
137 // As fallback leptons from origins not explictly vetoed (e.g. unkown origins) are added at the end of the list
138 std::vector<TLorentzVector> filterLeptonOrigins(const std::vector<TLorentzVector>&, const std::vector<int>&) const;
139
140 // Check whether a lepton originates from tau decay
141 bool isFromTau(const xAOD::TruthParticle& lepton, int nRecursions=0) const;
142
143 // Internal helper function to check wheter photon pTs are compatible with configured overlap cuts
144 bool checkPhotonPts(const std::vector<float>& photon_pts) const;
145
146 // Implementation of Eq 3.4 in https://arxiv.org/pdf/hep-ph/9801442
147 float frixioneFunc(float dR, float dR0, float exponent, float epsilon) const;
148
149 // MCTruthClassifier
151
152 // CONFIGURATION =================================================
153
154 // Number of leptons expected in process (e.g. 2 for Z+gamma, 1 for W+gamma, 4 for ZZ+gamma)
155 // If this is set to a negative number, all possible leptons are considered
156 // Per default this includes leptons from unkown origins, so it is more robuts to set a positive value
157 // for m_n_leptons as a upper limit
159 // Lepton flavours considered, signed pdgIds (only relevant if leptons are not provided by user)
160 // If possible, restricting flavors can increase the robustness
161 std::vector<int> m_lepton_pdgIds;
162 // Lepton origins preferred when searching prompt leptons
163 // These origins should be associated with the hard process
164 // Origin codes are defined here:
165 // https://svnweb.cern.ch/trac/atlasoff/browser/PhysicsAnalysis/MCTruthClassifier/trunk/MCTruthClassifier/MCTruthClassifierDefs.h
167 // Lepton origins of leptons never used as prompt
168 // These should be e.g. hadron origins
169 std::vector<int> m_lepton_veto_origins;
170
171 // Photon origins vetoed when searching prompt leptons
172 // These should be photons from hadron/tau decays
173 // Origin codes are defined here:
174 // https://svnweb.cern.ch/trac/atlasoff/browser/PhysicsAnalysis/MCTruthClassifier/trunk/MCTruthClassifier/MCTruthClassifierDefs.h
175 std::vector<int> m_veto_photon_origins;
176
177 // p_T (y) cut(s) used in inOverlap function -- only 1 for Vgamma OR, 2 for Vgammagamma
178 std::vector<float> m_photon_pT_cuts;
179 // delta R (l,y) cut for used in inOverlap and photonPtsOutsideDr function
181 // List of dR cuts for which the highest photon pT will be determined by photonPtsOutsideDrs function
182 std::vector<float> m_dR_lepton_photon_cuts;
183
184 // Require photons to be Frixione isolated (https://arxiv.org/abs/hep-ph/9801442)?
186 // Isolation cone used for Frixione isolation
188 // exponent in Eq 3.4 in https://arxiv.org/pdf/hep-ph/9801442
190 // epsilon in Eq 3.4 in https://arxiv.org/pdf/hep-ph/9801442
192 // Which stable particles are *not* considered in isolation? Usually leptons and photons.
194
195 // Minimum photon pT considered in algorithm -- increase speeds up algorithm as less photons need to be classified
197
198};
199
200
201
202#endif //> !GAMMAORTOOLS_VGAMMAORTOOL_H
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
std::vector< int > m_lepton_pdgIds
std::vector< float > m_dR_lepton_photon_cuts
float m_frixione_epsilon
VGammaORTool(const std::string &name)
std::vector< TLorentzVector > getPhotonP4s(const xAOD::TruthParticleContainer &truthParticleContainer) const
Get final state photons from truthParticleContainer A minimum pT cut and isolation is applied accordi...
std::vector< TLorentzVector > filterLeptonOrigins(const std::vector< TLorentzVector > &, const std::vector< int > &) const
std::vector< int > m_lepton_veto_origins
virtual ~VGammaORTool() override
StatusCode setInput(std::vector< TLorentzVector > &leptons_out, std::vector< TLorentzVector > &photons_out, const std::vector< TLorentzVector > *lepton_p4s, const std::vector< TLorentzVector > *photon_p4s, const std::vector< int > *lepton_origins, const std::vector< int > *photon_origins) const
std::vector< TLorentzVector > getLeptonP4s(const xAOD::TruthParticleContainer &truthParticleContainer) const
Get final state leptons from truthParticleContainer Filter function is applied, only leptons from rel...
std::vector< float > m_photon_pT_cuts
bool isFromTau(const xAOD::TruthParticle &lepton, int nRecursions=0) const
std::vector< int > m_preferred_lepton_origins
virtual StatusCode photonPtsOutsideDr(std::vector< float > &result, const std::vector< TLorentzVector > *leptons=0, const std::vector< TLorentzVector > *photons=0, const std::vector< int > *lepton_origins=0, const std::vector< int > *photon_origins=0) const override
Determine the pTs of photons outside the dR cut that is configured in tool initialization (dR_lepton_...
float frixioneFunc(float dR, float dR0, float exponent, float epsilon) const
asg::AnaToolHandle< MCTruthClassifier > m_truthClassifier
float m_dR_lepton_photon_cut
virtual StatusCode photonPtsOutsideDrs(std::map< float, std::vector< float > > &result, const std::vector< TLorentzVector > *leptons=0, const std::vector< TLorentzVector > *photons=0, const std::vector< int > *lepton_origins=0, const std::vector< int > *photon_origins=0) const override
Determine the pTs of photons outside of several dR cuts that are configured in tool initialization (d...
float m_frixione_exponent
virtual bool frixioneIsolated(const xAOD::TruthParticle &photon, const xAOD::TruthParticleContainer &truthParticles, float dR0, float exponent, float epsilon) const override
Function determining whether a photon is frixione isolated from truthParticles Parameters as defined ...
std::vector< int > m_veto_photon_origins
std::vector< TLorentzVector > filterPhotonOrigins(const std::vector< TLorentzVector > &, const std::vector< int > &) const
virtual StatusCode inOverlap(bool &result, const std::vector< TLorentzVector > *leptons=0, const std::vector< TLorentzVector > *photons=0, const std::vector< int > *lepton_origins=0, const std::vector< int > *photon_origins=0) const override
Determine whether current event is in overlap region (set via reference).
float m_frixione_dR
bool checkPhotonPts(const std::vector< float > &photon_pts) const
std::vector< int > m_abs_pdgids_excluded_from_iso
float m_min_considered_photon_pT
a modified tool handle that allows its owner to configure new tools from the C++ side
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
TruthParticle_v1 TruthParticle
Typedef to implementation.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.