CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Types | Protected Attributes
pat::Lepton< LeptonType > Class Template Reference

Analysis-level lepton class. More...

#include "DataFormats/PatCandidates/interface/Lepton.h"

Inheritance diagram for pat::Lepton< LeptonType >:
pat::PATObject< LeptonType >

Public Member Functions

float caloIso () const
 
float chargedHadronIso () const
 
Lepton< LeptonType > * clone () const override
 
float ecalIso () const
 
const IsoDepositecalIsoDeposit () const
 
void ecalIsoDeposit (const IsoDeposit &dep)
 
const reco::GenParticlegenLepton () const
 
float hcalIso () const
 
const IsoDeposithcalIsoDeposit () const
 
void hcalIsoDeposit (const IsoDeposit &dep)
 
const IsoDepositisoDeposit (IsolationKeys key) const
 Returns the IsoDeposit associated with some key, or a null pointer if it is not available. More...
 
 Lepton ()
 default constructor More...
 
 Lepton (const LeptonType &aLepton)
 constructor from LeptonType More...
 
 Lepton (const edm::RefToBase< LeptonType > &aLeptonRef)
 constructor from ref to LeptonType More...
 
 Lepton (const edm::Ptr< LeptonType > &aLeptonRef)
 constructor from ref to LeptonType More...
 
const PFIsolationminiPFIsolation () const
 
float neutralHadronIso () const
 
float particleIso () const
 
float photonIso () const
 
float puChargedHadronIso () const
 
void setEcalIso (float caloIso)
 Sets ecal isolation variable. More...
 
void setGenLepton (const reco::GenParticleRef &gl, bool embed=false)
 
void setHcalIso (float caloIso)
 Sets hcal isolation variable. More...
 
void setIsoDeposit (IsolationKeys key, const IsoDeposit &dep)
 Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten. More...
 
void setIsolation (IsolationKeys key, float value)
 
void setMiniPFIsolation (PFIsolation const &iso)
 
void setTrackIso (float trackIso)
 Sets tracker isolation variable. More...
 
void setUserIso (float value, uint8_t index=0)
 Sets user isolation variable #index. More...
 
float trackIso () const
 
const IsoDeposittrackIsoDeposit () const
 
void trackIsoDeposit (const IsoDeposit &dep)
 
float userIso (uint8_t index=0) const
 
const IsoDeposituserIsoDeposit (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
 
 ~Lepton () override
 destructor More...
 
- Public Member Functions inherited from pat::PATObject< LeptonType >
void addGenParticleRef (const reco::GenParticleRef &ref)
 
void addTriggerObjectMatch (const TriggerObjectStandAlone &trigObj)
 add a trigger match More...
 
void addUserCand (const std::string &label, const reco::CandidatePtr &data, const bool overwrite=false)
 Set user-defined int. More...
 
void addUserData (const std::string &label, const T &data, bool transientOnly=false, bool overwrite=false)
 
void addUserDataFromPtr (const std::string &label, const edm::Ptr< pat::UserData > &data, bool overwrite=false)
 
void addUserFloat (const std::string &label, float data, const bool overwrite=false)
 Set user-defined float. More...
 
void addUserInt (const std::string &label, int32_t data, const bool overwrite=false)
 Set user-defined int. More...
 
std::vector< std::pair< std::string, pat::LookupTableRecord > > efficiencies () const
 Returns the efficiencies as <name,value> pairs (by value) More...
 
const pat::LookupTableRecordefficiency (const std::string &name) const
 Returns an efficiency given its name. More...
 
const std::vector< std::string > & efficiencyNames () const
 Returns the list of the names of the stored efficiencies. More...
 
const std::vector< pat::LookupTableRecord > & efficiencyValues () const
 Returns the list of the values of the stored efficiencies (the ordering is the same as in efficiencyNames()) More...
 
void embedGenParticle ()
 
const reco::GenParticlegenParticle (size_t idx=0) const
 
reco::GenParticleRef genParticleById (int pdgId, int status, uint8_t autoCharge=0) const
 
reco::GenParticleRef genParticleRef (size_t idx=0) const
 
std::vector< reco::GenParticleRefgenParticleRefs () const
 
size_t genParticlesSize () const
 Number of generator level particles stored as ref or embedded. More...
 
const pat::CandKinResolutiongetKinResolution (const std::string &label="") const
 
bool hasKinResolution (const std::string &label="") const
 Check if the kinematic resolutions are stored into this object (possibly specifying a label for them) More...
 
bool hasOverlaps (const std::string &label) const
 Returns true if there was at least one overlap for this test label. More...
 
bool hasUserCand (const std::string &key) const
 Return true if there is a user-defined int with a given name. More...
 
bool hasUserData (const std::string &key) const
 Check if user data with a specific type is present. More...
 
bool hasUserFloat (const std::string &key) const
 Return true if there is a user-defined float with a given name. More...
 
bool hasUserFloat (const char *key) const
 a CINT-friendly interface More...
 
bool hasUserInt (const std::string &key) const
 Return true if there is a user-defined int with a given name. More...
 
const reco::CandidateoriginalObject () const
 access to the original object; returns zero for null Ref and throws for unavailable collection More...
 
const edm::Ptr< reco::Candidate > & originalObjectRef () const
 reference to original object. Returns a null reference if not available More...
 
const std::vector< std::string > & overlapLabels () const
 Returns the labels of the overlap tests that found at least one overlap. More...
 
const reco::CandidatePtrVectoroverlaps (const std::string &label) const
 
 PATObject ()
 default constructor More...
 
 PATObject (const LeptonType &obj)
 constructor from a base object (leaves invalid reference to original object!) More...
 
 PATObject (const edm::RefToBase< LeptonType > &ref)
 constructor from reference More...
 
 PATObject (const edm::Ptr< LeptonType > &ref)
 constructor from reference More...
 
double resolE (const std::string &label="") const
 Resolution on energy, possibly with a label to specify which resolution to use. More...
 
double resolEt (const std::string &label="") const
 Resolution on et, possibly with a label to specify which resolution to use. More...
 
double resolEta (const std::string &label="") const
 Resolution on eta, possibly with a label to specify which resolution to use. More...
 
double resolM (const std::string &label="") const
 
double resolP (const std::string &label="") const
 Resolution on p, possibly with a label to specify which resolution to use. More...
 
double resolPhi (const std::string &label="") const
 Resolution on phi, possibly with a label to specify which resolution to use. More...
 
double resolPInv (const std::string &label="") const
 Resolution on 1/p, possibly with a label to specify which resolution to use. More...
 
double resolPt (const std::string &label="") const
 Resolution on pt, possibly with a label to specify which resolution to use. More...
 
double resolPx (const std::string &label="") const
 Resolution on px, possibly with a label to specify which resolution to use. More...
 
double resolPy (const std::string &label="") const
 Resolution on py, possibly with a label to specify which resolution to use. More...
 
double resolPz (const std::string &label="") const
 Resolution on pz, possibly with a label to specify which resolution to use. More...
 
double resolTheta (const std::string &label="") const
 Resolution on theta, possibly with a label to specify which resolution to use. More...
 
void setEfficiency (const std::string &name, const pat::LookupTableRecord &value)
 
void setGenParticle (const reco::GenParticle &particle)
 Set the generator level particle from a particle not in the Event (embedding it, of course) More...
 
void setGenParticleRef (const reco::GenParticleRef &ref, bool embed=false)
 Set the generator level particle reference. More...
 
void setKinResolution (const pat::CandKinResolution &resol, const std::string &label="")
 Add a kinematic resolution to this object (possibly with a label) More...
 
void setOverlaps (const std::string &label, const reco::CandidatePtrVector &overlaps)
 
const TriggerObjectStandAlonetriggerObjectMatch (const size_t idx=0) const
 get one matched trigger object by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByAlgorithm (const std::string &nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByAlgorithm (const char *nameAlgorithm, const bool algoCondAccepted=true, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByAlgorithm (const std::string &nameAlgorithm, const unsigned algoCondAccepted, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByAlgorithm (const char *nameAlgorithm, const unsigned algoCondAccepted, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByCollection (const std::string &coll, const size_t idx=0) const
 get one matched trigger object from a certain collection by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByCollection (const char *coll, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByCondition (const std::string &nameCondition, const size_t idx=0) const
 get one matched L1 object used in a succeeding object combination of a certain L1 condition by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByCondition (const char *nameCondition, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByFilter (const std::string &labelFilter, const size_t idx=0) const
 get one matched HLT object used in a certain HLT filter by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByFilter (const char *labelFilter, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByFilterID (const unsigned triggerObjectType, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByPath (const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByPath (const char *namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByPath (const std::string &namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByPath (const char *namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1, const size_t idx=0) const
 
const TriggerObjectStandAlonetriggerObjectMatchByType (const trigger::TriggerObjectType triggerObjectType, const size_t idx=0) const
 get one matched trigger object of a certain type by index More...
 
const TriggerObjectStandAlonetriggerObjectMatchByType (const unsigned triggerObjectType, const size_t idx=0) const
 
const TriggerObjectStandAloneCollectiontriggerObjectMatches () const
 get all matched trigger objects More...
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const std::string &nameAlgorithm, const bool algoCondAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const char *nameAlgorithm, const bool algoCondAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const std::string &nameAlgorithm, const unsigned algoCondAccepted) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByAlgorithm (const char *nameAlgorithm, const unsigned algoCondAccepted) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection (const std::string &coll) const
 get all matched trigger objects from a certain collection More...
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCollection (const char *coll) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCondition (const std::string &nameCondition) const
 get all matched L1 objects used in a succeeding object combination of a certain L1 condition More...
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByCondition (const char *nameCondition) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilter (const std::string &labelFilter) const
 get all matched HLT objects used in a certain HLT filter More...
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilter (const char *labelFilter) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByFilterID (const unsigned triggerObjectType) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const char *namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const std::string &namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath (const char *namePath, const unsigned pathLastFilterAccepted, const unsigned pathL3FilterAccepted=1) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByType (const trigger::TriggerObjectType triggerObjectType) const
 
const TriggerObjectStandAloneCollection triggerObjectMatchesByType (const unsigned triggerObjectType) const
 
void unpackTriggerObjectPathNames (const edm::TriggerNames &names)
 unpack path names of matched trigger objects (if they were packed before embedding, which is not normally the case) More...
 
reco::CandidatePtr userCand (const std::string &key) const
 
const std::vector< std::string > & userCandNames () const
 Get list of user-defined cand names. More...
 
const TuserData (const std::string &key) const
 Returns user-defined data. Returns NULL if the data is not present, or not of type T. More...
 
const void * userDataBare (const std::string &key) const
 
const std::vector< std::string > & userDataNames () const
 Get list of user data object names. More...
 
const std::string & userDataObjectType (const std::string &key) const
 Get human-readable type of user data object, for debugging. More...
 
float userFloat (const std::string &key) const
 
float userFloat (const char *key) const
 a CINT-friendly interface More...
 
const std::vector< std::string > & userFloatNames () const
 Get list of user-defined float names. More...
 
std::vector< float > userFloatRange (const std::string &key) const
 return a range of values corresponding to key More...
 
int32_t userInt (const std::string &key) const
 
const std::vector< std::string > & userIntNames () const
 Get list of user-defined int names. More...
 
std::vector< int > userIntRange (const std::string &key) const
 returns a range of values corresponding to key More...
 
 ~PATObject () override
 destructor More...
 

Protected Types

typedef std::vector< std::pair< IsolationKeys, pat::IsoDeposit > > IsoDepositPairs
 

Protected Attributes

IsoDepositPairs isoDeposits_
 
std::vector< float > isolations_
 
PFIsolation miniPFIsolation_
 
- Protected Attributes inherited from pat::PATObject< LeptonType >
std::vector< std::string > efficiencyNames_
 vector of the efficiencies (names) More...
 
std::vector< pat::LookupTableRecordefficiencyValues_
 vector of the efficiencies (values) More...
 
std::vector< reco::GenParticlegenParticleEmbedded_
 vector to hold an embedded generator level particle More...
 
std::vector< reco::GenParticleRefgenParticleRef_
 Reference to a generator level particle. More...
 
std::vector< std::string > kinResolutionLabels_
 
std::vector< pat::CandKinResolutionkinResolutions_
 Kinematic resolutions. More...
 
std::vector< reco::CandidatePtrVectoroverlapItems_
 Overlapping items (sorted by distance) More...
 
std::vector< std::string > overlapLabels_
 Overlapping test labels (only if there are any overlaps) More...
 
edm::Ptr< reco::CandidaterefToOrig_
 
TriggerObjectStandAloneCollection triggerObjectMatchesEmbedded_
 vector of trigger matches More...
 
std::vector< std::string > userCandLabels_
 
std::vector< reco::CandidatePtruserCands_
 
std::vector< std::string > userDataLabels_
 User data object. More...
 
pat::UserDataCollection userDataObjects_
 
std::vector< std::string > userFloatLabels_
 
std::vector< float > userFloats_
 
std::vector< std::string > userIntLabels_
 
std::vector< int32_t > userInts_
 

Additional Inherited Members

- Public Types inherited from pat::PATObject< LeptonType >
typedef LeptonType base_type
 
- Protected Member Functions inherited from pat::PATObject< LeptonType >
void addUserDataObject_ (const std::string &label, std::unique_ptr< pat::UserData > value, bool overwrite=false)
 

Detailed Description

template<class LeptonType>
class pat::Lepton< LeptonType >

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

Author
Steven Lowette, Giovanni Petrucciani, Frederic Ronga

Definition at line 31 of file Lepton.h.

Member Typedef Documentation

template<class LeptonType>
typedef std::vector<std::pair<IsolationKeys, pat::IsoDeposit> > pat::Lepton< LeptonType >::IsoDepositPairs
protected

Definition at line 201 of file Lepton.h.

Constructor & Destructor Documentation

template<class LeptonType >
Lepton::Lepton ( )

default constructor

Definition at line 211 of file Lepton.h.

References pat::Lepton< LeptonType >::setMiniPFIsolation().

211  :
212  PATObject<LeptonType>(LeptonType()) {
213  // no common constructor, so initialize the candidate manually
214  this->setCharge(0);
215  this->setP4(reco::Particle::LorentzVector(0, 0, 0, 0));
216  this->setVertex(reco::Particle::Point(0, 0, 0));
218  }
math::XYZPoint Point
point in the space
Definition: Particle.h:25
void setMiniPFIsolation(PFIsolation const &iso)
Definition: Lepton.h:197
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
template<class LeptonType>
Lepton::Lepton ( const LeptonType &  aLepton)

constructor from LeptonType

Definition at line 223 of file Lepton.h.

References pat::Lepton< LeptonType >::setMiniPFIsolation().

223  :
224  PATObject<LeptonType>(aLepton) {
226  }
void setMiniPFIsolation(PFIsolation const &iso)
Definition: Lepton.h:197
template<class LeptonType>
Lepton::Lepton ( const edm::RefToBase< LeptonType > &  aLeptonRef)

constructor from ref to LeptonType

Definition at line 231 of file Lepton.h.

References pat::Lepton< LeptonType >::setMiniPFIsolation().

231  :
232  PATObject<LeptonType>(aLeptonRef) {
234  }
void setMiniPFIsolation(PFIsolation const &iso)
Definition: Lepton.h:197
template<class LeptonType>
Lepton::Lepton ( const edm::Ptr< LeptonType > &  aLeptonRef)

constructor from ref to LeptonType

Definition at line 239 of file Lepton.h.

References pat::Lepton< LeptonType >::setMiniPFIsolation().

239  :
240  PATObject<LeptonType>(aLeptonRef) {
242  }
void setMiniPFIsolation(PFIsolation const &iso)
Definition: Lepton.h:197
template<class LeptonType >
Lepton::~Lepton ( )
override

destructor

Definition at line 247 of file Lepton.h.

247  {
248  }

Member Function Documentation

template<class LeptonType>
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)

Definition at line 122 of file Lepton.h.

Referenced by dummy::Isolationdummy().

122 { return userIsolation(pat::CaloIso); }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:50
template<class LeptonType>
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.

Referenced by Lepton.Lepton::absIsoFromEA(), and Photon.Photon::passPhotonIso().

float userIsolation(IsolationKeys key) const
Definition: Lepton.h:50
template<class LeptonType>
Lepton<LeptonType>* pat::Lepton< LeptonType >::clone ( void  ) const
inlineoverride

Definition at line 41 of file Lepton.h.

41 { return new Lepton<LeptonType>(*this); }
template<class LeptonType>
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)

Definition at line 127 of file Lepton.h.

Referenced by dummy::Isolationdummy().

127 { return userIsolation(pat::EcalIso); }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:50
template<class LeptonType>
const IsoDeposit* pat::Lepton< LeptonType >::ecalIsoDeposit ( ) const
inline

Definition at line 186 of file Lepton.h.

186 { return isoDeposit(pat::EcalIso ); }
const IsoDeposit * isoDeposit(IsolationKeys key) const
Returns the IsoDeposit associated with some key, or a null pointer if it is not available.
Definition: Lepton.h:166
template<class LeptonType>
void pat::Lepton< LeptonType >::ecalIsoDeposit ( const IsoDeposit dep)
inline

Definition at line 192 of file Lepton.h.

192 { setIsoDeposit(pat::EcalIso, dep); }
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
Definition: Lepton.h:176
template<class LeptonType>
const reco::GenParticle* pat::Lepton< LeptonType >::genLepton ( ) const
inline

Definition at line 43 of file Lepton.h.

Referenced by gamma_radiative_analyzer::analyze(), and ZMuMu_Radiative_analyzer::analyze().

const reco::GenParticle * genParticle(size_t idx=0) const
Definition: PATObject.h:244
template<class LeptonType>
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)

Definition at line 132 of file Lepton.h.

Referenced by dummy::Isolationdummy().

132 { return userIsolation(pat::HcalIso); }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:50
template<class LeptonType>
const IsoDeposit* pat::Lepton< LeptonType >::hcalIsoDeposit ( ) const
inline

Definition at line 187 of file Lepton.h.

187 { return isoDeposit(pat::HcalIso ); }
const IsoDeposit * isoDeposit(IsolationKeys key) const
Returns the IsoDeposit associated with some key, or a null pointer if it is not available.
Definition: Lepton.h:166
template<class LeptonType>
void pat::Lepton< LeptonType >::hcalIsoDeposit ( const IsoDeposit dep)
inline

Definition at line 193 of file Lepton.h.

193 { setIsoDeposit(pat::HcalIso, dep); }
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
Definition: Lepton.h:176
template<class LeptonType>
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 166 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().

166  {
167  for (IsoDepositPairs::const_iterator it = isoDeposits_.begin(), ed = isoDeposits_.end();
168  it != ed; ++it)
169  {
170  if (it->first == key) return & it->second;
171  }
172  return nullptr;
173  }
IsoDepositPairs isoDeposits_
Definition: Lepton.h:202
template<class LeptonType>
const PFIsolation& pat::Lepton< LeptonType >::miniPFIsolation ( ) const
inline

Definition at line 196 of file Lepton.h.

Referenced by pat::MuonMvaEstimator::computeMva(), and pat::PATMuonProducer::getRelMiniIsoPUCorrected().

196 { return miniPFIsolation_; }
PFIsolation miniPFIsolation_
Definition: Lepton.h:205
template<class LeptonType>
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.

Referenced by Lepton.Lepton::absIsoFromEA(), and Photon.Photon::passPhotonIso().

float userIsolation(IsolationKeys key) const
Definition: Lepton.h:50
template<class LeptonType>
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.

float userIsolation(IsolationKeys key) const
Definition: Lepton.h:50
template<class LeptonType>
float pat::Lepton< LeptonType >::photonIso ( ) const
inline

Returns the isolation calculated with only the gamma PFCandidates

Definition at line 145 of file Lepton.h.

Referenced by Lepton.Lepton::absIsoFromEA(), and Photon.Photon::passPhotonIso().

145 { return userIsolation(pat::PfGammaIso); }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:50
template<class LeptonType>
float pat::Lepton< LeptonType >::puChargedHadronIso ( ) const
inline

Returns the isolation calculated with only the pile-up charged hadron PFCandidates

Definition at line 148 of file Lepton.h.

float userIsolation(IsolationKeys key) const
Definition: Lepton.h:50
template<class LeptonType>
void pat::Lepton< LeptonType >::setEcalIso ( float  caloIso)
inline

Sets ecal isolation variable.

Definition at line 157 of file Lepton.h.

Referenced by aod2patFilterZee::filter().

void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:99
float caloIso() const
Definition: Lepton.h:122
template<class LeptonType>
void pat::Lepton< LeptonType >::setGenLepton ( const reco::GenParticleRef gl,
bool  embed = false 
)
inline

Definition at line 45 of file Lepton.h.

void setGenParticleRef(const reco::GenParticleRef &ref, bool embed=false)
Set the generator level particle reference.
Definition: PATObject.h:671
#define embed
Definition: AMPTWrapper.h:178
template<class LeptonType>
void pat::Lepton< LeptonType >::setHcalIso ( float  caloIso)
inline

Sets hcal isolation variable.

Definition at line 159 of file Lepton.h.

Referenced by aod2patFilterZee::filter().

void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:99
float caloIso() const
Definition: Lepton.h:122
template<class LeptonType>
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 176 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::PATTauProducer::produce(), pat::PATElectronProducer::produce(), pat::Lepton< reco::Muon >::trackIsoDeposit(), and pat::Lepton< reco::Muon >::userIsoDeposit().

176  {
177  IsoDepositPairs::iterator it = isoDeposits_.begin(), ed = isoDeposits_.end();
178  for (; it != ed; ++it) {
179  if (it->first == key) { it->second = dep; return; }
180  }
181  isoDeposits_.push_back(std::make_pair(key,dep));
182  }
IsoDepositPairs isoDeposits_
Definition: Lepton.h:202
template<class LeptonType>
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(), PatElectronEAIsoCorrectionProducer::produce(), ZMuMuMuonUserData::produce(), pat::PATTauProducer::produce(), pat::PATElectronProducer::produce(), pat::PATMuonProducer::produce(), pat::Lepton< reco::Muon >::setEcalIso(), pat::Lepton< reco::Muon >::setHcalIso(), pat::Lepton< reco::Muon >::setTrackIso(), and pat::Lepton< reco::Muon >::setUserIso().

99  {
100  if (key >= 0) {
101  if (size_t(key) >= isolations_.size()) isolations_.resize(key+1, -1.0);
102  isolations_[key] = value;
103  } else {
104  throw cms::Exception("Illegal Argument") <<
105  "The key for which you're setting isolation does not correspond " <<
106  "to an individual isolation but to the sum of more independent isolations " <<
107  "(e.g. Calo = Ecal + Hcal), so you can't SET the value, just GET it.\n" <<
108  "Please set up each component independly.\n";
109  }
110  }
std::vector< float > isolations_
Definition: Lepton.h:203
template<class LeptonType>
void pat::Lepton< LeptonType >::setMiniPFIsolation ( PFIsolation const &  iso)
inline
template<class LeptonType>
void pat::Lepton< LeptonType >::setTrackIso ( float  trackIso)
inline

Sets tracker isolation variable.

Definition at line 155 of file Lepton.h.

Referenced by aod2patFilterZee::filter().

void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:99
float trackIso() const
Definition: Lepton.h:117
template<class LeptonType>
void pat::Lepton< LeptonType >::setUserIso ( float  value,
uint8_t  index = 0 
)
inline

Sets user isolation variable #index.

Definition at line 161 of file Lepton.h.

void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:99
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
Definition: value.py:1
template<class LeptonType>
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)

Definition at line 117 of file Lepton.h.

Referenced by dummy::Isolationdummy().

117 { return userIsolation(pat::TrackIso); }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:50
template<class LeptonType>
const IsoDeposit* pat::Lepton< LeptonType >::trackIsoDeposit ( ) const
inline

Definition at line 185 of file Lepton.h.

185 { return isoDeposit(pat::TrackIso); }
const IsoDeposit * isoDeposit(IsolationKeys key) const
Returns the IsoDeposit associated with some key, or a null pointer if it is not available.
Definition: Lepton.h:166
template<class LeptonType>
void pat::Lepton< LeptonType >::trackIsoDeposit ( const IsoDeposit dep)
inline

Definition at line 191 of file Lepton.h.

void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
Definition: Lepton.h:176
template<class LeptonType>
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 151 of file Lepton.h.

IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:50
template<class LeptonType>
const IsoDeposit* pat::Lepton< LeptonType >::userIsoDeposit ( uint8_t  index = 0) const
inline

Definition at line 188 of file Lepton.h.

IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
const IsoDeposit * isoDeposit(IsolationKeys key) const
Returns the IsoDeposit associated with some key, or a null pointer if it is not available.
Definition: Lepton.h:166
template<class LeptonType>
void pat::Lepton< LeptonType >::userIsoDeposit ( const IsoDeposit dep,
uint8_t  index = 0 
)
inline

Definition at line 194 of file Lepton.h.

IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
Definition: Lepton.h:176
template<class LeptonType>
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 50 of file Lepton.h.

Referenced by WenuPlots::analyze(), 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(), pat::Lepton< reco::Muon >::puChargedHadronIso(), WenuPlots::ReturnCandVar(), ZeePlots::ReturnCandVar(), PFElectronSelector::spring11Cuts(), PFMuonSelector::TopPag12LjetsCuts(), pat::Lepton< reco::Muon >::trackIso(), pat::Lepton< reco::Muon >::userIso(), and pat::Lepton< reco::Muon >::userIsolation().

50  {
51  if (key >= 0) {
52  //if (key >= isolations_.size()) throw cms::Excepton("Missing Data")
53  //<< "Isolation corresponding to key "
54  //<< key << " was not stored for this particle.";
55  if (size_t(key) >= isolations_.size()) return -1.0;
56  return isolations_[key];
57  } else switch (key) {
58  case pat::CaloIso:
59  //if (isolations_.size() <= pat::HcalIso) throw cms::Excepton("Missing Data")
60  //<< "CaloIso Isolation was not stored for this particle.";
61  if (isolations_.size() <= pat::HcalIso) return -1.0;
63  default:
64  return -1.0;
65  //throw cms::Excepton("Missing Data") << "Isolation corresponding to key "
66  //<< key << " was not stored for this particle.";
67  }
68  }
std::vector< float > isolations_
Definition: Lepton.h:203
template<class LeptonType>
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 73 of file Lepton.h.

73  {
74  // remove leading namespace specifier
75  std::string prunedKey = ( key.find("pat::") == 0 ) ? std::string(key, 5) : key;
76  if ( prunedKey == "TrackIso" ) return userIsolation(pat::TrackIso);
77  if ( prunedKey == "EcalIso" ) return userIsolation(pat::EcalIso);
78  if ( prunedKey == "HcalIso" ) return userIsolation(pat::HcalIso);
79  if ( prunedKey == "PfAllParticleIso" ) return userIsolation(pat::PfAllParticleIso);
80  if ( prunedKey == "PfChargedHadronIso" ) return userIsolation(pat::PfChargedHadronIso);
81  if ( prunedKey == "PfNeutralHadronIso" ) return userIsolation(pat::PfNeutralHadronIso);
82  if ( prunedKey == "PfGammaIso" ) return userIsolation(pat::PfGammaIso);
83  if ( prunedKey == "User1Iso" ) return userIsolation(pat::User1Iso);
84  if ( prunedKey == "User2Iso" ) return userIsolation(pat::User2Iso);
85  if ( prunedKey == "User3Iso" ) return userIsolation(pat::User3Iso);
86  if ( prunedKey == "User4Iso" ) return userIsolation(pat::User4Iso);
87  if ( prunedKey == "User5Iso" ) return userIsolation(pat::User5Iso);
88  if ( prunedKey == "UserBaseIso" ) return userIsolation(pat::UserBaseIso);
89  if ( prunedKey == "CaloIso" ) return userIsolation(pat::CaloIso);
90  if ( prunedKey == "PfPUChargedHadronIso" ) return userIsolation(pat::PfPUChargedHadronIso);
91  //throw cms::Excepton("Missing Data")
92  //<< "Isolation corresponding to key "
93  //<< key << " was not stored for this particle.";
94  return -1.0;
95  }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:50

Member Data Documentation

template<class LeptonType>
IsoDepositPairs pat::Lepton< LeptonType >::isoDeposits_
protected
template<class LeptonType>
std::vector<float> pat::Lepton< LeptonType >::isolations_
protected
template<class LeptonType>
PFIsolation pat::Lepton< LeptonType >::miniPFIsolation_
protected