-
Notifications
You must be signed in to change notification settings - Fork 0
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
Overlap recheck #118
Overlap recheck #118
Conversation
related to this and true hits: @leonardogiannini windows tuning algorithm uses truth. |
@osschar |
In the initial step built tracks I see So, it looks like in all the variants we are actually adding hits; even more layers. |
The conflict has been cleared ... note that I force-pushed the rebased branch back so please delete any local copies before re-checkouting. |
🍾 |
|
||
// XXXX For now we DO NOT use chi2 as this was how things were done before the post-update | ||
// chi2 check. To use it we should retune scoring function (might be even simpler). | ||
if (mkfndr->m_FailFlag[fi] == 0 && mkfndr->m_Chi2[fi] >= 0.0f && mkfndr->m_Chi2[fi] <= 60.0f) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to propose to make this configurable. We have chi2CutOverlap
parameter in iter config already, which is currently unused; and I guess it can be reused here.
the logic could probably be
if (mkfndr->m_FailFlag[fi] == 0 && mkfndr->m_Chi2[fi] >= 0.0f && mkfndr->m_Chi2[fi] <= 60.0f) { | |
if (m_iteration_params->chi2CutOverlap < 0 || (mkfndr->m_FailFlag[fi] == 0 && mkfndr->m_Chi2[fi] >= 0.0f && mkfndr->m_Chi2[fi] <= m_iteration_params->chi2CutOverlap)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default could be set to -1
in all iterations jsons for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also have pT cut for overlap ... it used to be applied so only tacks with pT > 1 GeV would pick up overlaps.
Default in jsons now seem to be 3.5 for chi2 and 0 for pT ... neither of them being used now.
Do you want me to just commit the above suggestion for now then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhm, pTCutOverlap
is used in RecoTracker/MkFitCore/src/CandCloner.cc; it does nothing because the value is zero. I can see it could become useful/reconsidered to change from 0 and pt being relatively well defined, I think it's fine where it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started testing a case with
tc.addHitIdx(seed_cand_overlap_idx[ii].ovlp_idx, curr_layer, mkfndr->m_Chi2[fi]);
but now I realize that it's a bad idea: we do not have a candidate without the overlap hit, if the overlap passes the chi2 cut.
I guess a more meaningful option is to compute the score with and without the overlap hit and then decide to add the hit or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess a more meaningful option is to compute the score with and without the overlap hit and then decide to add the hit or not.
is there a clean way to pop a hit from a TrackCand
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding of main / overlap hit as combinatorics is something I was thinking about in the context of thin / thick layers. I will check how we could hack this in, part of it would have to be done beforehand, in CandCloner, as you also said.
It's not really easy to pop a hit as there is a common tree-over-vector representation of hits for all Cands under one CombCandidate.
All this goes into the direction I'm thinking about things ... having some intermediate thick layer intermediate candidate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really easy to pop a hit as there is a common tree-over-vector representation of hits for all Cands under one CombCandidate.
can't I just set lastHitIdx_ = refLastHoTNode().m_prev_idx
and update n found, n overlap and chi2 in the TrackCand, without touching the HoT nodes in CombCandidate
?
or is there some code that would find an orphaned HoT node and complain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you're right this should work for the last hit -- it will just leave a slot unused as max-used-slot-id is kept in CombCandidate. But you want to keep two, right ... so it will be still used by the cand that has both hits.
There is recompactification done before backward search and there only the hits from the best cand get repopulated ... erasing all the others, including the void slots.
Here is what I see for the pixelLess where all other iterations are using CKF Compared to the initialStep from the initial PR tests So, at least in these iterations the impact is different: initialStep gets worse and pixelLess gets better. Just an extra motivation to make this overlap recheck feature configurable. |
there is apparently a conflict now in RecoTracker/MkFitCore/src/PropagationMPlex.icc I'm not sure though how recent this is. After the conflict is resolved before submitting a PR to cmssw it would be good to run the performance tests and see no changes in mkFit-5 setup and an increase in eff in the mkFit5+pixelLess. |
still
|
You want to update the trackreco/master and then I do the rebase? |
The complaint about conflicts is supposedly relative to the trackreco/master.
yes, it will be needed in the cmssw pr, so why not do it before the submission |
into which update-list to put a hit with an overlap.
31f712a
to
0e07d81
Compare
Force-pushed the rebased version ... remove local branch before pulling. |
looks green now |
some commits from me are useless, could be combined to 1 or two. Some others may be more useful since they are scattered over many files |
Here is the comparison (both 1K tt and 100 events single thread for timing) http://uaf-10.t2.ucsd.edu/~legianni/PR118/ Looks as expected Let me know if you also want to cross-check the old pixelLess with no recheck |
I think we also need a sanity check to show that mkfit5 does not change from this PR. Then indeed, on your set already provided it would be good to add the pixelLess before this PR. |
What do you mean with new layers? You mean add layers to traverse in each region? If that, then yes, you can modify it, it's part of the layer plan. But if you are adding them at the beginning then one needs to probably also fix the pick-up layers etc. ... I'd have to review the code to remember how it's done now, I did change this a bit during backwards-search / seed-reg rebuild implementation. |
I mean the new layer processing (the one that was integrated but disabled) |
the cross-check for low pT pixelLess is here http://uaf-10.t2.ucsd.edu/~legianni/PR118/plots_lowpt_xcheck/ (original is bad name choice, please ignore it) |
Thank you. |
I wanted to ask to add the low pt displaced, e.g. from /RelValXiMinus_13p6TeV/CMSSW_13_3_0-133X_mcRun3_2023_realistic_v3-v1/GEN-SIM-DIGI-RAW this is no PU, so, could process at least 10K events (if not the full sample; no timing necessary, so loading multiple threads will be OK) |
e.g. OOB high purity dist of all tracks oddly enough a similar loss is not visible in the efficiency plot (which is using signal TPs); unclear if the other cuts applied of efficiency plots play some role. |
Ah, good idea :) Let me take a look ... in principle we just need to call selectHitIndicesV2() from MkBuilder if some new flag is set. If this turns out to help, I can also try to optimize it, at least to the 0-th order. So, the plan:
|
|
hehe, yes, sure ... but we have to try it first and I have to update all the jsons anyway to have the new member. |
All the plots so far are using 1k ttbar. I'm going to run on the XiMinus. The release is cmssw_14_0_0_pre1, so it should include all the developments |
which release of ttbar, just for a reference?
OK, good. |
For testing, should I just enable v2 for forward search? we should have relatively good precision for backwards search, no? |
ttbar is quite old.. probably 12_5_x but I am not aware of changes in step2 after the beamspot was update. I can use a new relval too if you think it necessary |
is the beamspot payload in the GT used consistently with the SIM? |
I wouldn't be so sure for backward: it's complicated for eta>1.5 where pixel-less has to go back from TID/TEC to FPIX where distances can be around 1 m (and the pt is pretty low). |
OK, set it to true for pixelLess, both direction. |
it's not going to give a length, but it doesn't matter for pixels, fwiw this value is not distinguishable from 0 for pixels in this context of hit selections |
Oh, you mean this does not represent the true sigma in z (barrel) r (endcap) direction for pixels? It is used here as hit compatibility check, with extra factor of 1.2: |
is |
the test should add the propagation uncertainty or some other parametric tolerance representing expected propagation uncertainty. |
it seems like selV2 as it is now should only be in the forward direction for pixelLess |
now I can't recall where the hit overflow was happening at a worse rate in the pixelLess (forward or backward) ... hopefully mostly forward where selV2 logic related to the hit size would still make sense. |
…search and for doing hit preselection.
OK, I pushed this addition. The extra factors we have hardcoded there could now probably be reduced. |
Just to be sure, is it the error after propagating to the nominal radius of a given layer? |
yes, layer center r or z. |
Recheck overlap hit chi2 after the update with the primary hit.
Use the new chi2 to select wich overlap hits to append to the candidate, for the moment still not either adding the overlap chi2 to the cand score nor using the overlap to update the parameters. These could both be considered in the future but would require even further tuning of the scoring function.
Post-update chi2 distribution has a horrendous tail up to 10^7.
MTV plots: http://xrd-cache-1.t2.ucsd.edu/matevz/PKF/overlap-recheck-1/