27 {
28
29 float clusterEta = theFourVector.Eta();
30
32 float centerMag = accCenterMag(fe);
33
34 float radius = centerMag/cosh(clusterEta);
35
36 float EtaVertexCorrection = 0.0, PhiVertexCorrection = 0.0;
37 float clusterPhi = theFourVector.Phi();
38
39 if (radius > 1.0 && centerMag > 1e-3){
40 EtaVertexCorrection = (-vertexToCorrectTo.Z()/cosh(clusterEta) + (vertexToCorrectTo.X()*cos(clusterPhi) + vertexToCorrectTo.Y()*sin(clusterPhi))*tanh(clusterEta))/radius;
41 PhiVertexCorrection = (vertexToCorrectTo.X()*sin(clusterPhi) - vertexToCorrectTo.Y()*cos(clusterPhi))/radius;
42 }
43
44 float etaVertexCorrected = clusterEta + EtaVertexCorrection;
45 float p = std::sqrt(theFourVector.E()*theFourVector.E()-theFourVector.M()*theFourVector.M());
46 float ptVertexCorrected = p/cosh(etaVertexCorrected);
47 theFourVector.SetPtEtaPhiM(ptVertexCorrected, etaVertexCorrected, clusterPhi + PhiVertexCorrection, theFourVector.M());
48
49 }