CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
IsolationComputer.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_Heppy_IsolationComputer_h
2 #define PhysicsTools_Heppy_IsolationComputer_h
3 
4 #include <vector>
6 
7 namespace heppy {
9  public:
11  IsolationComputer(float weightCone = -1) : weightCone_(weightCone) {}
12 
16  void setPackedCandidates(const std::vector<pat::PackedCandidate> &all,
17  int fromPV_thresh = 1,
18  float dz_thresh = 9999.,
19  float dxy_thresh = 9999.,
20  bool also_leptons = false);
21 
23  void addVetos(const reco::Candidate &cand);
24 
26  void clearVetos();
27 
29  float chargedAbsIso(const reco::Candidate &cand,
30  float dR,
31  float innerR = 0,
32  float threshold = 0,
33  SelfVetoPolicy selfVeto = selfVetoAll) const;
34 
36  float puAbsIso(const reco::Candidate &cand,
37  float dR,
38  float innerR = 0,
39  float threshold = 0,
40  SelfVetoPolicy selfVeto = selfVetoAll) const;
41 
43  float neutralAbsIsoRaw(const reco::Candidate &cand,
44  float dR,
45  float innerR = 0,
46  float threshold = 0,
47  SelfVetoPolicy selfVeto = selfVetoAll) const;
48 
50  float neutralHadAbsIsoRaw(const reco::Candidate &cand,
51  float dR,
52  float innerR = 0,
53  float threshold = 0,
54  SelfVetoPolicy selfVeto = selfVetoAll) const;
55 
57  float photonAbsIsoRaw(const reco::Candidate &cand,
58  float dR,
59  float innerR = 0,
60  float threshold = 0,
61  SelfVetoPolicy selfVeto = selfVetoAll) const;
62 
64  float neutralAbsIsoWeighted(const reco::Candidate &cand,
65  float dR,
66  float innerR = 0,
67  float threshold = 0,
68  SelfVetoPolicy selfVeto = selfVetoAll) const;
69 
71  float neutralHadAbsIsoWeighted(const reco::Candidate &cand,
72  float dR,
73  float innerR = 0,
74  float threshold = 0,
75  SelfVetoPolicy selfVeto = selfVetoAll) const;
76 
78  float photonAbsIsoWeighted(const reco::Candidate &cand,
79  float dR,
80  float innerR = 0,
81  float threshold = 0,
82  SelfVetoPolicy selfVeto = selfVetoAll) const;
83 
84  protected:
85  const std::vector<pat::PackedCandidate> *allcands_;
86  float weightCone_;
87  // collections of objects, sorted in eta
88  std::vector<const pat::PackedCandidate *> charged_, neutral_, pileup_;
89  mutable std::vector<float> weights_;
90  std::vector<const reco::Candidate *> vetos_;
91 
92  float isoSumRaw(const std::vector<const pat::PackedCandidate *> &cands,
93  const reco::Candidate &cand,
94  float dR,
95  float innerR,
96  float threshold,
97  SelfVetoPolicy selfVeto,
98  int pdgId = -1) const;
99  float isoSumNeutralsWeighted(const reco::Candidate &cand,
100  float dR,
101  float innerR,
102  float threshold,
103  SelfVetoPolicy selfVeto,
104  int pdgId = -1) const;
105  };
106 
107 } // namespace heppy
108 
109 #endif
float isoSumNeutralsWeighted(const reco::Candidate &cand, float dR, float innerR, float threshold, SelfVetoPolicy selfVeto, int pdgId=-1) const
std::vector< const pat::PackedCandidate * > neutral_
void clearVetos()
clear all vetos
const std::vector< pat::PackedCandidate > * allcands_
void addVetos(const reco::Candidate &cand)
veto footprint from this candidate, for the isolation of all candidates and also for calculation of n...
float neutralAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from all neutrals (with weights)
float neutralHadAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from neutral hadrons (with weights)
float isoSumRaw(const std::vector< const pat::PackedCandidate * > &cands, const reco::Candidate &cand, float dR, float innerR, float threshold, SelfVetoPolicy selfVeto, int pdgId=-1) const
std::vector< const reco::Candidate * > vetos_
float chargedAbsIso(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from charged from the PV.
SelfVetoPolicy
Self-veto policy.
std::vector< const pat::PackedCandidate * > charged_
def all
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
float neutralHadAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from neutral hadrons (uncorrected)
std::vector< const pat::PackedCandidate * > pileup_
float neutralAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from all neutrals (uncorrected)
float photonAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from photons (uncorrected)
IsolationComputer(float weightCone=-1)
Create the calculator; optionally specify a cone for computing deltaBeta weights. ...
float puAbsIso(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from charged from PU.
float photonAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from photons (with weights)
std::vector< float > weights_
void setPackedCandidates(const std::vector< pat::PackedCandidate > &all, int fromPV_thresh=1, float dz_thresh=9999., float dxy_thresh=9999., bool also_leptons=false)
Initialize with the list of packed candidates (note: clears also all vetos)