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

MP fix new tracklet with projections #237

Merged
merged 3 commits into from
Oct 24, 2023
Merged

Conversation

bryates
Copy link

@bryates bryates commented Sep 12, 2023

PR description:

This PR fixes a disagreement between the HLS and emulation. Currently, the emulation resets the best match values only when a new tracklet is found. This means tracklets with multiple projections can have issues, e.g.:

D2 PHIB
tracklet: 0x4933f000
proj: 0x7106acaa7f8a3c2  passes
proj: 0x01129bb27e8883d  failes

The PR looks instead uses the current and previous projection. It currently uses the string value, as this was easy to access. If this is inefficient, we could look into comparing the member values.

PR validation:

Full agreement with HLS in the barrel and disks for PHIB and PHIC

                      Tracklet  SUMMARY
number of stubs     per TFP = 363.0212 +- 8.0716
number of tracks    per TFP =  70.6402 +- 1.5618
current tracking efficiency =   0.9284 +- 0.0122
max     tracking efficiency =   0.9306 +- 0.0120
                  fake rate =   0.1789
             duplicate rate =   0.589

@bryates bryates requested review from tomalin and aryd September 12, 2023 19:33
@bryates
Copy link
Author

bryates commented Sep 12, 2023

CI is failing due to the fatal: detected dubious ownership in repository at '/github/workspace' error brought up today.

@aryd
Copy link

aryd commented Sep 14, 2023

I'm confused. A tracklet can only have one projection to a specific layer or disk. I don't see how we can have multiple projections to the same layer with one tracklet.

@bryates
Copy link
Author

bryates commented Sep 14, 2023

I'm confused. A tracklet can only have one projection to a specific layer or disk. I don't see how we can have multiple projections to the same layer with one tracklet.

Sorry, I mislabeled it above since I was testing D2 PHIB in HLS. The emulation does all layers together. I'll check where that other projection comes from.

@tomalin
Copy link
Collaborator

tomalin commented Sep 28, 2023

@bryates I think we're just waiting for you to finish answering Anders's comment above, before merging this.

@bryates
Copy link
Author

bryates commented Sep 29, 2023

I'm confused. A tracklet can only have one projection to a specific layer or disk. I don't see how we can have multiple projections to the same layer with one tracklet.

Sorry, I mislabeled it above since I was testing D2 PHIB in HLS. The emulation does all layers together. I'll check where that other projection comes from.

Ok

I'm confused. A tracklet can only have one projection to a specific layer or disk. I don't see how we can have multiple projections to the same layer with one tracklet.

Sorry, I mislabeled it above since I was testing D2 PHIB in HLS. The emulation does all layers together. I'll check where that other projection comes from.

@aryd, running again with it just set to print D2 PHIB I find he following:

Event 20:
tracklet = 0x1dd0b000
projection 1 = 0x01129bb27e8883d (no FM output)
projection 2 = 0x7106acaa7f8a3c2 (FM=0x011258000ff159)

So with the old setup, 0x01129bb27e8883d is processed correctly, but when it gets to 0x7106acaa7f8a3c2, it will not reload the LUT values.

The corresponding FM for projection 2 is found in FullMatches_FM_L1L2_D2PHIB_04.dat. This still doesn't answer the original question of why a single tracklet (in this case from L1L2) can have multiple projections into the disks (in this case D2).

Looking into TrackletProjections_TPROJ_L1L2B_D2PHIB_04.dat I only see the (correct) second projection (0x7106acaa7f8a3c2), meaning the TP emulation does not write out 0x01129bb27e8883d. I'm not as familiar with how the modules are chained together in the emulation. @aryd does the MP in the emulation read the TP text files, or are the memories passed directly as objects between the modules?

@aryd
Copy link

aryd commented Sep 29, 2023

I'm confused. A tracklet can only have one projection to a specific layer or disk. I don't see how we can have multiple projections to the same layer with one tracklet.

Sorry, I mislabeled it above since I was testing D2 PHIB in HLS. The emulation does all layers together. I'll check where that other projection comes from.

Ok

I'm confused. A tracklet can only have one projection to a specific layer or disk. I don't see how we can have multiple projections to the same layer with one tracklet.

Sorry, I mislabeled it above since I was testing D2 PHIB in HLS. The emulation does all layers together. I'll check where that other projection comes from.

@aryd, running again with it just set to print D2 PHIB I find he following:

Event 20:
tracklet = 0x1dd0b000
projection 1 = 0x01129bb27e8883d (no FM output)
projection 2 = 0x7106acaa7f8a3c2 (FM=0x011258000ff159)

So with the old setup, 0x01129bb27e8883d is processed correctly, but when it gets to 0x7106acaa7f8a3c2, it will not reload the LUT values.

The corresponding FM for projection 2 is found in FullMatches_FM_L1L2_D2PHIB_04.dat. This still doesn't answer the original question of why a single tracklet (in this case from L1L2) can have multiple projections into the disks (in this case D2).

Looking into TrackletProjections_TPROJ_L1L2B_D2PHIB_04.dat I only see the (correct) second projection (0x7106acaa7f8a3c2), meaning the TP emulation does not write out 0x01129bb27e8883d. I'm not as familiar with how the modules are chained together in the emulation. @aryd does the MP in the emulation read the TP text files, or are the memories passed directly as objects between the modules?

Can you share the code for how you generated the printout? In the emulation the data is passed directly as objects without out writing/reading files. Files can be written out for use in the HLS code.

@bryates
Copy link
Author

bryates commented Sep 29, 2023

I'm confused. A tracklet can only have one projection to a specific layer or disk. I don't see how we can have multiple projections to the same layer with one tracklet.

Sorry, I mislabeled it above since I was testing D2 PHIB in HLS. The emulation does all layers together. I'll check where that other projection comes from.

Ok

I'm confused. A tracklet can only have one projection to a specific layer or disk. I don't see how we can have multiple projections to the same layer with one tracklet.

Sorry, I mislabeled it above since I was testing D2 PHIB in HLS. The emulation does all layers together. I'll check where that other projection comes from.

@aryd, running again with it just set to print D2 PHIB I find he following:

Event 20:
tracklet = 0x1dd0b000
projection 1 = 0x01129bb27e8883d (no FM output)
projection 2 = 0x7106acaa7f8a3c2 (FM=0x011258000ff159)

So with the old setup, 0x01129bb27e8883d is processed correctly, but when it gets to 0x7106acaa7f8a3c2, it will not reload the LUT values.
The corresponding FM for projection 2 is found in FullMatches_FM_L1L2_D2PHIB_04.dat. This still doesn't answer the original question of why a single tracklet (in this case from L1L2) can have multiple projections into the disks (in this case D2).
Looking into TrackletProjections_TPROJ_L1L2B_D2PHIB_04.dat I only see the (correct) second projection (0x7106acaa7f8a3c2), meaning the TP emulation does not write out 0x01129bb27e8883d. I'm not as familiar with how the modules are chained together in the emulation. @aryd does the MP in the emulation read the TP text files, or are the memories passed directly as objects between the modules?

Can you share the code for how you generated the printout? In the emulation the data is passed directly as objects without out writing/reading files. Files can be written out for use in the HLS code.

I've just pushed a branch called mp_log which has all my code. The important part for this study is in

if (disk_test < trklet::N_DISK && abs(int(layerdisk_ - N_LAYER + 1)) == disk_test &&
name_.substr(name_.length() - 4, name_.length()) == "PHIB") {
std::cout << name_ << "\t" << disk << "\t" << newtracklet << "\t" << tracklet << "\t" << curr_proj << "\t"
<< next_proj << std::endl;
std::cout << (tracklet == curr_tracklet ? "(would skip) " : "")
<< "proj=" << trklet::hexFormat(tracklet->trackletprojstrD(disk)) << " (" << tracklet
<< ") current=" << curr_proj << std::endl;
}

@aryd
Copy link

aryd commented Oct 4, 2023

I looked at the code in mp_log, but it was not obvious where this:

tracklet = 0x1dd0b000
projection 1 = 0x01129bb27e8883d (no FM output)
projection 2 = 0x7106acaa7f8a3c2 (FM=0x011258000ff159)

was printed out - can you tell men the line numbers for these printouts? (I did not yet try to checkout and run the code.)

@bryates
Copy link
Author

bryates commented Oct 4, 2023

I looked at the code in mp_log, but it was not obvious where this:

tracklet = 0x1dd0b000 projection 1 = 0x01129bb27e8883d (no FM output) projection 2 = 0x7106acaa7f8a3c2 (FM=0x011258000ff159)

was printed out - can you tell men the line numbers for these printouts? (I did not yet try to checkout and run the code.)

These lines should give a similar printout:

std::cout << (tracklet == curr_tracklet ? "(would skip) " : "")
<< "proj=" << trklet::hexFormat(tracklet->trackletprojstrD(disk)) << " (" << tracklet
<< ") current=" << curr_proj << std::endl;

it will print whether it would be skipped, the projection, the tracklet in parentheses, and the previous projection

It's currently set to print just D2_PHIB

if (disk_test < trklet::N_DISK && abs(int(layerdisk_ - N_LAYER + 1)) == disk_test &&
name_.substr(name_.length() - 4, name_.length()) == "PHIB") {

@tomalin tomalin removed their request for review October 10, 2023 13:06
Copy link

@aryd aryd left a comment

Choose a reason for hiding this comment

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

This looks fine now. (We had a long exchange to get to the bottom of this, but I think the proposed fix is good.)

@aryd aryd merged commit 580f54c into L1TK-dev-13_3_0_pre2 Oct 24, 2023
tomalin pushed a commit that referenced this pull request Dec 29, 2023
* Check for new proj instead of new tracklet

* Ran code-format

* Back to tracklet, bool for first proj

---------

Co-authored-by: bryates <brent.yates@email.ucr.edu>
@bryates bryates deleted the mp_tracklet_proj branch February 8, 2024 17:47
tomalin pushed a commit that referenced this pull request Mar 7, 2024
* Check for new proj instead of new tracklet

* Ran code-format

* Back to tracklet, bool for first proj

---------

Co-authored-by: bryates <brent.yates@email.ucr.edu>
tomalin pushed a commit that referenced this pull request Mar 7, 2024
* Check for new proj instead of new tracklet

* Ran code-format

* Back to tracklet, bool for first proj

---------

Co-authored-by: bryates <brent.yates@email.ucr.edu>
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.

3 participants