CMS 3D CMS Logo

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

reco::PFCandidateEGammaExtra Class Reference

#include <PFCandidateEGammaExtra.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

void addConversionRef (const reco::ConversionRef &convref)
 add Conversions from PF
void addSingleLegConvMva (float &mvasingleleg)
 add Single Leg Conversion mva
void addSingleLegConvTrackRef (const reco::TrackRef &trackref)
 add Single Leg Conversion TrackRef
reco::ConversionRefVector conversionRef () const
 return Conversions from PF
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
 PFCandidateEGammaExtra (const GsfTrackRef &)
 constructor
 PFCandidateEGammaExtra ()
 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
void setSuperClusterBoxRef (reco::SuperClusterRef sc)
 set reference to the corresponding supercluster
void setSuperClusterRef (reco::SuperClusterRef sc)
 set reference to the corresponding supercluster
float sigmaEtaEta () const
const std::vector< float > & singleLegConvMva () const
 return Single Leg Conversion mva
const std::vector
< reco::TrackRef > & 
singleLegConvTrackRef () const
 return vector of Single Leg Conversion TrackRef from
reco::SuperClusterRef superClusterBoxRef () const
 return a reference to the corresponding box supercluster
reco::SuperClusterRef superClusterRef () const
 return a reference to the corresponding supercluster
 ~PFCandidateEGammaExtra ()
 destructor

Private Member Functions

void setVariable (MvaVariable type, float var)

Private Attributes

reco::ConversionRefVector assoConversionsRef_
 vector of ConversionRef from PF
std::vector< float > assoSingleLegMva_
 vector of Mvas from Single Leg conversions
std::vector< reco::TrackRefassoSingleLegRefTrack_
 vector of TrackRef from Single Leg conversions
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.
reco::SuperClusterRef scBoxRef_
 Ref to box supercluster.
reco::SuperClusterRef scRef_
 Ref to (refined) supercluster.
float sigmaEtaEta_
int status_
 Status of the electron.

Detailed Description

extra information on the photon/electron particle candidate from particle flow

Definition at line 18 of file PFCandidateEGammaExtra.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 29 of file PFCandidateEGammaExtra.h.

Enumerator:
X 
Selected 
ECALDrivenPreselected 
MVASelected 
Rejected 

Definition at line 20 of file PFCandidateEGammaExtra.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

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

destructor

Definition at line 57 of file PFCandidateEGammaExtra.h.

{;}

Member Function Documentation

void PFCandidateEGammaExtra::addConversionRef ( const reco::ConversionRef convref)

add Conversions from PF

Definition at line 164 of file PFCandidateEGammaExtra.cc.

References assoConversionsRef_, and edm::RefVector< C, T, F >::push_back().

Referenced by PFEGammaAlgo::RunPFEG().

void PFCandidateEGammaExtra::addSingleLegConvMva ( float &  mvasingleleg)

add Single Leg Conversion mva

Definition at line 160 of file PFCandidateEGammaExtra.cc.

References assoSingleLegMva_.

Referenced by PFEGammaAlgo::RunPFEG().

                                                                   {
  assoSingleLegMva_.push_back(mvasingleleg);
}
void PFCandidateEGammaExtra::addSingleLegConvTrackRef ( const reco::TrackRef trackref)

add Single Leg Conversion TrackRef

Definition at line 156 of file PFCandidateEGammaExtra.cc.

References assoSingleLegRefTrack_.

Referenced by PFEGammaAlgo::RunPFEG().

                                                                                 {
  assoSingleLegRefTrack_.push_back(trackref);
}
reco::ConversionRefVector reco::PFCandidateEGammaExtra::conversionRef ( ) const [inline]

return Conversions from PF

Definition at line 99 of file PFCandidateEGammaExtra.h.

References assoConversionsRef_.

bool PFCandidateEGammaExtra::electronStatus ( StatusFlag  flag) const

access to the status

Definition at line 144 of file PFCandidateEGammaExtra.cc.

References status_.

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

access to the status

Definition at line 131 of file PFCandidateEGammaExtra.h.

References status_.

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

return a reference to the corresponding GSF track

Definition at line 66 of file PFCandidateEGammaExtra.h.

References gsfTrackRef_.

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

access to specific variables

Definition at line 143 of file PFCandidateEGammaExtra.h.

References hadEnergy_.

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

return a reference to the corresponding KF track

Definition at line 69 of file PFCandidateEGammaExtra.h.

References kfTrackRef_.

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

access to mva variable status

Definition at line 148 of file PFCandidateEGammaExtra.cc.

References mvaStatus_.

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

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

access to any variable

Definition at line 152 of file PFCandidateEGammaExtra.cc.

References mvaStatus(), and mvaVariables_.

Referenced by reco::operator<<().

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

access to the mva variables

Definition at line 137 of file PFCandidateEGammaExtra.h.

References mvaVariables_.

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

set the cluster energies. the Pout should be saved first

Definition at line 96 of file PFCandidateEGammaExtra.cc.

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

Referenced by PFEGammaAlgo::AddElectronCandidate().

                                                                               {
  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 PFCandidateEGammaExtra::setDeltaEta ( float  val)

set the delta eta

Definition at line 90 of file PFCandidateEGammaExtra.cc.

References deltaEta_, MVA_DeltaEtaTrackCluster, and setVariable().

void PFCandidateEGammaExtra::setEarlyBrem ( float  val)

set EarlyBrem

Definition at line 74 of file PFCandidateEGammaExtra.cc.

References earlyBrem_, MVA_FirstBrem, and setVariable().

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

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

Definition at line 51 of file PFCandidateEGammaExtra.cc.

References pout_.

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

set gsftrack reference

Definition at line 47 of file PFCandidateEGammaExtra.cc.

References gsfTrackRef_.

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

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

Definition at line 79 of file PFCandidateEGammaExtra.cc.

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

Referenced by setClusterEnergies().

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

set kf track reference

Definition at line 56 of file PFCandidateEGammaExtra.cc.

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

                                                                  {
  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 PFCandidateEGammaExtra::setLateBrem ( float  val)

set LateBrem

Definition at line 69 of file PFCandidateEGammaExtra.cc.

References lateBrem_, MVA_LateBrem, and setVariable().

void PFCandidateEGammaExtra::setMVA ( float  val)

set the result (mostly for debugging)

Definition at line 124 of file PFCandidateEGammaExtra.cc.

References MVA_MVA, and setVariable().

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

set the sigmaetaeta

Definition at line 85 of file PFCandidateEGammaExtra.cc.

References MVA_LogSigmaEtaEta, setVariable(), and sigmaEtaEta_.

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

set status

Definition at line 135 of file PFCandidateEGammaExtra.cc.

References status_.

Referenced by PFEGammaAlgo::AddElectronCandidate().

                                                                 {
  if(status)     {
    status_ |= (1 << type);
  }
  else     {
    status_ &= ~(1 <<type);
  }
}
void reco::PFCandidateEGammaExtra::setSuperClusterBoxRef ( reco::SuperClusterRef  sc) [inline]

set reference to the corresponding supercluster

Definition at line 81 of file PFCandidateEGammaExtra.h.

References scBoxRef_.

Referenced by PFEGammaAlgo::AddElectronCandidate(), and PFEGammaAlgo::RunPFEG().

{ scBoxRef_ = sc; }   
void reco::PFCandidateEGammaExtra::setSuperClusterRef ( reco::SuperClusterRef  sc) [inline]

set reference to the corresponding supercluster

Definition at line 78 of file PFCandidateEGammaExtra.h.

References scRef_.

Referenced by PFEGammaProducer::produce().

{ scRef_ = sc; }
void PFCandidateEGammaExtra::setVariable ( MvaVariable  type,
float  var 
) [private]
float reco::PFCandidateEGammaExtra::sigmaEtaEta ( ) const [inline]

Definition at line 144 of file PFCandidateEGammaExtra.h.

References sigmaEtaEta_.

{return sigmaEtaEta_;}
const std::vector<float>& reco::PFCandidateEGammaExtra::singleLegConvMva ( ) const [inline]

return Single Leg Conversion mva

Definition at line 93 of file PFCandidateEGammaExtra.h.

References assoSingleLegMva_.

const std::vector<reco::TrackRef>& reco::PFCandidateEGammaExtra::singleLegConvTrackRef ( ) const [inline]

return vector of Single Leg Conversion TrackRef from

Definition at line 87 of file PFCandidateEGammaExtra.h.

References assoSingleLegRefTrack_.

reco::SuperClusterRef reco::PFCandidateEGammaExtra::superClusterBoxRef ( ) const [inline]

return a reference to the corresponding box supercluster

Definition at line 75 of file PFCandidateEGammaExtra.h.

References scBoxRef_.

{return scBoxRef_ ; }    
reco::SuperClusterRef reco::PFCandidateEGammaExtra::superClusterRef ( ) const [inline]

return a reference to the corresponding supercluster

Definition at line 72 of file PFCandidateEGammaExtra.h.

References scRef_.

{return scRef_ ; }

Member Data Documentation

vector of ConversionRef from PF

Definition at line 169 of file PFCandidateEGammaExtra.h.

Referenced by addConversionRef(), and conversionRef().

vector of Mvas from Single Leg conversions

Definition at line 166 of file PFCandidateEGammaExtra.h.

Referenced by addSingleLegConvMva(), and singleLegConvMva().

vector of TrackRef from Single Leg conversions

Definition at line 163 of file PFCandidateEGammaExtra.h.

Referenced by addSingleLegConvTrackRef(), and singleLegConvTrackRef().

std::vector<float> reco::PFCandidateEGammaExtra::clusterEnergies_ [private]

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

Definition at line 172 of file PFCandidateEGammaExtra.h.

Referenced by setClusterEnergies(), and setHadEnergy().

Definition at line 189 of file PFCandidateEGammaExtra.h.

Referenced by setDeltaEta().

Definition at line 185 of file PFCandidateEGammaExtra.h.

Referenced by setEarlyBrem().

Ref to the GSF track.

Definition at line 152 of file PFCandidateEGammaExtra.h.

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

Ref to the KF track.

Definition at line 154 of file PFCandidateEGammaExtra.h.

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

Definition at line 186 of file PFCandidateEGammaExtra.h.

Referenced by setLateBrem().

status of mva variables

Definition at line 178 of file PFCandidateEGammaExtra.h.

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

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

mva variables - transient !

Definition at line 175 of file PFCandidateEGammaExtra.h.

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

Variables entering the MVA that should be saved.

Definition at line 184 of file PFCandidateEGammaExtra.h.

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

Ref to box supercluster.

Definition at line 160 of file PFCandidateEGammaExtra.h.

Referenced by setSuperClusterBoxRef(), and superClusterBoxRef().

Ref to (refined) supercluster.

Definition at line 157 of file PFCandidateEGammaExtra.h.

Referenced by setSuperClusterRef(), and superClusterRef().

Definition at line 187 of file PFCandidateEGammaExtra.h.

Referenced by PFCandidateEGammaExtra(), setSigmaEtaEta(), and sigmaEtaEta().

Status of the electron.

Definition at line 181 of file PFCandidateEGammaExtra.h.

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