CMS 3D CMS Logo

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 
44  float dR,
45  float innerR = 0,
46  float threshold = 0,
47  SelfVetoPolicy selfVeto = selfVetoAll) const;
48 
51  float dR,
52  float innerR = 0,
53  float threshold = 0,
54  SelfVetoPolicy selfVeto = selfVetoAll) const;
55 
58  float dR,
59  float innerR = 0,
60  float threshold = 0,
61  SelfVetoPolicy selfVeto = selfVetoAll) const;
62 
65  float dR,
66  float innerR = 0,
67  float threshold = 0,
68  SelfVetoPolicy selfVeto = selfVetoAll) const;
69 
72  float dR,
73  float innerR = 0,
74  float threshold = 0,
75  SelfVetoPolicy selfVeto = selfVetoAll) const;
76 
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;
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
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
std::vector< const pat::PackedCandidate * > neutral_
void clearVetos()
clear all vetos
float puAbsIso(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from charged from PU.
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...
std::vector< const reco::Candidate * > vetos_
float photonAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from photons (with weights)
SelfVetoPolicy
Self-veto policy.
std::vector< const pat::PackedCandidate * > charged_
TAKEN FROM http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/ElectroWeakAnalysis/Utilities/src/PdfWeig...
Definition: AlphaT.h:16
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
float neutralHadAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from neutral hadrons (with weights)
std::vector< const pat::PackedCandidate * > pileup_
float isoSumNeutralsWeighted(const reco::Candidate &cand, float dR, float innerR, float threshold, SelfVetoPolicy selfVeto, int pdgId=-1) const
float neutralAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from all neutrals (with weights)
IsolationComputer(float weightCone=-1)
Create the calculator; optionally specify a cone for computing deltaBeta weights. ...
float photonAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from photons (uncorrected)
float neutralHadAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from neutral hadrons (uncorrected)
float neutralAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from all neutrals (uncorrected)
std::vector< float > weights_
float chargedAbsIso(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from charged from the PV.
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)