CMS 3D CMS Logo

ElectronEPcombinator.cc
Go to the documentation of this file.
2 #include <iostream>
3 
4 //Accessor to the combination results
8  electron.setCombinedMomentum(combinedMomentum_);
9  electron.setCombinedMomentumError(combinedMomentumError_);
10 }
11 
12 //Core code to compute the EP combination
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 }
EgHLTOffHistBins_cfi.eOverP
eOverP
Definition: EgHLTOffHistBins_cfi.py:37
SimpleElectron::getTrackerMomentumError
double getTrackerMomentumError() const
Definition: SimpleElectron.h:66
SimpleElectron::getTrackerMomentum
double getTrackerMomentum() const
Definition: SimpleElectron.h:65
ElectronEPcombinator::mode_
int mode_
Definition: ElectronEPcombinator.h:24
ElectronEPcombinator::trackerMomentum_
double trackerMomentum_
Definition: ElectronEPcombinator.h:21
ElectronEPcombinator::scEnergyError_
double scEnergyError_
Definition: ElectronEPcombinator.h:20
SimpleElectron
Definition: SimpleElectron.h:8
SimpleElectron::getRegEnergyError
double getRegEnergyError() const
Definition: SimpleElectron.h:64
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
ElectronEPcombinator::combinedMomentum_
double combinedMomentum_
Definition: ElectronEPcombinator.h:17
ElectronEPcombinator::scEnergy_
double scEnergy_
Definition: ElectronEPcombinator.h:19
ElectronEPcombinator::trackerMomentumError_
double trackerMomentumError_
Definition: ElectronEPcombinator.h:22
SimpleElectron::getRegEnergy
double getRegEnergy() const
Definition: SimpleElectron.h:63
SimpleElectron::getNewEnergyError
double getNewEnergyError() const
Definition: SimpleElectron.h:56
ElectronEPcombinator.h
HPSPFTauProducerPuppi_cfi.electron
electron
Definition: HPSPFTauProducerPuppi_cfi.py:13
ElectronEPcombinator::electron_
SimpleElectron electron_
Definition: ElectronEPcombinator.h:15
SimpleElectron::getNewEnergy
double getNewEnergy() const
Definition: SimpleElectron.h:55
ElectronEPcombinator::computeEPcombination
void computeEPcombination()
Definition: ElectronEPcombinator.cc:13
SimpleElectron::getElClass
int getElClass() const
Definition: SimpleElectron.h:69
ElectronEPcombinator::combine
void combine(SimpleElectron &electron)
Definition: ElectronEPcombinator.cc:5
ElectronEPcombinator::combinedMomentumError_
double combinedMomentumError_
Definition: ElectronEPcombinator.h:18
ElectronEPcombinator::elClass_
int elClass_
Definition: ElectronEPcombinator.h:23