Analysis-level lepton class. More...
#include <DataFormats/PatCandidates/interface/Lepton.h>
Public Member Functions | |
float | caloIso () const |
float | chargedHadronIso () const |
virtual Lepton< LeptonType > * | clone () const |
float | ecalIso () const |
void | ecalIsoDeposit (const IsoDeposit &dep) |
const IsoDeposit * | ecalIsoDeposit () const |
const reco::GenParticle * | genLepton () const |
float | hcalIso () const |
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. | |
Lepton (const LeptonType &aLepton) | |
constructor from LeptonType | |
Lepton (const edm::Ptr< LeptonType > &aLeptonRef) | |
constructor from ref to LeptonType | |
Lepton (const edm::RefToBase< LeptonType > &aLeptonRef) | |
constructor from ref to LeptonType | |
Lepton () | |
default constructor | |
float | neutralHadronIso () const |
float | particleIso () const |
float | photonIso () const |
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) |
void | setTrackIso (float trackIso) |
Sets tracker isolation variable. | |
void | setUserIso (float value, uint8_t index=0) |
Sets user isolation variable #index. | |
float | trackIso () const |
void | trackIsoDeposit (const IsoDeposit &dep) |
const IsoDeposit * | trackIsoDeposit () const |
float | userIso (uint8_t index=0) const |
const IsoDeposit * | userIsoDeposit (uint8_t index=0) const |
void | userIsoDeposit (const IsoDeposit &dep, uint8_t index=0) |
float | userIsolation (IsolationKeys key) const |
float | userIsolation (const std::string &key) const |
virtual | ~Lepton () |
destructor | |
Protected Types | |
typedef std::vector< std::pair < IsolationKeys, pat::IsoDeposit > > | IsoDepositPairs |
Protected Attributes | |
IsoDepositPairs | isoDeposits_ |
std::vector< float > | isolations_ |
Analysis-level lepton class.
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: https://hypernews.cern.ch/HyperNews/CMS/get/physTools.html
typedef std::vector<std::pair<IsolationKeys, pat::IsoDeposit> > pat::Lepton< LeptonType >::IsoDepositPairs [protected] |
pat::Lepton< LeptonType >::Lepton | ( | ) |
default constructor
Definition at line 204 of file Lepton.h.
: PATObject<LeptonType>(LeptonType()) { // no common constructor, so initialize the candidate manually this->setCharge(0); this->setP4(reco::Particle::LorentzVector(0, 0, 0, 0)); this->setVertex(reco::Particle::Point(0, 0, 0)); }
pat::Lepton< LeptonType >::Lepton | ( | const LeptonType & | aLepton | ) |
pat::Lepton< LeptonType >::Lepton | ( | const edm::RefToBase< LeptonType > & | aLeptonRef | ) |
pat::Lepton< LeptonType >::Lepton | ( | const edm::Ptr< LeptonType > & | aLeptonRef | ) |
pat::Lepton< LeptonType >::~Lepton | ( | ) | [virtual] |
float pat::Lepton< LeptonType >::caloIso | ( | ) | const [inline] |
Returns 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 (overloaded if specific isolation functions are available from the derived objects)
Reimplemented in pat::Electron, and pat::Muon.
Definition at line 122 of file Lepton.h.
Referenced by dummy::Isolationdummy().
{ return userIsolation(pat::CaloIso); }
float pat::Lepton< LeptonType >::chargedHadronIso | ( | ) | const [inline] |
Returns the isolation calculated with only the charged hadron PFCandidates
Definition at line 139 of file Lepton.h.
{ return userIsolation(pat::PfChargedHadronIso); }
virtual Lepton<LeptonType>* pat::Lepton< LeptonType >::clone | ( | void | ) | const [inline, virtual] |
Reimplemented in pat::Electron, pat::Muon, and pat::Tau.
Definition at line 42 of file Lepton.h.
{ return new Lepton<LeptonType>(*this); }
float pat::Lepton< LeptonType >::ecalIso | ( | ) | const [inline] |
Returns the ecal isolation variable that was stored in this object when produced, or -1.0 if there is none (overloaded if specific isolation functions are available from the derived objects)
Reimplemented in pat::Electron, and pat::Muon.
Definition at line 127 of file Lepton.h.
Referenced by dummy::Isolationdummy().
{ return userIsolation(pat::EcalIso); }
const IsoDeposit* pat::Lepton< LeptonType >::ecalIsoDeposit | ( | ) | const [inline] |
Definition at line 183 of file Lepton.h.
{ return isoDeposit(pat::EcalIso ); }
void pat::Lepton< LeptonType >::ecalIsoDeposit | ( | const IsoDeposit & | dep | ) | [inline] |
Definition at line 189 of file Lepton.h.
{ setIsoDeposit(pat::EcalIso, dep); }
const reco::GenParticle* pat::Lepton< LeptonType >::genLepton | ( | ) | const [inline] |
Definition at line 44 of file Lepton.h.
Referenced by ZMuMu_Radiative_analyzer::analyze(), and gamma_radiative_analyzer::analyze().
{ return PATObject<LeptonType>::genParticle(); }
float pat::Lepton< LeptonType >::hcalIso | ( | ) | const [inline] |
Returns the hcal isolation variable that was stored in this object when produced, or -1.0 if there is none (overloaded if specific isolation functions are available from the derived objects)
Reimplemented in pat::Electron, and pat::Muon.
Definition at line 132 of file Lepton.h.
Referenced by dummy::Isolationdummy().
{ return userIsolation(pat::HcalIso); }
const IsoDeposit* pat::Lepton< LeptonType >::hcalIsoDeposit | ( | ) | const [inline] |
Definition at line 184 of file Lepton.h.
{ return isoDeposit(pat::HcalIso ); }
void pat::Lepton< LeptonType >::hcalIsoDeposit | ( | const IsoDeposit & | dep | ) | [inline] |
Definition at line 190 of file Lepton.h.
{ setIsoDeposit(pat::HcalIso, dep); }
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 163 of file Lepton.h.
Referenced by ZMuMuIsolationAnalyzer::analyze(), ZMuMu_Radiative_analyzer::analyze(), pat::Lepton< reco::Muon >::ecalIsoDeposit(), ZGlobalVsSAIsolationAnalyzer::evaluate(), pat::Lepton< reco::Muon >::hcalIsoDeposit(), pat::Lepton< reco::Muon >::trackIsoDeposit(), and pat::Lepton< reco::Muon >::userIsoDeposit().
{ for (IsoDepositPairs::const_iterator it = isoDeposits_.begin(), ed = isoDeposits_.end(); it != ed; ++it) { if (it->first == key) return & it->second; } return 0; }
float pat::Lepton< LeptonType >::neutralHadronIso | ( | ) | const [inline] |
Returns the isolation calculated with only the neutral hadron PFCandidates
Definition at line 142 of file Lepton.h.
{ return userIsolation(pat::PfNeutralHadronIso); }
float pat::Lepton< LeptonType >::particleIso | ( | ) | const [inline] |
PARTICLE FLOW ISOLATION Returns the isolation calculated with all the PFCandidates
Definition at line 136 of file Lepton.h.
{ return userIsolation(pat::PfAllParticleIso); }
float pat::Lepton< LeptonType >::photonIso | ( | ) | const [inline] |
Returns the isolation calculated with only the gamma PFCandidates
Definition at line 145 of file Lepton.h.
{ return userIsolation(pat::PfGammaIso); }
void pat::Lepton< LeptonType >::setEcalIso | ( | float | caloIso | ) | [inline] |
Sets ecal isolation variable.
Definition at line 154 of file Lepton.h.
Referenced by aod2patFilterZee::filter().
{ setIsolation(pat::EcalIso, caloIso); }
void pat::Lepton< LeptonType >::setGenLepton | ( | const reco::GenParticleRef & | gl, |
bool | embed = false |
||
) | [inline] |
void pat::Lepton< LeptonType >::setHcalIso | ( | float | caloIso | ) | [inline] |
Sets hcal isolation variable.
Definition at line 156 of file Lepton.h.
Referenced by aod2patFilterZee::filter().
{ setIsolation(pat::HcalIso, caloIso); }
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 173 of file Lepton.h.
Referenced by pat::Lepton< reco::Muon >::ecalIsoDeposit(), pat::PATElectronProducer::fillElectron(), pat::PATElectronProducer::fillElectron2(), pat::PATMuonProducer::fillMuon(), pat::Lepton< reco::Muon >::hcalIsoDeposit(), pat::PATElectronProducer::produce(), pat::PATTauProducer::produce(), pat::Lepton< reco::Muon >::trackIsoDeposit(), and pat::Lepton< reco::Muon >::userIsoDeposit().
{ IsoDepositPairs::iterator it = isoDeposits_.begin(), ed = isoDeposits_.end(); for (; it != ed; ++it) { if (it->first == key) { it->second = dep; return; } } isoDeposits_.push_back(std::make_pair(key,dep)); }
void pat::Lepton< LeptonType >::setIsolation | ( | IsolationKeys | key, |
float | value | ||
) | [inline] |
Sets the userIsolation variable for a specific key. Note that you can't set isolation for a pseudo-key like CaloIso
Definition at line 99 of file Lepton.h.
Referenced by pat::PATElectronProducer::fillElectron(), pat::PATElectronProducer::fillElectron2(), pat::PATMuonProducer::fillMuon(), pat::PATElectronProducer::produce(), pat::PATMuonProducer::produce(), ZMuMuMuonUserData::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().
{ if (key >= 0) { if (size_t(key) >= isolations_.size()) isolations_.resize(key+1, -1.0); isolations_[key] = value; } else { throw cms::Exception("Illegal Argument") << "The key for which you're setting isolation does not correspond " << "to an individual isolation but to the sum of more independent isolations " << "(e.g. Calo = Ecal + Hcal), so you can't SET the value, just GET it.\n" << "Please set up each component independly.\n"; } }
void pat::Lepton< LeptonType >::setTrackIso | ( | float | trackIso | ) | [inline] |
Sets tracker isolation variable.
Definition at line 152 of file Lepton.h.
Referenced by aod2patFilterZee::filter().
{ setIsolation(pat::TrackIso, trackIso); }
void pat::Lepton< LeptonType >::setUserIso | ( | float | value, |
uint8_t | index = 0 |
||
) | [inline] |
Sets user isolation variable #index.
Definition at line 158 of file Lepton.h.
{ setIsolation(IsolationKeys(UserBaseIso + index), value); }
float pat::Lepton< LeptonType >::trackIso | ( | ) | const [inline] |
Returns the tracker isolation variable that was stored in this object when produced, or -1.0 if there is none (overloaded if specific isolation functions are available from the derived objects)
Reimplemented in pat::Electron, and pat::Muon.
Definition at line 117 of file Lepton.h.
Referenced by dummy::Isolationdummy().
{ return userIsolation(pat::TrackIso); }
const IsoDeposit* pat::Lepton< LeptonType >::trackIsoDeposit | ( | ) | const [inline] |
Definition at line 182 of file Lepton.h.
{ return isoDeposit(pat::TrackIso); }
void pat::Lepton< LeptonType >::trackIsoDeposit | ( | const IsoDeposit & | dep | ) | [inline] |
Definition at line 188 of file Lepton.h.
{ setIsoDeposit(pat::TrackIso,dep); }
float pat::Lepton< LeptonType >::userIso | ( | uint8_t | index = 0 | ) | const [inline] |
Returns the user defined isolation variable #index that was stored in this object when produced, or -1.0 if there is none
Definition at line 148 of file Lepton.h.
{ return userIsolation(IsolationKeys(UserBaseIso + index)); }
const IsoDeposit* pat::Lepton< LeptonType >::userIsoDeposit | ( | uint8_t | index = 0 | ) | const [inline] |
Definition at line 185 of file Lepton.h.
{ return isoDeposit(IsolationKeys(UserBaseIso + index)); }
void pat::Lepton< LeptonType >::userIsoDeposit | ( | const IsoDeposit & | dep, |
uint8_t | index = 0 |
||
) | [inline] |
Definition at line 191 of file Lepton.h.
{ setIsoDeposit(IsolationKeys(UserBaseIso + index), dep); }
float pat::Lepton< LeptonType >::userIsolation | ( | const std::string & | key | ) | const [inline] |
Returns the isolation variable for string type function arguments (to be used with the cut-string parser); the possible values of the strings are the enums defined in DataFormats/PatCandidates/interface/Isolation.h
Definition at line 74 of file Lepton.h.
{ // remove leading namespace specifier std::string prunedKey = ( key.find("pat::") == 0 ) ? std::string(key, 5) : key; if ( prunedKey == "TrackIso" ) return userIsolation(pat::TrackIso); if ( prunedKey == "EcalIso" ) return userIsolation(pat::EcalIso); if ( prunedKey == "HcalIso" ) return userIsolation(pat::HcalIso); if ( prunedKey == "PfAllParticleIso" ) return userIsolation(pat::PfAllParticleIso); if ( prunedKey == "PfChargedHadronIso" ) return userIsolation(pat::PfChargedHadronIso); if ( prunedKey == "PfNeutralHadronIso" ) return userIsolation(pat::PfNeutralHadronIso); if ( prunedKey == "PfGammaIso" ) return userIsolation(pat::PfGammaIso); if ( prunedKey == "User1Iso" ) return userIsolation(pat::User1Iso); if ( prunedKey == "User2Iso" ) return userIsolation(pat::User2Iso); if ( prunedKey == "User3Iso" ) return userIsolation(pat::User3Iso); if ( prunedKey == "User4Iso" ) return userIsolation(pat::User4Iso); if ( prunedKey == "User5Iso" ) return userIsolation(pat::User5Iso); if ( prunedKey == "UserBaseIso" ) return userIsolation(pat::UserBaseIso); if ( prunedKey == "CaloIso" ) return userIsolation(pat::CaloIso); //throw cms::Excepton("Missing Data") //<< "Isolation corresponding to key " //<< key << " was not stored for this particle."; return -1.0; }
float pat::Lepton< LeptonType >::userIsolation | ( | IsolationKeys | key | ) | const [inline] |
Returns the isolation variable for a specific key (or pseudo-key like CaloIso), or -1.0 if not available
Definition at line 51 of file Lepton.h.
Referenced by pat::Lepton< reco::Muon >::caloIso(), pat::Lepton< reco::Muon >::chargedHadronIso(), pat::Lepton< reco::Muon >::ecalIso(), pat::Lepton< reco::Muon >::hcalIso(), pat::Lepton< reco::Muon >::neutralHadronIso(), pat::Lepton< reco::Muon >::particleIso(), pat::Lepton< reco::Muon >::photonIso(), ZeePlots::ReturnCandVar(), PFMuonSelector::spring11Cuts(), PFElectronSelector::spring11Cuts(), pat::Lepton< reco::Muon >::trackIso(), pat::Lepton< reco::Muon >::userIso(), and pat::Lepton< reco::Muon >::userIsolation().
{ if (key >= 0) { //if (key >= isolations_.size()) throw cms::Excepton("Missing Data") //<< "Isolation corresponding to key " //<< key << " was not stored for this particle."; if (size_t(key) >= isolations_.size()) return -1.0; return isolations_[key]; } else switch (key) { case pat::CaloIso: //if (isolations_.size() <= pat::HcalIso) throw cms::Excepton("Missing Data") //<< "CaloIso Isolation was not stored for this particle."; if (isolations_.size() <= pat::HcalIso) return -1.0; return isolations_[pat::EcalIso] + isolations_[pat::HcalIso]; default: return -1.0; //throw cms::Excepton("Missing Data") << "Isolation corresponding to key " //<< key << " was not stored for this particle."; } }
IsoDepositPairs pat::Lepton< LeptonType >::isoDeposits_ [protected] |
Definition at line 197 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 198 of file Lepton.h.
Referenced by pat::Lepton< reco::Muon >::setIsolation(), and pat::Lepton< reco::Muon >::userIsolation().