-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A revision of the HelixClass #24
Comments
A similar issue appears in the function
and the corresponding one for the other helix again assume that the ref. point is |
As this topic is popped up in my feed I will also add that I think Yasser also encountered that Also, while, https://github.com/iLCSoft/Garlic/blob/32edf27735ac1a58bbb986535b82ce0c18c3dc9e/src/GarlicExtendedTrack.cc#L231 which is, of course, not ideal in the long term, as it hard to catch them all. |
For me it works fine just after these two fixes ( Do you know if Yasser found some problems also for a |
I think he used it for some analysis involving tracks from 2nd and/or 3rd vertices. So I think so the main issue was indeed in reference point not being at 0. |
@gaede and me just had a discussion about this issue and we agree that the current status is far from ideal and should be addressed. However, there is overall no easy solution to this, given the number of places where One thing that we would like to point out is that in In the long run the goal would be to converge on only one implementation of this functionality (and the current goal for that would be
For now starting with the unit tests would be the first step. Here I would start with providing the necessary "harness", but we would also definitely need your help to actually put together meaningful unit tests. |
Brief description
After the discussion with @yradkhorrami we discovered some issues in the HelixClass which I will describe here below. All problems are connected to the fact that HelixClass initializers all rely on the assumption that
reference point = (0, 0, 0)
even in the situations when it is really not supposed to.This might lead to ambiguity and misunderstanding all over the place.
HelixClass::Initialize_Canonical()
Issue
A helix in the canonical representation is defined by the
reference point
and 5 parameters:phi0
,omega
,tanL
,d0
,z0
.This initializer is useful to define the helix from the
trackState
which has all parameters defined.However this initializer doesn't take
reference point
as an input argument and assumesreference point
always to be(0,0,0)
which can lead to a confusion:
Here the
helixClass
treats passedd0
,z0
arguments as with respect to the(0, 0, 0)
. However in thetrackState
they are written with respect to the arbitraryreference_point=ts->getReferencePoint()
which is not necessarily(0, 0, 0)
.This will result with a helix of the same curvature and dip, but completely different positioning as one would expect from the trackState.
By simply copying
d0
andz0
parameters we completely transform their geometrical meaning:As the
ts.getZ0()
is the distance alongz
between helix PCA and thets->getReferencePoint()[2]
While the
helix.getZ0()
is the distance alongz
between helix PCA and thez=0
.So they shouldn't be identical if we talk about "the same" helix.
In the current state to get the desired helix one would have to be aware to recalculate
d0
andz0
from the track state assumingreference point
is(0, 0, 0)
, e.g.:which is not necessarily trivial...
Potential way to improve
Provide reference point as an input argument to avoid ambiguity.
HelixClass::Initialize_VP()
Issue
This initializer is useful if one has:
It uses the given point as a
reference point
to construct the helix:One would expect that output
d0
andz0
paremeters must be 0 as the reference point is on the helix by definition.However, while calculating
d0
andz0
initializer comes backs to assumingreference point
as(0,0,0)
without mentioning it anywhere:This would fail the user, if he plans to use
d0
,z0
helix parameters further in the program, e.g. to draw the helix,which @yradkhorrami has experienced in the following example:
Potential way to improve
Cross check all the equations and remove any assumptions of
reference point
as0,0,0
where it is definitely shouldn't be and setd0
andz0
as 0.HelixClass::Initialize_BZ()
Issue
This initializer is good when we know exact geometrical properties of the helix:
xCentre
,yCentre
radius
bZ
phi0
One should immediately note very inconvenient naming of the
phi0
parameter.Inside the
Initialize_BZ()
thephi0
parameter is a phase shift of the initial helix alongz
and is NOT a track parameter as in previous two initializers, which is a great point to become confused in this context.We also see inconsistency between
helix.getReferencePoint()
which seems to be ON the helix:and output
d0
andz0
parameters that have nothing to do with the helixreference point
. It is hard to understand for me from the equations with respect to what pointd0
andz0
are actually calculated in this case...I am very confused about the most of the equations in the
Initialize_BZ()
. So some discussion with experts would be nice. E.g.:_phiAtPCA = atan2(-_yCentre,-_xCentre);
does it make sense?Potential way to improve
Cross check all of the equations, rename
phi0
to something different, e.g.phase0
HelixClass_double ?
This is just a comment to bring a discussion on why we have separate class for the
HelixClass
withdouble
. Is it bad to transitHelixClass
fromfloat
todouble
? Overload/template? Isn't there any better way to implement this?List of packages using HelixClass
providing a comment:
(231) // get helix-plane intersection by hand (the one from HelixClass seems strange/buggy...)
Any thoughts, comments @tmadlener, @gaede?
The text was updated successfully, but these errors were encountered: