-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[WIP] add fillPSetDescription
to CkfTrackCandidateMakerBase
and propagate it to CkfTrackCandidateMaker
#35385
[WIP] add fillPSetDescription
to CkfTrackCandidateMakerBase
and propagate it to CkfTrackCandidateMaker
#35385
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35385/25478
|
A new Pull Request was created by @mmusich (Marco Musich) for master. It involves the following packages:
@jpata, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
desc.add<edm::InputTag>("src", edm::InputTag("globalMixedSeeds")); | ||
|
||
edm::ParameterSetDescription psd0; | ||
desc.add<edm::ParameterSetDescription>("TrajectoryBuilderPSet", psd0); |
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'm afraid this states that the TrajectoryBuilderPSet
can be only an empty PSet.
In the CkfTrackCandidates_cfi
the TrajectoryBuilderPSet = cms.PSet(refToPSet_ = cms.string('GroupedCkfTrajectoryBuilder'))
means that the contents of TrajectoryBuilderPSet
are taken from process.GroupedCkfTrajectoryBuilder
PSet at the time the python configuration is "serialized" to be shipped to the C++ code, where the configuration validation, based on the ConfigurationDescriptions
, is run. The configuration validation should then fail because the PSet has unexpected parameters.
A complication here is that the parameters of this PSet depend (in general, at least, I didn't check this particular case) on the helper plugin. But, in this case the helper plugin type appears to be defined within the PSet, in which case it might be straightforward to use
https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideConfigurationValidationAndHelp#A_Plugin_Module_Using_Another_He
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 configuration validation should then fail because the PSet has unexpected parameters.
indeed it fails at runtime with:
----- Begin Fatal Exception 23-Sep-2021 18:17:08 CEST-----------------------
An exception of category 'Configuration' occurred while
[0] Constructing the EventProcessor
[1] Validating configuration of module: class=CkfTrackCandidateMaker label='convTrackCandidates'
Exception Message:
Illegal parameters found in configuration. The parameters are named:
'ComponentType'
'MeasurementTrackerName'
'TTRHBuilder'
'alwaysUseInvalidHits'
'bestHitOnly'
'estimator'
'foundHitBonus'
'inOutTrajectoryFilter'
'intermediateCleaning'
'keepOriginalIfRebuildFails'
'lockHits'
'lostHitPenalty'
'maxCand'
'minNrOfHitsForRebuild'
'propagatorAlong'
'propagatorOpposite'
'requireSeedHitsInRebuild'
'seedAs5DHit'
'trajectoryFilter'
'updator'
'useSameTrajFilter'
You could be trying to use parameter names that are not
allowed for this plugin or they could be misspelled.
----- End Fatal Exception -------------------------------------------------
I'm afraid this states that the TrajectoryBuilderPSet can be only an empty PSet.
now, this is quite unfortunate because in turn process.GroupedCkfTrajectoryBuilder
depends on other refToPSet_
s, e.g.:
trajectoryFilter = cms.PSet(refToPSet_ = cms.string('CkfBaseTrajectoryFilter_block')), |
and
inOutTrajectoryFilter = cms.PSet(refToPSet_ = cms.string('CkfBaseTrajectoryFilter_block')), |
. But, in this case the helper plugin type appears to be defined within the PSet, in which case it might be straightforward to use https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideConfigurationValidationAndHelp#A_Plugin_Module_Using_Another_He
Let me get this straight, where should I define the descriptions for the configurations that are just contained in a PSet
which doesn't seem to be directly linked with any EDModule
?
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.
Let me get this straight, where should I define the descriptions for the configurations that are just contained in a
PSet
which doesn't seem to be directly linked with anyEDModule
?
Strictly speaking there is no mechanism to define the fillDescriptions()
for such "global PSets". But such global PSets can still be used via cms.PSet(refToPSet_ = cms.string(...))
construct in an EDModule that uses the "helper plugin mechanism" in its fillDescriptions()
.
In the "helper plugin mechanism" the static void fillPSetDescription(edm::ParameterSetDescription& iDesc)
would be defined in all the plugin classes that are part of BaseCkfTrajectoryBuilderFactory
factory, the factory registration macro
EDM_REGISTER_PLUGINFACTORY(BaseCkfTrajectoryBuilderFactory, "BaseCkfTrajectoryBuilderFactory"); |
needs to be changed to
EDM_REGISTER_VALIDATED_PLUGINFACTORY
, and the plugin registration macro e.g. incmssw/RecoTracker/CkfPattern/plugins/SealModules.cc
Lines 21 to 22 in 1a6b75d
DEFINE_EDM_PLUGIN(BaseCkfTrajectoryBuilderFactory, CkfTrajectoryBuilder, "CkfTrajectoryBuilder"); | |
DEFINE_EDM_PLUGIN(BaseCkfTrajectoryBuilderFactory, GroupedCkfTrajectoryBuilder, "GroupedCkfTrajectoryBuilder"); |
need to be changed to
DEFINE_EDM_VALIDATED_PLUGIN
.
When using a global PSet via refToPSet_
in this setup the PSet is missing a parameter, that parameter is inserted into "a local copy of the PSet" during the configuration validation phase.
But a new parameter does not get added into the "global PSet" in the cfi generation phase. A new parameter gets added only to the cfi generated for the EDModule.
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 see, thanks. I will take a stab at it tomorrow.
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.
Thanks, @missirol I merged your commit, though I am a bit lost on what still needs to be done.
If I merge your changes on top of mine and I run for example wf. 4.53 I get:
----- Begin Fatal Exception 24-Sep-2021 17:15:28 CEST-----------------------
An exception of category 'Configuration' occurred while
[0] Constructing the EventProcessor
[1] Validating configuration of module: class=CkfTrackCandidateMaker label='convTrackCandidates'
Exception Message:
Illegal parameter found in configuration. The parameter is named:
'minGoodStripCharge'
You could be trying to use a parameter name that is not
allowed for this plugin or it could be misspelled.
----- End Fatal Exception -------------------------------------------------
while I would have naively expected that to be taken care from here:
4352178#diff-3a57ce7e190928d1e542d59a175b5be0b6b5d0c6bb0a664aa909e96778f92c6eR42
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.
When I last tested, I encountered a similar complaint (in a different wf, from a different module, about different parameters), so something must be off in how I filled the FillDescriptions
methods. I'll try to have a look today/tomorrow.
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35385/25519
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
@@ -26,6 +27,10 @@ class CompositeTrajectoryFilter : public TrajectoryFilter { | |||
|
|||
~CompositeTrajectoryFilter() override {} | |||
|
|||
static void fillPSetDescription(edm::ParameterSetDescription& iDesc){ | |||
// !!! MISSING |
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.
Just highlighting this function, because it needs to be implemented.
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.
yeah, I noticed that, but I was more curious about the ones that I don't understand, before tackling the one I do understand :)
be36ebb
to
97ab884
Compare
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35385/25520
|
@mmusich missirol@7d7525f includes some more fixes, but is still work-in-progress. With that, wf
These parameters should be provided by One problem might be that |
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35385/25548
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
kind ping on this, let us know if/how you plan to take this forward. |
Hi, I identified a couple of fixes, and I was planning to have an update in 1/2 days from now (assuming this works for @mmusich). |
missirol@cecd514 contains a new attempt from scratch (with all changes squashed, and rebased on top of
Details: |
kind ping on this |
@jpata sorry for the delay, I plan to come back to this later this week. |
kind ping on this |
kind 7-day ping |
-1 for now |
resolves #35344
PR description:
Address #35344 by adding a
fillPSetDescription
method toCkfTrackCandidateMakerBase
and propagate it toCkfTrackCandidateMaker
.PR validation:
It compiles, not yet run a full integration tests matrix.
if this PR is a backport please specify the original PR and why you need to backport that PR:
N/A