Skip to content

Conversation

@bonventre
Copy link
Contributor

Store derivatives wrt to position in residuals for use in alignment analyses

Copy link
Contributor

@brownd1978 brownd1978 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the added residual is restricted to a single use case, I wonder if the added functionality should reside in a subclass of Residual, say AlignmentResidual. It appears that could be constructed by the appropriate hit from the existing residual and the closest approach. I'm not sure if the downstream calling sequence supports that.

double pvar_; // estimated variance due to parameter uncertainty
bool active_; // whether this residual is active or not
DVEC dRdP_; // derivative of this residual WRT the trajectory parameters, evaluated at the reference parameters
VEC3 dRdX_; // derivative of this residual WRT the trajectory POCA, evaluated at the reference parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this is returned VEC3 and not SVEC3? SVEC3 supports algebraic manipulation while VEC3 supports geometric manipulation, even if the payload is identical. Nominally a derivative is an algebraic concept.

double pvar = ROOT::Math::Similarity(resid.dRdP(),params.covariance());
if(pvar<0) throw std::runtime_error("Covariance projection inconsistency");
return Residual(uresid,resid.variance(),pvar,resid.active(),resid.dRdP());
return Residual(uresid,resid.variance(),pvar,resid.active(),resid.dRdP(),resid.dRdX());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have an estimate of the increased to processing time from adding this derivative?

@brownd1978 brownd1978 merged commit 3d00942 into KFTrack:main Mar 21, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants