CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 Set user-defined int. More...
 
void addUserData (const std::string &label, const T &data, bool transientOnly=false)
 
void addUserDataFromPtr (const std::string &label, const edm::Ptr< pat::UserData > &data)
 
void addUserFloat (const std::string &label, float data)
 Set user-defined float. More...
 
void addUserInt (const std::string &label, int32_t data)
 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
TriggerObjectStandAloneCollection
triggerObjectMatches () 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
 
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...
 
int32_t userInt (const std::string &key) const
 
const std::vector< std::string > & userIntNames () const
 Get list of user-defined int names. 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::LookupTableRecord
efficiencyValues_
 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::CandKinResolution
kinResolutions_
 Kinematic resolutions. More...
 
std::vector
< reco::CandidatePtrVector
overlapItems_
 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
 

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
Version
Id:
Lepton.h,v 1.24 2011/09/29 05:19:08 cbern Exp

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

Constructor & Destructor Documentation

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

default constructor

Definition at line 208 of file Lepton.h.

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

constructor from LeptonType

Definition at line 219 of file Lepton.h.

219  :
220  PATObject<LeptonType>(aLepton) {
221  }
template<class LeptonType>
pat::Lepton< LeptonType >::Lepton ( const edm::RefToBase< LeptonType > &  aLeptonRef)

constructor from ref to LeptonType

Definition at line 226 of file Lepton.h.

226  :
227  PATObject<LeptonType>(aLeptonRef) {
228  }
template<class LeptonType>
pat::Lepton< LeptonType >::Lepton ( const edm::Ptr< LeptonType > &  aLeptonRef)

constructor from ref to LeptonType

Definition at line 233 of file Lepton.h.

233  :
234  PATObject<LeptonType>(aLeptonRef) {
235  }
template<class LeptonType >
pat::Lepton< LeptonType >::~Lepton ( )
virtual

destructor

Definition at line 240 of file Lepton.h.

240  {
241  }

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

Referenced by dummy::Isolationdummy().

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

Returns the isolation calculated with only the charged hadron PFCandidates

Definition at line 140 of file Lepton.h.

float userIsolation(IsolationKeys key) const
Definition: Lepton.h:51
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 42 of file Lepton.h.

42 { 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 128 of file Lepton.h.

Referenced by dummy::Isolationdummy().

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

Definition at line 187 of file Lepton.h.

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

Definition at line 193 of file Lepton.h.

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

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

Referenced by dummy::Isolationdummy().

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

Definition at line 188 of file Lepton.h.

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

Definition at line 194 of file Lepton.h.

194 { 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:177
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 167 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().

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

Returns the isolation calculated with only the neutral hadron PFCandidates

Definition at line 143 of file Lepton.h.

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

PARTICLE FLOW ISOLATION Returns the isolation calculated with all the PFCandidates

Definition at line 137 of file Lepton.h.

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

Returns the isolation calculated with only the gamma PFCandidates

Definition at line 146 of file Lepton.h.

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

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

Sets ecal isolation variable.

Definition at line 158 of file Lepton.h.

Referenced by aod2patFilterZee::filter().

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

Definition at line 46 of file Lepton.h.

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

Sets hcal isolation variable.

Definition at line 160 of file Lepton.h.

Referenced by aod2patFilterZee::filter().

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

177  {
178  IsoDepositPairs::iterator it = isoDeposits_.begin(), ed = isoDeposits_.end();
179  for (; it != ed; ++it) {
180  if (it->first == key) { it->second = dep; return; }
181  }
182  isoDeposits_.push_back(std::make_pair(key,dep));
183  }
IsoDepositPairs isoDeposits_
Definition: Lepton.h:201
list key
Definition: combine.py:13
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 100 of file Lepton.h.

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

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

Sets tracker isolation variable.

Definition at line 156 of file Lepton.h.

Referenced by aod2patFilterZee::filter().

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

Sets user isolation variable #index.

Definition at line 162 of file Lepton.h.

void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:100
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
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 118 of file Lepton.h.

Referenced by dummy::Isolationdummy().

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

Definition at line 186 of file Lepton.h.

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

Definition at line 192 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:177
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 152 of file Lepton.h.

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

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

Definition at line 195 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:177
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 51 of file Lepton.h.

Referenced by pat::Lepton< reco::Muon >::caloIso(), pat::Lepton< reco::Muon >::chargedHadronIso(), pat::Lepton< reco::Muon >::ecalIso(), pat::Lepton< reco::Muon >::hcalIso(), pat::Lepton< reco::Muon >::neutralHadronIso(), pat::Lepton< reco::Muon >::particleIso(), pat::Lepton< reco::Muon >::photonIso(), pat::Lepton< reco::Muon >::puChargedHadronIso(), WenuPlots::ReturnCandVar(), ZeePlots::ReturnCandVar(), PFMuonSelector::TopPag12LjetsCuts(), PFElectronSelector::topPAGRefCuts(), pat::Lepton< reco::Muon >::trackIso(), pat::Lepton< reco::Muon >::userIso(), and pat::Lepton< reco::Muon >::userIsolation().

51  {
52  if (key >= 0) {
53  //if (key >= isolations_.size()) throw cms::Excepton("Missing Data")
54  //<< "Isolation corresponding to key "
55  //<< key << " was not stored for this particle.";
56  if (size_t(key) >= isolations_.size()) return -1.0;
57  return isolations_[key];
58  } else switch (key) {
59  case pat::CaloIso:
60  //if (isolations_.size() <= pat::HcalIso) throw cms::Excepton("Missing Data")
61  //<< "CaloIso Isolation was not stored for this particle.";
62  if (isolations_.size() <= pat::HcalIso) 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:202
list key
Definition: combine.py:13
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" ) return userIsolation(pat::TrackIso);
78  if ( prunedKey == "EcalIso" ) return userIsolation(pat::EcalIso);
79  if ( prunedKey == "HcalIso" ) return userIsolation(pat::HcalIso);
80  if ( prunedKey == "PfAllParticleIso" ) return userIsolation(pat::PfAllParticleIso);
81  if ( prunedKey == "PfChargedHadronIso" ) return userIsolation(pat::PfChargedHadronIso);
82  if ( prunedKey == "PfNeutralHadronIso" ) return userIsolation(pat::PfNeutralHadronIso);
83  if ( prunedKey == "PfGammaIso" ) return userIsolation(pat::PfGammaIso);
84  if ( prunedKey == "User1Iso" ) return userIsolation(pat::User1Iso);
85  if ( prunedKey == "User2Iso" ) return userIsolation(pat::User2Iso);
86  if ( prunedKey == "User3Iso" ) return userIsolation(pat::User3Iso);
87  if ( prunedKey == "User4Iso" ) return userIsolation(pat::User4Iso);
88  if ( prunedKey == "User5Iso" ) return userIsolation(pat::User5Iso);
89  if ( prunedKey == "UserBaseIso" ) return userIsolation(pat::UserBaseIso);
90  if ( prunedKey == "CaloIso" ) return userIsolation(pat::CaloIso);
91  if ( prunedKey == "PfPUChargedHadronIso" ) return userIsolation(pat::PfPUChargedHadronIso);
92  //throw cms::Excepton("Missing Data")
93  //<< "Isolation corresponding to key "
94  //<< key << " was not stored for this particle.";
95  return -1.0;
96  }
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:51
list key
Definition: combine.py:13

Member Data Documentation

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