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

BuildUpVertexAlgorithm: Issues in moving IP tracks to the buildUp vertices: Primary vertex is not updated, beam smearing is always on #66

Open
dudarboh opened this issue Aug 30, 2022 · 6 comments

Comments

@dudarboh
Copy link

PrimaryVertexFinder has a steering parameter which determines, whether central position of the beam constrain for the fit is being smeared with a Gaussian.
We don't use it by default in the ILD production steering file:
<parameter name="PrimaryVertexFinder.BeamspotSmearing" type="bool" value="0" />

However, when a BuildUpVertex algorithm removes IP track (due to better chi2 with a BuildUp vertex) it refits IP vertex with a BeamspotSmearing always ON, ignoring the steering parameter!

Vertex* vbeam;
algoEtc::makeBeamVertex(vbeam);

if (iptracks.size() < ip->getTracks().size()) {
// tracks removed
delete ip;
ip = VertexFitterSimple_V()(iptracks.begin(), iptracks.end(), vbeam);

Shouldn't it be consistent with a PrimaryVertexFinder?

@dudarboh
Copy link
Author

dudarboh commented Sep 9, 2022

More relevant issue:
Refitted IP vertex with few tracks removed is not used anywhere.

There are many events, where we have identical PFOs written both in Primary and BuildUp vertices collections.

I think if we moved a track to the secondary vertex, due to the lower chi2, it should be moved, not copied.

@dudarboh dudarboh changed the title BeamSmearing is always ON when refitting IP inside a BuildUpVertex algorithm BuildUpVertexAlgorithm: Issues in moving IP tracks to the buildUp vertices: Primary vertex is not updated, beam smearing is always on Sep 9, 2022
@ryonamin
Copy link
Contributor

@dudarboh, thank you for the heads-up! I completely agree with the first comment, I will fix this part and make a pull request as soon as possible. Regarding the second comment of duplicated tracks in Primary and BuildUp vertices, let me take a closer look which part causes the problem.

@suehara
Copy link
Member

suehara commented Oct 13, 2022

Yes tracks in both primary and secondary vertices are problematic. We need to think how to replace the primary vertex since it is not forseen on design. Also I'm a bit afraid of side effect for existing analysis but on this case fix (in default) with a fallback option to be run as before seems more reasonable for me.

@dudarboh
Copy link
Author

@suehara,
"I'm a bit afraid of side effect for existing analysis ..."
In my opinion, it doesn't matter. If these PFO duplicates have an impact on the physics analysis and cause "better" or "worse" results/performance, this physics analysis has wrong results... I think we should not be afraid to fix this, as we should strive to get the most realistic results, not results that are backwards compatible with the old versions.

".. fallback option to be run as before .."
If somebody wants to run old versions of LCFIPlus, he can easily do so for their analysis:

  1. git clone
  2. git checkout ANY commit/tag
  3. recompile & update MARLIN_DLL
    Maybe not everybody is aware of that, but we can write one page tutorial on how to do that, if somebody will need the old version.
    For the ILD Standard Reconstruction we can always postpone updating the version until we are sure it does not introduce new bugs and has only improvements.

So I am a bit skeptical about the idea of introducing new option flags to make everything backwards compatible in this particular case. In the end, its not a reconstruction algorithm option, it is a unintended bug..

". it is not forseen on design"

Yes, I agree this is a bit tricky to change.
In my opinion, this associateIPTracks() should be not a part of the BuildUpAlgorithm, but rather its own, separate, algorithm.
Which takes all vertices from Primary and BuildUp and then modifies both. But then we need to make verticies public so we can modify them outside of the class..

@ryonamin
Copy link
Contributor

For the first simple part, I have made a pull request #67.

@suehara
Copy link
Member

suehara commented Oct 14, 2022

Thanks for the comment.
I slightly change my mind. I think we sometime redo secondary vertexing from existing data, so maybe it's good to keep the updated primary vertex in a different collection (name). This can be done in the current framework.
We should just prepare to output a new primary vertex collection from the BuildUpVertex.
This does not have an impact to existing code either.

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

No branches or pull requests

3 participants