CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
reco::PFCandidateElectronExtra Class Reference

#include <PFCandidateElectronExtra.h>

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

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 More...
 
float deltaEta_
 
float earlyBrem_
 
reco::GsfTrackRef gsfTrackRef_
 Ref to the GSF track. More...
 
float hadEnergy_
 
reco::TrackRef kfTrackRef_
 Ref to the KF track. More...
 
float lateBrem_
 
int mvaStatus_
 status of mva variables More...
 
std::vector< float > mvaVariables_
 mva variables - transient ! More...
 
math::XYZTLorentzVector pout_
 Variables entering the MVA that should be saved. More...
 
float sigmaEtaEta_
 
int status_
 Status of the electron. More...
 

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.

27  {
28  MVA_FIRST=0,
30  MVA_EtaGsf,
32  MVA_Fbrem,
35  MVA_Chi2Kf,
44  MVA_MVA,
45  MVA_LAST
46  };
Enumerator
X 
Selected 
ECALDrivenPreselected 
MVASelected 
Rejected 

Definition at line 18 of file PFCandidateElectronExtra.h.

Constructor & Destructor Documentation

PFCandidateElectronExtra::PFCandidateElectronExtra ( )

constructor

Definition at line 8 of file PFCandidateElectronExtra.cc.

References gsfTrackRef_, hadEnergy_, kfTrackRef_, m, MVA_FIRST, MVA_LAST, mvaStatus_, mvaVariables_, pout_, sigmaEtaEta_, and status_.

8  {
9  status_ = 0;
10  mvaStatus_ = 0;
11  pout_ = math::XYZTLorentzVector(0.,0.,0.,0.);
12  hadEnergy_ = -9999. ;
13  sigmaEtaEta_ = -9999.;
14 
16  mvaVariables_.push_back(-9999.);
17 
20 }
edm::Ref< GsfTrackCollection > GsfTrackRef
persistent reference to a GsfTrack
Definition: GsfTrackFwd.h:13
math::XYZTLorentzVector pout_
Variables entering the MVA that should be saved.
int mvaStatus_
status of mva variables
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
reco::TrackRef kfTrackRef_
Ref to the KF track.
reco::GsfTrackRef gsfTrackRef_
Ref to the GSF track.
int status_
Status of the electron.
std::vector< float > mvaVariables_
mva variables - transient !
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:14
PFCandidateElectronExtra::PFCandidateElectronExtra ( const GsfTrackRef gsfTrack)

constructor

Definition at line 22 of file PFCandidateElectronExtra.cc.

References gsfTrackRef_, hadEnergy_, kfTrackRef_, fff_deletion::log, m, MVA_Chi2Gsf, MVA_EtaGsf, MVA_Fbrem, MVA_FIRST, MVA_LAST, MVA_LnPtGsf, MVA_SigmaPtOverPt, mvaStatus_, mvaVariables_, pout_, setVariable(), sigmaEtaEta_, and status_.

22  {
23  status_ = 0;
24  mvaStatus_ = 0;
25  pout_ = math::XYZTLorentzVector(0.,0.,0.,0.);
26  hadEnergy_ = -9999. ;
27  sigmaEtaEta_ = -9999.;
28 
30  mvaVariables_.push_back(-9999.);
31 
32  gsfTrackRef_ = gsfTrack;
34 
37  setVariable(MVA_Chi2Gsf,gsfTrackRef_->normalizedChi2());
38  float ptmodeerror=gsfTrackRef_->ptModeError() ;
39  if(ptmodeerror>0.)
40  setVariable(MVA_SigmaPtOverPt,ptmodeerror/gsfTrackRef_->ptMode());
41  else
43 
44  setVariable(MVA_Fbrem,(gsfTrackRef_->ptMode() - pout_.pt())/gsfTrackRef_->ptMode());
45 }
void setVariable(MvaVariable type, float var)
math::XYZTLorentzVector pout_
Variables entering the MVA that should be saved.
int mvaStatus_
status of mva variables
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
reco::TrackRef kfTrackRef_
Ref to the KF track.
reco::GsfTrackRef gsfTrackRef_
Ref to the GSF track.
int status_
Status of the electron.
std::vector< float > mvaVariables_
mva variables - transient !
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:14
reco::PFCandidateElectronExtra::~PFCandidateElectronExtra ( )
inline

destructor

Definition at line 55 of file PFCandidateElectronExtra.h.

55 {;}

Member Function Documentation

bool PFCandidateElectronExtra::electronStatus ( StatusFlag  flag) const

access to the status

Definition at line 144 of file PFCandidateElectronExtra.cc.

References archive::flag, and status_.

144  {
145  return status_ & (1<<flag) ;
146 }
int status_
Status of the electron.
int reco::PFCandidateElectronExtra::electronStatus ( ) const
inline

access to the status

Definition at line 99 of file PFCandidateElectronExtra.h.

References status_.

99 {return status_;}
int status_
Status of the electron.
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()().

64 { return gsfTrackRef_; }
reco::GsfTrackRef gsfTrackRef_
Ref to the GSF track.
float reco::PFCandidateElectronExtra::hadEnergy ( ) const
inline

access to specific variables

Definition at line 111 of file PFCandidateElectronExtra.h.

References 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()().

67 { return kfTrackRef_; }
reco::TrackRef kfTrackRef_
Ref to the KF track.
bool PFCandidateElectronExtra::mvaStatus ( MvaVariable  flag) const

access to mva variable status

Definition at line 148 of file PFCandidateElectronExtra.cc.

References archive::flag, and mvaStatus_.

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

148  {
149  return mvaStatus_ & (1<< (flag)) ;
150 }
int mvaStatus_
status of mva variables
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<<().

152  {
153  return (mvaStatus(var) ? mvaVariables_[var] : -9999. );
154 }
std::vector< float > mvaVariables_
mva variables - transient !
bool mvaStatus(MvaVariable flag) const
access to mva variable status
const std::vector<float>& reco::PFCandidateElectronExtra::mvaVariables ( ) const
inline

access to the mva variables

Definition at line 105 of file PFCandidateElectronExtra.h.

References mvaVariables_.

105 {return mvaVariables_;}
std::vector< float > mvaVariables_
mva variables - transient !
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().

96  {
97  clusterEnergies_=energies;
98 
99  if(pout_.t()!=0.)
101 
102  const float m_el2=0.00051*0.00051;
103  float Ein_gsf =sqrt(gsfTrackRef_->pMode()*
104  gsfTrackRef_->pMode()+m_el2);
105 
106  float etot=0;
107  unsigned size=clusterEnergies_.size();
108  // std::cout << " N clusters " << size << std::endl;
109  float ebrem=0.;
110  for(unsigned ic=0;ic<size;++ic) {
111  etot+=clusterEnergies_[ic];
112  if(ic>0)
113  ebrem+=clusterEnergies_[ic];
114  }
115  setVariable(MVA_EtotOverPin,etot/Ein_gsf);
116  setVariable(MVA_EbremOverDeltaP,ebrem/(Ein_gsf-pout_.t()));
117 
118  // recompute - as in PFElectronAglo, the had energy is filled before the cluster energies
119  if(hadEnergy_!=-9999.)
121 
122 }
std::vector< float > clusterEnergies_
energy of individual clusters (corrected). The first cluster is the seed
void setVariable(MvaVariable type, float var)
math::XYZTLorentzVector pout_
Variables entering the MVA that should be saved.
T sqrt(T t)
Definition: SSEVec.h:48
reco::GsfTrackRef gsfTrackRef_
Ref to the GSF track.
tuple size
Write out results.
void setHadEnergy(float val)
set the had energy. The cluster energies should be entered before
void PFCandidateElectronExtra::setDeltaEta ( float  val)
void PFCandidateElectronExtra::setEarlyBrem ( float  val)
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().

51  {
52  pout_ = pout;
53 
54 }
math::XYZTLorentzVector pout_
Variables entering the MVA that should be saved.
void PFCandidateElectronExtra::setGsfTrackRef ( const reco::GsfTrackRef ref)

set gsftrack reference

Definition at line 47 of file PFCandidateElectronExtra.cc.

References gsfTrackRef_.

47  {
48  gsfTrackRef_= ref;
49 }
reco::GsfTrackRef gsfTrackRef_
Ref to the GSF track.
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().

79  {
80  hadEnergy_ = val;
81  if(clusterEnergies_.size()>0)
83 }
std::vector< float > clusterEnergies_
energy of individual clusters (corrected). The first cluster is the seed
void setVariable(MvaVariable type, float var)
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().

56  {
57  kfTrackRef_ = ref;
58  float nhit_kf=0;
59  float chi2_kf=-0.01;
60  // if the reference is null, it does not mean that the variables have not been set
61  if(kfTrackRef_.isNonnull()) {
62  nhit_kf=(float)kfTrackRef_->hitPattern().trackerLayersWithMeasurement();
63  chi2_kf=kfTrackRef_->normalizedChi2();
64  }
65  setVariable(MVA_NhitsKf,nhit_kf);
66  setVariable(MVA_Chi2Kf,chi2_kf);
67 }
void setVariable(MvaVariable type, float var)
reco::TrackRef kfTrackRef_
Ref to the KF track.
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
void PFCandidateElectronExtra::setLateBrem ( float  val)
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().

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

set status

Definition at line 135 of file PFCandidateElectronExtra.cc.

References status_.

135  {
136  if(status) {
137  status_ |= (1 << type);
138  }
139  else {
140  status_ &= ~(1 <<type);
141  }
142 }
type
Definition: HCALResponse.h:21
int status_
Status of the electron.
tuple status
Definition: ntuplemaker.py:245
void PFCandidateElectronExtra::setVariable ( MvaVariable  type,
float  var 
)
private

Definition at line 128 of file PFCandidateElectronExtra.cc.

References mvaStatus_, and mvaVariables_.

Referenced by PFCandidateElectronExtra(), setClusterEnergies(), setDeltaEta(), setEarlyBrem(), setHadEnergy(), setKfTrackRef(), setLateBrem(), setMVA(), and setSigmaEtaEta().

128  {
129 
130  mvaVariables_[type]=val;
131  mvaStatus_ |= (1 << (type)) ;
132 }
type
Definition: HCALResponse.h:21
int mvaStatus_
status of mva variables
std::vector< float > mvaVariables_
mva variables - transient !
float reco::PFCandidateElectronExtra::sigmaEtaEta ( ) const
inline

Definition at line 112 of file PFCandidateElectronExtra.h.

References sigmaEtaEta_.

Member Data Documentation

std::vector<float> reco::PFCandidateElectronExtra::clusterEnergies_
private

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

Definition at line 125 of file PFCandidateElectronExtra.h.

Referenced by setClusterEnergies(), and setHadEnergy().

float reco::PFCandidateElectronExtra::deltaEta_
private

Definition at line 142 of file PFCandidateElectronExtra.h.

Referenced by setDeltaEta().

float reco::PFCandidateElectronExtra::earlyBrem_
private

Definition at line 138 of file PFCandidateElectronExtra.h.

Referenced by setEarlyBrem().

reco::GsfTrackRef reco::PFCandidateElectronExtra::gsfTrackRef_
private

Ref to the GSF track.

Definition at line 120 of file PFCandidateElectronExtra.h.

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

float reco::PFCandidateElectronExtra::hadEnergy_
private
reco::TrackRef reco::PFCandidateElectronExtra::kfTrackRef_
private

Ref to the KF track.

Definition at line 122 of file PFCandidateElectronExtra.h.

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

float reco::PFCandidateElectronExtra::lateBrem_
private

Definition at line 139 of file PFCandidateElectronExtra.h.

Referenced by setLateBrem().

int reco::PFCandidateElectronExtra::mvaStatus_
private

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().

math::XYZTLorentzVector reco::PFCandidateElectronExtra::pout_
private

Variables entering the MVA that should be saved.

Definition at line 137 of file PFCandidateElectronExtra.h.

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

float reco::PFCandidateElectronExtra::sigmaEtaEta_
private
int reco::PFCandidateElectronExtra::status_
private

Status of the electron.

Definition at line 134 of file PFCandidateElectronExtra.h.

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