CMS 3D CMS Logo

reco::PFCandidate Class Reference

particle candidate from particle flow More...

#include <DataFormats/ParticleFlowCandidate/interface/PFCandidate.h>

Inheritance diagram for reco::PFCandidate:

reco::CompositeCandidate reco::Candidate reco::Particle pat::PATObject< reco::PFCandidate > reco::IsolatedPFCandidate reco::PileUpPFCandidate

List of all members.

Public Types

typedef std::pair
< reco::PFBlockRef, unsigned > 
ElementInBlock
 return indices of elements used in the block
typedef std::vector
< ElementInBlock
ElementsInBlocks
enum  Flags {
  NORMAL = 0, E_PHI_SMODULES, E_ETA_0, E_ETA_MODULES,
  E_BARREL_ENDCAP, E_PRESHOWER_EDGE, E_PRESHOWER, E_ENDCAP_EDGE,
  H_ETA_0, H_BARREL_ENDCAP, H_ENDCAP_VFCAL, H_VFCAL_EDGE,
  T_TO_NUCLINT, T_FROM_NUCLINT, T_FROM_V0, T_FROM_GAMMACONV,
  GAMMA_TO_GAMMACONV
}
enum  ParticleType {
  X = 0, h, e, mu,
  gamma, h0, h_HF, egamma_HF
}
 particle types More...

Public Member Functions

void addElementInBlock (const reco::PFBlockRef &blockref, unsigned elementIndex)
 add an element to the current PFCandidate
virtual PFCandidateclone () const
 return a clone
reco::ConversionRef conversionRef () const
 return a reference to the original conversion
double deltaP () const
 uncertainty on 3-momentum
double ecalEnergy () const
 return corrected Ecal energy
const ElementsInBlockselementsInBlocks () const
bool flag (Flags theFlag) const
 return a given flag
reco::GsfTrackRef gsfTrackRef () const
 return a reference to the corresponding GSF track, if an electron.
double hcalEnergy () const
 return corrected Hcal energy
reco::MuonRef muonRef () const
 return a reference to the corresponding muon, if a muon.
float mva_e_mu () const
 mva for electron-muon discrimination
float mva_e_pi () const
 mva for electron-pion discrimination
float mva_gamma_nh () const
 mva for neutral hadron - gamma discrimination
float mva_nothing_gamma () const
 mva for gamma detection
float mva_nothing_nh () const
 mva for neutral hadron detection
float mva_pi_mu () const
 mva for pi-muon discrimination
reco::NuclearInteractionRef nuclearRef () const
 return a reference to the corresponding nuclear interaction, otherwise, return a null reference
size_t numberOfSourceCandidatePtrs () const
 return the number of source Candidates ( the candidates used to construct this Candidate)
virtual ParticleType particleId () const
 particle identification code
 PFCandidate (Charge q, const LorentzVector &p4, ParticleType particleId)
 PFCandidate (const PFCandidatePtr &sourcePtr)
 constructor from a reference (keeps track of source relationship)
 PFCandidate ()
 default constructor
const math::XYZPointFpositionAtECALEntrance () const
 
Returns:
position at ECAL entrance

double pS1Energy () const
 return corrected PS1 energy
double pS2Energy () const
 return corrected PS2 energy
double rawEcalEnergy () const
 return corrected Ecal energy
double rawHcalEnergy () const
 return corrected Hcal energy
void rescaleMomentum (double rescaleFactor)
 particle momentum *= rescaleFactor
void set_mva_e_mu (float mva)
 set mva for electron-muon discrimination
void set_mva_e_pi (float mva)
 set mva for electron-pion discrimination.
void set_mva_gamma_nh (float mva)
 set mva for neutral hadron - gamma discrimination
void set_mva_nothing_gamma (float mva)
 set mva for gamma detection
void set_mva_nothing_nh (float mva)
 set mva for neutral hadron detection
void set_mva_pi_mu (float mva)
 set mva for pi-muon discrimination
void setConversionRef (const reco::ConversionRef &ref)
 set ref to original reco conversion
void setDeltaP (double dp)
 set uncertainty on momentum
void setEcalEnergy (float ee)
 set corrected Ecal energy
void setFlag (Flags theFlag, bool value)
 set a given flag
void setGsfTrackRef (const reco::GsfTrackRef &ref)
 set gsftrack reference
void setHcalEnergy (float eh)
 set corrected Hcal energy
void setMuonRef (const reco::MuonRef &ref)
 set muon reference
void setNuclearRef (const reco::NuclearInteractionRef &ref)
 set nuclear interaction reference
void setParticleType (ParticleType type)
 set Particle Type
void setPositionAtECALEntrance (const math::XYZPointF &pos)
 set position at ECAL entrance
void setPs1Energy (float e1)
 set corrected PS1 energy
void setPs2Energy (float e2)
 set corrected PS2 energy
void setRawEcalEnergy (float ee)
 set corrected Ecal energy
void setRawHcalEnergy (float eh)
 set corrected Hcal energy
void setSourcePtr (const PFCandidatePtr &ptr)
void setTrackRef (const reco::TrackRef &ref)
 set track reference
CandidatePtr sourceCandidatePtr (size_type i) const
reco::TrackRef trackRef () const
 return a reference to the corresponding track, if charged.
int translateTypeToPdgId (ParticleType type) const
 returns the pdg id corresponding to the particle type.
virtual ~PFCandidate ()
 destructor

Static Public Attributes

static const float bigMva_ = 999

Private Member Functions

bool flag (unsigned shift, unsigned flag) const
void setFlag (unsigned shift, unsigned flag, bool value)

Private Attributes

reco::ConversionRef conversionRef_
double deltaP_
 uncertainty on 3-momentum
float ecalEnergy_
 corrected ECAL energy
ElementsInBlocks elementsInBlocks_
unsigned flags_
 all flags, packed (ecal regional, hcal regional, tracking)
reco::GsfTrackRef gsfTrackRef_
float hcalEnergy_
 corrected HCAL energy
reco::MuonRef muonRef_
float mva_e_mu_
 mva for electron-muon discrimination
float mva_e_pi_
 mva for electron-pion discrimination
float mva_gamma_nh_
 mva for neutral hadron - gamma discrimination
float mva_nothing_gamma_
 mva for gamma detection
float mva_nothing_nh_
 mva for neutral hadron detection
float mva_pi_mu_
 mva for pi-muon discrimination
reco::NuclearInteractionRef nuclearRef_
ParticleType particleId_
 particle identification
math::XYZPointF positionAtECALEntrance_
 position at ECAL entrance, from the PFRecTrack
float ps1Energy_
 corrected PS1 energy
float ps2Energy_
 corrected PS2 energy
float rawEcalEnergy_
 raw ECAL energy
float rawHcalEnergy_
 raw HCAL energy
PFCandidatePtr sourcePtr_
 reference to the source PFCandidate, if any
reco::TrackRef trackRef_

Friends

std::ostream & operator<< (std::ostream &out, const PFCandidate &c)


Detailed Description

particle candidate from particle flow

Particle reconstructed by the particle flow algorithm.

Author:
Colin Bernet
Date:
February 2007

Definition at line 31 of file PFCandidate.h.


Member Typedef Documentation

typedef std::pair<reco::PFBlockRef, unsigned> reco::PFCandidate::ElementInBlock

return indices of elements used in the block

return elements return elements in blocks

Definition at line 278 of file PFCandidate.h.

typedef std::vector< ElementInBlock > reco::PFCandidate::ElementsInBlocks

Definition at line 280 of file PFCandidate.h.


Member Enumeration Documentation

enum reco::PFCandidate::Flags

Enumerator:
NORMAL 
E_PHI_SMODULES 
E_ETA_0 
E_ETA_MODULES 
E_BARREL_ENDCAP 
E_PRESHOWER_EDGE 
E_PRESHOWER 
E_ENDCAP_EDGE 
H_ETA_0 
H_BARREL_ENDCAP 
H_ENDCAP_VFCAL 
H_VFCAL_EDGE 
T_TO_NUCLINT 
T_FROM_NUCLINT 
T_FROM_V0 
T_FROM_GAMMACONV 
GAMMA_TO_GAMMACONV 

Definition at line 176 of file PFCandidate.h.

00176                {
00177       NORMAL=0,
00178       E_PHI_SMODULES,
00179       E_ETA_0,
00180       E_ETA_MODULES,
00181       E_BARREL_ENDCAP,
00182       E_PRESHOWER_EDGE,
00183       E_PRESHOWER,
00184       E_ENDCAP_EDGE,
00185       H_ETA_0,
00186       H_BARREL_ENDCAP,
00187       H_ENDCAP_VFCAL,
00188       H_VFCAL_EDGE,  
00189       T_TO_NUCLINT,
00190       T_FROM_NUCLINT,
00191       T_FROM_V0,
00192       T_FROM_GAMMACONV,
00193       GAMMA_TO_GAMMACONV
00194     };

enum reco::PFCandidate::ParticleType

particle types

Enumerator:
X 
h 
e 
mu 
gamma 
h0 
h_HF 
egamma_HF 

Definition at line 36 of file PFCandidate.h.

00036                       {
00037       X=0,     // undefined
00038       h,       // charged hadron
00039       e,       // electron 
00040       mu,      // muon 
00041       gamma,   // photon
00042       h0,      // neutral hadron
00043       h_HF,        // HF tower identified as a hadron
00044       egamma_HF    // HF tower identified as an EM particle
00045     };


Constructor & Destructor Documentation

PFCandidate::PFCandidate (  ) 

default constructor

Definition at line 18 of file PFCandidate.cc.

References particleId_, reco::Particle::setPdgId(), and translateTypeToPdgId().

Referenced by clone().

PFCandidate::PFCandidate ( const PFCandidatePtr sourcePtr  ) 

constructor from a reference (keeps track of source relationship)

Definition at line 39 of file PFCandidate.cc.

References sourcePtr_.

00039                                                           {
00040   *this = *sourcePtr;
00041   sourcePtr_ = sourcePtr;
00042 }

PFCandidate::PFCandidate ( Charge  q,
const LorentzVector p4,
ParticleType  particleId 
)

Definition at line 45 of file PFCandidate.cc.

References e, err, Exception, h, mu, particleId_, reco::Particle::setPdgId(), and translateTypeToPdgId().

00047                                                     : 
00048   
00049   CompositeCandidate(charge, p4), 
00050   particleId_(particleId), 
00051 //   blockRef_(blockRef), 
00052   ecalEnergy_(0),
00053   hcalEnergy_(0),
00054   rawEcalEnergy_(0),
00055   rawHcalEnergy_(0),
00056   ps1Energy_(-1),
00057   ps2Energy_(-1),
00058   flags_(0),
00059   deltaP_(-1),
00060   mva_e_pi_(-PFCandidate::bigMva_),
00061   mva_e_mu_(-PFCandidate::bigMva_),
00062   mva_pi_mu_(-PFCandidate::bigMva_),
00063   mva_nothing_gamma_(-PFCandidate::bigMva_),
00064   mva_nothing_nh_(-PFCandidate::bigMva_),
00065   mva_gamma_nh_(-PFCandidate::bigMva_)
00066   
00067   /*       ,elementIndices_(elementIndices)  */ 
00068 {
00069 
00070   // proceed with various consistency checks
00071 
00072   // charged candidate: track ref and charge must be non null
00073   if(  particleId_ == h || 
00074        particleId_ == e || 
00075        particleId_ == mu ) {
00076     
00077     if( charge == 0 ) {
00078       string err;
00079       err+="Attempt to construct a charged PFCandidate with a zero charge";
00080       throw cms::Exception("InconsistentValue",
00081                            err.c_str() );
00082     } 
00083   }
00084   else {
00085     if( charge ) { 
00086       string err;
00087       err += "Attempt to construct a neutral PFCandidate ";
00088       err += "with a non-zero charge";
00089       throw cms::Exception("InconsistentValue",
00090                            err.c_str() );
00091     } 
00092   }
00093   setPdgId( translateTypeToPdgId( particleId_ ) );
00094 }

virtual reco::PFCandidate::~PFCandidate (  )  [inline, virtual]

destructor

Definition at line 62 of file PFCandidate.h.

00062 {}


Member Function Documentation

void PFCandidate::addElementInBlock ( const reco::PFBlockRef blockref,
unsigned  elementIndex 
)

add an element to the current PFCandidate

add element in block

Definition at line 103 of file PFCandidate.cc.

References elementsInBlocks_.

Referenced by PFElectronAlgo::SetCandidates(), and PFConversionAlgo::setCandidates().

00104                                                              {
00105   elementsInBlocks_.push_back( make_pair(blockref, elementIndex) );
00106 }

PFCandidate * PFCandidate::clone ( void   )  const [virtual]

return a clone

Reimplemented from reco::CompositeCandidate.

Reimplemented in reco::IsolatedPFCandidate, and reco::PileUpPFCandidate.

Definition at line 98 of file PFCandidate.cc.

References PFCandidate().

00098                                        {
00099   return new PFCandidate( * this );
00100 }

reco::ConversionRef reco::PFCandidate::conversionRef (  )  const [inline]

return a reference to the original conversion

Definition at line 135 of file PFCandidate.h.

References conversionRef_.

00135 { return conversionRef_; }

double reco::PFCandidate::deltaP (  )  const [inline]

uncertainty on 3-momentum

Definition at line 206 of file PFCandidate.h.

References deltaP_.

00206 { return deltaP_;}

double reco::PFCandidate::ecalEnergy (  )  const [inline]

return corrected Ecal energy

Definition at line 141 of file PFCandidate.h.

References ecalEnergy_.

00141 { return ecalEnergy_;}

const ElementsInBlocks& reco::PFCandidate::elementsInBlocks (  )  const [inline]

Definition at line 281 of file PFCandidate.h.

References elementsInBlocks_.

Referenced by PFRootEventManager::mcTruthMatching(), and reco::operator<<().

00281                                                      { 
00282       return elementsInBlocks_;
00283     }

bool reco::PFCandidate::flag ( unsigned  shift,
unsigned  flag 
) const [private]

bool PFCandidate::flag ( Flags  theFlag  )  const

return a given flag

Definition at line 242 of file PFCandidate.cc.

References flags_.

Referenced by PFCandConnector::isSecondary(), PFCandConnector::link(), reco::operator<<(), setConversionRef(), and setNuclearRef().

00242                                           {
00243 
00244   return (flags_>>theFlag) & 1;
00245 }

reco::GsfTrackRef reco::PFCandidate::gsfTrackRef (  )  const [inline]

return a reference to the corresponding GSF track, if an electron.

otherwise, return a null reference

Definition at line 115 of file PFCandidate.h.

References gsfTrackRef_.

00115 { return gsfTrackRef_; }     

double reco::PFCandidate::hcalEnergy (  )  const [inline]

return corrected Hcal energy

Definition at line 147 of file PFCandidate.h.

References hcalEnergy_.

00147 { return hcalEnergy_;}

reco::MuonRef reco::PFCandidate::muonRef (  )  const [inline]

return a reference to the corresponding muon, if a muon.

otherwise, return a null reference

Definition at line 122 of file PFCandidate.h.

References muonRef_.

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

00122 { return muonRef_; }    

float reco::PFCandidate::mva_e_mu (  )  const [inline]

mva for electron-muon discrimination

Definition at line 224 of file PFCandidate.h.

References mva_e_mu_.

00224 { return mva_e_mu_;}

float reco::PFCandidate::mva_e_pi (  )  const [inline]

mva for electron-pion discrimination

Definition at line 217 of file PFCandidate.h.

References mva_e_pi_.

00217 { return mva_e_pi_;}

float reco::PFCandidate::mva_gamma_nh (  )  const [inline]

mva for neutral hadron - gamma discrimination

Definition at line 252 of file PFCandidate.h.

References mva_gamma_nh_.

00252 { return mva_gamma_nh_;}

float reco::PFCandidate::mva_nothing_gamma (  )  const [inline]

mva for gamma detection

Definition at line 238 of file PFCandidate.h.

References mva_nothing_gamma_.

00238 { return mva_nothing_gamma_;}

float reco::PFCandidate::mva_nothing_nh (  )  const [inline]

mva for neutral hadron detection

Definition at line 245 of file PFCandidate.h.

References mva_nothing_nh_.

00245 { return mva_nothing_nh_;}

float reco::PFCandidate::mva_pi_mu (  )  const [inline]

mva for pi-muon discrimination

Definition at line 231 of file PFCandidate.h.

References mva_pi_mu_.

00231 { return mva_pi_mu_;}

reco::NuclearInteractionRef reco::PFCandidate::nuclearRef (  )  const [inline]

return a reference to the corresponding nuclear interaction, otherwise, return a null reference

Definition at line 129 of file PFCandidate.h.

References nuclearRef_.

Referenced by PFCandConnector::shouldBeLinked().

00129 { return nuclearRef_; }

size_t reco::PFCandidate::numberOfSourceCandidatePtrs (  )  const [inline, virtual]

return the number of source Candidates ( the candidates used to construct this Candidate)

Reimplemented from reco::Candidate.

Definition at line 79 of file PFCandidate.h.

00079                                                { 
00080       return 1;
00081     }

virtual ParticleType reco::PFCandidate::particleId (  )  const [inline, virtual]

particle identification code

Todo:
use Particle::pdgId_ and remove this data member

Definition at line 266 of file PFCandidate.h.

References particleId_.

Referenced by PFTester::analyze(), PFRootEventManager::fillOutEventWithPFCandidates(), reco::Pi0Algo::fillPi0sUsingPF(), JetMaker::makeSpecific(), reco::operator<<(), and PFRootEventManager::tauBenchmark().

00266 { return particleId_;}

const math::XYZPointF& reco::PFCandidate::positionAtECALEntrance (  )  const [inline]

Returns:
position at ECAL entrance

Definition at line 260 of file PFCandidate.h.

References positionAtECALEntrance_.

00260                                                         {
00261       return positionAtECALEntrance_;
00262     }

double reco::PFCandidate::pS1Energy (  )  const [inline]

return corrected PS1 energy

Definition at line 165 of file PFCandidate.h.

References ps1Energy_.

00165 { return ps1Energy_;}

double reco::PFCandidate::pS2Energy (  )  const [inline]

return corrected PS2 energy

Definition at line 171 of file PFCandidate.h.

References ps2Energy_.

00171 { return ps2Energy_;}

double reco::PFCandidate::rawEcalEnergy (  )  const [inline]

return corrected Ecal energy

Definition at line 153 of file PFCandidate.h.

References rawEcalEnergy_.

00153 { return rawEcalEnergy_;}

double reco::PFCandidate::rawHcalEnergy (  )  const [inline]

return corrected Hcal energy

Definition at line 159 of file PFCandidate.h.

References rawHcalEnergy_.

00159 { return rawHcalEnergy_;}

void PFCandidate::rescaleMomentum ( double  rescaleFactor  ) 

particle momentum *= rescaleFactor

Definition at line 225 of file PFCandidate.cc.

References reco::Particle::p4(), and reco::Particle::setP4().

00225                                                         {
00226   LorentzVector rescaledp4 = p4();
00227   rescaledp4 *= rescaleFactor;
00228   setP4( rescaledp4 );
00229 }

void reco::PFCandidate::set_mva_e_mu ( float  mva  )  [inline]

set mva for electron-muon discrimination

Definition at line 221 of file PFCandidate.h.

References mva_e_mu_.

00221 { mva_e_mu_ = mva; } 

void reco::PFCandidate::set_mva_e_pi ( float  mva  )  [inline]

set mva for electron-pion discrimination.

For charged particles, this variable is set to 0 for particles that are not preided to 1 otherwise For neutral particles, it is set to the default value

Definition at line 214 of file PFCandidate.h.

References mva_e_pi_.

Referenced by PFElectronAlgo::SetCandidates().

00214 { mva_e_pi_ = mva; } 

void reco::PFCandidate::set_mva_gamma_nh ( float  mva  )  [inline]

set mva for neutral hadron - gamma discrimination

Definition at line 249 of file PFCandidate.h.

References mva_gamma_nh_.

00249 { mva_gamma_nh_ = mva; } 

void reco::PFCandidate::set_mva_nothing_gamma ( float  mva  )  [inline]

set mva for gamma detection

Definition at line 235 of file PFCandidate.h.

References mva_nothing_gamma_.

00235 { mva_nothing_gamma_ = mva; } 

void reco::PFCandidate::set_mva_nothing_nh ( float  mva  )  [inline]

set mva for neutral hadron detection

Definition at line 242 of file PFCandidate.h.

References mva_nothing_nh_.

00242 { mva_nothing_nh_ = mva; } 

void reco::PFCandidate::set_mva_pi_mu ( float  mva  )  [inline]

set mva for pi-muon discrimination

Definition at line 228 of file PFCandidate.h.

References mva_pi_mu_.

00228 { mva_pi_mu_ = mva; } 

void PFCandidate::setConversionRef ( const reco::ConversionRef ref  ) 

set ref to original reco conversion

Definition at line 176 of file PFCandidate.cc.

References conversionRef_, err, Exception, flag(), gamma, GAMMA_TO_GAMMACONV, funct::num(), and particleId_.

Referenced by PFConversionAlgo::setCandidates().

00176                                                                {
00177 
00178   if( particleId_ != gamma ) {
00179     string err;
00180     err += "PFCandidate::setConversionRef: this is not a (converted) photon ! particleId_=";
00181     char num[4];
00182     sprintf( num, "%d", particleId_);
00183     err += num;
00184 
00185     throw cms::Exception("InconsistentReference",
00186                          err.c_str() );
00187   }
00188   else if(  !flag( GAMMA_TO_GAMMACONV ) ) {
00189     string err;
00190     err += "PFCandidate::setConversionRef: particule flag is not GAMMA_TO_GAMMACONV";
00191 
00192     throw cms::Exception("InconsistentReference",
00193                          err.c_str() );
00194   }
00195 
00196   conversionRef_ = ref;
00197 }

void reco::PFCandidate::setDeltaP ( double  dp  )  [inline]

set uncertainty on momentum

Definition at line 203 of file PFCandidate.h.

References deltaP_.

00203 {deltaP_ = dp;}

void reco::PFCandidate::setEcalEnergy ( float  ee  )  [inline]

set corrected Ecal energy

Definition at line 138 of file PFCandidate.h.

References ecalEnergy_.

Referenced by PFElectronAlgo::SetCandidates(), and PFConversionAlgo::setCandidates().

00138 {ecalEnergy_ = ee;}

void reco::PFCandidate::setFlag ( unsigned  shift,
unsigned  flag,
bool  value 
) [private]

void PFCandidate::setFlag ( Flags  theFlag,
bool  value 
)

set a given flag

Definition at line 232 of file PFCandidate.cc.

References flags_.

Referenced by PFCandConnector::link(), and PFConversionAlgo::setCandidates().

00232                                                    {
00233   
00234   if(value)
00235     flags_ = flags_ | (1<<theFlag);
00236   else 
00237     flags_ = flags_ ^ (1<<theFlag);
00238 }

void PFCandidate::setGsfTrackRef ( const reco::GsfTrackRef ref  ) 

set gsftrack reference

Definition at line 149 of file PFCandidate.cc.

References e, err, Exception, gsfTrackRef_, funct::num(), and particleId_.

Referenced by PFElectronAlgo::SetCandidates().

00149                                                            {
00150   if( particleId_ != e ) {
00151     string err;
00152     err += "PFCandidate::setGsfTrackRef: this is not an electron ! particleId_=";
00153     char num[4];
00154     sprintf( num, "%d", particleId_);
00155     err += num;
00156 
00157     throw cms::Exception("InconsistentReference",
00158                          err.c_str() );
00159   }
00160   gsfTrackRef_ = ref;
00161 }

void reco::PFCandidate::setHcalEnergy ( float  eh  )  [inline]

set corrected Hcal energy

Definition at line 144 of file PFCandidate.h.

References hcalEnergy_.

Referenced by PFElectronAlgo::SetCandidates(), and PFConversionAlgo::setCandidates().

00144 {hcalEnergy_ = eh;}

void PFCandidate::setMuonRef ( const reco::MuonRef ref  ) 

set muon reference

Definition at line 163 of file PFCandidate.cc.

References err, Exception, muonRef_, and trackRef_.

00163                                                    {
00164 
00165   if(  trackRef_ != ref->track() ) {
00166     string err;
00167     err += "PFCandidate::setMuonRef: inconsistent track references!";
00168     
00169     throw cms::Exception("InconsistentReference",
00170                          err.c_str() );
00171   }
00172     
00173   muonRef_ = ref;
00174 }

void PFCandidate::setNuclearRef ( const reco::NuclearInteractionRef ref  ) 

set nuclear interaction reference

Definition at line 201 of file PFCandidate.cc.

References err, Exception, flag(), h, nuclearRef_, funct::num(), particleId_, T_FROM_NUCLINT, and T_TO_NUCLINT.

00201                                                                     {
00202 
00203   if( particleId_ != h ) {
00204     string err;
00205     err += "PFCandidate::setNuclearRef: this is not a hadron! particleId_=";
00206     char num[4];
00207     sprintf( num, "%d", particleId_);
00208     err += num;
00209 
00210     throw cms::Exception("InconsistentReference",
00211                          err.c_str() );
00212   }
00213   else if(  !flag( T_FROM_NUCLINT ) && !flag( T_TO_NUCLINT ) ) {
00214     string err;
00215     err += "PFCandidate::setNuclearRef: particule flag is neither T_FROM_NUCLINT nor T_TO_NUCLINT";
00216 
00217     throw cms::Exception("InconsistentReference",
00218                          err.c_str() );
00219   }
00220 
00221   nuclearRef_ = ref;
00222 }

void PFCandidate::setParticleType ( ParticleType  type  ) 

set Particle Type

Definition at line 127 of file PFCandidate.cc.

References particleId_, reco::Particle::setPdgId(), and translateTypeToPdgId().

00127                                                      {
00128   particleId_ = type;
00129   setPdgId( translateTypeToPdgId( type ) );
00130 }

void reco::PFCandidate::setPositionAtECALEntrance ( const math::XYZPointF pos  )  [inline]

set position at ECAL entrance

Definition at line 255 of file PFCandidate.h.

References positionAtECALEntrance_.

00255                                                              {
00256       positionAtECALEntrance_ = pos;
00257     } 

void reco::PFCandidate::setPs1Energy ( float  e1  )  [inline]

set corrected PS1 energy

Definition at line 162 of file PFCandidate.h.

References ps1Energy_.

Referenced by PFElectronAlgo::SetCandidates(), and PFConversionAlgo::setCandidates().

00162 {ps1Energy_ = e1;}

void reco::PFCandidate::setPs2Energy ( float  e2  )  [inline]

set corrected PS2 energy

Definition at line 168 of file PFCandidate.h.

References ps2Energy_.

Referenced by PFElectronAlgo::SetCandidates(), and PFConversionAlgo::setCandidates().

00168 {ps2Energy_ = e2;}

void reco::PFCandidate::setRawEcalEnergy ( float  ee  )  [inline]

set corrected Ecal energy

Definition at line 150 of file PFCandidate.h.

References rawEcalEnergy_.

00150 {rawEcalEnergy_ = ee;}

void reco::PFCandidate::setRawHcalEnergy ( float  eh  )  [inline]

set corrected Hcal energy

Definition at line 156 of file PFCandidate.h.

References rawHcalEnergy_.

00156 {rawHcalEnergy_ = eh;}

void reco::PFCandidate::setSourcePtr ( const PFCandidatePtr ptr  )  [inline]

Definition at line 77 of file PFCandidate.h.

References sourcePtr_.

00077 { sourcePtr_ = ptr; }

void PFCandidate::setTrackRef ( const reco::TrackRef ref  ) 

set track reference

Definition at line 133 of file PFCandidate.cc.

References reco::Particle::charge(), err, Exception, funct::num(), particleId_, and trackRef_.

Referenced by PFElectronAlgo::SetCandidates().

00133                                                      {
00134   if(!charge()) {
00135     string err;
00136     err += "PFCandidate::setTrackRef: this is a neutral candidate! ";
00137     err += "particleId_=";
00138     char num[4];
00139     sprintf( num, "%d", particleId_);
00140     err += num;
00141     
00142     throw cms::Exception("InconsistentReference",
00143                          err.c_str() );
00144   }
00145 
00146   trackRef_ = ref;
00147 }

CandidatePtr reco::PFCandidate::sourceCandidatePtr ( size_type  i  )  const [inline]

Definition at line 83 of file PFCandidate.h.

References sourcePtr_.

Referenced by reco::operator<<().

00083                                                          {
00084       return sourcePtr_;
00085     }

reco::TrackRef reco::PFCandidate::trackRef (  )  const [inline]

return a reference to the corresponding track, if charged.

otherwise, return a null reference

Definition at line 108 of file PFCandidate.h.

References trackRef_.

Referenced by PFPileUp::chargedHadronVertex(), pat::helper::VertexingHelper::getTrack_(), and reco::PFJet::getTrackRefs().

00108 { return trackRef_; }

int PFCandidate::translateTypeToPdgId ( ParticleType  type  )  const

returns the pdg id corresponding to the particle type.

the particle type could be removed at some point to gain some space. low priority

Definition at line 109 of file PFCandidate.cc.

References reco::Particle::charge(), e, egamma_HF, gamma, h, h0, h_HF, mu, and X.

Referenced by PFCandidate(), and setParticleType().

00109                                                                {
00110   
00111   int thecharge = charge();
00112   
00113   switch( type ) {
00114   case h:     return thecharge*211; // pi+
00115   case e:     return thecharge*11;
00116   case mu:    return thecharge*13;
00117   case gamma: return 22;
00118   case h0:    return 130; // K_L0
00119   case h_HF:         return 999211; // dummy pdg code 
00120   case egamma_HF:    return 99922;  // dummy pdg code
00121   case X: 
00122   default:    return 0;  
00123   }
00124 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const PFCandidate c 
) [friend]


Member Data Documentation

const float PFCandidate::bigMva_ = 999 [static]

Definition at line 287 of file PFCandidate.h.

reco::ConversionRef reco::PFCandidate::conversionRef_ [private]

Definition at line 315 of file PFCandidate.h.

Referenced by conversionRef(), and setConversionRef().

double reco::PFCandidate::deltaP_ [private]

uncertainty on 3-momentum

Definition at line 339 of file PFCandidate.h.

Referenced by deltaP(), and setDeltaP().

float reco::PFCandidate::ecalEnergy_ [private]

corrected ECAL energy

Definition at line 318 of file PFCandidate.h.

Referenced by ecalEnergy(), and setEcalEnergy().

ElementsInBlocks reco::PFCandidate::elementsInBlocks_ [private]

Definition at line 301 of file PFCandidate.h.

Referenced by addElementInBlock(), and elementsInBlocks().

unsigned reco::PFCandidate::flags_ [private]

all flags, packed (ecal regional, hcal regional, tracking)

Definition at line 336 of file PFCandidate.h.

Referenced by flag(), and setFlag().

reco::GsfTrackRef reco::PFCandidate::gsfTrackRef_ [private]

Definition at line 309 of file PFCandidate.h.

Referenced by gsfTrackRef(), and setGsfTrackRef().

float reco::PFCandidate::hcalEnergy_ [private]

corrected HCAL energy

Definition at line 321 of file PFCandidate.h.

Referenced by hcalEnergy(), and setHcalEnergy().

reco::MuonRef reco::PFCandidate::muonRef_ [private]

Definition at line 311 of file PFCandidate.h.

Referenced by muonRef(), and setMuonRef().

float reco::PFCandidate::mva_e_mu_ [private]

mva for electron-muon discrimination

Definition at line 345 of file PFCandidate.h.

Referenced by mva_e_mu(), and set_mva_e_mu().

float reco::PFCandidate::mva_e_pi_ [private]

mva for electron-pion discrimination

Definition at line 342 of file PFCandidate.h.

Referenced by mva_e_pi(), and set_mva_e_pi().

float reco::PFCandidate::mva_gamma_nh_ [private]

mva for neutral hadron - gamma discrimination

Definition at line 357 of file PFCandidate.h.

Referenced by mva_gamma_nh(), and set_mva_gamma_nh().

float reco::PFCandidate::mva_nothing_gamma_ [private]

mva for gamma detection

Definition at line 351 of file PFCandidate.h.

Referenced by mva_nothing_gamma(), and set_mva_nothing_gamma().

float reco::PFCandidate::mva_nothing_nh_ [private]

mva for neutral hadron detection

Definition at line 354 of file PFCandidate.h.

Referenced by mva_nothing_nh(), and set_mva_nothing_nh().

float reco::PFCandidate::mva_pi_mu_ [private]

mva for pi-muon discrimination

Definition at line 348 of file PFCandidate.h.

Referenced by mva_pi_mu(), and set_mva_pi_mu().

reco::NuclearInteractionRef reco::PFCandidate::nuclearRef_ [private]

Definition at line 313 of file PFCandidate.h.

Referenced by nuclearRef(), and setNuclearRef().

ParticleType reco::PFCandidate::particleId_ [private]

particle identification

Definition at line 298 of file PFCandidate.h.

Referenced by particleId(), PFCandidate(), setConversionRef(), setGsfTrackRef(), setNuclearRef(), setParticleType(), and setTrackRef().

math::XYZPointF reco::PFCandidate::positionAtECALEntrance_ [private]

position at ECAL entrance, from the PFRecTrack

Definition at line 360 of file PFCandidate.h.

Referenced by positionAtECALEntrance(), and setPositionAtECALEntrance().

float reco::PFCandidate::ps1Energy_ [private]

corrected PS1 energy

Definition at line 330 of file PFCandidate.h.

Referenced by pS1Energy(), and setPs1Energy().

float reco::PFCandidate::ps2Energy_ [private]

corrected PS2 energy

Definition at line 333 of file PFCandidate.h.

Referenced by pS2Energy(), and setPs2Energy().

float reco::PFCandidate::rawEcalEnergy_ [private]

raw ECAL energy

Definition at line 324 of file PFCandidate.h.

Referenced by rawEcalEnergy(), and setRawEcalEnergy().

float reco::PFCandidate::rawHcalEnergy_ [private]

raw HCAL energy

Definition at line 327 of file PFCandidate.h.

Referenced by rawHcalEnergy(), and setRawHcalEnergy().

PFCandidatePtr reco::PFCandidate::sourcePtr_ [private]

reference to the source PFCandidate, if any

Definition at line 305 of file PFCandidate.h.

Referenced by reco::operator<<(), PFCandidate(), setSourcePtr(), and sourceCandidatePtr().

reco::TrackRef reco::PFCandidate::trackRef_ [private]

Definition at line 307 of file PFCandidate.h.

Referenced by setMuonRef(), setTrackRef(), and trackRef().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:51:18 2009 for CMSSW by  doxygen 1.5.4