CMS 3D CMS Logo

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::ElectronEPcombinator ( )
inline

Definition at line 10 of file ElectronEPcombinator.h.

10 {}

Member Function Documentation

◆ combine()

void ElectronEPcombinator::combine ( SimpleElectron electron)

◆ computeEPcombination()

void ElectronEPcombinator::computeEPcombination ( )
private

Definition at line 13 of file ElectronEPcombinator.cc.

References combinedMomentum_, combinedMomentumError_, elClass_, electron_, EgHLTOffHistBins_cfi::eOverP, 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().

13  {
14  if (mode_ == 1) {
17  }
18  if (mode_ == 2) {
21  }
25 
26  combinedMomentum_ = scEnergy_; // initial
28 
29  // first check for large errors
30 
34  } else if (trackerMomentumError_ / trackerMomentum_ <= 0.5 && scEnergyError_ / scEnergy_ > 0.5) {
37  } else if (trackerMomentumError_ / trackerMomentum_ > 0.5 && scEnergyError_ / scEnergy_ > 0.5) {
41  } else {
44  }
45  }
46 
47  // then apply the combination algorithm
48  else {
49  // calculate E/p and corresponding error
54 
55  bool eleIsNotInCombination = false;
56  if ((eOverP > 1 + 2.5 * errorEOverP) || (eOverP < 1 - 2.5 * errorEOverP) || (eOverP < 0.8) || (eOverP > 1.3)) {
57  eleIsNotInCombination = true;
58  }
59 
60  if (eleIsNotInCombination) {
61  if (eOverP > 1) {
64  } else {
65  if (elClass_ == 0) // == reco::GsfElectron::GOLDEN)
66  {
69  }
70  if (elClass_ == 1) //reco::GsfElectron::BIGBREM)
71  {
72  if (scEnergy_ < 36) {
75  } else {
78  }
79  }
80  if (elClass_ == 2) // == reco::GsfElectron::BADTRACK)
81  {
84  }
85  if (elClass_ == 3) //reco::GsfElectron::SHOWERING)
86  {
87  if (scEnergy_ < 30) {
90  } else {
93  }
94  }
95  if (elClass_ == 4) //reco::GsfElectron::GAP)
96  {
97  if (scEnergy_ < 60) {
100  } else {
103  }
104  }
105  }
106  } else {
107  // combination
111  float combinedMomentum_Variance =
113  combinedMomentumError_ = sqrt(combinedMomentum_Variance);
114  }
115  }
116 }
double getNewEnergy() const
double getRegEnergy() const
double getTrackerMomentumError() const
int getElClass() const
T sqrt(T t)
Definition: SSEVec.h:23
double getTrackerMomentum() const
double getNewEnergyError() const
double getRegEnergyError() const

◆ setCombinationMode()

void ElectronEPcombinator::setCombinationMode ( int  mode)
inline

Member Data Documentation

◆ combinedMomentum_

double ElectronEPcombinator::combinedMomentum_
private

Definition at line 17 of file ElectronEPcombinator.h.

Referenced by combine(), and computeEPcombination().

◆ combinedMomentumError_

double ElectronEPcombinator::combinedMomentumError_
private

Definition at line 18 of file ElectronEPcombinator.h.

Referenced by combine(), and computeEPcombination().

◆ elClass_

int ElectronEPcombinator::elClass_
private

Definition at line 23 of file ElectronEPcombinator.h.

Referenced by computeEPcombination().

◆ electron_

SimpleElectron ElectronEPcombinator::electron_
private

Definition at line 15 of file ElectronEPcombinator.h.

Referenced by combine(), and computeEPcombination().

◆ mode_

int ElectronEPcombinator::mode_
private

Definition at line 24 of file ElectronEPcombinator.h.

Referenced by computeEPcombination(), and setCombinationMode().

◆ scEnergy_

double ElectronEPcombinator::scEnergy_
private

Definition at line 19 of file ElectronEPcombinator.h.

Referenced by computeEPcombination().

◆ scEnergyError_

double ElectronEPcombinator::scEnergyError_
private

Definition at line 20 of file ElectronEPcombinator.h.

Referenced by computeEPcombination().

◆ trackerMomentum_

double ElectronEPcombinator::trackerMomentum_
private

Definition at line 21 of file ElectronEPcombinator.h.

Referenced by computeEPcombination().

◆ trackerMomentumError_

double ElectronEPcombinator::trackerMomentumError_
private

Definition at line 22 of file ElectronEPcombinator.h.

Referenced by computeEPcombination().