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 29 of file Lepton.h.

Member Typedef Documentation

◆ IsoDepositPairs

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

Definition at line 221 of file Lepton.h.

Constructor & Destructor Documentation

◆ Lepton() [1/4]

template<class LeptonType >
Lepton::Lepton ( )

default constructor

Definition at line 230 of file Lepton.h.

230  : PATObject<LeptonType>(LeptonType()) {
231  // no common constructor, so initialize the candidate manually
232  this->setCharge(0);
233  this->setP4(reco::Particle::LorentzVector(0, 0, 0, 0));
234  this->setVertex(reco::Particle::Point(0, 0, 0));
236  }
math::XYZPoint Point
point in the space
Definition: Particle.h:25
void setMiniPFIsolation(PFIsolation const &iso)
Definition: Lepton.h:217
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21

◆ Lepton() [2/4]

template<class LeptonType>
Lepton::Lepton ( const LeptonType &  aLepton)

constructor from LeptonType

Definition at line 240 of file Lepton.h.

240  : PATObject<LeptonType>(aLepton) {
242  }
void setMiniPFIsolation(PFIsolation const &iso)
Definition: Lepton.h:217

◆ Lepton() [3/4]

template<class LeptonType>
Lepton::Lepton ( const edm::RefToBase< LeptonType > &  aLeptonRef)

constructor from ref to LeptonType

Definition at line 246 of file Lepton.h.

246  : PATObject<LeptonType>(aLeptonRef) {
248  }
void setMiniPFIsolation(PFIsolation const &iso)
Definition: Lepton.h:217

◆ Lepton() [4/4]

template<class LeptonType>
Lepton::Lepton ( const edm::Ptr< LeptonType > &  aLeptonRef)

constructor from ref to LeptonType

Definition at line 252 of file Lepton.h.

252  : PATObject<LeptonType>(aLeptonRef) {
254  }
void setMiniPFIsolation(PFIsolation const &iso)
Definition: Lepton.h:217

◆ ~Lepton()

template<class LeptonType >
Lepton::~Lepton ( )
override

destructor

Definition at line 258 of file Lepton.h.

258 {}

Member Function Documentation

◆ caloIso()

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 139 of file Lepton.h.

Referenced by pat::Lepton< reco::Muon >::setEcalIso(), and pat::Lepton< reco::Muon >::setHcalIso().

139 { return userIsolation(pat::CaloIso); }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:48

◆ chargedHadronIso()

template<class LeptonType>
float pat::Lepton< LeptonType >::chargedHadronIso ( ) const
inline

Returns the isolation calculated with only the charged hadron PFCandidates

Definition at line 156 of file Lepton.h.

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

float userIsolation(IsolationKeys key) const
Definition: Lepton.h:48

◆ clone()

template<class LeptonType>
Lepton<LeptonType>* pat::Lepton< LeptonType >::clone ( void  ) const
inlineoverride

Definition at line 37 of file Lepton.h.

37 { return new Lepton<LeptonType>(*this); }

◆ ecalIso()

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 144 of file Lepton.h.

144 { return userIsolation(pat::EcalIso); }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:48

◆ ecalIsoDeposit() [1/2]

template<class LeptonType>
const IsoDeposit* pat::Lepton< LeptonType >::ecalIsoDeposit ( ) const
inline

Definition at line 204 of file Lepton.h.

204 { 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:182

◆ ecalIsoDeposit() [2/2]

template<class LeptonType>
void pat::Lepton< LeptonType >::ecalIsoDeposit ( const IsoDeposit dep)
inline

Definition at line 210 of file Lepton.h.

210 { 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:191

◆ genLepton()

template<class LeptonType>
const reco::GenParticle* pat::Lepton< LeptonType >::genLepton ( ) const
inline

Definition at line 39 of file Lepton.h.

const reco::GenParticle * genParticle(size_t idx=0) const
Definition: PATObject.h:285

◆ hcalIso()

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 149 of file Lepton.h.

149 { return userIsolation(pat::HcalIso); }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:48

◆ hcalIsoDeposit() [1/2]

template<class LeptonType>
const IsoDeposit* pat::Lepton< LeptonType >::hcalIsoDeposit ( ) const
inline

Definition at line 205 of file Lepton.h.

205 { 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:182

◆ hcalIsoDeposit() [2/2]

template<class LeptonType>
void pat::Lepton< LeptonType >::hcalIsoDeposit ( const IsoDeposit dep)
inline

Definition at line 211 of file Lepton.h.

211 { 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:191

◆ isoDeposit()

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 182 of file Lepton.h.

Referenced by pat::Lepton< reco::Muon >::ecalIsoDeposit(), pat::Lepton< reco::Muon >::hcalIsoDeposit(), pat::Lepton< reco::Muon >::trackIsoDeposit(), and pat::Lepton< reco::Muon >::userIsoDeposit().

182  {
183  for (IsoDepositPairs::const_iterator it = isoDeposits_.begin(), ed = isoDeposits_.end(); it != ed; ++it) {
184  if (it->first == key)
185  return &it->second;
186  }
187  return nullptr;
188  }
IsoDepositPairs isoDeposits_
Definition: Lepton.h:222

◆ miniPFIsolation()

template<class LeptonType>
const PFIsolation& pat::Lepton< LeptonType >::miniPFIsolation ( ) const
inline

Definition at line 216 of file Lepton.h.

216 { return miniPFIsolation_; }
PFIsolation miniPFIsolation_
Definition: Lepton.h:225

◆ neutralHadronIso()

template<class LeptonType>
float pat::Lepton< LeptonType >::neutralHadronIso ( ) const
inline

Returns the isolation calculated with only the neutral hadron PFCandidates

Definition at line 159 of file Lepton.h.

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

float userIsolation(IsolationKeys key) const
Definition: Lepton.h:48

◆ particleIso()

template<class LeptonType>
float pat::Lepton< LeptonType >::particleIso ( ) const
inline

PARTICLE FLOW ISOLATION Returns the isolation calculated with all the PFCandidates

Definition at line 153 of file Lepton.h.

float userIsolation(IsolationKeys key) const
Definition: Lepton.h:48

◆ photonIso()

template<class LeptonType>
float pat::Lepton< LeptonType >::photonIso ( ) const
inline

Returns the isolation calculated with only the gamma PFCandidates

Definition at line 162 of file Lepton.h.

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

162 { return userIsolation(pat::PfGammaIso); }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:48

◆ puChargedHadronIso()

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 165 of file Lepton.h.

float userIsolation(IsolationKeys key) const
Definition: Lepton.h:48

◆ setEcalIso()

template<class LeptonType>
void pat::Lepton< LeptonType >::setEcalIso ( float  caloIso)
inline

Sets ecal isolation variable.

Definition at line 174 of file Lepton.h.

void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:115
float caloIso() const
Definition: Lepton.h:139

◆ setGenLepton()

template<class LeptonType>
void pat::Lepton< LeptonType >::setGenLepton ( const reco::GenParticleRef gl,
bool  embed = false 
)
inline

Definition at line 41 of file Lepton.h.

41  {
43  }
void setGenParticleRef(const reco::GenParticleRef &ref, bool embed=false)
Set the generator level particle reference.
Definition: PATObject.h:743
#define embed
Definition: AMPTWrapper.h:188

◆ setHcalIso()

template<class LeptonType>
void pat::Lepton< LeptonType >::setHcalIso ( float  caloIso)
inline

Sets hcal isolation variable.

Definition at line 176 of file Lepton.h.

void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:115
float caloIso() const
Definition: Lepton.h:139

◆ setIsoDeposit()

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 191 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().

191  {
192  IsoDepositPairs::iterator it = isoDeposits_.begin(), ed = isoDeposits_.end();
193  for (; it != ed; ++it) {
194  if (it->first == key) {
195  it->second = dep;
196  return;
197  }
198  }
199  isoDeposits_.push_back(std::make_pair(key, dep));
200  }
IsoDepositPairs isoDeposits_
Definition: Lepton.h:222

◆ setIsolation()

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 115 of file Lepton.h.

Referenced by pat::PATElectronProducer::fillElectron(), pat::PATElectronProducer::fillElectron2(), pat::PATMuonProducer::fillMuon(), PatElectronEAIsoCorrectionProducer::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().

115  {
116  if (key >= 0) {
117  if (size_t(key) >= isolations_.size())
118  isolations_.resize(key + 1, -1.0);
119  isolations_[key] = value;
120  } else {
121  throw cms::Exception("Illegal Argument")
122  << "The key for which you're setting isolation does not correspond "
123  << "to an individual isolation but to the sum of more independent isolations "
124  << "(e.g. Calo = Ecal + Hcal), so you can't SET the value, just GET it.\n"
125  << "Please set up each component independly.\n";
126  }
127  }
std::vector< float > isolations_
Definition: Lepton.h:223

◆ setMiniPFIsolation()

template<class LeptonType>
void pat::Lepton< LeptonType >::setMiniPFIsolation ( PFIsolation const &  iso)
inline

Definition at line 217 of file Lepton.h.

Referenced by pat::PATElectronProducer::setElectronMiniIso(), and pat::PATMuonProducer::setMuonMiniIso().

217 { miniPFIsolation_ = iso; }
PFIsolation miniPFIsolation_
Definition: Lepton.h:225

◆ setTrackIso()

template<class LeptonType>
void pat::Lepton< LeptonType >::setTrackIso ( float  trackIso)
inline

Sets tracker isolation variable.

Definition at line 172 of file Lepton.h.

float trackIso() const
Definition: Lepton.h:134
void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:115

◆ setUserIso()

template<class LeptonType>
void pat::Lepton< LeptonType >::setUserIso ( float  value,
uint8_t  index = 0 
)
inline

Sets user isolation variable #index.

Definition at line 178 of file Lepton.h.

void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:115
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
Definition: value.py:1

◆ trackIso()

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 134 of file Lepton.h.

Referenced by pat::Lepton< reco::Muon >::setTrackIso().

134 { return userIsolation(pat::TrackIso); }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:48

◆ trackIsoDeposit() [1/2]

template<class LeptonType>
const IsoDeposit* pat::Lepton< LeptonType >::trackIsoDeposit ( ) const
inline

Definition at line 203 of file Lepton.h.

203 { 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:182

◆ trackIsoDeposit() [2/2]

template<class LeptonType>
void pat::Lepton< LeptonType >::trackIsoDeposit ( const IsoDeposit dep)
inline

Definition at line 209 of file Lepton.h.

209 { setIsoDeposit(pat::TrackIso, 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:191

◆ userIso()

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 168 of file Lepton.h.

float userIsolation(IsolationKeys key) const
Definition: Lepton.h:48
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9

◆ userIsoDeposit() [1/2]

template<class LeptonType>
const IsoDeposit* pat::Lepton< LeptonType >::userIsoDeposit ( uint8_t  index = 0) const
inline

Definition at line 206 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:182

◆ userIsoDeposit() [2/2]

template<class LeptonType>
void pat::Lepton< LeptonType >::userIsoDeposit ( const IsoDeposit dep,
uint8_t  index = 0 
)
inline

Definition at line 212 of file Lepton.h.

212  {
214  }
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:191

◆ userIsolation() [1/2]

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 48 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(), pat::Lepton< reco::Muon >::puChargedHadronIso(), pat::Lepton< reco::Muon >::trackIso(), pat::Lepton< reco::Muon >::userIso(), and pat::Lepton< reco::Muon >::userIsolation().

48  {
49  if (key >= 0) {
50  //if (key >= isolations_.size()) throw cms::Excepton("Missing Data")
51  //<< "Isolation corresponding to key "
52  //<< key << " was not stored for this particle.";
53  if (size_t(key) >= isolations_.size())
54  return -1.0;
55  return isolations_[key];
56  } else
57  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)
62  return -1.0;
64  default:
65  return -1.0;
66  //throw cms::Excepton("Missing Data") << "Isolation corresponding to key "
67  //<< key << " was not stored for this particle.";
68  }
69  }
std::vector< float > isolations_
Definition: Lepton.h:223

◆ userIsolation() [2/2]

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 74 of file Lepton.h.

74  {
75  // remove leading namespace specifier
76  std::string prunedKey = (key.find("pat::") == 0) ? std::string(key, 5) : key;
77  if (prunedKey == "TrackIso")
79  if (prunedKey == "EcalIso")
81  if (prunedKey == "HcalIso")
83  if (prunedKey == "PfAllParticleIso")
85  if (prunedKey == "PfChargedHadronIso")
87  if (prunedKey == "PfNeutralHadronIso")
89  if (prunedKey == "PfGammaIso")
91  if (prunedKey == "User1Iso")
93  if (prunedKey == "User2Iso")
95  if (prunedKey == "User3Iso")
97  if (prunedKey == "User4Iso")
99  if (prunedKey == "User5Iso")
101  if (prunedKey == "UserBaseIso")
103  if (prunedKey == "CaloIso")
104  return userIsolation(pat::CaloIso);
105  if (prunedKey == "PfPUChargedHadronIso")
107  //throw cms::Excepton("Missing Data")
108  //<< "Isolation corresponding to key "
109  //<< key << " was not stored for this particle.";
110  return -1.0;
111  }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:48

Member Data Documentation

◆ isoDeposits_

template<class LeptonType>
IsoDepositPairs pat::Lepton< LeptonType >::isoDeposits_
protected

◆ isolations_

template<class LeptonType>
std::vector<float> pat::Lepton< LeptonType >::isolations_
protected

◆ miniPFIsolation_

template<class LeptonType>
PFIsolation pat::Lepton< LeptonType >::miniPFIsolation_
protected