44 edm::LogWarning(
"ElectronMomentumCorrector::correct")<<
"unexpected classification" ;
68 if (elClass==0) {scale = 1./(0.00104*
sqrt(trackMomentum)+1);}
69 if (elClass==1) {scale = 1./(0.0017*
sqrt(trackMomentum)+0.9986);}
71 if (elClass==4) {scale = 0.995;}
72 }
else if (electron.
isEE()){
73 if (elClass==3){scale = 1./(1.01432-0.00201872*trackMomentum+0.0000142621*trackMomentum*
trackMomentum);}
74 if (elClass==4){scale = 1./(0.996859-0.000345347*
trackMomentum);}
76 if (scale<0.) scale = 1.;
77 trackMomentum = trackMomentum*
scale ;
82 float errorTrackMomentum = trackMomentum*trackMomentum*
sqrt(qpUtils.mode().variance()) ;
89 float finalMomentum = electron.
p4().t();
90 float finalMomentumError = 999.;
94 if (errorTrackMomentum/trackMomentum > 0.5 && errorEnergy/scEnergy <= 0.5) {
95 finalMomentum = scEnergy; finalMomentumError = errorEnergy;
97 else if (errorTrackMomentum/trackMomentum <= 0.5 && errorEnergy/scEnergy > 0.5){
98 finalMomentum =
trackMomentum; finalMomentumError = errorTrackMomentum;
100 else if (errorTrackMomentum/trackMomentum > 0.5 && errorEnergy/scEnergy > 0.5){
101 if (errorTrackMomentum/trackMomentum < errorEnergy/scEnergy) {
102 finalMomentum =
trackMomentum; finalMomentumError = errorTrackMomentum;
105 finalMomentum = scEnergy; finalMomentumError = errorEnergy;
114 float errorEOverP =
sqrt(
115 (errorEnergy/trackMomentum)*(errorEnergy/trackMomentum) +
116 (scEnergy*errorTrackMomentum/trackMomentum/trackMomentum)*
117 (scEnergy*errorTrackMomentum/trackMomentum/trackMomentum));
152 bool eleIsNotInCombination =
false ;
153 if ( (eOverP > 1 + 2.5*errorEOverP) || (eOverP < 1 - 2.5*errorEOverP) || (eOverP < 0.8) || (eOverP > 1.3) )
154 { eleIsNotInCombination =
true ; }
155 if (eleIsNotInCombination)
158 { finalMomentum = scEnergy ; finalMomentumError = errorEnergy ; }
162 { finalMomentum = scEnergy; finalMomentumError = errorEnergy; }
166 { finalMomentum =
trackMomentum ; finalMomentumError = errorTrackMomentum ; }
168 { finalMomentum = scEnergy ; finalMomentumError = errorEnergy ; }
171 { finalMomentum = scEnergy; finalMomentumError = errorEnergy ; }
175 { finalMomentum =
trackMomentum ; finalMomentumError = errorTrackMomentum; }
177 { finalMomentum = scEnergy; finalMomentumError = errorEnergy;}
182 { finalMomentum =
trackMomentum ; finalMomentumError = errorTrackMomentum ; }
184 { finalMomentum = scEnergy; finalMomentumError = errorEnergy ; }
192 finalMomentum = (scEnergy/errorEnergy/errorEnergy + trackMomentum/errorTrackMomentum/errorTrackMomentum) /
193 (1/errorEnergy/errorEnergy + 1/errorTrackMomentum/errorTrackMomentum);
194 float finalMomentumVariance = 1 / (1/errorEnergy/errorEnergy + 1/errorTrackMomentum/errorTrackMomentum);
195 finalMomentumError =
sqrt(finalMomentumVariance);
207 ( oldMomentum.x()*finalMomentum/oldMomentum.t(),
208 oldMomentum.y()*finalMomentum/oldMomentum.t(),
209 oldMomentum.z()*finalMomentum/oldMomentum.t(),
212 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