CMS 3D CMS Logo

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends

pat::Electron Class Reference

Analysis-level electron class. More...

#include <DataFormats/PatCandidates/interface/Electron.h>

Inheritance diagram for pat::Electron:
pat::Lepton< reco::GsfElectron > pat::PATObject< reco::GsfElectron > reco::GsfElectron reco::RecoCandidate reco::LeafCandidate reco::Candidate

List of all members.

Public Types

typedef std::pair< std::string,
float > 
IdPair
enum  IPTYPE {
  None = 0, PV2D = 1, PV3D = 2, BS2D = 3,
  BS3D = 4
}
typedef enum pat::Electron::IPTYPE IpType

Public Member Functions

const std::vector
< reco::CaloCluster > & 
basicClusters () const
float caloIso () const
 Overload of pat::Lepton::caloIso(); returns the sum of ecalIso() and hcalIso.
virtual Electronclone () const
 required reimplementation of the Candidate's clone method
reco::TrackRef closestCtfTrackRef () const
 override the reco::GsfElectron::closestCtfTrackRef method, to access the internal storage of the track
virtual reco::GsfElectronCoreRef core () const
 override the virtual reco::GsfElectron::core method, so that the embedded core can be used by GsfElectron client methods
double dB (IpType type=None) const
 Impact parameter wrt primary vertex or beamspot.
const LorentzVectorecalDrivenMomentum () const
float ecalIso () const
 Overload of pat::Lepton::ecalIso(); returns the value of the summed Et of all recHits in the ecal in a cone of deltaR<0.4.
double ecalRegressionEnergy () const
double ecalRegressionError () const
double ecalRegressionScale () const
double ecalRegressionSmear () const
double ecalScale () const
 get scale corrections /smearings
double ecalSmear () const
double ecalTrackRegressionEnergy () const
 regression2
double ecalTrackRegressionError () const
double ecalTrackRegressionScale () const
double ecalTrackRegressionSmear () const
double edB (IpType type=None) const
 Uncertainty on the corresponding impact parameter.
 Electron (const reco::GsfElectron &anElectron)
 constructor from reco::GsfElectron
 Electron (const edm::Ptr< reco::GsfElectron > &anElectronRef)
 constructor from a Ptr to a reco::GsfElectron
 Electron (const edm::RefToBase< reco::GsfElectron > &anElectronRef)
 constructor from a RefToBase to a reco::GsfElectron (to be superseded by Ptr counterpart)
 Electron ()
 default constructor
float electronID (const std::string &name) const
 Returns a specific electron ID associated to the pat::Electron given its name.
float electronID (const char *name) const
const std::vector< IdPair > & electronIDs () const
 Returns all the electron IDs in the form of <name,value> pairs. The 'default' ID is the first in the list.
void embedBasicClusters ()
 method to store the electron's basic clusters
void embedGsfElectronCore ()
 method to store the electron's core internally
void embedGsfTrack ()
 method to store the electron's GsfTrack internally
void embedPFCandidate ()
 embed the PFCandidate pointed to by pfCandidateRef_
void embedPflowBasicClusters ()
 method to store the electron's pflow basic clusters
void embedPflowPreshowerClusters ()
 method to store the electron's pflow preshower clusters
void embedPflowSuperCluster ()
 method to store the electron's PflowSuperCluster internally
void embedPreshowerClusters ()
 method to store the electron's preshower clusters
void embedRecHits (const EcalRecHitCollection *rechits)
 method to store the RecHits internally - can be called from the PATElectronProducer
void embedSeedCluster ()
 method to store the electron's seedcluster internally
void embedSuperCluster ()
 method to store the electron's SuperCluster internally
void embedTrack ()
 method to store the electron's Track internally
reco::GsfTrackRef gsfTrack () const
 override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster
float hcalIso () const
 Overload of pat::Lepton::hcalIso(); returns the value of the summed Et of all caloTowers in the hcal in a cone of deltaR<0.4.
double ip3d () const
 ip3d
bool isElectronIDAvailable (const char *name) const
bool isElectronIDAvailable (const std::string &name) const
 Returns true if a specific ID is available in this pat::Electron.
bool isPF () const
size_t numberOfSourceCandidatePtrs () const
 get the number of non-null PFCandidates
bool passConversionVeto () const
 vertex fit combined with missing number of hits method
reco::PFCandidateRef pfCandidateRef () const
 reference to the source PFCandidates; null if this has been built from a standard electron
const std::vector
< reco::CaloCluster > & 
pflowBasicClusters () const
const std::vector
< reco::CaloCluster > & 
pflowPreshowerClusters () const
reco::SuperClusterRef pflowSuperCluster () const
 override the reco::GsfElectron::pflowSuperCluster method, to access the internal storage of the pflowSuperCluster
const std::vector
< reco::CaloCluster > & 
preshowerClusters () const
double r9 () const
const EcalRecHitCollectionrecHits () const
reco::CaloClusterPtr seed () const
 direct access to the seed cluster
void setDB (double dB, double edB, IpType type=None)
 Set impact parameter of a certain type and its uncertainty.
void setEcalDrivenMomentum (const Candidate::LorentzVector &mom)
void setEcalRegressionEnergy (double val, double err)
 set regression1
void setEcalRegressionScale (double val)
void setEcalRegressionSmear (double val)
void setEcalScale (double val)
 set scale corrections / smearings
void setEcalSmear (double val)
void setEcalTrackRegressionEnergy (double val, double err)
 set regression2
void setEcalTrackRegressionScale (double val)
void setEcalTrackRegressionSmear (double val)
void setElectronIDs (const std::vector< IdPair > &ids)
 Store multiple electron ID values, discarding existing ones. The first one in the list becomes the 'default' electron id.
void setIsPF (bool hasPFCandidate)
void setMvaVariables (double r9, double sigmaIphiIphi, double sigmaIetaIphi, double ip3d)
 set missing mva input variables
void setPassConversionVeto (bool flag)
void setPFCandidateRef (const reco::PFCandidateRef &ref)
 add a reference to the source IsolatedPFCandidate
double sigmaIetaIphi () const
 sigmaIEtaIPhi
double sigmaIphiIphi () const
 sigmaIPhiPhi
reco::CandidatePtr sourceCandidatePtr (size_type i) const
 get the source candidate pointer with index i
reco::SuperClusterRef superCluster () const
 override the reco::GsfElectron::superCluster method, to access the internal storage of the supercluster
reco::TrackRef track () const
 returns nothing. Use either gsfTrack or closestCtfTrack
float trackIso () const
 Overload of pat::Lepton::trackIso(); returns the value of the summed track pt in a cone of deltaR<0.4.
virtual ~Electron ()
 destructor

Protected Member Functions

void initImpactParameters ()
 init impact parameter defaults (for use in a constructor)

Protected Attributes

std::vector< reco::CaloClusterbasicClusters_
 Place to store electron's basic clusters internally.
bool cachedDB_
 True if impact parameter has been cached.
std::vector< bool > cachedIP_
 True if the IP (former dB) has been cached.
double dB_
 Impact parameter at the primary vertex.
LorentzVector ecalDrivenMomentum_
 ECAL-driven momentum.
double ecalRegressionEnergy_
 output of regression
double ecalRegressionError_
double ecalRegressionScale_
double ecalRegressionSmear_
double ecalScale_
 scale corrections and smearing applied or to be be applied. Initialized to -99999.
double ecalSmear_
double ecalTrackRegressionEnergy_
double ecalTrackRegressionError_
double ecalTrackRegressionScale_
double ecalTrackRegressionSmear_
double edB_
 Impact paramater uncertainty at the primary vertex.
std::vector< double > eip_
 Impact parameter uncertainty as recommended by the tracking group.
std::vector< IdPairelectronIDs_
 Electron IDs.
bool embeddedGsfElectronCore_
 True if electron's gsfElectronCore is stored internally.
bool embeddedGsfTrack_
 True if electron's gsfTrack is stored internally.
bool embeddedPFCandidate_
 true if the IsolatedPFCandidate is embedded
bool embeddedPflowSuperCluster_
 True if electron's pflowsupercluster is stored internally.
bool embeddedRecHits_
 True if RecHits stored internally.
bool embeddedSeedCluster_
 True if seed cluster is stored internally.
bool embeddedSuperCluster_
 True if electron's supercluster is stored internally.
bool embeddedTrack_
 True if electron's track is stored internally.
std::vector
< reco::GsfElectronCore
gsfElectronCore_
 Place to store electron's gsfElectronCore internally.
std::vector< reco::GsfTrackgsfTrack_
 Place to store electron's gsfTrack internally.
double ip3d_
std::vector< double > ip_
 Impact parameter at the primary vertex,.
bool isPF_
bool passConversionVeto_
 conversion veto
reco::PFCandidateCollection pfCandidate_
 A copy of the source IsolatedPFCandidate is stored in this vector if embeddedPFCandidate_ if True.
reco::PFCandidateRef pfCandidateRef_
 reference to the IsolatedPFCandidate this has been built from; null if this has been built from a standard electron
std::vector< reco::CaloClusterpflowBasicClusters_
 Place to store electron's pflow basic clusters internally.
std::vector< reco::CaloClusterpflowPreshowerClusters_
 Place to store electron's pflow preshower clusters internally.
std::vector< reco::SuperClusterpflowSuperCluster_
 Place to store electron's pflow supercluster internally.
std::vector< reco::CaloClusterpreshowerClusters_
 Place to store electron's preshower clusters internally.
double r9_
 additional missing mva variables : 14/04/2012
EcalRecHitCollection recHits_
 Place to store electron's RecHits internally (5x5 around seed+ all RecHits)
std::vector< reco::CaloClusterseedCluster_
 Place to store electron's seed cluster internally.
double sigmaIetaIphi_
double sigmaIphiIphi_
std::vector< reco::SuperClustersuperCluster_
 Place to store electron's supercluster internally.
std::vector< reco::Tracktrack_
 Place to store electron's track internally.

Friends

std::ostream & reco::operator<< (std::ostream &out, const pat::Electron &obj)
 pipe operator (introduced to use pat::Electron with PFTopProjectors)

Detailed Description

Analysis-level electron class.

pat::Electron implements the analysis-level electron class within the 'pat' namespace.

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:
Electron.h,v 1.46 2013/04/11 22:42:32 beaudett Exp

Definition at line 52 of file Electron.h.


Member Typedef Documentation

typedef std::pair<std::string,float> pat::Electron::IdPair

Definition at line 56 of file Electron.h.


Member Enumeration Documentation

Enumerator:
None 
PV2D 
PV3D 
BS2D 
BS3D 

Definition at line 178 of file Electron.h.

{ None = 0, PV2D = 1, PV3D = 2, BS2D = 3, BS3D = 4 } IpType;

Constructor & Destructor Documentation

Electron::Electron ( )
Electron::Electron ( const reco::GsfElectron anElectron)

constructor from reco::GsfElectron

Definition at line 42 of file Electron.cc.

References initImpactParameters().

Electron::Electron ( const edm::RefToBase< reco::GsfElectron > &  anElectronRef)

constructor from a RefToBase to a reco::GsfElectron (to be superseded by Ptr counterpart)

Definition at line 61 of file Electron.cc.

References initImpactParameters().

Electron::Electron ( const edm::Ptr< reco::GsfElectron > &  anElectronRef)

constructor from a Ptr to a reco::GsfElectron

Definition at line 80 of file Electron.cc.

References initImpactParameters().

Electron::~Electron ( ) [virtual]

destructor

Definition at line 99 of file Electron.cc.

                    {
}

Member Function Documentation

const std::vector<reco::CaloCluster>& pat::Electron::basicClusters ( ) const [inline]

Definition at line 89 of file Electron.h.

References basicClusters_.

{ return basicClusters_ ; }
float pat::Electron::caloIso ( ) const [inline]

Overload of pat::Lepton::caloIso(); returns the sum of ecalIso() and hcalIso.

Reimplemented from pat::Lepton< reco::GsfElectron >.

Definition at line 156 of file Electron.h.

References ecalIso(), and hcalIso().

{ return ecalIso()+hcalIso(); }
virtual Electron* pat::Electron::clone ( void  ) const [inline, virtual]

required reimplementation of the Candidate's clone method

Reimplemented from pat::Lepton< reco::GsfElectron >.

Definition at line 70 of file Electron.h.

References Electron().

{ return new Electron(*this); }
reco::TrackRef Electron::closestCtfTrackRef ( ) const

override the reco::GsfElectron::closestCtfTrackRef method, to access the internal storage of the track

override the reco::GsfElectron::closestCtfTrack method, to access the internal storage of the track

Reimplemented from reco::GsfElectron.

Definition at line 177 of file Electron.cc.

References embeddedTrack_, and track_.

Referenced by WenuPlots::analyze().

                                                {
  if (embeddedTrack_) {
    return reco::TrackRef(&track_, 0);
  } else {
    return reco::GsfElectron::closestCtfTrackRef();
  }
}
reco::GsfElectronCoreRef Electron::core ( ) const [virtual]

override the virtual reco::GsfElectron::core method, so that the embedded core can be used by GsfElectron client methods

Reimplemented from reco::GsfElectron.

Definition at line 140 of file Electron.cc.

References embeddedGsfElectronCore_, and gsfElectronCore_.

double Electron::dB ( IpType  type_ = None) const

Impact parameter wrt primary vertex or beamspot.

dB gives the impact parameter wrt the beamline. If this is not cached it is not meaningful, since it relies on the distance to the beamline.

IpType defines the type of the impact parameter None is default and reverts to the old functionality.

Example: electron->dB(pat::Electron::PV2D) will return the electron transverse impact parameter relative to the primary vertex.

Definition at line 378 of file Electron.cc.

References cachedDB_, cachedIP_, dB_, ip_, max(), and None.

Referenced by WenuPlots::analyze(), ElectronVPlusJetsIDSelectionFunctor::firstDataCuts(), ZeePlots::ReturnCandVar(), setDB(), and PFElectronSelector::spring11Cuts().

                                      {
  // preserve old functionality exactly
  if (type_ == None){
    if ( cachedDB_ ) {
      return dB_;
    } else {
      return std::numeric_limits<double>::max();
    }
  }
  // more IP types (new)
  else if ( cachedIP_[type_] ) {
    return ip_[type_];
  } else {
    return std::numeric_limits<double>::max();
  }
}
const LorentzVector& pat::Electron::ecalDrivenMomentum ( ) const [inline]

Definition at line 187 of file Electron.h.

References ecalDrivenMomentum_.

float pat::Electron::ecalIso ( ) const [inline]

Overload of pat::Lepton::ecalIso(); returns the value of the summed Et of all recHits in the ecal in a cone of deltaR<0.4.

Reimplemented from pat::Lepton< reco::GsfElectron >.

Definition at line 152 of file Electron.h.

References reco::GsfElectron::dr04EcalRecHitSumEt().

Referenced by caloIso().

{ return dr04EcalRecHitSumEt(); }
double pat::Electron::ecalRegressionEnergy ( ) const [inline]

additional regression variables regression1

Definition at line 209 of file Electron.h.

References ecalRegressionEnergy_.

double pat::Electron::ecalRegressionError ( ) const [inline]

Definition at line 210 of file Electron.h.

References ecalRegressionError_.

double pat::Electron::ecalRegressionScale ( ) const [inline]

Definition at line 230 of file Electron.h.

References ecalRegressionScale_.

double pat::Electron::ecalRegressionSmear ( ) const [inline]

Definition at line 231 of file Electron.h.

References ecalRegressionSmear_.

double pat::Electron::ecalScale ( ) const [inline]

get scale corrections /smearings

Definition at line 228 of file Electron.h.

References ecalScale_.

{ return ecalScale_ ;}               
double pat::Electron::ecalSmear ( ) const [inline]

Definition at line 229 of file Electron.h.

References ecalSmear_.

{ return ecalSmear_;}                
double pat::Electron::ecalTrackRegressionEnergy ( ) const [inline]

regression2

Definition at line 212 of file Electron.h.

References ecalTrackRegressionEnergy_.

double pat::Electron::ecalTrackRegressionError ( ) const [inline]

Definition at line 213 of file Electron.h.

References ecalTrackRegressionError_.

double pat::Electron::ecalTrackRegressionScale ( ) const [inline]

Definition at line 232 of file Electron.h.

References ecalTrackRegressionScale_.

double pat::Electron::ecalTrackRegressionSmear ( ) const [inline]

Definition at line 233 of file Electron.h.

References ecalTrackRegressionSmear_.

double Electron::edB ( IpType  type_ = None) const

Uncertainty on the corresponding impact parameter.

edB gives the uncertainty on the impact parameter wrt the beamline. If this is not cached it is not meaningful, since it relies on the distance to the beamline.

IpType defines the type of the impact parameter None is default and reverts to the old functionality.

Example: electron->edB(pat::Electron::PV2D) will return the electron transverse impact parameter uncertainty relative to the primary vertex.

Definition at line 405 of file Electron.cc.

References cachedDB_, cachedIP_, edB_, eip_, max(), and None.

Referenced by ElectronVPlusJetsIDSelectionFunctor::firstDataCuts(), and setDB().

                                       {
  // preserve old functionality exactly
  if (type_ == None) {
    if ( cachedDB_ ) {
      return edB_;
    } else {
      return std::numeric_limits<double>::max();
    }
  }
  // more IP types (new)
  else if ( cachedIP_[type_] ) {
    return eip_[type_];
  } else {
    return std::numeric_limits<double>::max();
  }

}
float pat::Electron::electronID ( const char *  name) const [inline]

Definition at line 137 of file Electron.h.

References electronID(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by electronID().

{ return electronID( std::string(name) );}
float Electron::electronID ( const std::string &  name) const

Returns a specific electron ID associated to the pat::Electron given its name.

Returns a specific electron ID associated to the pat::Electron given its name For cut-based IDs, the value map has the following meaning: 0: fails, 1: passes electron ID only, 2: passes electron Isolation only, 3: passes electron ID and Isolation only, 4: passes conversion rejection, 5: passes conversion rejection and ID, 6: passes conversion rejection and Isolation, 7: passes the whole selection. For more details have a look at: https://twiki.cern.ch/twiki/bin/view/CMS/SimpleCutBasedEleID https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCategoryBasedElectronID Note: an exception is thrown if the specified ID is not available

Definition at line 315 of file Electron.cc.

References electronIDs_.

Referenced by WenuPlots::analyze(), WenuPlots::CheckCuts(), ZeePlots::CheckCuts1(), ZeePlots::CheckCuts2(), and PFElectronSelector::spring11Cuts().

                                                      {
    for (std::vector<IdPair>::const_iterator it = electronIDs_.begin(), ed = electronIDs_.end(); it != ed; ++it) {
        if (it->first == name) return it->second;
    }
    cms::Exception ex("Key not found");
    ex << "pat::Electron: the ID " << name << " can't be found in this pat::Electron.\n";
    ex << "The available IDs are: ";
    for (std::vector<IdPair>::const_iterator it = electronIDs_.begin(), ed = electronIDs_.end(); it != ed; ++it) {
        ex << "'" << it->first << "' ";
    }
    ex << ".\n";
    throw ex;
}
const std::vector<IdPair>& pat::Electron::electronIDs ( ) const [inline]

Returns all the electron IDs in the form of <name,value> pairs. The 'default' ID is the first in the list.

Definition at line 144 of file Electron.h.

References electronIDs_.

{ return electronIDs_; }
void Electron::embedBasicClusters ( )

method to store the electron's basic clusters

Stores the electron's BasicCluster (reco::CaloCluster) internally.

Definition at line 237 of file Electron.cc.

References basicClusters_, superCluster(), and reco::GsfElectron::superCluster().

Referenced by pat::PATElectronProducer::fillElectron(), and pat::PATElectronProducer::fillElectron2().

                                  {
  basicClusters_.clear();
  if (reco::GsfElectron::superCluster().isNonnull()){
    reco::CaloCluster_iterator itscl = reco::GsfElectron::superCluster()->clustersBegin();
    reco::CaloCluster_iterator itsclE = reco::GsfElectron::superCluster()->clustersEnd();
    for(;itscl!=itsclE;++itscl){
      basicClusters_.push_back( **itscl ) ;
    } 
  }
}
void Electron::embedGsfElectronCore ( )

method to store the electron's core internally

Stores the electron's core (reco::GsfElectronCoreRef) internally.

Definition at line 191 of file Electron.cc.

References reco::GsfElectron::core(), embeddedGsfElectronCore_, and gsfElectronCore_.

Referenced by pat::PATElectronProducer::fillElectron(), and pat::PATElectronProducer::fillElectron2().

void Electron::embedGsfTrack ( )

method to store the electron's GsfTrack internally

Stores the electron's gsfTrack (reco::GsfTrackRef) internally.

Definition at line 200 of file Electron.cc.

References embeddedGsfTrack_, reco::GsfElectron::gsfTrack(), and gsfTrack_.

Referenced by pat::PATElectronProducer::fillElectron(), and pat::PATElectronProducer::fillElectron2().

                             {
  gsfTrack_.clear();
  if (reco::GsfElectron::gsfTrack().isNonnull()) {
      gsfTrack_.push_back(*reco::GsfElectron::gsfTrack());
      embeddedGsfTrack_ = true;
  }
}
void Electron::embedPFCandidate ( )

embed the PFCandidate pointed to by pfCandidateRef_

Stores the PFCandidate pointed to by pfCandidateRef_ internally.

Definition at line 348 of file Electron.cc.

References embeddedPFCandidate_, edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), pfCandidate_, and pfCandidateRef_.

Referenced by pat::PATElectronProducer::produce().

void Electron::embedPflowBasicClusters ( )

method to store the electron's pflow basic clusters

Stores the electron's PflowBasicCluster (reco::CaloCluster) internally.

Definition at line 261 of file Electron.cc.

References pflowBasicClusters_, reco::GsfElectron::pflowSuperCluster(), and pflowSuperCluster().

Referenced by pat::PATElectronProducer::fillElectron(), and pat::PATElectronProducer::fillElectron2().

                                       {
  pflowBasicClusters_.clear();
  if (reco::GsfElectron::pflowSuperCluster().isNonnull()){
    reco::CaloCluster_iterator itscl = reco::GsfElectron::pflowSuperCluster()->clustersBegin();
    reco::CaloCluster_iterator itsclE = reco::GsfElectron::pflowSuperCluster()->clustersEnd();
    for(;itscl!=itsclE;++itscl){
      pflowBasicClusters_.push_back( **itscl ) ;
    }
  }
}
void Electron::embedPflowPreshowerClusters ( )

method to store the electron's pflow preshower clusters

Stores the electron's PflowPreshowerCluster (reco::CaloCluster) internally.

Definition at line 273 of file Electron.cc.

References pflowPreshowerClusters_, reco::GsfElectron::pflowSuperCluster(), and pflowSuperCluster().

Referenced by pat::PATElectronProducer::fillElectron(), and pat::PATElectronProducer::fillElectron2().

                                           {
  pflowPreshowerClusters_.clear();
  if (reco::GsfElectron::pflowSuperCluster().isNonnull()){
    reco::CaloCluster_iterator itscl = reco::GsfElectron::pflowSuperCluster()->preshowerClustersBegin();
    reco::CaloCluster_iterator itsclE = reco::GsfElectron::pflowSuperCluster()->preshowerClustersEnd();
    for(;itscl!=itsclE;++itscl){
      pflowPreshowerClusters_.push_back( **itscl ) ;
    }
  }
}
void Electron::embedPflowSuperCluster ( )

method to store the electron's PflowSuperCluster internally

Stores the electron's SuperCluster (reco::SuperClusterRef) internally.

Definition at line 219 of file Electron.cc.

References embeddedPflowSuperCluster_, reco::GsfElectron::pflowSuperCluster(), and pflowSuperCluster_.

Referenced by pat::PATElectronProducer::fillElectron(), and pat::PATElectronProducer::fillElectron2().

void Electron::embedPreshowerClusters ( )

method to store the electron's preshower clusters

Stores the electron's PreshowerCluster (reco::CaloCluster) internally.

Definition at line 249 of file Electron.cc.

References preshowerClusters_, superCluster(), and reco::GsfElectron::superCluster().

Referenced by pat::PATElectronProducer::fillElectron(), and pat::PATElectronProducer::fillElectron2().

                                      {
  preshowerClusters_.clear();
  if (reco::GsfElectron::superCluster().isNonnull()){
    reco::CaloCluster_iterator itscl = reco::GsfElectron::superCluster()->preshowerClustersBegin();
    reco::CaloCluster_iterator itsclE = reco::GsfElectron::superCluster()->preshowerClustersEnd();
    for(;itscl!=itsclE;++itscl){
      preshowerClusters_.push_back( **itscl ) ;
    }
  }
}
void Electron::embedRecHits ( const EcalRecHitCollection rechits)

method to store the RecHits internally - can be called from the PATElectronProducer

Definition at line 294 of file Electron.cc.

References embeddedRecHits_, HI_PhotonSkim_cff::rechits, and recHits_.

Referenced by pat::PATElectronProducer::produce().

                                                                {
  if (rechits!=0) {
    recHits_ = *rechits;
    embeddedRecHits_ = true;
  }
}
void Electron::embedSeedCluster ( )

method to store the electron's seedcluster internally

Stores the electron's SeedCluster (reco::BasicClusterPtr) internally.

Definition at line 228 of file Electron.cc.

References embeddedSeedCluster_, seed(), seedCluster_, and reco::GsfElectron::superCluster().

Referenced by pat::PATElectronProducer::fillElectron(), and pat::PATElectronProducer::fillElectron2().

void Electron::embedSuperCluster ( )

method to store the electron's SuperCluster internally

Stores the electron's SuperCluster (reco::SuperClusterRef) internally.

Definition at line 210 of file Electron.cc.

References embeddedSuperCluster_, reco::GsfElectron::superCluster(), and superCluster_.

Referenced by pat::PATElectronProducer::fillElectron(), and pat::PATElectronProducer::fillElectron2().

void Electron::embedTrack ( )

method to store the electron's Track internally

method to store the electron's track internally

Definition at line 285 of file Electron.cc.

References reco::GsfElectron::closestCtfTrackRef(), embeddedTrack_, and track_.

Referenced by pat::PATElectronProducer::fillElectron(), and pat::PATElectronProducer::fillElectron2().

reco::GsfTrackRef Electron::gsfTrack ( ) const [virtual]
float pat::Electron::hcalIso ( ) const [inline]

Overload of pat::Lepton::hcalIso(); returns the value of the summed Et of all caloTowers in the hcal in a cone of deltaR<0.4.

Reimplemented from pat::Lepton< reco::GsfElectron >.

Definition at line 154 of file Electron.h.

References reco::GsfElectron::dr04HcalTowerSumEt().

Referenced by caloIso().

{ return dr04HcalTowerSumEt(); }
void Electron::initImpactParameters ( ) [protected]

init impact parameter defaults (for use in a constructor)

initializes the impact parameter container vars

Definition at line 121 of file Electron.cc.

References cachedIP_, eip_, and ip_.

Referenced by Electron().

                                    {
  for (int i_ = 0; i_<5; ++i_){
    ip_.push_back(0.0);
    eip_.push_back(0.0);
    cachedIP_.push_back(false);
  }
}
double pat::Electron::ip3d ( ) const [inline]

ip3d

Definition at line 201 of file Electron.h.

References ip3d_.

Referenced by setMvaVariables().

{ return ip3d_; }
bool Electron::isElectronIDAvailable ( const std::string &  name) const

Returns true if a specific ID is available in this pat::Electron.

Checks if a specific electron ID is associated to the pat::Electron.

Definition at line 330 of file Electron.cc.

References electronIDs_.

Referenced by WenuPlots::analyze(), and isElectronIDAvailable().

                                                                {
    for (std::vector<IdPair>::const_iterator it = electronIDs_.begin(), ed = electronIDs_.end(); it != ed; ++it) {
        if (it->first == name) return true;
    }
    return false;
}
bool pat::Electron::isElectronIDAvailable ( const char *  name) const [inline]
bool pat::Electron::isPF ( ) const [inline]

Definition at line 159 of file Electron.h.

References isPF_.

{ return isPF_; }
size_t pat::Electron::numberOfSourceCandidatePtrs ( ) const [inline, virtual]

get the number of non-null PFCandidates

Reimplemented from reco::LeafCandidate.

Definition at line 171 of file Electron.h.

References edm::Ref< C, T, F >::isNonnull(), and pfCandidateRef_.

                                                 {
        return pfCandidateRef_.isNonnull() ? 1 : 0;
      }
bool pat::Electron::passConversionVeto ( ) const [inline]

vertex fit combined with missing number of hits method

Definition at line 235 of file Electron.h.

References passConversionVeto_.

{ return passConversionVeto_; }
reco::PFCandidateRef Electron::pfCandidateRef ( ) const

reference to the source PFCandidates; null if this has been built from a standard electron

reference to the source PFCandidates

Definition at line 339 of file Electron.cc.

References embeddedPFCandidate_, pfCandidate_, and pfCandidateRef_.

Referenced by pat::PATElectronProducer::fillElectron(), and pat::PATElectronProducer::fillElectron2().

                                                  {
  if (embeddedPFCandidate_) {
    return reco::PFCandidateRef(&pfCandidate_, 0);
  } else {
    return pfCandidateRef_;
  }
}
const std::vector<reco::CaloCluster>& pat::Electron::pflowBasicClusters ( ) const [inline]

Definition at line 93 of file Electron.h.

References pflowBasicClusters_.

{ return pflowBasicClusters_ ; }
const std::vector<reco::CaloCluster>& pat::Electron::pflowPreshowerClusters ( ) const [inline]

Definition at line 95 of file Electron.h.

References pflowPreshowerClusters_.

reco::SuperClusterRef Electron::pflowSuperCluster ( ) const

override the reco::GsfElectron::pflowSuperCluster method, to access the internal storage of the pflowSuperCluster

override the reco::GsfElectron::pflowSuperCluster method, to access the internal storage of the supercluster

Reimplemented from reco::GsfElectron.

Definition at line 159 of file Electron.cc.

References embeddedPflowSuperCluster_, and pflowSuperCluster_.

Referenced by embedPflowBasicClusters(), and embedPflowPreshowerClusters().

const std::vector<reco::CaloCluster>& pat::Electron::preshowerClusters ( ) const [inline]

Definition at line 91 of file Electron.h.

References preshowerClusters_.

{ return preshowerClusters_ ; }
double pat::Electron::r9 ( ) const [inline]

additional mva input variables R9 variable

Reimplemented from reco::GsfElectron.

Definition at line 195 of file Electron.h.

References r9_.

Referenced by setMvaVariables().

{ return r9_; };
const EcalRecHitCollection* pat::Electron::recHits ( void  ) const [inline]

Definition at line 205 of file Electron.h.

References recHits_.

{ return &recHits_;}
reco::CaloClusterPtr Electron::seed ( ) const

direct access to the seed cluster

Definition at line 168 of file Electron.cc.

References embeddedSeedCluster_, seedCluster_, and superCluster().

Referenced by embedSeedCluster().

void Electron::setDB ( double  dB,
double  edB,
IpType  type = None 
)

Set impact parameter of a certain type and its uncertainty.

Sets the impact parameter and its error wrt the beamline and caches it.

Definition at line 424 of file Electron.cc.

References cachedDB_, cachedIP_, dB(), dB_, edB(), edB_, eip_, ip_, and None.

Referenced by pat::PATElectronProducer::embedHighLevel(), and pat::PATElectronProducer::produce().

                                                      {
  if (type == None) { // Preserve  old functionality exactly
    dB_ = dB; edB_ = edB;
    cachedDB_ = true;
  } else {
    ip_[type] = dB; 
    eip_[type] = edB; 
    cachedIP_[type] = true;
  }
}
void pat::Electron::setEcalDrivenMomentum ( const Candidate::LorentzVector mom) [inline]

Definition at line 188 of file Electron.h.

References ecalDrivenMomentum_.

Referenced by pat::PATElectronProducer::fillElectron2().

void pat::Electron::setEcalRegressionEnergy ( double  val,
double  err 
) [inline]

set regression1

Definition at line 215 of file Electron.h.

References ecalRegressionEnergy_, and ecalRegressionError_.

void pat::Electron::setEcalRegressionScale ( double  val) [inline]

Definition at line 222 of file Electron.h.

References ecalRegressionScale_.

void pat::Electron::setEcalRegressionSmear ( double  val) [inline]

Definition at line 223 of file Electron.h.

References ecalRegressionSmear_.

void pat::Electron::setEcalScale ( double  val) [inline]

set scale corrections / smearings

Definition at line 220 of file Electron.h.

References ecalScale_.

{ ecalScale_= val ;}               
void pat::Electron::setEcalSmear ( double  val) [inline]

Definition at line 221 of file Electron.h.

References ecalSmear_.

{ ecalSmear_= val;}                
void pat::Electron::setEcalTrackRegressionEnergy ( double  val,
double  err 
) [inline]

set regression2

Definition at line 217 of file Electron.h.

References ecalTrackRegressionEnergy_, and ecalTrackRegressionError_.

void pat::Electron::setEcalTrackRegressionScale ( double  val) [inline]

Definition at line 224 of file Electron.h.

References ecalTrackRegressionScale_.

void pat::Electron::setEcalTrackRegressionSmear ( double  val) [inline]

Definition at line 225 of file Electron.h.

References ecalTrackRegressionSmear_.

void pat::Electron::setElectronIDs ( const std::vector< IdPair > &  ids) [inline]

Store multiple electron ID values, discarding existing ones. The first one in the list becomes the 'default' electron id.

Definition at line 146 of file Electron.h.

References electronIDs_.

Referenced by pat::PATElectronProducer::produce().

{ electronIDs_ = ids; }
void pat::Electron::setIsPF ( bool  hasPFCandidate) [inline]

Definition at line 160 of file Electron.h.

References isPF_.

Referenced by pat::PATElectronProducer::produce().

{ isPF_ = hasPFCandidate ; }
void Electron::setMvaVariables ( double  r9,
double  sigmaIphiIphi,
double  sigmaIetaIphi,
double  ip3d 
)

set missing mva input variables

Set additional missing mva input variables for new mva ID : 14/04/2012.

Definition at line 436 of file Electron.cc.

References ip3d(), ip3d_, r9(), r9_, sigmaIetaIphi(), sigmaIetaIphi_, sigmaIphiIphi(), and sigmaIphiIphi_.

Referenced by pat::PATElectronProducer::produce().

void pat::Electron::setPassConversionVeto ( bool  flag) [inline]

Definition at line 236 of file Electron.h.

References passConversionVeto_.

Referenced by pat::PATElectronProducer::produce().

void pat::Electron::setPFCandidateRef ( const reco::PFCandidateRef ref) [inline]

add a reference to the source IsolatedPFCandidate

Definition at line 165 of file Electron.h.

References pfCandidateRef_.

Referenced by pat::PATElectronProducer::produce().

                                                            {
        pfCandidateRef_ = ref;
      }
double pat::Electron::sigmaIetaIphi ( ) const [inline]

sigmaIEtaIPhi

Definition at line 199 of file Electron.h.

References sigmaIetaIphi_.

Referenced by setMvaVariables().

{ return sigmaIetaIphi_; };
double pat::Electron::sigmaIphiIphi ( ) const [inline]

sigmaIPhiPhi

Reimplemented from reco::GsfElectron.

Definition at line 197 of file Electron.h.

References sigmaIphiIphi_.

Referenced by setMvaVariables().

{ return sigmaIphiIphi_; };
reco::CandidatePtr Electron::sourceCandidatePtr ( size_type  i) const [virtual]

get the source candidate pointer with index i

Returns the reference to the parent PF candidate with index i. For use in TopProjector.

Reimplemented from reco::LeafCandidate.

Definition at line 358 of file Electron.cc.

References embeddedPFCandidate_, edm::Ref< C, T, F >::get(), edm::Ref< C, T, F >::id(), edm::Ref< C, T, F >::key(), and pfCandidateRef_.

reco::SuperClusterRef Electron::superCluster ( ) const [virtual]
reco::TrackRef Electron::track ( void  ) const [virtual]

returns nothing. Use either gsfTrack or closestCtfTrack

Reimplemented from reco::RecoCandidate.

Definition at line 186 of file Electron.cc.

                                   {
  return reco::TrackRef();
}
float pat::Electron::trackIso ( ) const [inline]

Overload of pat::Lepton::trackIso(); returns the value of the summed track pt in a cone of deltaR<0.4.

Reimplemented from pat::Lepton< reco::GsfElectron >.

Definition at line 150 of file Electron.h.

References reco::GsfElectron::dr04TkSumPt().

{ return dr04TkSumPt(); }

Friends And Related Function Documentation

std::ostream& reco::operator<< ( std::ostream &  out,
const pat::Electron obj 
) [friend]

pipe operator (introduced to use pat::Electron with PFTopProjectors)


Member Data Documentation

Place to store electron's basic clusters internally.

Definition at line 258 of file Electron.h.

Referenced by basicClusters(), and embedBasicClusters().

bool pat::Electron::cachedDB_ [protected]

True if impact parameter has been cached.

Definition at line 299 of file Electron.h.

Referenced by dB(), edB(), and setDB().

std::vector<bool> pat::Electron::cachedIP_ [protected]

True if the IP (former dB) has been cached.

Definition at line 333 of file Electron.h.

Referenced by dB(), edB(), initImpactParameters(), and setDB().

double pat::Electron::dB_ [protected]

Impact parameter at the primary vertex.

Definition at line 301 of file Electron.h.

Referenced by dB(), and setDB().

ECAL-driven momentum.

Definition at line 295 of file Electron.h.

Referenced by ecalDrivenMomentum(), and setEcalDrivenMomentum().

output of regression

Definition at line 312 of file Electron.h.

Referenced by ecalRegressionEnergy(), and setEcalRegressionEnergy().

Definition at line 314 of file Electron.h.

Referenced by ecalRegressionError(), and setEcalRegressionEnergy().

Definition at line 321 of file Electron.h.

Referenced by ecalRegressionScale(), and setEcalRegressionScale().

Definition at line 322 of file Electron.h.

Referenced by ecalRegressionSmear(), and setEcalRegressionSmear().

double pat::Electron::ecalScale_ [protected]

scale corrections and smearing applied or to be be applied. Initialized to -99999.

Definition at line 318 of file Electron.h.

Referenced by ecalScale(), and setEcalScale().

double pat::Electron::ecalSmear_ [protected]

Definition at line 319 of file Electron.h.

Referenced by ecalSmear(), and setEcalSmear().

Definition at line 313 of file Electron.h.

Referenced by ecalTrackRegressionEnergy(), and setEcalTrackRegressionEnergy().

Definition at line 315 of file Electron.h.

Referenced by ecalTrackRegressionError(), and setEcalTrackRegressionEnergy().

Definition at line 324 of file Electron.h.

Referenced by ecalTrackRegressionScale(), and setEcalTrackRegressionScale().

Definition at line 325 of file Electron.h.

Referenced by ecalTrackRegressionSmear(), and setEcalTrackRegressionSmear().

double pat::Electron::edB_ [protected]

Impact paramater uncertainty at the primary vertex.

Definition at line 303 of file Electron.h.

Referenced by edB(), and setDB().

std::vector<double> pat::Electron::eip_ [protected]

Impact parameter uncertainty as recommended by the tracking group.

Definition at line 337 of file Electron.h.

Referenced by edB(), initImpactParameters(), and setDB().

std::vector<IdPair> pat::Electron::electronIDs_ [protected]

Electron IDs.

Definition at line 282 of file Electron.h.

Referenced by electronID(), electronIDs(), isElectronIDAvailable(), and setElectronIDs().

True if electron's gsfElectronCore is stored internally.

Definition at line 244 of file Electron.h.

Referenced by core(), and embedGsfElectronCore().

True if electron's gsfTrack is stored internally.

Definition at line 248 of file Electron.h.

Referenced by embedGsfTrack(), and gsfTrack().

true if the IsolatedPFCandidate is embedded

Definition at line 287 of file Electron.h.

Referenced by embedPFCandidate(), pfCandidateRef(), and sourceCandidatePtr().

True if electron's pflowsupercluster is stored internally.

Definition at line 254 of file Electron.h.

Referenced by embedPflowSuperCluster(), and pflowSuperCluster().

True if RecHits stored internally.

Definition at line 276 of file Electron.h.

Referenced by embedRecHits().

True if seed cluster is stored internally.

Definition at line 272 of file Electron.h.

Referenced by embedSeedCluster(), and seed().

True if electron's supercluster is stored internally.

Definition at line 252 of file Electron.h.

Referenced by embedSuperCluster(), and superCluster().

True if electron's track is stored internally.

Definition at line 268 of file Electron.h.

Referenced by closestCtfTrackRef(), and embedTrack().

Place to store electron's gsfElectronCore internally.

Definition at line 246 of file Electron.h.

Referenced by core(), and embedGsfElectronCore().

std::vector<reco::GsfTrack> pat::Electron::gsfTrack_ [protected]

Place to store electron's gsfTrack internally.

Definition at line 250 of file Electron.h.

Referenced by embedGsfTrack(), and gsfTrack().

double pat::Electron::ip3d_ [protected]

Definition at line 309 of file Electron.h.

Referenced by ip3d(), and setMvaVariables().

std::vector<double> pat::Electron::ip_ [protected]

Impact parameter at the primary vertex,.

Definition at line 335 of file Electron.h.

Referenced by dB(), initImpactParameters(), and setDB().

bool pat::Electron::isPF_ [protected]

Definition at line 285 of file Electron.h.

Referenced by isPF(), and setIsPF().

conversion veto

Definition at line 329 of file Electron.h.

Referenced by passConversionVeto(), and setPassConversionVeto().

A copy of the source IsolatedPFCandidate is stored in this vector if embeddedPFCandidate_ if True.

Definition at line 289 of file Electron.h.

Referenced by embedPFCandidate(), and pfCandidateRef().

reference to the IsolatedPFCandidate this has been built from; null if this has been built from a standard electron

Definition at line 291 of file Electron.h.

Referenced by embedPFCandidate(), numberOfSourceCandidatePtrs(), pfCandidateRef(), setPFCandidateRef(), and sourceCandidatePtr().

Place to store electron's pflow basic clusters internally.

Definition at line 262 of file Electron.h.

Referenced by embedPflowBasicClusters(), and pflowBasicClusters().

Place to store electron's pflow preshower clusters internally.

Definition at line 264 of file Electron.h.

Referenced by embedPflowPreshowerClusters(), and pflowPreshowerClusters().

Place to store electron's pflow supercluster internally.

Definition at line 266 of file Electron.h.

Referenced by embedPflowSuperCluster(), and pflowSuperCluster().

Place to store electron's preshower clusters internally.

Definition at line 260 of file Electron.h.

Referenced by embedPreshowerClusters(), and preshowerClusters().

double pat::Electron::r9_ [protected]

additional missing mva variables : 14/04/2012

Definition at line 306 of file Electron.h.

Referenced by r9(), and setMvaVariables().

Place to store electron's RecHits internally (5x5 around seed+ all RecHits)

Definition at line 278 of file Electron.h.

Referenced by embedRecHits(), and recHits().

Place to store electron's seed cluster internally.

Definition at line 274 of file Electron.h.

Referenced by embedSeedCluster(), and seed().

double pat::Electron::sigmaIetaIphi_ [protected]

Definition at line 308 of file Electron.h.

Referenced by setMvaVariables(), and sigmaIetaIphi().

double pat::Electron::sigmaIphiIphi_ [protected]

Definition at line 307 of file Electron.h.

Referenced by setMvaVariables(), and sigmaIphiIphi().

Place to store electron's supercluster internally.

Definition at line 256 of file Electron.h.

Referenced by embedSuperCluster(), and superCluster().

std::vector<reco::Track> pat::Electron::track_ [protected]

Place to store electron's track internally.

Definition at line 270 of file Electron.h.

Referenced by closestCtfTrackRef(), and embedTrack().