CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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  };
18  void setPackedCandidates(const std::vector<pat::PackedCandidate> & all, int fromPV_thresh=1, float dz_thresh=9999., bool also_leptons=false) ;
19 
20 
22  void addVetos(const reco::Candidate &cand) ;
23 
25  void clearVetos() ;
26 
28  float chargedAbsIso(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ;
29 
31  float puAbsIso(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ;
32 
34  float neutralAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ;
35 
37  float neutralHadAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ;
38 
40  float photonAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ;
41 
43  float neutralAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ;
44 
46  float neutralHadAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ;
47 
49  float photonAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const ;
50  protected:
51  const std::vector<pat::PackedCandidate> * allcands_;
52  float weightCone_;
53  // collections of objects, sorted in eta
54  std::vector<const pat::PackedCandidate *> charged_, neutral_, pileup_;
55  mutable std::vector<float> weights_;
56  std::vector<const reco::Candidate *> vetos_;
57 
58  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 ;
59  float isoSumNeutralsWeighted(const reco::Candidate &cand, float dR, float innerR, float threshold, SelfVetoPolicy selfVeto, int pdgId=-1) const ;
60 };
61 
62 }
63 
64 #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.
void setPackedCandidates(const std::vector< pat::PackedCandidate > &all, int fromPV_thresh=1, float dz_thresh=9999., bool also_leptons=false)
Initialize with the list of packed candidates (note: clears also all vetos)
std::vector< const pat::PackedCandidate * > charged_
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_