-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add fillDescription to CommonTools/UtilAlgos/interface/Merger.h #43728
Conversation
cms-bot internal usage |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43728/38432
|
A new Pull Request was created by @silviodonato (Silvio Donato) for master. It involves the following packages:
@mandrenguyen, @jfernan2, @cmsbuild can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild, please test |
-1 Failed Tests: Build BuildI found compilation error when building: function for each template instantiation. 3. This can also happen when there is an inheritance heirarchy and multiple plugin modules are defined using derived classes and the base class which share the same fillDescriptions function. Fix these by redefining the fillDescriptions function in each derived class. ----- End Fatal Exception ------------------------------------------------- gmake: *** [lib/el8_amd64_gcc12/CommonToolsCandAlgos_plugins.edmplugin] Error 1 Entering library rule at CommonTools/CandAlgos >> Compiling /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_14_0_X_2024-01-16-2300/src/CommonTools/CandAlgos/src/GenJetParticleSelector.cc >> Compiling /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_14_0_X_2024-01-16-2300/src/CommonTools/CandAlgos/src/ModifyObjectValueBase.cc >> Compiling /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_14_0_X_2024-01-16-2300/src/CommonTools/CandAlgos/src/decayParser.cc >> Building shared library tmp/el8_amd64_gcc12/src/CommonTools/CandAlgos/src/CommonToolsCandAlgos/libCommonToolsCandAlgos.so |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43728/38433
|
Pull request #43728 was updated. @jfernan2, @cmsbuild, @mandrenguyen can you please check and sign again. |
It is still crashing, I need to implement the fillDescription for all classes derived from Merged.h |
…r PFClusterCandidateMerger SuperClusterMerger TrackSimpleMerger
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.
minor suggestion.
edm::InputTag("collection1"), | ||
edm::InputTag("collection2"), | ||
}); | ||
descriptions.add("basicClusterMerger", desc); |
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.
descriptions.add("basicClusterMerger", desc); | |
descriptions.addWithDefaultLabel(desc); |
?
edm::InputTag("collection1"), | ||
edm::InputTag("collection2"), | ||
}); | ||
descriptions.add("gsfElectronCollectionMerger", desc); |
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.
descriptions.add("gsfElectronCollectionMerger", desc); | |
descriptions.addWithDefaultLabel(desc); |
edm::InputTag("collection1"), | ||
edm::InputTag("collection2"), | ||
}); | ||
descriptions.add("patElectronCollectionMerger", desc); |
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.
descriptions.add("patElectronCollectionMerger", desc); | |
descriptions.addWithDefaultLabel(desc); |
edm::InputTag("collection1"), | ||
edm::InputTag("collection2"), | ||
}); | ||
descriptions.add("pfClusterRefCandidateMerger", desc); |
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.
descriptions.add("pfClusterRefCandidateMerger", desc); | |
descriptions.addWithDefaultLabel(desc); |
edm::InputTag("collection1"), | ||
edm::InputTag("collection2"), | ||
}); | ||
descriptions.add("superClusterMerger", desc); |
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.
descriptions.add("superClusterMerger", desc); | |
descriptions.addWithDefaultLabel(desc); |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43728/38435
|
Pull request #43728 was updated. @cmsbuild, @jfernan2, @mandrenguyen can you please check and sign again. |
…tedPFCandidateMerger L1TPFCandMerger EgammaIsolationAlgos PFProducer
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43728/38436
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
@@ -34,19 +36,20 @@ class Merger : public edm::global::EDProducer<> { | |||
explicit Merger(const edm::ParameterSet&); | |||
/// destructor | |||
~Merger() override; | |||
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); |
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 completely guessing, but I thought it would be enough to call addWithDefaultLabel
from the fillDescriptions
of the template class (here, Merger
), and then different cfi
s would be generated for the different instances automatically. Something like this seemed to work in #37039. (but again, I'm only guessing)
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.
That was my first attempt, but I got
----- Begin Fatal Exception 17-Jan-2024 12:20:25 CET-----------------------
An exception of category 'LogicError' occurred while
[0] Running executable "edmWriteConfigs"
[1] Processing library /afs/cern.ch/work/s/sdonato/CMSSW_14_0_X_2024-01-16-2300/tmp/el8_amd64_gcc12/src/CommonTools/RecoAlgos/plugins/CommonToolsRecoAlgos_plugins/libCommonToolsRecoAlgos_plugins.so
[2] Writing cfi files using ParameterSetDescriptions for module of base type EDProducer with plugin name 'SuperClusterMerger'
[3] Executing function ConfigurationDescriptions::writeCfiForLabel
Exception Message:
Two cfi files are being generated with the same name in the same directory.
The cfi file name is 'simpleMergedTracks_cfi.py' and
the module label is 'simpleMergedTracks'.
This error is probably caused by an error in one or more fillDescriptions functions
where duplicate module labels are being passed to the ConfigurationDescriptions::add
function. All such module labels must be unique within a package.
If you do not want the generated cfi file and do not need more than one
description for a plugin, then a way to fix this is to use the addDefault
function instead of the add function.
There are 3 common ways this problem can happen.
1. This can happen when a module label is explicitly duplicated in one or more
fillDescriptions functions. Fix these by changing the module labels to be unique.
2. This can also happen when a module class is a template class and plugins are
defined by instantiations with differing template parameters and these plugins
share the same fillDescriptions function. Fix these by specializing the fillDescriptions
function for each template instantiation.
3. This can also happen when there is an inheritance heirarchy and multiple plugin modules
are defined using derived classes and the base class which share the same fillDescriptions
function. Fix these by redefining the fillDescriptions function in each derived class.
----- End Fatal Exception -------------------------------------------------
``` (see above).
But probably it is because I used `add` instead of `addWithDefaultLabel`
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.
Indeed using addWithDefaultLabel
seems to solve the problem. Moved to #43731
Moved to #43731 |
PR description:
This PR addd fillDescription to CommonTools/UtilAlgos/interface/Merger.h in order to make it available in ConfDB.
No "_cfi" was available previeusly.
PR validation:
Without the PR the output is
If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:
Yes, I will need a backport to 13_3_X.
cc: @mmusich