public void doCorrection(Track trkcand, Geometry geo) { double B = bstSwim.Bfield(Points[0][0] / 10, Points[0][0] / 10, Points[0][0] / 10).z(); double ELossMax = 600; // 600Mev double stepSize = 0.001; // 1 MeV int nbins = (int) ELossMax; double pt0 = trkcand.get_Pt() + ELossMax * stepSize; // Assumes the max ELoss is 600 MeV double pt = pt0; double curv = (Constants.LIGHTVEL * Math.abs(B)) * Math.signum(this.OrigTrack.get_curvature()) / pt; for (int j = 0; j < nbins; j++) { if (Math.abs(this.OrigTrack.get_curvature()) < Math.abs(curv)) { double correctedCurv = (Constants.LIGHTVEL * Math.abs(B)) * Math.signum(this.OrigTrack.get_curvature()) / (pt + stepSize); trkcand.get_Helix().set_curvature(correctedCurv); trkcand.set_HelicalTrack(trkcand.get_Helix()); return; } pt = pt0 - j * stepSize; double aveCurv = 0; for (int k = 0; k < trkcand.size(); k++) { aveCurv += doEnergyLossCorrection(k, pt); } aveCurv /= trkcand.size(); curv = aveCurv; } }