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

PurgeDuplicates test-vectors (11_3_X) #70

Merged

Conversation

aehart
Copy link

@aehart aehart commented Feb 12, 2021

@skinnari @tomalin

PR description:

This is a duplicate of PR #69, but rebased to L1TK-dev-11_3_0_pre3.

This PR includes various changes needed to output a first version of the test-vectors for the development of the PurgeDuplicates HLS module, including both the TrackBuilder and TrackMerger steps.

These changes involve turning on writing the TrackFitMemories and CleanTrackMemories (corresponding to the output vectors for the TrackBuilder and TrackMerger, respectively) in the TrackletEventProcessor, and adjusting the output format in Tracklet::trackfitstr(). The stub r has also been added in Tracklet::fullmatchstr() and Tracklet::fullmatchdiskstr() (input vectors for the TrackBuilder).

PR validation:
Running the code with writeMem set to true in Settings.h correctly produces the test-vectors currently in use for development of the PurgeDuplicates module. The usual code checks and format scripts have also been run.

string stubid2 = "111111111";
string stubid3 = "111111111";
const std::string Tracklet::layerstubstr(const unsigned layer) const {
assert(layer <= 5);

Choose a reason for hiding this comment

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

super minor but can the 5 be a constant? (like N_DISK if that's what the 5 means)

Choose a reason for hiding this comment

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

correction: can be "layer < N_LAYER" ? where N_LAYER==6 (didn't read properly first...)

Copy link
Author

Choose a reason for hiding this comment

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

Done.

}
const FPGAWord tmp(trackIndex_, 7, true, __LINE__, __FILE__);

Choose a reason for hiding this comment

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

can we avoid hardcoded "7"?

Copy link
Author

Choose a reason for hiding this comment

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

Done.

}
}
const std::string Tracklet::diskstubstr(const unsigned disk) const {
assert(disk <= 4);

Choose a reason for hiding this comment

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

similarly here, can this be "disk < N_DISK" where N_DISK=5 from Settings.h?

Copy link
Author

Choose a reason for hiding this comment

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

Done.

if (!diskresid_[disk].valid())
oss << "0|0000000|0000000000|000000000000|000000000000|0000000";
else {
if (trackIndex_ < 0 || trackIndex_ > 127) {

Choose a reason for hiding this comment

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

avoid 127 hardcoded if possible

Copy link
Author

Choose a reason for hiding this comment

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

Done.

@skinnari
Copy link

@tomalin could you please have a look and see that you agree with the updates, then we can merge this? thanks!

@tomalin
Copy link
Collaborator

tomalin commented Feb 19, 2021

Are the names of the output memories sensible?

  1. Output of TrackBuilder is TrackFitMemories, despite the fact TrackBuilder doesn't fit the tracks.
  2. Output of TrackMerger is CleanTrackMemories. (Though DupKilledMemories might have been clearer). And slide 2 of https://indico.cern.ch/event/957554/contributions/4025232/attachments/2118379/3564551/HLSUpdateL1TrkAlg071020.pdf says TrackMerger writes MergeTrackMemories.

@aehart
Copy link
Author

aehart commented Feb 19, 2021

Are the names of the output memories sensible?

No, not really. I was hesitant to change the names because they are somewhat baked into the wiring files. That being said, I don't have an opinion one way or the other, so if you would like the names changed, I will change them.

If so, I would propose doing the following:

 } else if (memType == "TrackFit:" || memType == "BuiltTrack:") {
   addMemToVec(BT_, memName, settings_, isector_, phimin_, phimax_);
 } else if (memType == "CleanTrack:" || memType == "DupKilled:") {
   addMemToVec(DK_, memName, settings_, isector_, phimin_, phimax_);
  • Update the wiring files with the new names. I guess this is done with a PR to the cms-data/L1Trigger-TrackFindingTracklet?
  • When everything settles down and is merged, remove the old names from Sector.cc.

Technically, we don't need to update the names of the memories in the wiring files, but I think consistency is a good goal.

@tomalin
Copy link
Collaborator

tomalin commented Feb 19, 2021

@aryd as you're preparing C++ wiring code, would the proposed memory name change mentioned above cause any problems that you can see?

@aryd
Copy link

aryd commented Feb 19, 2021 via email

@aehart
Copy link
Author

aehart commented Feb 19, 2021

In particular, is the BT_ and DK_ new types of memories?

@aryd No, these would just be new names for what are now known as the TrackFitMemory and CleanTrackMemory. Nothing about the classes would change other than their names, which are meant to better reflect their roles in the hybrid algorithm.

@tomalin
Copy link
Collaborator

tomalin commented Feb 19, 2021

I favour the name change. I think the TrackFitMemory name is particularly confusing.

If we decide to go ahead with it, (i.e. if it is not too much work), I assume we'll have to make the same name change in the HLS code too). And yes the updated data files would go in https://github.com/cms-data/L1Trigger-TrackTracklet.git . (We could perhaps put both old & new names there for a while, to minimise problems). We'd also have to put the name change in both python & C++ wiring scripts.

The name change can be done as a separate PR, so I am approving this one.

Copy link
Collaborator

@tomalin tomalin left a comment

Choose a reason for hiding this comment

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

I've checked the code quality. And run the code and verified that we get output files.

@aehart aehart merged commit 1606921 into cms-L1TK:L1TK-dev-11_3_0_pre3 Feb 21, 2021
@aehart aehart deleted the purge_duplicates_test_vectors branch February 21, 2021 23:17
skinnari pushed a commit that referenced this pull request Mar 2, 2021
* Various changes for outputting PurgeDuplicates test-vectors.

* Removed some magic numbers.

* Updated trackfitstr() to be more readable and include more comments.

* Removed more magic.
skinnari pushed a commit that referenced this pull request May 20, 2021
…ms-patatrack#106)

Can be included with the following snippet in the configuration:

    from RecoPixelVertexing.Configuration.customizePixelTracksForProfiling import customizePixelTracksForProfiling
    process = customizePixelTracksForProfiling(process)

Removes validation, DQM, and output modules.
As suggested in #70 (comment), an `AsciiOutputModule` is used to require the `pixelTracks`.
skinnari pushed a commit that referenced this pull request May 20, 2021
* Various changes for outputting PurgeDuplicates test-vectors.

* Removed some magic numbers.

* Updated trackfitstr() to be more readable and include more comments.

* Removed more magic.
skinnari pushed a commit that referenced this pull request Jun 8, 2021
* Various changes for outputting PurgeDuplicates test-vectors.

* Removed some magic numbers.

* Updated trackfitstr() to be more readable and include more comments.

* Removed more magic.
skinnari pushed a commit that referenced this pull request Jun 22, 2021
* Various changes for outputting PurgeDuplicates test-vectors.

* Removed some magic numbers.

* Updated trackfitstr() to be more readable and include more comments.

* Removed more magic.
skinnari pushed a commit that referenced this pull request Jun 22, 2021
* Various changes for outputting PurgeDuplicates test-vectors.

* Removed some magic numbers.

* Updated trackfitstr() to be more readable and include more comments.

* Removed more magic.
skinnari pushed a commit that referenced this pull request Jul 9, 2021
* Various changes for outputting PurgeDuplicates test-vectors.

* Removed some magic numbers.

* Updated trackfitstr() to be more readable and include more comments.

* Removed more magic.
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.

None yet

4 participants