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
Fix of the L1CaloTowerTreeProducer and L1uGTTreeProducer to avoid an exception MustUseESGetToken #36756
Fix of the L1CaloTowerTreeProducer and L1uGTTreeProducer to avoid an exception MustUseESGetToken #36756
Conversation
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36756/27878
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36756/27879
|
A new Pull Request was created by @elfontan (Elisa Fontanesi) for master. It involves the following packages:
@epalencia, @cmsbuild, @cecilecaillol, @rekovic can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
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 understand that these plugins are meant to be used to produce private ntuples...
Nevertheless, since they are located in the plugin
area, and not in test
, I'd further fix the fact that they are legacy modules, and not thread safe ones. The simplest fix could be to make them edm::one::EDAnalyzer<>
, but probably they could even become global
modules as well with little effort
@@ -47,6 +47,7 @@ class L1uGTTreeProducer : public edm::EDAnalyzer { | |||
|
|||
// EDM input tokens | |||
const edm::EDGetTokenT<GlobalAlgBlkBxCollection> ugt_token_; | |||
edm::ESGetToken<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd> l1GtMenuToken_; |
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.
Make it const
, and initialize in the class initializer list
@@ -99,6 +100,7 @@ L1CaloTowerTreeProducer::L1CaloTowerTreeProducer(const edm::ParameterSet& iConfi | |||
ecalToken_ = consumes<EcalTrigPrimDigiCollection>(iConfig.getUntrackedParameter<edm::InputTag>("ecalToken")); | |||
hcalToken_ = consumes<HcalTrigPrimDigiCollection>(iConfig.getUntrackedParameter<edm::InputTag>("hcalToken")); | |||
l1TowerToken_ = consumes<l1t::CaloTowerBxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("l1TowerToken")); | |||
decoderToken_ = esConsumes<CaloTPGTranscoder, CaloTPGRecord>(); |
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.
Certainly all these tokens, but I'd say also most (if not all) class parameters can be made const
and initialized in the class initializer list
-1 Failed Tests: RelVals-INPUT CMS StaticAnalyzer warnings: There are 2 inherits from legacy modules warnings. See https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-22ebae/21841/llvm-analysis/legacy-mod-sa.txt for details. RelVals-INPUT
Comparison SummarySummary:
|
… initializer list)
@perrotta changes mentioned above should be correctly included, thank you very much for the suggestions! |
@perrotta The relvals validation failed for a file open error, similarly as in other of our PRs today and yesterday. Is there a central problem? What can we do? |
Yes, it is there since a few days already. The workflow must be updated with a reachable input file, ppd was informed. See also #36771 In the meanwhile, just ignore that single workflow, and consider the validation as passed if all other succeed |
+l1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (but tests are reportedly failing). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1
|
merge |
@@ -59,10 +59,10 @@ Description: Produce L1 Extra tree | |||
// class declaration | |||
// | |||
|
|||
class L1CaloTowerTreeProducer : public edm::EDAnalyzer { | |||
class L1CaloTowerTreeProducer : public edm::one::EDAnalyzer<> { |
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.
Since this is using the TFileService and only one module at a time can use that Service, this needs to be
class L1CaloTowerTreeProducer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
ecalToken_(consumes<EcalTrigPrimDigiCollection>(iConfig.getUntrackedParameter<edm::InputTag>("ecalToken"))), | ||
hcalToken_(consumes<HcalTrigPrimDigiCollection>(iConfig.getUntrackedParameter<edm::InputTag>("hcalToken"))), | ||
l1TowerToken_(consumes<l1t::CaloTowerBxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("l1TowerToken"))), | ||
decoderToken_(esConsumes<CaloTPGTranscoder, CaloTPGRecord>()) { | ||
edm::InputTag clusterTag = iConfig.getUntrackedParameter<edm::InputTag>("l1ClusterToken"); |
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.
One also needs to add in the constructor
usesResource(TFileService::kSharedResource);
Thank you @Dr15Jones , indeed we forgot it |
@Dr15Jones and @perrotta, thank you very much for the fix and the explanation! [1] cmssw/L1Trigger/L1TMuonOverlapPhase1/plugins/L1MuonOverlapPhase1ParamsDBProducer.h Line 16 in ffe0bbf
[2]
|
Uhm... In [1] I don't see any TFileService used in the code, and I
would say that WatchRun was not actually needed even there, in fact.
@Dr15Jones, what do you think? Am I wrong?
Elisa Fontanesi ***@***.***> ha scritto:
… @Dr15Jones and @perrotta, thank you very much for the fix and the
explanation!
Can you please further clarify how I can distinguish when I am using
a TFileService (so that only one module at a time can use the
service) and when not and the difference with other cases (e.g. here
[1] I see WatchRun and here [2] nothing)?
Thanks a lot,
--Elisa
[1]
https://github.com/cms-sw/cmssw/blob/ffe0bbf1e59edade2a85c26c30dd3d49c393fedb/L1Trigger/L1TMuonOverlapPhase1/plugins/L1MuonOverlapPhase1ParamsDBProducer.h#L16
[2]
https://github.com/cms-sw/cmssw/blob/c33bb6c199ba2b7d6eb8ebfa97b091a32c2c6333/L1Trigger/GlobalCaloTrigger/test/L1GctTestAnalyzer.h#L34
--
Reply to this email directly or view it on GitHub:
#36756 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
@elfontan here is the link to the Twiki about the different kinds of thread same module types: https://twiki.cern.ch/twiki/bin/view/CMSPublic/FWMultithreadedFrameworkModuleTypes In particular, the full interface for the The WatchRuns is described here It is only needed if the module in question needs to see beginRun or endRun transitions. |
@perrotta [1] does have a cmssw/L1Trigger/L1TMuonOverlapPhase1/plugins/L1MuonOverlapPhase1ParamsDBProducer.cc Line 16 in ffe0bbf
although it is so trivial as to have all its contents be easily moved to the |
@elfontan the only way I know it find TFileService is to check the module itself and any helper classes used by the module and see if they use the TFileService. Luckily, having helpers use the TFileService is not all that common so just looking at the body of the module often shows if it is used or not. |
@Dr15Jones many many thanks for your help and your comments! |
PR description:
The PR is needed to prevent the L1 Trigger emulation to crash when running in CMSSW_12_3_X using the cmsDriver command.
PR validation:
Basic tests performed successfully starting from CMSSW_12_3_0_pre3.
From CMSSW_12_3_0_pre3/src:
Checks that the following cmsDriver commands (for MC and data) are running properly:
MC:
Data: