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
heppy::IsolationComputer::allcands_
const std::vector< pat::PackedCandidate > * allcands_
Definition: IsolationComputer.h:85
heppy::IsolationComputer::pileup_
std::vector< const pat::PackedCandidate * > pileup_
Definition: IsolationComputer.h:88
heppy::IsolationComputer::selfVetoNone
Definition: IsolationComputer.h:14
heppy::IsolationComputer::selfVetoFirst
Definition: IsolationComputer.h:14
heppy::IsolationComputer::neutralAbsIsoWeighted
float neutralAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from all neutrals (with weights)
Definition: IsolationComputer.cc:75
heppy::IsolationComputer::selfVetoAll
Definition: IsolationComputer.h:14
heppy::IsolationComputer::puAbsIso
float puAbsIso(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from charged from PU.
Definition: IsolationComputer.cc:65
python.cmstools.all
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:26
heppy::IsolationComputer::neutral_
std::vector< const pat::PackedCandidate * > neutral_
Definition: IsolationComputer.h:88
heppy::IsolationComputer::vetos_
std::vector< const reco::Candidate * > vetos_
Definition: IsolationComputer.h:90
heppy::IsolationComputer::setPackedCandidates
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)
Definition: IsolationComputer.cc:14
heppy::IsolationComputer::photonAbsIsoWeighted
float photonAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from photons (with weights)
Definition: IsolationComputer.cc:95
heppy::IsolationComputer::isoSumNeutralsWeighted
float isoSumNeutralsWeighted(const reco::Candidate &cand, float dR, float innerR, float threshold, SelfVetoPolicy selfVeto, int pdgId=-1) const
Definition: IsolationComputer.cc:147
heppy::IsolationComputer::charged_
std::vector< const pat::PackedCandidate * > charged_
Definition: IsolationComputer.h:88
heppy::IsolationComputer::photonAbsIsoRaw
float photonAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from photons (uncorrected)
Definition: IsolationComputer.cc:90
heppy
TAKEN FROM http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/ElectroWeakAnalysis/Utilities/src/PdfWeig...
Definition: AlphaT.h:16
heppy::IsolationComputer::clearVetos
void clearVetos()
clear all vetos
Definition: IsolationComputer.cc:56
HLT_FULL_cff.cands
cands
Definition: HLT_FULL_cff.py:15146
heppy::IsolationComputer::SelfVetoPolicy
SelfVetoPolicy
Self-veto policy.
Definition: IsolationComputer.h:14
heppy::IsolationComputer::neutralHadAbsIsoRaw
float neutralHadAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from neutral hadrons (uncorrected)
Definition: IsolationComputer.cc:80
heppy::IsolationComputer
Definition: IsolationComputer.h:8
PackedCandidate.h
heppy::IsolationComputer::chargedAbsIso
float chargedAbsIso(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from charged from the PV.
Definition: IsolationComputer.cc:59
cand
Definition: decayParser.h:32
EgammaValidation_cff.pdgId
pdgId
Definition: EgammaValidation_cff.py:118
heppy::IsolationComputer::neutralHadAbsIsoWeighted
float neutralHadAbsIsoWeighted(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from neutral hadrons (with weights)
Definition: IsolationComputer.cc:85
heppy::IsolationComputer::weights_
std::vector< float > weights_
Definition: IsolationComputer.h:89
reco::Candidate
Definition: Candidate.h:27
heppy::IsolationComputer::weightCone_
float weightCone_
Definition: IsolationComputer.h:86
heppy::IsolationComputer::IsolationComputer
IsolationComputer(float weightCone=-1)
Create the calculator; optionally specify a cone for computing deltaBeta weights.
Definition: IsolationComputer.h:11
heppy::IsolationComputer::neutralAbsIsoRaw
float neutralAbsIsoRaw(const reco::Candidate &cand, float dR, float innerR=0, float threshold=0, SelfVetoPolicy selfVeto=selfVetoAll) const
Isolation from all neutrals (uncorrected)
Definition: IsolationComputer.cc:70
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
heppy::IsolationComputer::addVetos
void addVetos(const reco::Candidate &cand)
veto footprint from this candidate, for the isolation of all candidates and also for calculation of n...
Definition: IsolationComputer.cc:47
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430
heppy::IsolationComputer::isoSumRaw
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
Definition: IsolationComputer.cc:100