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

Adding an HLT filter based on PPS local track multiplicity conditions for selection of events for PPS PCL #34827

Merged
merged 4 commits into from Aug 25, 2021

Conversation

maaraujo94
Copy link
Contributor

PR description:

This PR implements an HLT filter which selects events based on multiplicity conditions of the proton tracks from the PPS detector. It is to be used in the PCL of the PPS for the calibration streams.

PR validation:

Filter has been run on run 2 data and has worked as expected. More information on tests done is shown here

if this PR is a backport please specify the original PR and why you need to backport that PR:

PR is not a backport.

cc: @fabferro @jjhollar @kshcheli @jan-kaspar @vavati

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-34827/24606

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @maaraujo94 for master.

It involves the following packages:

  • HLTrigger/special (hlt)

@Martin-Grunewald, @cmsbuild can you please review it and eventually sign? Thanks.
@Martin-Grunewald this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

Copy link
Contributor

@Martin-Grunewald Martin-Grunewald left a comment

Choose a reason for hiding this comment

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

Looks like there is a lot of unneeded code included, or some other code is missing...


// strip map definition
// diamond map definition

Copy link
Contributor

Choose a reason for hiding this comment

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

Why are there no strip/diam settings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have the strip and diam options in place but not fully defined. This is done in case there is a future decision to include these detectors in the filter as well. As they are unused for the current implementation of the filter, all references to strip / diam conditions can be removed for clarity.

}

// Then filter on strips (2016-17) selection
if (!strip_filter_.empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

strip is always empty as it is not being set beforehand

if (strip_filter_.count(rpv.id) == 0)
continue;
auto& fltr = strip_filter_.at(rpv.id);
fltr = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

If fltr is set to true always, then why the previous line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure what this comment is pointing out, but as mentioned in the previous reply, the strip / diam conditions can be removed, which would remove the problem for these detectors. Does this issue also apply to the case of the pixels? If so, please elaborate on what the issue is as I don't understand it at the moment.

Copy link
Contributor

Choose a reason for hiding this comment

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

You set fltr to strip_filter something, and then the line immediatly afterwards you set fltr to true, so it gets reassigned a constant value...

}

// Finally filter on diamond (2016+) selection
if (!diam_filter_.empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

diam is always empty as it is not being set beforehand

if (diam_filter_.count(rpv.id) == 0)
continue;
auto& fltr = diam_filter_.at(rpv.id);
fltr = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

If fltr is set to true always, then why the previous line?

// maps for assigning filter pass / fail
std::unordered_map<uint32_t, bool> pixel_filter_;
std::unordered_map<uint32_t, bool> strip_filter_;
std::unordered_map<uint32_t, bool> diam_filter_;
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems these 3 maps are just used as bools to switch on/off IDs, so these variables could become (const) class members and initialised as such in the class, rather than being local variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The maps are used as bools to store whether the track multiplicity of each detector is within the max and min number of tracks. The final filter condition combines the result for each detector in a single logical expression, depending on which type of filtering is done.
Given their purpose, I'm not sure how to define the maps as const class members and initialize them in the class, and still be able to change their value when the filter checks track multiplicity conditions. Could you give an example of how to implement this?

@qliphy
Copy link
Contributor

qliphy commented Aug 16, 2021

@maaraujo94 Would you please address above comments?

@maaraujo94
Copy link
Contributor Author

Thank you for the reminder. I have addressed the comments on the code and will await responses to these, then implement the necessary changes and push the updates.

@Martin-Grunewald
Copy link
Contributor

Please remove placeholder/unused code.

pixel_filter_[CTPPSPixelDetId(0, 2, 3)] = false;
pixel_filter_[CTPPSPixelDetId(1, 0, 3)] = false;
pixel_filter_[CTPPSPixelDetId(1, 2, 3)] = false;

Copy link
Contributor

Choose a reason for hiding this comment

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

pixel_filter never gets changed after these lines, so can be class members initialised in the class.
Same for the other two Boolean arrays.

@maaraujo94
Copy link
Contributor Author

I have updated and pushed the code, removing the unused code for strips and diam and also removing the auxiliary variable "fltr", which is not essential and which I believe was obscuring how the filter is processed, raising issues about the definitions of the maps of booleans.
Please let me know if I have misunderstood any of the issues above and they still stand in the current form of the filter.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-34827/24748

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

Pull request #34827 was updated. @Martin-Grunewald, @cmsbuild can you please check and sign again.

@Martin-Grunewald
Copy link
Contributor

I still think the Boolean unordred_maps should be class members and initialised in the constructor (even if not const, syntax becomes ugly), as the maps do not seem to be changed during the event processing.

@maaraujo94
Copy link
Contributor Author

I have attempted this change and found that, due to the definition of the filter as "bool filter (...) const", it is not possible to alter the boolean values of the map inside the filter if they are class members (lines 98, 104, 106 of the code give compilation errors related to this). This const declaration does not seem to be removable as it's an imposition for a global EDFilter. Please advise on which changes to apply to the filter declaration and class type to circumvent this issue.

@Martin-Grunewald
Copy link
Contributor

Ah ok, never mind then.

@Martin-Grunewald
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-34827/24846

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

Pull request #34827 was updated. @Martin-Grunewald, @cmsbuild can you please check and sign again.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-34827/24847

  • This PR adds an extra 16KB to repository

@perrotta
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f2761f/17994/summary.html
COMMIT: 69e510a
CMSSW: CMSSW_12_1_X_2021-08-23-2300/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/34827/17994/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 3 differences found in the comparisons
  • DQMHistoTests: Total files compared: 39
  • DQMHistoTests: Total histograms compared: 3000352
  • DQMHistoTests: Total failures: 5
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3000324
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.004 KiB( 38 files compared)
  • DQMHistoSizes: changed ( 312.0 ): 0.004 KiB MessageLogger/Warnings
  • Checked 165 log files, 37 edm output root files, 39 DQM output files
  • TriggerResults: no differences found

@Martin-Grunewald
Copy link
Contributor

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@perrotta
Copy link
Contributor

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants