<div dir="ltr">Hello,<br><br>Below one can find the details for correcting the electron angles using a new vertex position (a vertex at 0,0,0, is chosen by default)<br><br>x = electron[0]->ft(FTCAL)->getX();<br>y = electron[0]->ft(FTCAL)->getY();<br>z = electron[0]->ft(FTCAL)->getZ();<br>z = z + VALZ; //Where VALZ is the new vertex position you want to have for the electron.<br><br>r = sqrt(x*x + y*y + z*z);<br><br>This function calculates a new LorentzVector for the electron assuming a straight line from the new vertex to the hit in the FTCAL.<br>TLorentzVector Correct_z_position(TLorentzVector e, Double_t x, Double_t y, Double_t z, Double_t r){<br><br>  Double_t px, py, pz;<br>  TLorentzVector el_corZ;<br>  Double_t mom=e.E()*e.E()-0.000511*0.000511;<br>  mom=TMath::Sqrt(mom);<br><br>  px = mom*(x/r);<br>  py = mom*(y/r);<br>  pz = mom*(z/r);<br><br>  el_corZ.SetXYZM(px, py, pz, 0.000511);<br><br>  return el_corZ;<br>}<br><br>el_corZ = Correct_z_position(el, x, y, z, r);<br><br><br>In order to calculate the angles at the production vertex, one needs to swim the electron back to the vertex. This is done by the following two functions for theta and phi<br><br>Double_t Correct_Theta(TLorentzVector e){<br><br>  Double_t Th_cor, Corect_Th;<br><br>  Th_cor = exp(1.797 - 4.485*e.E()) + exp(-0.8671 - 1.078*e.E());<br>  Th_cor = TMath::DegToRad()*Th_cor;<br><br>  Corect_Th = e.Theta() + Th_cor;<br><br>  return Corect_Th;<br>}<br><br>Double_t Correct_Phi(TLorentzVector e){<br><br>  Double_t Ph_cor, Corect_Ph;<br><br>  Ph_cor = exp(4.918 - 3.828*e.E()) + exp(3.841 - 1.256*e.E()) + exp(2.874 - 0.2195*e.E());<br>  Ph_cor = TMath::DegToRad()*Ph_cor;<br><br>  Corect_Ph = e.Phi() + Ph_cor;<br><br>  return Corect_Ph;<br>}<br><br>el_corZ.SetTheta(Correct_Theta(el_corZ));<br><br>el_corZ.SetPhi(Correct_Phi(el_corZ));<br><br>The sum:<br><br>Corect_Ph = e.Phi() + Ph_cor<br><br>Assumes inbending data for outbending it would be the following:<br><br>Corect_Ph = e.Phi() - Ph_cor<br><br>Thanks,<br>Geraint Clash. <br></div>