Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,55 +230,8 @@ public Pair<double[], SymmetricMatrix> getCorrectedPerigeeParameters(HelicalTrac
// find the point on the trajectory from the GBLPOINT
int iLabel = getPointIndex(point);

double pathLength = getPathLength(iLabel);

//We already have the corrections at s=0, no need to transform the point
if (pathLength < 1.e-6) {

// Get corrections from GBL fit
Vector locPar = new Vector(5);
SymMatrix locCov = new SymMatrix(5);

// Extract the corrections to the track parameters and the covariance matrix from the GBL trajectory
getResults(iLabel, locPar, locCov);

// find the corrected perigee track parameters at this point
double[] helixParametersCorrected = GblUtils.getCorrectedPerigeeParameters(locPar, htf, bfield);

// Use the super class to keep track of reference point of the helix
HpsHelicalTrackFit helicalTrackFit = new HpsHelicalTrackFit(htf);
double[] refIP = helicalTrackFit.getRefPoint();

// Form the helical track fit (redundant)
HpsHelicalTrackFit helicalTrackFitCorrected = new HpsHelicalTrackFit(helixParametersCorrected, helicalTrackFit.covariance(), helicalTrackFit.chisq(), helicalTrackFit.ndf(), helicalTrackFit.PathMap(), helicalTrackFit.ScatterMap(), refIP);

// Get the jacobian
// Calculate the updated covariance
Matrix jacobian = GblUtils.getCLToPerigeeJacobian(helicalTrackFit, helicalTrackFitCorrected, bfield);
Matrix helixCovariance = jacobian.times(locCov.times(jacobian.transpose()));
SymmetricMatrix cov = new SymmetricMatrix(5);
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
if (i >= j) {
cov.setElement(i, j, helixCovariance.get(i, j));
}
}
}
double parameters_gbl[] = helicalTrackFitCorrected.parameters();
//System.out.printf("NEW NEW parameters_gbl for pathLength %f - %f %f %f %f %f\n", pathLength, parameters_gbl[BaseTrack.OMEGA], parameters_gbl[BaseTrack.TANLAMBDA], parameters_gbl[BaseTrack.PHI],parameters_gbl[BaseTrack.D0],parameters_gbl[BaseTrack.Z0]);

//System.out.printf("Jacobian and Covariance Matrix::\n");
//jacobian.print(5,5);
//System.out.println(cov.toString());

return new Pair<double[], SymmetricMatrix>(parameters_gbl, cov);
}

else {

return getCorrectedPerigeeParameters(htf, iLabel, bfield);
}

return getCorrectedPerigeeParameters(htf, iLabel, bfield);

}

/**
Expand Down Expand Up @@ -349,15 +302,15 @@ public Pair<double[], SymmetricMatrix> getCorrectedPerigeeParameters(HelicalTrac
//LOGGER.finest("corrected helix covariance:\n" + cov);

double parameters_gbl[] = helicalTrackFitAtIPCorrected.parameters();

/*
System.out.printf("parameters_gbl for pathLength %f - %f %f %f %f %f\n", pathLength, parameters_gbl[BaseTrack.OMEGA], parameters_gbl[BaseTrack.TANLAMBDA], parameters_gbl[BaseTrack.PHI],parameters_gbl[BaseTrack.D0],parameters_gbl[BaseTrack.Z0]);

System.out.printf("Jacobian and Covariance Matrix::\n");
jacobian.print(5,5);
System.out.println(cov.toString());
*/

return new Pair<double[], SymmetricMatrix>(parameters_gbl, cov);
}

Expand Down