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

Selector by region #31055

Merged
merged 8 commits into from
Aug 13, 2020
Merged

Selector by region #31055

merged 8 commits into from
Aug 13, 2020

Conversation

ats2008
Copy link
Contributor

@ats2008 ats2008 commented Aug 5, 2020

PR description:

Module that can take in a track collection and a tracking region , then produce the subset track collection with tracks that are compliant to the constraints in tracking region

PR validation:

Results for CMSSW_11_2_0_pre2 , RelValZMM_14

A brief overview :

RvR := Regionally reconstructed tracks passing the selector
GvR := Global pixel tracks passing the selector

SUMMARY for TrackingRegion : hltIterL3MuonPixelTracksTrackingRegions, TrackCollection : hltIterL3MuonPixelTracks

  • Total number of events triggered evts : 15301
  • Regionally reconstructed tracks : 16852
  • Total RvR Tracks : 16256
  • Missed RegReco Tracks in RvR Tracks : 596
  • Total GvR Tracks : 16331
  • Matched RegReco Tracks in GvR Tracks : 16244
  • Missed RegReco Tracks in GvR Tracks : 608
  • Addtional Tracks in GvR : 87

SUMMARY for TrackingRegion : hltPixelTracksTrackingRegionsL3MuonNoVtx, TrackCollection : hltPixelTracksL3MuonNoVtx

  • Total number of events triggered evts : 8242
  • Regionally reconstructed tracks : 216052
  • Total RvR Tracks : 126371
  • Missed RegReco Tracks in RvR Tracks : 89681
  • Total GvR Tracks : 126269
  • Matched RegReco Tracks in GvR Tracks : 125859
  • Missed RegReco Tracks in GvR Tracks : 90193
  • Addtional Tracks in GvR : 410

Plots for the same are attached alongside
TrackSelectorByRegion(3)
TrackSelectorByRegion(2)
TrackSelectorByRegion(1)
TrackSelectorByRegion

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 5, 2020

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 5, 2020

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-31055/17564

  • This PR adds an extra 624KB to repository

  • Found files with invalid states:

    • RecoTracker/FinalTrackSelectors/test/trackSelector_validation/dqmPlots.py:
    • RecoTracker/FinalTrackSelectors/test/trackSelector_validation/validate.cc:
    • RecoTracker/FinalTrackSelectors/test/trackSelector_validation/Harvesting_cfg.py:
    • RecoTracker/FinalTrackSelectors/test/trackSelector_validation/analyze.py:
    • RecoTracker/FinalTrackSelectors/test/trackSelector_validation/IsoMu24_config.py:

Code check has found code style and quality issues which could be resolved by applying following patch(s)

public:
explicit TrackSelectorByRegion(const edm::ParameterSet& conf)
: tracksToken_(consumes<reco::TrackCollection>(conf.getParameter<edm::InputTag>("tracks"))) {
inputTrkRegionToken_ = consumes<edm::OwnVector<TrackingRegion>>(conf.getParameter<edm::InputTag>("inputROI"));
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest to rename "inputROI" to "regions"

explicit TrackSelectorByRegion(const edm::ParameterSet& conf)
: tracksToken_(consumes<reco::TrackCollection>(conf.getParameter<edm::InputTag>("tracks"))) {
inputTrkRegionToken_ = consumes<edm::OwnVector<TrackingRegion>>(conf.getParameter<edm::InputTag>("inputROI"));
produce_collection = conf.getParameter<bool>("produceTrackCollection");
Copy link
Contributor

Choose a reason for hiding this comment

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

as briefly discussed today, it might be useful to have an other boolean parameter for handling the mask collection


auto tracksHandle = iEvent.getHandle(tracksToken_);

if (tracksHandle.isValid()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove the isValid() check; otherwise this module sill silently ignore any errors in the configuration.
If the handle is not valid it's OK to get a run time error.

const auto& regions = *regionsHandle;

for (const auto& tmp : regions)
if (const auto* roi = dynamic_cast<const TrackingRegion*>(&tmp)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

the dynamic_cast should not be needed any longer, because you have introduced the function in the TrackingRegion itself, now
(each region has its own implementation of the function, and it will be automatically called)

if (tracksHandle.isValid()) {
const auto tracks = *tracksHandle;
mask->assign(tracks.size(), false);
if (regionsHandle.isValid()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove this check - see above

if (regionsHandle.isValid()) {
const auto& regions = *regionsHandle;

for (const auto& tmp : regions)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rename tmp to region


for (const auto& tmp : regions)
if (const auto* roi = dynamic_cast<const TrackingRegion*>(&tmp)) {
auto amask = roi->checkTracks(tracks);
Copy link
Contributor

Choose a reason for hiding this comment

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

can be auto const& ... to avoid a copy (even though the compiler should optimise it away here)

for (const auto& tmp : regions)
if (const auto* roi = dynamic_cast<const TrackingRegion*>(&tmp)) {
auto amask = roi->checkTracks(tracks);
for (size_t it = 0; it < amask.size(); it++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest to use i for the counter instead of it; it looks like an iterator :-)

Comment on lines 67 to 69
for (size_t it = 0; it < mask->size(); it++)
if (mask->at(it))
output_tracks->push_back(tracks[it]);
Copy link
Contributor

Choose a reason for hiding this comment

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

these should be run only if(produce_collection) { ... }

#include <vector>
#include <memory>

namespace {
Copy link
Contributor

@fwyzard fwyzard Aug 5, 2020

Choose a reason for hiding this comment

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

Why do you put everything in an anonymous namespace ?

It's probably correct, but I don't think I have seen it used frequently (or at all) ?

if (!etaRange().inside(track.eta())) {
continue;
}
if (std::abs(reco::deltaPhi(track.phi(), phiDirection())) > phiMargin().right()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

see above

Copy link
Contributor

Choose a reason for hiding this comment

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

also, since phiMargin() could potentially be asymmetric, should this make explicit checks for direction - margin and direction + margin ?

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 6, 2020

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-31055/17712

  • This PR adds an extra 40KB to repository

@cmsbuild
Copy link
Contributor

Pull request #31055 was updated. @perrotta, @jpata, @cmsbuild, @slava77 can you please check and sign again.

@jpata
Copy link
Contributor

jpata commented Aug 12, 2020

@cmsbuild please test

Thanks for the update! I'll just run a quick build and then it should be fine from my side.

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 12, 2020

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+1
Tested at: 2888bd9
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0ab8c1/8726/summary.html
CMSSW: CMSSW_11_2_X_2020-08-12-1100
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0ab8c1/8726/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 2 differences found in the comparisons
  • DQMHistoTests: Total files compared: 35
  • DQMHistoTests: Total histograms compared: 2612401
  • DQMHistoTests: Total failures: 5
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 2612347
  • DQMHistoTests: Total skipped: 48
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.004 KiB( 34 files compared)
  • DQMHistoSizes: changed ( 10224.0 ): 0.004 KiB MessageLogger/Warnings
  • Checked 149 log files, 22 edm output root files, 35 DQM output files

@jpata
Copy link
Contributor

jpata commented Aug 13, 2020

+1

  • tests pass, changes to existing modules do not modify reco output as far as we can tell
  • new TrackSelectorByRegion EDProducer has been implemented and presented at the TSG
  • requested changes have been implemented
  • per Selector by region #31055 (comment) we expect a backport to 11_1_X for phase 2 HLT TDR studies

@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. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@qliphy
Copy link
Contributor

qliphy commented Aug 13, 2020

+1

@cmsbuild cmsbuild merged commit b68d91a into cms-sw:master Aug 13, 2020
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.

9 participants