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

Add fillDescription to CommonTools/UtilAlgos/interface/Merger.h #43728

Closed
wants to merge 4 commits into from

Conversation

silviodonato
Copy link
Contributor

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:

[sdonato@lxplus713 src]$ edmPluginHelp  -p TrackSimpleMerger
1  TrackSimpleMerger  (global::EDProducer)  "pluginCommonToolsRecoAlgos_plugins.so"

This plugin has 1 PSet description. This description is always used to validate configurations. The label below is used when generating the cfi file.

  1.1 module label: simpleMergedTracks

    src
                        type: VInputTag 
                        default: (vector size = 2)
                          [0]: 'collection1'
                          [1]: 'collection2'

    mightGet
                        type: untracked vstring optional
                        default: none
                        List contains the branch names for the EDProducts which might be requested by the module.
                        The format for identifying the EDProduct is the same as the one used for OutputModules, except no wild cards are allowed. E.g.
                        Foos_foomodule_whichFoo_RECO

Without the PR the output is

[sdonato@lxplus713 src]$ edmPluginHelp  -p TrackSimpleMerger
1  TrackSimpleMerger  (global::EDProducer)  "pluginCommonToolsRecoAlgos_plugins.so"

  This plugin has not implemented the function which defines its
  configuration descriptions yet. No descriptions are available.
  Its PSets will not be validated, and no cfi files will be generated.

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

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 17, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43728/38432

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @silviodonato (Silvio Donato) for master.

It involves the following packages:

  • CommonTools/UtilAlgos (reconstruction)

@mandrenguyen, @jfernan2, @cmsbuild can you please review it and eventually sign? Thanks.
@missirol this is something you requested to watch as well.
@antoniovilela, @sextonkennedy, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@mmusich
Copy link
Contributor

mmusich commented Jan 17, 2024

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

-1

Failed Tests: Build
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-de28bf/36882/summary.html
COMMIT: df5ba00
CMSSW: CMSSW_14_0_X_2024-01-16-2300/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/43728/36882/install.sh to create a dev area with all the needed externals and cmssw changes.

Build

I 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


@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43728/38433

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

Pull request #43728 was updated. @jfernan2, @cmsbuild, @mandrenguyen can you please check and sign again.

@silviodonato
Copy link
Contributor Author

It is still crashing, I need to implement the fillDescription for all classes derived from Merged.h

…r PFClusterCandidateMerger SuperClusterMerger TrackSimpleMerger
Copy link
Contributor

@mmusich mmusich left a 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);
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
descriptions.add("basicClusterMerger", desc);
descriptions.addWithDefaultLabel(desc);

?

edm::InputTag("collection1"),
edm::InputTag("collection2"),
});
descriptions.add("gsfElectronCollectionMerger", desc);
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
descriptions.add("gsfElectronCollectionMerger", desc);
descriptions.addWithDefaultLabel(desc);

edm::InputTag("collection1"),
edm::InputTag("collection2"),
});
descriptions.add("patElectronCollectionMerger", desc);
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
descriptions.add("patElectronCollectionMerger", desc);
descriptions.addWithDefaultLabel(desc);

edm::InputTag("collection1"),
edm::InputTag("collection2"),
});
descriptions.add("pfClusterRefCandidateMerger", desc);
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
descriptions.add("pfClusterRefCandidateMerger", desc);
descriptions.addWithDefaultLabel(desc);

edm::InputTag("collection1"),
edm::InputTag("collection2"),
});
descriptions.add("superClusterMerger", desc);
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
descriptions.add("superClusterMerger", desc);
descriptions.addWithDefaultLabel(desc);

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43728/38435

  • This PR adds an extra 24KB to repository

@cmsbuild
Copy link
Contributor

Pull request #43728 was updated. @cmsbuild, @jfernan2, @mandrenguyen can you please check and sign again.

…tedPFCandidateMerger L1TPFCandMerger EgammaIsolationAlgos PFProducer
@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43728/38436

  • This PR adds an extra 32KB to repository

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);
Copy link
Contributor

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 cfis would be generated for the different instances automatically. Something like this seemed to work in #37039. (but again, I'm only guessing)

Copy link
Contributor Author

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` 

Copy link
Contributor Author

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

@silviodonato
Copy link
Contributor Author

Moved to #43731

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.

4 participants