CMS 3D CMS Logo

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

#include <ElectronEPcombinator.h>

Public Member Functions

void combine (SimpleElectron &electron)
 
 ElectronEPcombinator ()
 
void setCombinationMode (int mode)
 

Private Member Functions

void computeEPcombination ()
 

Private Attributes

double combinedMomentum_
 
double combinedMomentumError_
 
int elClass_
 
SimpleElectron electron_
 
int mode_
 
double scEnergy_
 
double scEnergyError_
 
double trackerMomentum_
 
double trackerMomentumError_
 

Detailed Description

Definition at line 8 of file ElectronEPcombinator.h.

Constructor & Destructor Documentation

ElectronEPcombinator::ElectronEPcombinator ( )
inline

Definition at line 11 of file ElectronEPcombinator.h.

11 {}

Member Function Documentation

void ElectronEPcombinator::combine ( SimpleElectron electron)
void ElectronEPcombinator::computeEPcombination ( )
private

Definition at line 14 of file ElectronEPcombinator.cc.

References combinedMomentum_, combinedMomentumError_, elClass_, electron_, SimpleElectron::getElClass(), SimpleElectron::getNewEnergy(), SimpleElectron::getNewEnergyError(), SimpleElectron::getRegEnergy(), SimpleElectron::getRegEnergyError(), SimpleElectron::getTrackerMomentum(), SimpleElectron::getTrackerMomentumError(), mode_, scEnergy_, scEnergyError_, mathSSE::sqrt(), trackerMomentum_, and trackerMomentumError_.

Referenced by combine().

15 {
16  if ( mode_==1 )
17  {
20  }
21  if ( mode_==2 )
22  {
25  }
29 
30  combinedMomentum_ = scEnergy_; // initial
32 
33  // first check for large errors
34 
36  && scEnergyError_/scEnergy_ <= 0.5 )
37  {
40  }
41  else if ( trackerMomentumError_/trackerMomentum_ <= 0.5
42  && scEnergyError_/scEnergy_ > 0.5 )
43  {
46  }
48  && scEnergyError_/scEnergy_ > 0.5 )
49  {
51  {
54  }
55  else
56  {
59  }
60  }
61 
62  // then apply the combination algorithm
63  else
64  {
65  // calculate E/p and corresponding error
66  float eOverP = scEnergy_ / trackerMomentum_;
67  float errorEOverP = sqrt(
71 
72  bool eleIsNotInCombination = false;
73  if ( ( eOverP > 1 + 2.5*errorEOverP )
74  || ( eOverP < 1 - 2.5*errorEOverP )
75  || ( eOverP < 0.8 ) || ( eOverP > 1.3 ) )
76  {
77  eleIsNotInCombination = true;
78  }
79 
80  if ( eleIsNotInCombination )
81  {
82  if ( eOverP > 1 )
83  {
86  }
87  else
88  {
89  if ( elClass_ == 0 ) // == reco::GsfElectron::GOLDEN)
90  {
93  }
94  if ( elClass_ == 1 ) //reco::GsfElectron::BIGBREM)
95  {
96  if ( scEnergy_ < 36 )
97  {
100  } else
101  {
104  }
105  }
106  if ( elClass_ == 2 ) // == reco::GsfElectron::BADTRACK)
107  {
110  }
111  if ( elClass_ == 3 ) //reco::GsfElectron::SHOWERING)
112  {
113  if ( scEnergy_ < 30 )
114  {
117  } else
118  {
121  }
122  }
123  if ( elClass_ == 4 ) //reco::GsfElectron::GAP)
124  {
125  if ( scEnergy_ < 60 )
126  {
129  } else
130  {
133  }
134  }
135  }
136  } else
137  {
138  // combination
142  float combinedMomentum_Variance = 1 / (1/scEnergyError_/scEnergyError_ + 1/trackerMomentumError_/trackerMomentumError_);
143  combinedMomentumError_ = sqrt(combinedMomentum_Variance);
144  }
145  }
146 }
double getRegEnergyError()
double getTrackerMomentum()
double getNewEnergyError()
double getTrackerMomentumError()
T sqrt(T t)
Definition: SSEVec.h:46
double getNewEnergy()
double getRegEnergy()
void ElectronEPcombinator::setCombinationMode ( int  mode)
inline

Definition at line 13 of file ElectronEPcombinator.h.

References alignBH_cfg::mode, and mode_.

Member Data Documentation

double ElectronEPcombinator::combinedMomentum_
private

Definition at line 18 of file ElectronEPcombinator.h.

Referenced by combine(), and computeEPcombination().

double ElectronEPcombinator::combinedMomentumError_
private

Definition at line 19 of file ElectronEPcombinator.h.

Referenced by combine(), and computeEPcombination().

int ElectronEPcombinator::elClass_
private

Definition at line 24 of file ElectronEPcombinator.h.

Referenced by computeEPcombination().

SimpleElectron ElectronEPcombinator::electron_
private

Definition at line 16 of file ElectronEPcombinator.h.

Referenced by combine(), and computeEPcombination().

int ElectronEPcombinator::mode_
private

Definition at line 25 of file ElectronEPcombinator.h.

Referenced by computeEPcombination(), and setCombinationMode().

double ElectronEPcombinator::scEnergy_
private

Definition at line 20 of file ElectronEPcombinator.h.

Referenced by computeEPcombination().

double ElectronEPcombinator::scEnergyError_
private

Definition at line 21 of file ElectronEPcombinator.h.

Referenced by computeEPcombination().

double ElectronEPcombinator::trackerMomentum_
private

Definition at line 22 of file ElectronEPcombinator.h.

Referenced by computeEPcombination().

double ElectronEPcombinator::trackerMomentumError_
private

Definition at line 23 of file ElectronEPcombinator.h.

Referenced by computeEPcombination().