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

make track quality requirement in GeneralTracksImporter and PFTrackAl… #28200

Merged
merged 6 commits into from Oct 29, 2019

Conversation

jsalfeld
Copy link
Contributor

…goTools configurable

PR description:

Track Quality requirements in the PFBlockProducer are hardcoded. This PR is intended add configurability.

PR validation:

I ran OnLine_HLT_GRun.py with the new input for different track quality requirements in "process.hltParticleFlowBlock" PFBlockProducer. Locally I did a print out to check if bools are set correctly and the string correctly passed.

if this PR is a backport please specify the original PR:

Before submitting your pull requests, make sure you followed this checklist:

@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-28200/12305

  • This PR adds an extra 20KB to repository

  • There are other open Pull requests which might conflict with changes you have proposed:

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

@@ -31,10 +33,10 @@ class GeneralTracksImporter : public BlockElementImporterBase {

edm::EDGetTokenT<reco::PFRecTrackCollection> src_;
edm::EDGetTokenT<reco::MuonCollection> muons_;
std::string trackQuality_;
Copy link
Contributor

Choose a reason for hiding this comment

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

could you make this const ?

@@ -18,5 +18,6 @@ namespace PFTrackAlgoTools {
const std::vector<double>& DPtovPtCut,
const std::vector<unsigned>& NHitCut,
bool useIterTracking,
bool debug = false);
bool debug = false,
std::string trackQuality = "highPurity");
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 swap the order, and have trackQuality before debug.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also

Suggested change
std::string trackQuality = "highPurity");
const std::string& trackQuality = "highPurity");

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 change of order would complicate backward compatibility and introduce changes to where this function ("goodPtResolution") is used without trackQuality variable as input explicitly.

Let me know if this is ok (in principle I agree that having "debug" as last variable).

As far as I can tell, the affected classes are these ones:
RecoParticleFlow/PFTracking/plugins/HGCalTrackCollectionProducer.cc
RecoParticleFlow/PFProducer/plugins/importers/GeneralTracksImporterWithVeto.cc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@makortel is your suggested change ready to go into the commit or needs testing?
@fwyzard let me know if the other classes should be changed to accommodate the suggested change of order

Copy link
Contributor

@fwyzard fwyzard Oct 17, 2019

Choose a reason for hiding this comment

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

I think you can find out by running git cms-checkdeps -a, rebuilding with scram b, and seeing what breaks...

@@ -15,6 +15,8 @@ class GeneralTracksImporter : public BlockElementImporterBase {
: BlockElementImporterBase(conf, sumes),
src_(sumes.consumes<reco::PFRecTrackCollection>(conf.getParameter<edm::InputTag>("source"))),
muons_(sumes.consumes<reco::MuonCollection>(conf.getParameter<edm::InputTag>("muonSrc"))),
trackQuality_(
(conf.existsAs<std::string>("trackQuality")) ? conf.getParameter<std::string>("trackQuality") : trackQuality_ = "highPurity"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
(conf.existsAs<std::string>("trackQuality")) ? conf.getParameter<std::string>("trackQuality") : trackQuality_ = "highPurity"),
(conf.existsAs<std::string>("trackQuality")) ? conf.getParameter<std::string>("trackQuality") : "highPurity"),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@makortel is your suggested change ready to go into the commit or needs testing?

@@ -18,5 +18,6 @@ namespace PFTrackAlgoTools {
const std::vector<double>& DPtovPtCut,
const std::vector<unsigned>& NHitCut,
bool useIterTracking,
bool debug = false);
bool debug = false,
std::string trackQuality = "highPurity");
Copy link
Contributor

Choose a reason for hiding this comment

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

Also

Suggested change
std::string trackQuality = "highPurity");
const std::string& trackQuality = "highPurity");

std::string trackQuality) {

//check quality of tracks
if(!trackref->quality(reco::TrackBase::qualityByName(trackQuality)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, it would be better to do the string-to-enum conversion (reco::TrackBase::qualityByName()) once in the constructor (and possibly throw an exception if the returned value is undefQuality), and pass the enum to this function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@makortel apart from the last comment, is your suggested change ready to go into the commit or needs testing?

Copy link
Contributor

Choose a reason for hiding this comment

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

Changing the trackQuality parameter here and GeneralTracksImporter::trackQuality_ to TrackBase::TrackQuality enum? Yes, please do (and of course it needs to be eventually tested).

@hatakeyamak
Copy link
Contributor

hatakeyamak commented Oct 17, 2019

Thanks Jakob!

Perhaps this is beyond the scope of this PR, but it might be nice if we can move these config parameter setting for PFBlockProducer to fillDescription-based, as I am doing for PFProducer on #28110
(https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideConfigurationValidationAndHelp)
which allow us to validate input parameters. Just wanted to mention this to see if this is something RECO conveners would prefer and Jakob would be willing to work on.

…rder of debug and trackquality, no exception thrown though
@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-28200/12339

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @jsalfeld (Jakob Salfeld-Nebgen) for master.

It involves the following packages:

RecoParticleFlow/PFProducer
RecoParticleFlow/PFTracking

@perrotta, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@mmarionncern, @makortel, @cbernet, @rovere, @lgray, @bachtis, @hatakeyamak, @seemasharmafnal this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@slava77
Copy link
Contributor

slava77 commented Oct 18, 2019

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 18, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/3034/console Started: 2019/10/19 00:20

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@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-28200/12478

@cmsbuild
Copy link
Contributor

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

@perrotta
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 28, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/3202/console Started: 2019/10/28 16:58

@hatakeyamak
Copy link
Contributor

yes indeed, will do asap. I assume these things will be fixed once the fillDescription is used and the cfi`s are produced automatically.

Thanks for sorting this out.

@cmsbuild
Copy link
Contributor

@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-2ee0e7/3202/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 34
  • DQMHistoTests: Total histograms compared: 2961036
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2960693
  • DQMHistoTests: Total skipped: 341
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 33 files compared)
  • Checked 147 log files, 16 edm output root files, 34 DQM output files

@perrotta
Copy link
Contributor

+1

  • The trackQuality to compare with is now made configurable in the mentioned classes
  • Some cleaning of the code and python configurations is also implemented
  • Jenkins tests pass and show no difference

@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. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2)

@fabiocos
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 4e01538 into cms-sw:master Oct 29, 2019
@Martin-Grunewald
Copy link
Contributor

Martin-Grunewald commented Oct 30, 2019

@perrotta
Just to confirm: PFBlockProducer is currently parsed from RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py
But the two parameters you mention are NOT top-level parameters but inside nested PSets, and so they would need to be added by hand in existing ConfDB instances of the module.

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

10 participants