43 edm::LogWarning(
"ElectronMomentumCorrector::correct")<<
"unexpected classification" ;
67 if (elClass==0) {scale = 1./(0.00104*
sqrt(trackMomentum)+1);}
68 if (elClass==1) {scale = 1./(0.0017*
sqrt(trackMomentum)+0.9986);}
70 if (elClass==4) {scale = 0.995;}
71 }
else if (electron.
isEE()){
72 if (elClass==3){scale = 1./(1.01432-0.00201872*trackMomentum+0.0000142621*trackMomentum*
trackMomentum);}
73 if (elClass==4){scale = 1./(0.996859-0.000345347*
trackMomentum);}
75 if (scale<0.) scale = 1.;
76 trackMomentum = trackMomentum*
scale ;
81 float errorTrackMomentum = trackMomentum*trackMomentum*
sqrt(qpUtils.mode().variance()) ;
88 float finalMomentum = electron.
p4().t();
89 float finalMomentumError = 999.;
93 if (errorTrackMomentum/trackMomentum > 0.5 && errorEnergy/scEnergy <= 0.5) {
94 finalMomentum = scEnergy; finalMomentumError = errorEnergy;
96 else if (errorTrackMomentum/trackMomentum <= 0.5 && errorEnergy/scEnergy > 0.5){
97 finalMomentum =
trackMomentum; finalMomentumError = errorTrackMomentum;
99 else if (errorTrackMomentum/trackMomentum > 0.5 && errorEnergy/scEnergy > 0.5){
100 if (errorTrackMomentum/trackMomentum < errorEnergy/scEnergy) {
101 finalMomentum =
trackMomentum; finalMomentumError = errorTrackMomentum;
104 finalMomentum = scEnergy; finalMomentumError = errorEnergy;
113 float errorEOverP =
sqrt(
114 (errorEnergy/trackMomentum)*(errorEnergy/trackMomentum) +
115 (scEnergy*errorTrackMomentum/trackMomentum/trackMomentum)*
116 (scEnergy*errorTrackMomentum/trackMomentum/trackMomentum));
151 bool eleIsNotInCombination =
false ;
152 if ( (eOverP > 1 + 2.5*errorEOverP) || (eOverP < 1 - 2.5*errorEOverP) || (eOverP < 0.8) || (eOverP > 1.3) )
153 { eleIsNotInCombination =
true ; }
154 if (eleIsNotInCombination)
157 { finalMomentum = scEnergy ; finalMomentumError = errorEnergy ; }
161 { finalMomentum = scEnergy; finalMomentumError = errorEnergy; }
165 { finalMomentum =
trackMomentum ; finalMomentumError = errorTrackMomentum ; }
167 { finalMomentum = scEnergy ; finalMomentumError = errorEnergy ; }
170 { finalMomentum = scEnergy; finalMomentumError = errorEnergy ; }
174 { finalMomentum =
trackMomentum ; finalMomentumError = errorTrackMomentum; }
176 { finalMomentum = scEnergy; finalMomentumError = errorEnergy;}
181 { finalMomentum =
trackMomentum ; finalMomentumError = errorTrackMomentum ; }
183 { finalMomentum = scEnergy; finalMomentumError = errorEnergy ; }
191 finalMomentum = (scEnergy/errorEnergy/errorEnergy + trackMomentum/errorTrackMomentum/errorTrackMomentum) /
192 (1/errorEnergy/errorEnergy + 1/errorTrackMomentum/errorTrackMomentum);
193 float finalMomentumVariance = 1 / (1/errorEnergy/errorEnergy + 1/errorTrackMomentum/errorTrackMomentum);
194 finalMomentumError =
sqrt(finalMomentumVariance);
206 ( oldMomentum.x()*finalMomentum/oldMomentum.t(),
207 oldMomentum.y()*finalMomentum/oldMomentum.t(),
208 oldMomentum.z()*finalMomentum/oldMomentum.t(),
211 electron.
correctMomentum(newMomentum,errorTrackMomentum,finalMomentumError);
const LorentzVector & p4(P4Kind kind) const
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
math::XYZVectorF trackMomentumAtVtx() const
float p4Error(P4Kind kind) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
float correctedEcalEnergy() const
Classification classification() const
float correctedEcalEnergyError() const