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
Conversation
…goTools configurable
The code-checks are being triggered in jenkins. |
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28200/12305
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_; |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also
std::string trackQuality = "highPurity"); | |
const std::string& trackQuality = "highPurity"); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(conf.existsAs<std::string>("trackQuality")) ? conf.getParameter<std::string>("trackQuality") : trackQuality_ = "highPurity"), | |
(conf.existsAs<std::string>("trackQuality")) ? conf.getParameter<std::string>("trackQuality") : "highPurity"), |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also
std::string trackQuality = "highPurity"); | |
const std::string& trackQuality = "highPurity"); |
std::string trackQuality) { | ||
|
||
//check quality of tracks | ||
if(!trackref->quality(reco::TrackBase::qualityByName(trackQuality))) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
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 |
…rder of debug and trackquality, no exception thrown though
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28200/12339
|
A new Pull Request was created by @jsalfeld (Jakob Salfeld-Nebgen) for master. It involves the following packages: RecoParticleFlow/PFProducer @perrotta, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28200/12478
|
please test |
The tests are being triggered in jenkins. |
Thanks for sorting this out. |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
+1
|
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) |
+1 |
@perrotta |
…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: