#include <DataFormats/PatCandidates/interface/Lepton.h>
Public Member Functions | |
float | caloIso () const |
Return the sum of ecal and hcal isolation variable that were stored in this object when produced, or -1.0 if at least one is missing. | |
float | chargedParticleIso () const |
Return the isolation calculated with only the charged PFCandidates. | |
virtual Lepton< LeptonType > * | clone () const |
float | ecalIso () const |
Return the ecal isolation variable that was stored in this object when produced, or -1.0 if there is none. | |
void | ecalIsoDeposit (const IsoDeposit &dep) |
const IsoDeposit * | ecalIsoDeposit () const |
float | gammaParticleIso () const |
Return the isolation calculated with only the gamma PFCandidates. | |
const reco::GenParticle * | genLepton () const |
float | hcalIso () const |
Return the hcal isolation variable that was stored in this object when produced, or -1.0 if there is none. | |
void | hcalIsoDeposit (const IsoDeposit &dep) |
const IsoDeposit * | hcalIsoDeposit () const |
const IsoDeposit * | isoDeposit (IsolationKeys key) const |
Returns the IsoDeposit associated with some key, or a null pointer if it is not available. | |
float | isolation (IsolationKeys key) const |
Returns the isolation variable for a specifc key (or pseudo-key like CaloIso), or -1.0 if not available. | |
Lepton (const edm::Ptr< LeptonType > &aLeptonRef) | |
constructor from ref to LeptonType | |
Lepton (const edm::RefToBase< LeptonType > &aLeptonRef) | |
constructor from ref to LeptonType | |
Lepton (const LeptonType &aLepton) | |
constructor from LeptonType | |
Lepton () | |
default constructor | |
float | neutralParticleIso () const |
Return the isolation calculated with only the neutral hadrons PFCandidates. | |
float | particleIso () const |
PARTICLE FLOW ISOLATION Return the isolation calculated with all the PFCandidates. | |
void | setECalIso (float caloIso) |
Sets ecal isolation variable. | |
void | setGenLepton (const reco::GenParticleRef &gl, bool embed=false) |
void | setHCalIso (float caloIso) |
Sets hcal isolation variable. | |
void | setIsoDeposit (IsolationKeys key, const IsoDeposit &dep) |
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten. | |
void | setIsolation (IsolationKeys key, float value) |
Sets the isolation variable for a specifc key. | |
void | setTrackIso (float trackIso) |
Sets tracker isolation variable. | |
void | setUserIso (float value, uint8_t index=0) |
Sets user isolation variable index. | |
void | trackerIsoDeposit (const IsoDeposit &dep) |
const IsoDeposit * | trackerIsoDeposit () const |
float | trackIso () const |
Return the tracker isolation variable that was stored in this object when produced, or -1.0 if there is none. | |
float | userIso (uint8_t index=0) const |
Return the user defined isolation variable index that was stored in this object when produced, or -1.0 if there is none. | |
void | userIsoDeposit (const IsoDeposit &dep, uint8_t index=0) |
const IsoDeposit * | userIsoDeposit (uint8_t index=0) const |
virtual | ~Lepton () |
destructor | |
Protected Types | |
typedef std::vector< std::pair < IsolationKeys, pat::IsoDeposit > > | IsoDepositPairs |
Protected Attributes | |
IsoDepositPairs | isoDeposits_ |
std::vector< float > | isolations_ |
Lepton implements the analysis-level charged lepton class within the 'pat' namespace. It currently provides the link to the generated lepton and the isolation information.
Please post comments and questions to the Physics Tools hypernews: httpss://hypernews.cern.ch/HyperNews/CMS/get/physTools.html
Definition at line 32 of file Lepton.h.
typedef std::vector<std::pair<IsolationKeys, pat::IsoDeposit> > pat::Lepton< LeptonType >::IsoDepositPairs [protected] |
pat::Lepton< LeptonType >::Lepton | ( | ) | [inline] |
default constructor
Definition at line 158 of file Lepton.h.
00158 : 00159 PATObject<LeptonType>(LeptonType()) { 00160 // no common constructor, so initialize the candidate manually 00161 this->setCharge(0); 00162 this->setP4(reco::Particle::LorentzVector(0, 0, 0, 0)); 00163 this->setVertex(reco::Particle::Point(0, 0, 0)); 00164 }
pat::Lepton< LeptonType >::Lepton | ( | const LeptonType & | aLepton | ) | [inline] |
pat::Lepton< LeptonType >::Lepton | ( | const edm::RefToBase< LeptonType > & | aLeptonRef | ) | [inline] |
pat::Lepton< LeptonType >::Lepton | ( | const edm::Ptr< LeptonType > & | aLeptonRef | ) | [inline] |
pat::Lepton< LeptonType >::~Lepton | ( | ) | [inline, virtual] |
float pat::Lepton< LeptonType >::caloIso | ( | ) | const [inline] |
Return the sum of ecal and hcal isolation variable that were stored in this object when produced, or -1.0 if at least one is missing.
Definition at line 85 of file Lepton.h.
Referenced by pat::HistoMuon::fill(), and pat::HistoElectron::fill().
float pat::Lepton< LeptonType >::chargedParticleIso | ( | ) | const [inline] |
Return the isolation calculated with only the charged PFCandidates.
Definition at line 95 of file Lepton.h.
00095 { return isolation(ChargedParticleIso); }
virtual Lepton<LeptonType>* pat::Lepton< LeptonType >::clone | ( | void | ) | const [inline, virtual] |
float pat::Lepton< LeptonType >::ecalIso | ( | ) | const [inline] |
void pat::Lepton< LeptonType >::ecalIsoDeposit | ( | const IsoDeposit & | dep | ) | [inline] |
const IsoDeposit* pat::Lepton< LeptonType >::ecalIsoDeposit | ( | ) | const [inline] |
float pat::Lepton< LeptonType >::gammaParticleIso | ( | ) | const [inline] |
Return the isolation calculated with only the gamma PFCandidates.
Definition at line 99 of file Lepton.h.
00099 { return isolation(GammaParticleIso); }
const reco::GenParticle* pat::Lepton< LeptonType >::genLepton | ( | ) | const [inline] |
float pat::Lepton< LeptonType >::hcalIso | ( | ) | const [inline] |
void pat::Lepton< LeptonType >::hcalIsoDeposit | ( | const IsoDeposit & | dep | ) | [inline] |
const IsoDeposit* pat::Lepton< LeptonType >::hcalIsoDeposit | ( | ) | const [inline] |
const IsoDeposit* pat::Lepton< LeptonType >::isoDeposit | ( | IsolationKeys | key | ) | const [inline] |
Returns the IsoDeposit associated with some key, or a null pointer if it is not available.
Definition at line 117 of file Lepton.h.
Referenced by pat::Lepton< reco::Muon >::ecalIsoDeposit(), pat::Lepton< reco::Muon >::hcalIsoDeposit(), pat::Lepton< reco::Muon >::trackerIsoDeposit(), and pat::Lepton< reco::Muon >::userIsoDeposit().
00117 { 00118 for (IsoDepositPairs::const_iterator it = isoDeposits_.begin(), ed = isoDeposits_.end(); 00119 it != ed; ++it) 00120 { 00121 if (it->first == key) return & it->second; 00122 } 00123 return 0; 00124 }
float pat::Lepton< LeptonType >::isolation | ( | IsolationKeys | key | ) | const [inline] |
Returns the isolation variable for a specifc key (or pseudo-key like CaloIso), or -1.0 if not available.
Definition at line 50 of file Lepton.h.
Referenced by pat::Lepton< reco::Muon >::caloIso(), pat::Lepton< reco::Muon >::chargedParticleIso(), pat::Lepton< reco::Muon >::ecalIso(), pat::Lepton< reco::Muon >::gammaParticleIso(), pat::Lepton< reco::Muon >::hcalIso(), pat::Lepton< reco::Muon >::neutralParticleIso(), pat::Lepton< reco::Muon >::particleIso(), pat::Lepton< reco::Muon >::trackIso(), and pat::Lepton< reco::Muon >::userIso().
00050 { 00051 if (key >= 0) { 00052 //if (key >= isolations_.size()) throw cms::Excepton("Missing Data") << "Isolation corresponding to key " << key << " was not stored for this particle."; 00053 if (size_t(key) >= isolations_.size()) return -1.0; 00054 return isolations_[key]; 00055 } else switch (key) { 00056 case CaloIso: 00057 //if (isolations_.size() <= HCalIso) throw cms::Excepton("Missing Data") << "CalIsoo Isolation was not stored for this particle."; 00058 if (isolations_.size() <= HCalIso) return -1.0; 00059 return isolations_[ECalIso] + isolations_[HCalIso]; 00060 default: 00061 return -1.0; 00062 //throw cms::Excepton("Missing Data") << "Isolation corresponding to key " << key << " was not stored for this particle."; 00063 } 00064 }
float pat::Lepton< LeptonType >::neutralParticleIso | ( | ) | const [inline] |
Return the isolation calculated with only the neutral hadrons PFCandidates.
Definition at line 97 of file Lepton.h.
00097 { return isolation(NeutralParticleIso); }
float pat::Lepton< LeptonType >::particleIso | ( | ) | const [inline] |
PARTICLE FLOW ISOLATION Return the isolation calculated with all the PFCandidates.
Definition at line 93 of file Lepton.h.
00093 { return isolation(ParticleIso); }
void pat::Lepton< LeptonType >::setECalIso | ( | float | caloIso | ) | [inline] |
void pat::Lepton< LeptonType >::setGenLepton | ( | const reco::GenParticleRef & | gl, | |
bool | embed = false | |||
) | [inline] |
Definition at line 46 of file Lepton.h.
00046 { PATObject<LeptonType>::setGenParticleRef(gl, embed); }
void pat::Lepton< LeptonType >::setHCalIso | ( | float | caloIso | ) | [inline] |
void pat::Lepton< LeptonType >::setIsoDeposit | ( | IsolationKeys | key, | |
const IsoDeposit & | dep | |||
) | [inline] |
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
Definition at line 127 of file Lepton.h.
Referenced by pat::Lepton< reco::Muon >::ecalIsoDeposit(), pat::Lepton< reco::Muon >::hcalIsoDeposit(), pat::PATElectronProducer::produce(), pat::PATMuonProducer::produce(), pat::PATTauProducer::produce(), pat::Lepton< reco::Muon >::trackerIsoDeposit(), and pat::Lepton< reco::Muon >::userIsoDeposit().
00127 { 00128 IsoDepositPairs::iterator it = isoDeposits_.begin(), ed = isoDeposits_.end(); 00129 for (; it != ed; ++it) { 00130 if (it->first == key) { it->second = dep; return; } 00131 } 00132 isoDeposits_.push_back(std::make_pair(key,dep)); 00133 }
void pat::Lepton< LeptonType >::setIsolation | ( | IsolationKeys | key, | |
float | value | |||
) | [inline] |
Sets the isolation variable for a specifc key.
Note that you can't set isolation for a pseudo-key like CaloIso
Definition at line 68 of file Lepton.h.
Referenced by pat::PATElectronProducer::produce(), pat::PATMuonProducer::produce(), pat::PATTauProducer::produce(), pat::Lepton< reco::Muon >::setECalIso(), pat::Lepton< reco::Muon >::setHCalIso(), pat::Lepton< reco::Muon >::setTrackIso(), and pat::Lepton< reco::Muon >::setUserIso().
00068 { 00069 if (key >= 0) { 00070 if (size_t(key) >= isolations_.size()) isolations_.resize(key+1, -1.0); 00071 isolations_[key] = value; 00072 } else { 00073 throw cms::Exception("Illegal Argument") << 00074 "The key for which you're setting isolation does not correspond " << 00075 "to an individual isolation but to the sum of more independent isolations " << 00076 "(e.g. Calo = ECal + HCal), so you can't SET the value, just GET it.\n" << 00077 "Please set up each component independly.\n"; 00078 } 00079 }
void pat::Lepton< LeptonType >::setTrackIso | ( | float | trackIso | ) | [inline] |
Sets tracker isolation variable.
Definition at line 106 of file Lepton.h.
00106 { setIsolation(TrackerIso, trackIso); }
void pat::Lepton< LeptonType >::setUserIso | ( | float | value, | |
uint8_t | index = 0 | |||
) | [inline] |
Sets user isolation variable index.
Definition at line 112 of file Lepton.h.
00112 { setIsolation(IsolationKeys(UserBaseIso + index), value); }
void pat::Lepton< LeptonType >::trackerIsoDeposit | ( | const IsoDeposit & | dep | ) | [inline] |
const IsoDeposit* pat::Lepton< LeptonType >::trackerIsoDeposit | ( | ) | const [inline] |
float pat::Lepton< LeptonType >::trackIso | ( | ) | const [inline] |
Return the tracker isolation variable that was stored in this object when produced, or -1.0 if there is none.
Definition at line 83 of file Lepton.h.
Referenced by pat::HistoMuon::fill(), and pat::HistoElectron::fill().
00083 { return isolation(TrackerIso); }
float pat::Lepton< LeptonType >::userIso | ( | uint8_t | index = 0 |
) | const [inline] |
Return the user defined isolation variable index that was stored in this object when produced, or -1.0 if there is none.
Definition at line 102 of file Lepton.h.
00102 { return isolation(IsolationKeys(UserBaseIso + index)); }
void pat::Lepton< LeptonType >::userIsoDeposit | ( | const IsoDeposit & | dep, | |
uint8_t | index = 0 | |||
) | [inline] |
Definition at line 145 of file Lepton.h.
00145 { setIsoDeposit(IsolationKeys(UserBaseIso + index), dep); }
const IsoDeposit* pat::Lepton< LeptonType >::userIsoDeposit | ( | uint8_t | index = 0 |
) | const [inline] |
Definition at line 139 of file Lepton.h.
00139 { return isoDeposit(IsolationKeys(UserBaseIso + index)); }
IsoDepositPairs pat::Lepton< LeptonType >::isoDeposits_ [protected] |
Definition at line 151 of file Lepton.h.
Referenced by pat::Lepton< reco::Muon >::isoDeposit(), and pat::Lepton< reco::Muon >::setIsoDeposit().
std::vector<float> pat::Lepton< LeptonType >::isolations_ [protected] |
Definition at line 152 of file Lepton.h.
Referenced by pat::Lepton< reco::Muon >::isolation(), and pat::Lepton< reco::Muon >::setIsolation().