CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends

reco::PFCandidate Class Reference

Particle reconstructed by the particle flow algorithm. More...

#include <PFCandidate.h>

Inheritance diagram for reco::PFCandidate:
reco::CompositeCandidate reco::LeafCandidate reco::Candidate pat::PATObject< reco::PFCandidate > reco::IsolatedPFCandidate reco::PileUpPFCandidate pat::PFParticle

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_DISP, T_FROM_DISP, 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
reco::PFDisplacedVertexRef displacedVertexRef (Flags type) const
double ecalEnergy () const
 return corrected Ecal energy
reco::PFCandidateElectronExtraRef electronExtraRef () const
 return a reference to the electron extra
const ElementsInBlockselementsInBlocks () const
bool flag (Flags theFlag) const
 return a given flag
reco::GsfElectronRef gsfElectronRef () const
 return a reference to the corresponding GsfElectron if any
reco::GsfTrackRef gsfTrackRef () const
double hcalEnergy () const
 return corrected Hcal energy
reco::MuonRef muonRef () const
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
size_t numberOfSourceCandidatePtrs () const
virtual ParticleType particleId () const
 PFCandidate (Charge q, const LorentzVector &p4, ParticleType particleId)
 PFCandidate ()
 default constructor
 PFCandidate (const PFCandidatePtr &sourcePtr)
 constructor from a reference (keeps track of source relationship)
const math::XYZPointFpositionAtECALEntrance () const
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)
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 setDisplacedVertexRef (const reco::PFDisplacedVertexRef &ref, Flags flag)
 set displaced vertex reference
void setEcalEnergy (float ee)
 set corrected Ecal energy
void setFlag (Flags theFlag, bool value)
 set a given flag
void setGsfElectronRef (const reco::GsfElectronRef &ref)
 set GsfElectronRef
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 setParticleType (ParticleType type)
 set Particle Type
void setPFElectronExtraRef (const reco::PFCandidateElectronExtraRef &ref)
 set the PF Electron Extra Ref
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 setSourceCandidatePtr (const PFCandidatePtr &ptr)
void setTrackRef (const reco::TrackRef &ref)
 set track reference
void setV0Ref (const reco::VertexCompositeCandidateRef &ref)
 set ref to original reco conversion
CandidatePtr sourceCandidatePtr (size_type i) const
reco::SuperClusterRef superClusterRef () const
 return a reference to the corresponding SuperCluster if any
reco::TrackRef trackRef () const
int translateTypeToPdgId (ParticleType type) const
reco::VertexCompositeCandidateRef v0Ref () const
 return a reference to the original conversion
virtual ~PFCandidate ()
 destructor

Static Public Attributes

static const float bigMva_ = 999

Private Member Functions

bool flag (unsigned shift, unsigned flag) const
virtual bool overlap (const Candidate &) const
 Polymorphic overlap.
void setFlag (unsigned shift, unsigned flag, bool value)

Private Attributes

reco::ConversionRef conversionRef_
double deltaP_
 uncertainty on 3-momentum
reco::PFDisplacedVertexRef displacedVertexDaughterRef_
 reference to the corresponding pf displaced vertex which this track was created
reco::PFDisplacedVertexRef displacedVertexMotherRef_
 reference to the corresponding pf displaced vertex where this track was created
float ecalEnergy_
 corrected ECAL energy
ElementsInBlocks elementsInBlocks_
unsigned flags_
 all flags, packed (ecal regional, hcal regional, tracking)
reco::GsfElectronRef gsfElectronRef_
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
reco::PFCandidateElectronExtraRef pfElectronExtraRef_
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::SuperClusterRef superClusterRef_
reco::TrackRef trackRef_
reco::VertexCompositeCandidateRef v0Ref_

Friends

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

Detailed Description

Particle reconstructed by the particle flow algorithm.

particle candidate from particle flow

Author:
Colin Bernet
Date:
February 2007

Definition at line 34 of file PFCandidate.h.


Member Typedef Documentation

return indices of elements used in the block

return elements return elements in blocks

Definition at line 311 of file PFCandidate.h.

Definition at line 313 of file PFCandidate.h.


Member Enumeration Documentation

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_DISP 
T_FROM_DISP 
T_FROM_V0 
T_FROM_GAMMACONV 
GAMMA_TO_GAMMACONV 

Definition at line 50 of file PFCandidate.h.

particle types

Enumerator:
X 
h 
e 
mu 
gamma 
h0 
h_HF 
egamma_HF 

Definition at line 39 of file PFCandidate.h.

                      {
      X=0,     // undefined
      h,       // charged hadron
      e,       // electron 
      mu,      // muon 
      gamma,   // photon
      h0,      // neutral hadron
      h_HF,        // HF tower identified as a hadron
      egamma_HF    // HF tower identified as an EM particle
    };

Constructor & Destructor Documentation

PFCandidate::PFCandidate ( )
PFCandidate::PFCandidate ( const PFCandidatePtr sourcePtr)

constructor from a reference (keeps track of source relationship)

Definition at line 39 of file PFCandidate.cc.

References sourcePtr_.

                                                          {
  *this = *sourcePtr;
  sourcePtr_ = sourcePtr;
}
PFCandidate::PFCandidate ( Charge  q,
const LorentzVector p4,
ParticleType  particleId 
)

Definition at line 45 of file PFCandidate.cc.

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

                                                    : 
  
  CompositeCandidate(charge, p4), 
  particleId_(particleId), 
//   blockRef_(blockRef), 
  ecalEnergy_(0),
  hcalEnergy_(0),
  rawEcalEnergy_(0),
  rawHcalEnergy_(0),
  ps1Energy_(-1),
  ps2Energy_(-1),
  flags_(0),
  deltaP_(-1),
  mva_e_pi_(-PFCandidate::bigMva_),
  mva_e_mu_(-PFCandidate::bigMva_),
  mva_pi_mu_(-PFCandidate::bigMva_),
  mva_nothing_gamma_(-PFCandidate::bigMva_),
  mva_nothing_nh_(-PFCandidate::bigMva_),
  mva_gamma_nh_(-PFCandidate::bigMva_)
  
  /*       ,elementIndices_(elementIndices)  */ 
{

  
  // proceed with various consistency checks

  // charged candidate: track ref and charge must be non null
  if(  particleId_ == h || 
       particleId_ == e || 
       particleId_ == mu ) {
    
    if( charge == 0 ) {
      string err;
      err+="Attempt to construct a charged PFCandidate with a zero charge";
      throw cms::Exception("InconsistentValue",
                           err.c_str() );
    } 
  }
  else {
    if( charge ) { 
      string err;
      err += "Attempt to construct a neutral PFCandidate ";
      err += "with a non-zero charge";
      throw cms::Exception("InconsistentValue",
                           err.c_str() );
    } 
  }  
  setPdgId( translateTypeToPdgId( particleId_ ) );
}
virtual reco::PFCandidate::~PFCandidate ( ) [inline, virtual]

destructor

Definition at line 87 of file PFCandidate.h.

{}

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 104 of file PFCandidate.cc.

References elementsInBlocks_.

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

                                                             {
  elementsInBlocks_.push_back( make_pair(blockref, elementIndex) );
}
PFCandidate * PFCandidate::clone ( void  ) const [virtual]

return a clone

Reimplemented from reco::CompositeCandidate.

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

Definition at line 99 of file PFCandidate.cc.

References PFCandidate().

                                       {
  return new PFCandidate( * this );
}
reco::ConversionRef reco::PFCandidate::conversionRef ( ) const [inline]

return a reference to the original conversion

Definition at line 165 of file PFCandidate.h.

References conversionRef_.

{ return conversionRef_; }
double reco::PFCandidate::deltaP ( ) const [inline]

uncertainty on 3-momentum

Definition at line 234 of file PFCandidate.h.

References deltaP_.

{ return deltaP_;}
reco::PFDisplacedVertexRef reco::PFCandidate::displacedVertexRef ( Flags  type) const [inline]

return a reference to the corresponding displaced vertex, otherwise, return a null reference

Definition at line 155 of file PFCandidate.h.

References displacedVertexDaughterRef_, displacedVertexMotherRef_, T_FROM_DISP, and T_TO_DISP.

Referenced by PFCandConnector::analyseNuclearWPrim(), PFCandConnector::isPrimaryNucl(), and PFCandConnector::isSecondaryNucl().

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

return corrected Ecal energy

Definition at line 186 of file PFCandidate.h.

References ecalEnergy_.

Referenced by PFCandConnector::analyseNuclearWPrim(), and PFCandidateBenchmark::fillOne().

{ return ecalEnergy_;}
reco::PFCandidateElectronExtraRef reco::PFCandidate::electronExtraRef ( ) const [inline]

return a reference to the electron extra

Definition at line 180 of file PFCandidate.h.

References pfElectronExtraRef_.

const ElementsInBlocks& reco::PFCandidate::elementsInBlocks ( ) const [inline]
bool PFCandidate::flag ( Flags  theFlag) const

return a given flag

Definition at line 277 of file PFCandidate.cc.

References flags_.

Referenced by PFCandConnector::isPrimaryNucl(), PFCandConnector::isSecondaryNucl(), setConversionRef(), and setDisplacedVertexRef().

                                          {

  return (flags_>>theFlag) & 1;
}
bool reco::PFCandidate::flag ( unsigned  shift,
unsigned  flag 
) const [private]
reco::GsfElectronRef reco::PFCandidate::gsfElectronRef ( ) const [inline]

return a reference to the corresponding GsfElectron if any

Definition at line 174 of file PFCandidate.h.

References gsfElectronRef_.

{return gsfElectronRef_;} 
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 141 of file PFCandidate.h.

References gsfTrackRef_.

Referenced by LeptonRecoSkim::filter(), and PFElectronTranslator::produce().

{ return gsfTrackRef_; }     
double reco::PFCandidate::hcalEnergy ( ) const [inline]

return corrected Hcal energy

Definition at line 192 of file PFCandidate.h.

References hcalEnergy_.

Referenced by PFCandConnector::analyseNuclearWPrim(), and PFCandidateBenchmark::fillOne().

{ 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 148 of file PFCandidate.h.

References muonRef_.

Referenced by PFAlgo::postMuonCleaning(), and pat::PATMuonProducer::produce().

{ return muonRef_; }    
float reco::PFCandidate::mva_e_mu ( ) const [inline]

mva for electron-muon discrimination

Definition at line 252 of file PFCandidate.h.

References mva_e_mu_.

{ return mva_e_mu_;}
float reco::PFCandidate::mva_e_pi ( ) const [inline]

mva for electron-pion discrimination

Definition at line 245 of file PFCandidate.h.

References mva_e_pi_.

Referenced by PFCandidateBenchmark::fillOne(), and PFElectronTranslator::produce().

{ return mva_e_pi_;}
float reco::PFCandidate::mva_gamma_nh ( ) const [inline]

mva for neutral hadron - gamma discrimination

Definition at line 280 of file PFCandidate.h.

References mva_gamma_nh_.

{ return mva_gamma_nh_;}
float reco::PFCandidate::mva_nothing_gamma ( ) const [inline]

mva for gamma detection

Definition at line 266 of file PFCandidate.h.

References mva_nothing_gamma_.

{ return mva_nothing_gamma_;}
float reco::PFCandidate::mva_nothing_nh ( ) const [inline]

mva for neutral hadron detection

Definition at line 273 of file PFCandidate.h.

References mva_nothing_nh_.

{ return mva_nothing_nh_;}
float reco::PFCandidate::mva_pi_mu ( ) const [inline]

mva for pi-muon discrimination

Definition at line 259 of file PFCandidate.h.

References mva_pi_mu_.

{ return mva_pi_mu_;}
size_t reco::PFCandidate::numberOfSourceCandidatePtrs ( ) const [inline, virtual]

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

Reimplemented from reco::LeafCandidate.

Definition at line 105 of file PFCandidate.h.

                                               { 
      return 1;
    }
bool PFCandidate::overlap ( const Candidate other) const [private, virtual]

Polymorphic overlap.

Reimplemented from reco::CompositeCandidate.

Definition at line 243 of file PFCandidate.cc.

References i, edm::Ptr< T >::isNonnull(), edm::Ptr< T >::isNull(), n, reco::Candidate::numberOfSourceCandidatePtrs(), reco::Candidate::sourceCandidatePtr(), sourceCandidatePtr(), and sourcePtr_.

                                                           {
    CandidatePtr myPtr = sourceCandidatePtr(0);
    if (myPtr.isNull()) return false;
    for (size_t i = 0, n = other.numberOfSourceCandidatePtrs(); i < n; ++i) {
        CandidatePtr otherPtr = other.sourceCandidatePtr(i);
        if ((otherPtr == myPtr) || 
            (sourcePtr_.isNonnull() && otherPtr.isNonnull() && sourcePtr_->overlap(*otherPtr))) {
                return true;
        }
    }
    return false;
}
virtual ParticleType reco::PFCandidate::particleId ( ) const [inline, virtual]
const math::XYZPointF& reco::PFCandidate::positionAtECALEntrance ( ) const [inline]
Returns:
position at ECAL entrance

Definition at line 293 of file PFCandidate.h.

References positionAtECALEntrance_.

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

return corrected PS1 energy

Definition at line 213 of file PFCandidate.h.

References ps1Energy_.

{ return ps1Energy_;}
double reco::PFCandidate::pS2Energy ( ) const [inline]

return corrected PS2 energy

Definition at line 219 of file PFCandidate.h.

References ps2Energy_.

{ return ps2Energy_;}
double reco::PFCandidate::rawEcalEnergy ( ) const [inline]

return corrected Ecal energy

Definition at line 198 of file PFCandidate.h.

References rawEcalEnergy_.

Referenced by PFElectronTranslator::createBasicCluster(), and PFAlgo::postMuonCleaning().

{ return rawEcalEnergy_;}
double reco::PFCandidate::rawHcalEnergy ( ) const [inline]

return corrected Hcal energy

Definition at line 207 of file PFCandidate.h.

References rawHcalEnergy_.

Referenced by PFAlgo::postMuonCleaning().

{ return rawHcalEnergy_;}
void PFCandidate::rescaleMomentum ( double  rescaleFactor)

particle momentum *= rescaleFactor

Definition at line 260 of file PFCandidate.cc.

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

                                                        {
  LorentzVector rescaledp4 = p4();
  rescaledp4 *= rescaleFactor;
  setP4( rescaledp4 );
}
void reco::PFCandidate::set_mva_e_mu ( float  mva) [inline]

set mva for electron-muon discrimination

Definition at line 249 of file PFCandidate.h.

References mva_e_mu_.

{ 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 242 of file PFCandidate.h.

References mva_e_pi_.

Referenced by PFElectronAlgo::SetCandidates().

{ mva_e_pi_ = mva; } 
void reco::PFCandidate::set_mva_gamma_nh ( float  mva) [inline]

set mva for neutral hadron - gamma discrimination

Definition at line 277 of file PFCandidate.h.

References mva_gamma_nh_.

{ mva_gamma_nh_ = mva; } 
void reco::PFCandidate::set_mva_nothing_gamma ( float  mva) [inline]

set mva for gamma detection

Definition at line 263 of file PFCandidate.h.

References mva_nothing_gamma_.

{ mva_nothing_gamma_ = mva; } 
void reco::PFCandidate::set_mva_nothing_nh ( float  mva) [inline]

set mva for neutral hadron detection

Definition at line 270 of file PFCandidate.h.

References mva_nothing_nh_.

{ mva_nothing_nh_ = mva; } 
void reco::PFCandidate::set_mva_pi_mu ( float  mva) [inline]

set mva for pi-muon discrimination

Definition at line 256 of file PFCandidate.h.

References mva_pi_mu_.

{ mva_pi_mu_ = mva; } 
void PFCandidate::setConversionRef ( const reco::ConversionRef ref)

set ref to original reco conversion

Definition at line 177 of file PFCandidate.cc.

References conversionRef_, Exception, flag(), gamma, GAMMA_TO_GAMMACONV, and particleId_.

Referenced by PFConversionAlgo::setCandidates().

                                                               {

  if( particleId_ != gamma ) {
    string err;
    err += "PFCandidate::setConversionRef: this is not a (converted) photon ! particleId_=";
    char num[4];
    sprintf( num, "%d", particleId_);
    err += num;

    throw cms::Exception("InconsistentReference",
                         err.c_str() );
  }
  else if(  !flag( GAMMA_TO_GAMMACONV ) ) {
    string err;
    err += "PFCandidate::setConversionRef: particule flag is not GAMMA_TO_GAMMACONV";

    throw cms::Exception("InconsistentReference",
                         err.c_str() );
  }

  conversionRef_ = ref;
}
void reco::PFCandidate::setDeltaP ( double  dp) [inline]

set uncertainty on momentum

Definition at line 231 of file PFCandidate.h.

References deltaP_.

{deltaP_ = dp;}
void PFCandidate::setDisplacedVertexRef ( const reco::PFDisplacedVertexRef ref,
Flags  flag 
)

set displaced vertex reference

Definition at line 202 of file PFCandidate.cc.

References displacedVertexDaughterRef_, displacedVertexMotherRef_, Exception, flag(), h, particleId_, T_FROM_DISP, and T_TO_DISP.

                                                                                       {

  if( particleId_ != h ) {
    string err;
    err += "PFCandidate::setDisplacedVertexRef: this is not a hadron! particleId_=";
    char num[4];
    sprintf( num, "%d", particleId_);
    err += num;

    throw cms::Exception("InconsistentReference",
                         err.c_str() );
  }
  else if(  !flag( T_FROM_DISP ) && !flag( T_TO_DISP ) ) {
    string err;
    err += "PFCandidate::setDisplacedVertexRef: particule flag is neither T_FROM_DISP nor T_TO_DISP";

    throw cms::Exception("InconsistentReference",
                         err.c_str() );
  }

  if (type == T_TO_DISP && flag( T_TO_DISP )) displacedVertexDaughterRef_ = ref; 
  else if (type == T_FROM_DISP && flag( T_FROM_DISP )) displacedVertexMotherRef_ = ref; 
  else if ( (type == T_FROM_DISP && !flag( T_FROM_DISP )) 
            || 
            (type == T_TO_DISP && !flag( T_TO_DISP )) ){
    string err;
    err += "PFCandidate::setDisplacedVertexRef: particule flag is not switched on";

    throw cms::Exception("InconsistentReference",
                         err.c_str() );
  }

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

set corrected Ecal energy

Definition at line 183 of file PFCandidate.h.

References ecalEnergy_.

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

{ecalEnergy_ = ee;}
void PFCandidate::setFlag ( Flags  theFlag,
bool  value 
)

set a given flag

Definition at line 267 of file PFCandidate.cc.

References flags_.

Referenced by PFConversionAlgo::setCandidates().

                                                   {
  
  if(value)
    flags_ = flags_ | (1<<theFlag);
  else 
    flags_ = flags_ ^ (1<<theFlag);
}
void reco::PFCandidate::setFlag ( unsigned  shift,
unsigned  flag,
bool  value 
) [private]
void reco::PFCandidate::setGsfElectronRef ( const reco::GsfElectronRef ref) [inline]

set GsfElectronRef

Definition at line 204 of file PFCandidate.h.

References gsfElectronRef_.

{gsfElectronRef_ = ref; }
void PFCandidate::setGsfTrackRef ( const reco::GsfTrackRef ref)

set gsftrack reference

Definition at line 150 of file PFCandidate.cc.

References e, Exception, gsfTrackRef_, and particleId_.

Referenced by PFElectronAlgo::SetCandidates().

                                                           {
  if( particleId_ != e ) {
    string err;
    err += "PFCandidate::setGsfTrackRef: this is not an electron ! particleId_=";
    char num[4];
    sprintf( num, "%d", particleId_);
    err += num;

    throw cms::Exception("InconsistentReference",
                         err.c_str() );
  }
  gsfTrackRef_ = ref;
}
void reco::PFCandidate::setHcalEnergy ( float  eh) [inline]

set corrected Hcal energy

Definition at line 189 of file PFCandidate.h.

References hcalEnergy_.

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

{hcalEnergy_ = eh;}
void PFCandidate::setMuonRef ( const reco::MuonRef ref)

set muon reference

Definition at line 164 of file PFCandidate.cc.

References Exception, muonRef_, and trackRef_.

                                                   {

  if(  trackRef_ != ref->track() ) {
    string err;
    err += "PFCandidate::setMuonRef: inconsistent track references!";
    
    throw cms::Exception("InconsistentReference",
                         err.c_str() );
  }
    
  muonRef_ = ref;
}
void PFCandidate::setParticleType ( ParticleType  type)
void reco::PFCandidate::setPFElectronExtraRef ( const reco::PFCandidateElectronExtraRef ref) [inline]

set the PF Electron Extra Ref

Definition at line 288 of file PFCandidate.h.

References pfElectronExtraRef_.

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

set position at ECAL entrance

Definition at line 283 of file PFCandidate.h.

References pos, and positionAtECALEntrance_.

Referenced by PFElectronAlgo::SetCandidates().

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

set corrected PS1 energy

Definition at line 210 of file PFCandidate.h.

References ps1Energy_.

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

{ps1Energy_ = e1;}
void reco::PFCandidate::setPs2Energy ( float  e2) [inline]

set corrected PS2 energy

Definition at line 216 of file PFCandidate.h.

References ps2Energy_.

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

{ps2Energy_ = e2;}
void reco::PFCandidate::setRawEcalEnergy ( float  ee) [inline]

set corrected Ecal energy

Definition at line 195 of file PFCandidate.h.

References rawEcalEnergy_.

Referenced by PFAlgoTestBenchElectrons::processBlock(), and PFElectronAlgo::SetCandidates().

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

set corrected Hcal energy

Definition at line 201 of file PFCandidate.h.

References rawHcalEnergy_.

Referenced by PFAlgoTestBenchElectrons::processBlock().

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

Definition at line 103 of file PFCandidate.h.

References sourcePtr_.

{ sourcePtr_ = ptr; }
void PFCandidate::setTrackRef ( const reco::TrackRef ref)

set track reference

Definition at line 134 of file PFCandidate.cc.

References reco::LeafCandidate::charge(), Exception, particleId_, and trackRef_.

Referenced by PFElectronAlgo::SetCandidates().

                                                     {
  if(!charge()) {
    string err;
    err += "PFCandidate::setTrackRef: this is a neutral candidate! ";
    err += "particleId_=";
    char num[4];
    sprintf( num, "%d", particleId_);
    err += num;
    
    throw cms::Exception("InconsistentReference",
                         err.c_str() );
  }

  trackRef_ = ref;
}
void PFCandidate::setV0Ref ( const reco::VertexCompositeCandidateRef ref)

set ref to original reco conversion

Definition at line 237 of file PFCandidate.cc.

References v0Ref_.

                                                                     {

  v0Ref_ = ref;

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

return a Ptr to one of the source Candidates ( the candidates used to construct this Candidate)

Reimplemented from reco::LeafCandidate.

Definition at line 109 of file PFCandidate.h.

References sourcePtr_.

Referenced by overlap().

                                                         {
      return sourcePtr_;
    }
reco::SuperClusterRef reco::PFCandidate::superClusterRef ( ) const [inline]

return a reference to the corresponding SuperCluster if any

Definition at line 177 of file PFCandidate.h.

References superClusterRef_.

{return superClusterRef_;} 
reco::TrackRef reco::PFCandidate::trackRef ( ) const [inline]
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 110 of file PFCandidate.cc.

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

Referenced by PFCandidate(), and setParticleType().

                                                               {
  
  int thecharge = charge();

  switch( type ) {
  case h:     return thecharge*211; // pi+
  case e:     return thecharge*(-11);
  case mu:    return thecharge*(-13);
  case gamma: return 22;
  case h0:    return 130; // K_L0
  case h_HF:         return 130; // dummy pdg code 
  case egamma_HF:    return 22;  // dummy pdg code
  case X: 
  default:    return 0;  
  }
}
reco::VertexCompositeCandidateRef reco::PFCandidate::v0Ref ( ) const [inline]

return a reference to the original conversion

Definition at line 171 of file PFCandidate.h.

References v0Ref_.

{ return v0Ref_; }

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 320 of file PFCandidate.h.

Definition at line 353 of file PFCandidate.h.

Referenced by conversionRef(), and setConversionRef().

double reco::PFCandidate::deltaP_ [private]

uncertainty on 3-momentum

Definition at line 377 of file PFCandidate.h.

Referenced by deltaP(), and setDeltaP().

reference to the corresponding pf displaced vertex which this track was created

Definition at line 405 of file PFCandidate.h.

Referenced by displacedVertexRef(), and setDisplacedVertexRef().

reference to the corresponding pf displaced vertex where this track was created

Definition at line 402 of file PFCandidate.h.

Referenced by displacedVertexRef(), and setDisplacedVertexRef().

corrected ECAL energy

Definition at line 356 of file PFCandidate.h.

Referenced by ecalEnergy(), and setEcalEnergy().

Definition at line 337 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 374 of file PFCandidate.h.

Referenced by flag(), and setFlag().

Definition at line 412 of file PFCandidate.h.

Referenced by gsfElectronRef(), and setGsfElectronRef().

Definition at line 345 of file PFCandidate.h.

Referenced by gsfTrackRef(), and setGsfTrackRef().

corrected HCAL energy

Definition at line 359 of file PFCandidate.h.

Referenced by hcalEnergy(), and setHcalEnergy().

Definition at line 347 of file PFCandidate.h.

Referenced by muonRef(), and setMuonRef().

mva for electron-muon discrimination

Definition at line 383 of file PFCandidate.h.

Referenced by mva_e_mu(), and set_mva_e_mu().

mva for electron-pion discrimination

Definition at line 380 of file PFCandidate.h.

Referenced by mva_e_pi(), and set_mva_e_pi().

mva for neutral hadron - gamma discrimination

Definition at line 395 of file PFCandidate.h.

Referenced by mva_gamma_nh(), and set_mva_gamma_nh().

mva for gamma detection

Definition at line 389 of file PFCandidate.h.

Referenced by mva_nothing_gamma(), and set_mva_nothing_gamma().

mva for neutral hadron detection

Definition at line 392 of file PFCandidate.h.

Referenced by mva_nothing_nh(), and set_mva_nothing_nh().

mva for pi-muon discrimination

Definition at line 386 of file PFCandidate.h.

Referenced by mva_pi_mu(), and set_mva_pi_mu().

Definition at line 350 of file PFCandidate.h.

particle identification

Definition at line 334 of file PFCandidate.h.

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

Definition at line 418 of file PFCandidate.h.

Referenced by electronExtraRef(), and setPFElectronExtraRef().

position at ECAL entrance, from the PFRecTrack

Definition at line 398 of file PFCandidate.h.

Referenced by positionAtECALEntrance(), and setPositionAtECALEntrance().

corrected PS1 energy

Definition at line 368 of file PFCandidate.h.

Referenced by pS1Energy(), and setPs1Energy().

corrected PS2 energy

Definition at line 371 of file PFCandidate.h.

Referenced by pS2Energy(), and setPs2Energy().

raw ECAL energy

Definition at line 362 of file PFCandidate.h.

Referenced by rawEcalEnergy(), and setRawEcalEnergy().

raw HCAL energy

Definition at line 365 of file PFCandidate.h.

Referenced by rawHcalEnergy(), and setRawHcalEnergy().

reference to the source PFCandidate, if any

Definition at line 341 of file PFCandidate.h.

Referenced by overlap(), PFCandidate(), setSourceCandidatePtr(), and sourceCandidatePtr().

Definition at line 415 of file PFCandidate.h.

Referenced by superClusterRef().

Definition at line 343 of file PFCandidate.h.

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

Definition at line 409 of file PFCandidate.h.

Referenced by setV0Ref(), and v0Ref().