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
 
virtual Lepton< LeptonType > * clone () const
 
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...
 
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 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
 
virtual ~Lepton ()
 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...
 
virtual ~PATObject ()
 destructor More...
 

Protected Types

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

Protected Attributes

IsoDepositPairs isoDeposits_
 
std::vector< float > isolations_
 
- 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 30 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 198 of file Lepton.h.

Constructor & Destructor Documentation

template<class LeptonType >
Lepton::Lepton ( )

default constructor

Definition at line 206 of file Lepton.h.

206  :
207  PATObject<LeptonType>(LeptonType()) {
208  // no common constructor, so initialize the candidate manually
209  this->setCharge(0);
210  this->setP4(reco::Particle::LorentzVector(0, 0, 0, 0));
211  this->setVertex(reco::Particle::Point(0, 0, 0));
212  }
math::XYZPoint Point
point in the space
Definition: Particle.h:25
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
template<class LeptonType>
Lepton::Lepton ( const LeptonType &  aLepton)

constructor from LeptonType

Definition at line 217 of file Lepton.h.

217  :
218  PATObject<LeptonType>(aLepton) {
219  }
template<class LeptonType>
Lepton::Lepton ( const edm::RefToBase< LeptonType > &  aLeptonRef)

constructor from ref to LeptonType

Definition at line 224 of file Lepton.h.

224  :
225  PATObject<LeptonType>(aLeptonRef) {
226  }
template<class LeptonType>
Lepton::Lepton ( const edm::Ptr< LeptonType > &  aLeptonRef)

constructor from ref to LeptonType

Definition at line 231 of file Lepton.h.

231  :
232  PATObject<LeptonType>(aLeptonRef) {
233  }
template<class LeptonType >
Lepton::~Lepton ( )
virtual

destructor

Definition at line 238 of file Lepton.h.

238  {
239  }

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

Referenced by dummy::Isolationdummy().

121 { return userIsolation(pat::CaloIso); }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:49
template<class LeptonType>
float pat::Lepton< LeptonType >::chargedHadronIso ( ) const
inline

Returns the isolation calculated with only the charged hadron PFCandidates

Definition at line 138 of file Lepton.h.

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

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

Reimplemented in pat::Tau, pat::Electron, and pat::Muon.

Definition at line 40 of file Lepton.h.

40 { 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 126 of file Lepton.h.

Referenced by dummy::Isolationdummy().

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

Definition at line 185 of file Lepton.h.

185 { 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:165
template<class LeptonType>
void pat::Lepton< LeptonType >::ecalIsoDeposit ( const IsoDeposit dep)
inline

Definition at line 191 of file Lepton.h.

191 { 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:175
template<class LeptonType>
const reco::GenParticle* pat::Lepton< LeptonType >::genLepton ( ) const
inline

Definition at line 42 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 131 of file Lepton.h.

Referenced by dummy::Isolationdummy().

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

Definition at line 186 of file Lepton.h.

186 { 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:165
template<class LeptonType>
void pat::Lepton< LeptonType >::hcalIsoDeposit ( const IsoDeposit dep)
inline

Definition at line 192 of file Lepton.h.

192 { 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:175
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 165 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().

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

Returns the isolation calculated with only the neutral hadron PFCandidates

Definition at line 141 of file Lepton.h.

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

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

PARTICLE FLOW ISOLATION Returns the isolation calculated with all the PFCandidates

Definition at line 135 of file Lepton.h.

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

Returns the isolation calculated with only the gamma PFCandidates

Definition at line 144 of file Lepton.h.

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

144 { return userIsolation(pat::PfGammaIso); }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:49
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 147 of file Lepton.h.

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

Sets ecal isolation variable.

Definition at line 156 of file Lepton.h.

Referenced by aod2patFilterZee::filter().

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

Definition at line 44 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 158 of file Lepton.h.

Referenced by aod2patFilterZee::filter().

void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:98
float caloIso() const
Definition: Lepton.h:121
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 175 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().

175  {
176  IsoDepositPairs::iterator it = isoDeposits_.begin(), ed = isoDeposits_.end();
177  for (; it != ed; ++it) {
178  if (it->first == key) { it->second = dep; return; }
179  }
180  isoDeposits_.push_back(std::make_pair(key,dep));
181  }
IsoDepositPairs isoDeposits_
Definition: Lepton.h:199
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 98 of file Lepton.h.

Referenced by pat::PATElectronProducer::fillElectron(), pat::PATElectronProducer::fillElectron2(), pat::PATMuonProducer::fillMuon(), PatElectronEAIsoCorrectionProducer::produce(), ZMuMuMuonUserData::produce(), pat::PATMuonProducer::produce(), pat::PATTauProducer::produce(), pat::PATElectronProducer::produce(), pat::Lepton< reco::Muon >::setEcalIso(), pat::Lepton< reco::Muon >::setHcalIso(), pat::Lepton< reco::Muon >::setTrackIso(), and pat::Lepton< reco::Muon >::setUserIso().

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

Sets tracker isolation variable.

Definition at line 154 of file Lepton.h.

Referenced by aod2patFilterZee::filter().

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

Sets user isolation variable #index.

Definition at line 160 of file Lepton.h.

void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:98
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 116 of file Lepton.h.

Referenced by dummy::Isolationdummy().

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

Definition at line 184 of file Lepton.h.

184 { 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:165
template<class LeptonType>
void pat::Lepton< LeptonType >::trackIsoDeposit ( const IsoDeposit dep)
inline

Definition at line 190 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:175
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 150 of file Lepton.h.

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

Definition at line 187 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:165
template<class LeptonType>
void pat::Lepton< LeptonType >::userIsoDeposit ( const IsoDeposit dep,
uint8_t  index = 0 
)
inline

Definition at line 193 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:175
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 49 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().

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

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

Member Data Documentation

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