CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

reco::PFCandidateElectronExtra Class Reference

#include <PFCandidateElectronExtra.h>

List of all members.

Public Types

enum  MvaVariable {
  MVA_FIRST = 0, MVA_LnPtGsf = MVA_FIRST, MVA_EtaGsf, MVA_SigmaPtOverPt,
  MVA_Fbrem, MVA_Chi2Gsf, MVA_NhitsKf, MVA_Chi2Kf,
  MVA_EtotOverPin, MVA_EseedOverPout, MVA_EbremOverDeltaP, MVA_DeltaEtaTrackCluster,
  MVA_LogSigmaEtaEta, MVA_HOverHE, MVA_LateBrem, MVA_FirstBrem,
  MVA_MVA, MVA_LAST
}
enum  StatusFlag {
  X = 0, Selected, ECALDrivenPreselected, MVASelected,
  Rejected
}

Public Member Functions

bool electronStatus (StatusFlag) const
 access to the status
int electronStatus () const
 access to the status
reco::GsfTrackRef gsfTrackRef () const
 return a reference to the corresponding GSF track
float hadEnergy () const
 access to specific variables
reco::TrackRef kfTrackRef () const
 return a reference to the corresponding KF track
bool mvaStatus (MvaVariable flag) const
 access to mva variable status
float mvaVariable (MvaVariable var) const
 access to any variable
const std::vector< float > & mvaVariables () const
 access to the mva variables
 PFCandidateElectronExtra (const GsfTrackRef &)
 constructor
 PFCandidateElectronExtra ()
 constructor
void setClusterEnergies (const std::vector< float > &energies)
 set the cluster energies. the Pout should be saved first
void setDeltaEta (float val)
 set the delta eta
void setEarlyBrem (float val)
 set EarlyBrem
void setGsfTrackPout (const math::XYZTLorentzVector &pout)
 set the pout (not trivial to get from the GSF track)
void setGsfTrackRef (const reco::GsfTrackRef &ref)
 set gsftrack reference
void setHadEnergy (float val)
 set the had energy. The cluster energies should be entered before
void setKfTrackRef (const reco::TrackRef &ref)
 set kf track reference
void setLateBrem (float val)
 set LateBrem
void setMVA (float val)
 set the result (mostly for debugging)
void setSigmaEtaEta (float val)
 set the sigmaetaeta
void setStatus (StatusFlag type, bool status=true)
 set status
float sigmaEtaEta () const
 ~PFCandidateElectronExtra ()
 destructor

Private Member Functions

void setVariable (MvaVariable type, float var)

Private Attributes

std::vector< float > clusterEnergies_
 energy of individual clusters (corrected). The first cluster is the seed
float deltaEta_
float earlyBrem_
reco::GsfTrackRef gsfTrackRef_
 Ref to the GSF track.
float hadEnergy_
reco::TrackRef kfTrackRef_
 Ref to the KF track.
float lateBrem_
int mvaStatus_
 status of mva variables
std::vector< float > mvaVariables_
 mva variables - transient !
math::XYZTLorentzVector pout_
 Variables entering the MVA that should be saved.
float sigmaEtaEta_
int status_
 Status of the electron.

Detailed Description

extra information on the electron particle candidate from particle flow

Definition at line 16 of file PFCandidateElectronExtra.h.


Member Enumeration Documentation

Enumerator:
MVA_FIRST 
MVA_LnPtGsf 
MVA_EtaGsf 
MVA_SigmaPtOverPt 
MVA_Fbrem 
MVA_Chi2Gsf 
MVA_NhitsKf 
MVA_Chi2Kf 
MVA_EtotOverPin 
MVA_EseedOverPout 
MVA_EbremOverDeltaP 
MVA_DeltaEtaTrackCluster 
MVA_LogSigmaEtaEta 
MVA_HOverHE 
MVA_LateBrem 
MVA_FirstBrem 
MVA_MVA 
MVA_LAST 

Definition at line 27 of file PFCandidateElectronExtra.h.

Enumerator:
X 
Selected 
ECALDrivenPreselected 
MVASelected 
Rejected 

Definition at line 18 of file PFCandidateElectronExtra.h.

                    {
      X=0,                            // undefined
      Selected,                       // selected 
      ECALDrivenPreselected,          // ECAL-driven electron pre-selected
      MVASelected,                    // Passed the internal particle-flow selection (mva selection)
      Rejected                        // Rejected 
    };

Constructor & Destructor Documentation

PFCandidateElectronExtra::PFCandidateElectronExtra ( )
PFCandidateElectronExtra::PFCandidateElectronExtra ( const GsfTrackRef gsfTrack)
reco::PFCandidateElectronExtra::~PFCandidateElectronExtra ( ) [inline]

destructor

Definition at line 55 of file PFCandidateElectronExtra.h.

{;}

Member Function Documentation

bool PFCandidateElectronExtra::electronStatus ( StatusFlag  flag) const

access to the status

Definition at line 144 of file PFCandidateElectronExtra.cc.

References status_.

                                                                   {
  return status_ & (1<<flag) ;
}
int reco::PFCandidateElectronExtra::electronStatus ( ) const [inline]

access to the status

Definition at line 99 of file PFCandidateElectronExtra.h.

References status_.

{return status_;}
reco::GsfTrackRef reco::PFCandidateElectronExtra::gsfTrackRef ( ) const [inline]

return a reference to the corresponding GSF track

Definition at line 64 of file PFCandidateElectronExtra.h.

References gsfTrackRef_.

Referenced by PFElectronExtraEqual::operator()().

{ return gsfTrackRef_; }     
float reco::PFCandidateElectronExtra::hadEnergy ( ) const [inline]

access to specific variables

Definition at line 111 of file PFCandidateElectronExtra.h.

References hadEnergy_.

{return hadEnergy_;}
reco::TrackRef reco::PFCandidateElectronExtra::kfTrackRef ( ) const [inline]

return a reference to the corresponding KF track

Definition at line 67 of file PFCandidateElectronExtra.h.

References kfTrackRef_.

Referenced by PFElectronExtraKfEqual::operator()().

{ return kfTrackRef_; }     
bool PFCandidateElectronExtra::mvaStatus ( MvaVariable  flag) const

access to mva variable status

Definition at line 148 of file PFCandidateElectronExtra.cc.

References mvaStatus_.

Referenced by mvaVariable(), and reco::operator<<().

                                                               {
  return mvaStatus_ & (1<< (flag)) ;
}
float PFCandidateElectronExtra::mvaVariable ( MvaVariable  var) const

access to any variable

Definition at line 152 of file PFCandidateElectronExtra.cc.

References mvaStatus(), and mvaVariables_.

Referenced by reco::operator<<().

                                                                 {
  return (mvaStatus(var) ? mvaVariables_[var] : -9999. );
}
const std::vector<float>& reco::PFCandidateElectronExtra::mvaVariables ( ) const [inline]

access to the mva variables

Definition at line 105 of file PFCandidateElectronExtra.h.

References mvaVariables_.

{return mvaVariables_;}
void PFCandidateElectronExtra::setClusterEnergies ( const std::vector< float > &  energies)

set the cluster energies. the Pout should be saved first

Definition at line 96 of file PFCandidateElectronExtra.cc.

References clusterEnergies_, gsfTrackRef_, hadEnergy_, MVA_EbremOverDeltaP, MVA_EseedOverPout, MVA_EtotOverPin, pout_, setHadEnergy(), setVariable(), findQualityFiles::size, and mathSSE::sqrt().

                                                                                 {
  clusterEnergies_=energies;

  if(pout_.t()!=0.)
    setVariable(MVA_EseedOverPout,clusterEnergies_[0]/pout_.t());
 
  static float m_el2=0.00051*0.00051;
  float Ein_gsf =sqrt(gsfTrackRef_->pMode()*
                      gsfTrackRef_->pMode()+m_el2);
  
  float etot=0;
  unsigned size=clusterEnergies_.size();
  //  std::cout << " N clusters "  << size << std::endl;
  float ebrem=0.;
  for(unsigned ic=0;ic<size;++ic) {    
    etot+=clusterEnergies_[ic];
    if(ic>0)
      ebrem+=clusterEnergies_[ic];
  }
  setVariable(MVA_EtotOverPin,etot/Ein_gsf);
  setVariable(MVA_EbremOverDeltaP,ebrem/(Ein_gsf-pout_.t()));  

  // recompute - as in PFElectronAglo, the had energy is filled before the cluster energies
  if(hadEnergy_!=-9999.)
    setHadEnergy(hadEnergy_);

}
void PFCandidateElectronExtra::setDeltaEta ( float  val)

set the delta eta

Definition at line 90 of file PFCandidateElectronExtra.cc.

References deltaEta_, MVA_DeltaEtaTrackCluster, and setVariable().

Referenced by PFElectronAlgo::SetIDOutputs().

void PFCandidateElectronExtra::setEarlyBrem ( float  val)

set EarlyBrem

Definition at line 74 of file PFCandidateElectronExtra.cc.

References earlyBrem_, MVA_FirstBrem, and setVariable().

Referenced by PFElectronAlgo::SetIDOutputs().

void PFCandidateElectronExtra::setGsfTrackPout ( const math::XYZTLorentzVector pout)

set the pout (not trivial to get from the GSF track)

Definition at line 51 of file PFCandidateElectronExtra.cc.

References pout_.

Referenced by PFElectronAlgo::SetIDOutputs().

                                                                                {
  pout_ = pout;
  
}
void PFCandidateElectronExtra::setGsfTrackRef ( const reco::GsfTrackRef ref)

set gsftrack reference

Definition at line 47 of file PFCandidateElectronExtra.cc.

References gsfTrackRef_.

                                                                        {
  gsfTrackRef_= ref;
}   
void PFCandidateElectronExtra::setHadEnergy ( float  val)

set the had energy. The cluster energies should be entered before

Definition at line 79 of file PFCandidateElectronExtra.cc.

References clusterEnergies_, hadEnergy_, MVA_HOverHE, and setVariable().

Referenced by setClusterEnergies(), and PFElectronAlgo::SetIDOutputs().

void PFCandidateElectronExtra::setKfTrackRef ( const reco::TrackRef ref)

set kf track reference

Definition at line 56 of file PFCandidateElectronExtra.cc.

References edm::Ref< C, T, F >::isNonnull(), kfTrackRef_, MVA_Chi2Kf, MVA_NhitsKf, and setVariable().

Referenced by PFElectronAlgo::SetIDOutputs().

                                                                    {
  kfTrackRef_ = ref;
  float nhit_kf=0;
  float chi2_kf=-0.01;
  // if the reference is null, it does not mean that the variables have not been set
  if(kfTrackRef_.isNonnull()) {
    nhit_kf=(float)kfTrackRef_->hitPattern().trackerLayersWithMeasurement();
    chi2_kf=kfTrackRef_->normalizedChi2();
  }
  setVariable(MVA_NhitsKf,nhit_kf);
  setVariable(MVA_Chi2Kf,chi2_kf);
}
void PFCandidateElectronExtra::setLateBrem ( float  val)

set LateBrem

Definition at line 69 of file PFCandidateElectronExtra.cc.

References lateBrem_, MVA_LateBrem, and setVariable().

Referenced by PFElectronAlgo::SetIDOutputs().

void PFCandidateElectronExtra::setMVA ( float  val)

set the result (mostly for debugging)

Definition at line 124 of file PFCandidateElectronExtra.cc.

References MVA_MVA, and setVariable().

Referenced by PFElectronAlgo::SetIDOutputs().

                                               {
  setVariable(MVA_MVA,val);
}
void PFCandidateElectronExtra::setSigmaEtaEta ( float  val)

set the sigmaetaeta

Definition at line 85 of file PFCandidateElectronExtra.cc.

References MVA_LogSigmaEtaEta, setVariable(), and sigmaEtaEta_.

Referenced by PFElectronAlgo::SetIDOutputs().

void PFCandidateElectronExtra::setStatus ( StatusFlag  type,
bool  status = true 
)

set status

Definition at line 135 of file PFCandidateElectronExtra.cc.

References status_.

                                                                   {
  if(status)     {
    status_ |= (1 << type);
  }
  else     {
    status_ &= ~(1 <<type);
  }
}
void PFCandidateElectronExtra::setVariable ( MvaVariable  type,
float  var 
) [private]
float reco::PFCandidateElectronExtra::sigmaEtaEta ( ) const [inline]

Definition at line 112 of file PFCandidateElectronExtra.h.

References sigmaEtaEta_.

{return sigmaEtaEta_;}

Member Data Documentation

energy of individual clusters (corrected). The first cluster is the seed

Definition at line 125 of file PFCandidateElectronExtra.h.

Referenced by setClusterEnergies(), and setHadEnergy().

Definition at line 142 of file PFCandidateElectronExtra.h.

Referenced by setDeltaEta().

Definition at line 138 of file PFCandidateElectronExtra.h.

Referenced by setEarlyBrem().

Ref to the GSF track.

Definition at line 120 of file PFCandidateElectronExtra.h.

Referenced by gsfTrackRef(), PFCandidateElectronExtra(), setClusterEnergies(), and setGsfTrackRef().

Ref to the KF track.

Definition at line 122 of file PFCandidateElectronExtra.h.

Referenced by kfTrackRef(), PFCandidateElectronExtra(), and setKfTrackRef().

Definition at line 139 of file PFCandidateElectronExtra.h.

Referenced by setLateBrem().

status of mva variables

Definition at line 131 of file PFCandidateElectronExtra.h.

Referenced by mvaStatus(), PFCandidateElectronExtra(), and setVariable().

std::vector<float> reco::PFCandidateElectronExtra::mvaVariables_ [private]

mva variables - transient !

Definition at line 128 of file PFCandidateElectronExtra.h.

Referenced by mvaVariable(), mvaVariables(), PFCandidateElectronExtra(), and setVariable().

Variables entering the MVA that should be saved.

Definition at line 137 of file PFCandidateElectronExtra.h.

Referenced by PFCandidateElectronExtra(), setClusterEnergies(), and setGsfTrackPout().

Status of the electron.

Definition at line 134 of file PFCandidateElectronExtra.h.

Referenced by electronStatus(), PFCandidateElectronExtra(), and setStatus().