Skip to content
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

remove overwriting of input parameters in TVSurface::CalcXingPointWith #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

danieljeans
Copy link

BEGINRELEASENOTES

  • don't ignore input params "eps" and "mode" of TVSurface::CalcXingPointWith
  • this would address the (potential) issue of TVSurface: ignored parameters? #6
    ENDRELEASENOTES

@tmadlener
Copy link
Contributor

Hi @danieljeans, I agree overwriting arguments seems a bit strange. A minor concern that I have here, is that the default value for eps is 1e-8:

Double_t eps = 1.e-8) const;

Adapting that to the previously hardcoded value of 1e-5 would avoid changing things where no eps was passed. Could you change that as well?

For mode I am not entirely sure if there will be problems if removing the hardcoded value of 0. However, there is also not really something we can do about it. At least a quick iLCSoft wide search for TVSurface gave a few hits. I could try to flush them out with compiler warnings when I do the next HEAD build, unless you think this should not affect things to much in any case (also because there is a second overload without mode, that just forwards with mode set to 0).

@tmadlener tmadlener linked an issue Dec 2, 2022 that may be closed by this pull request
@tmadlener
Copy link
Contributor

Hi @danieljeans, I checked where this shows up throughout the stack. As you can see in the overview below there are a few cases, where the value of mode is not directly visible from the calling site, because it is either just passed on as an argument, or deduced from other variables. There are also a few cases, where it is explicitly set to something else than 0 and then there are a few cases, where it is indeed set to 0 explicitly or implicitly by calling the overload without mode. So overall, I am not entirely sure what the effects of this change would be in practice. Maybe you have a bit more intuition in this direction?

mode as variable (value not easily deducible)

mode != 0 explicitly set at calling site

mode == 0 at calling site

calling the "no mode" version (i.e. mode == 0 by definition)

@danieljeans
Copy link
Author

danieljeans commented Dec 13, 2022

changed default eps to 1e-5 which should preserve current behaviour.
Keisuke agrees this is a reasonable default value, when using mm for length units.
This eps is the tolerance on the squared distance to the surface, so 10-5 corresponds to a few microns, probably precise enough for a general case.

@danieljeans
Copy link
Author

@tmadlener thanks for checking where "mode" is used.
To be honest I don't know this code so well.
Keisuke (original author) noticed this forcing of "mode=0", describing it as a bug.
He explained that mode=0 means we look for the intersection closest to the current position, while mode=+(-)1 looks for the next intersection forwards(backwards) along the track.
He is still looking into the effect of this "mode=0" overwriting, so I suggest we wait for his conclusion before merging this.

@danieljeans
Copy link
Author

after some more checks, Keisuke recommends to remove the "mode=0" line.
It may be a good idea to remake some usual tracking efficiency plots (eg for ILC) as a final check before merging?
Who knows how to make them?

@tmadlener
Copy link
Contributor

OK. In that case I would leave this out of the current patch release to let that move forward. We can then make another one once we have a solution for this.

It may be a good idea to remake some usual tracking efficiency plots (eg for ILC) as a final check before merging?
Who knows how to make them?

I agree. I am not sure if there is someone who routinely makes them at the moment. In principle the necessary scripts should all be somewhere. I will try to find out.

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.

TVSurface: ignored parameters?
2 participants