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

Fix of the L1CaloTowerTreeProducer and L1uGTTreeProducer to avoid an exception MustUseESGetToken #36756

Merged
merged 7 commits into from Jan 21, 2022

Conversation

elfontan
Copy link
Contributor

@elfontan elfontan commented Jan 20, 2022

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:

scram b distclean
git cms-checkdeps -a -A
scram b -j 8
scram b runtests
runTheMatrix.py -l limited -i all --ibeos

Checks that the following cmsDriver commands (for MC and data) are running properly:

MC:

  • cmsDriver.py l1Ntuple --python_filename mc.py -s L1REPACK:uGT,RAW2DIGI --mc -n -1 --conditions auto:phase1_2021_realistic --era Run3 --no_output --customise=L1Trigger/L1TNtuples/customiseL1Ntuple.L1NtupleRAWEMU --customise=L1Trigger/Configuration/customiseUtils.L1TGlobalMenuXML --filein /store/relval/CMSSW_12_0_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/120X_mcRun3_2021_realistic_v7-v2/10000/b67e121b-b29f-4eb0-8628-b3aa1cb76720.root
  • cmsDriver.py l1Ntuple --python_filename mc.py -s L1REPACK:FullMC,RAW2DIGI --mc -n -1 --conditions auto:phase1_2021_realistic --era Run3 --no_output --customise=L1Trigger/L1TNtuples/customiseL1Ntuple.L1NtupleRAWEMU --customise=L1Trigger/Configuration/customiseUtils.L1TGlobalMenuXML --filein /store/relval/CMSSW_12_0_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/120X_mcRun3_2021_realistic_v7-v2/10000/b67e121b-b29f-4eb0-8628-b3aa1cb76720.root

Data:

  • cmsDriver.py l1Ntuple -s L1REPACK:uGT,RAW2DIGI --python_filename=data.py -n -1 --no_output --era=Run2_2018 --data --conditions=120X_dataRun2_v2 --customise=L1Trigger/Configuration/customiseReEmul.L1TReEmulFromRAW --customise=L1Trigger/L1TNtuples/customiseL1Ntuple.L1NtupleRAWEMU --customise=L1Trigger/Configuration/customiseUtils.L1TGlobalMenuXML --filein=root://xrootd-cms.infn.it//store/data/Run2018D/EphemeralZeroBias8/RAW/v1/000/320/497/00000/04E0297E-C893-E811-B0AA-FA163EADBE2E.root

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36756/27878

  • This PR adds an extra 16KB to repository

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36756/27879

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @elfontan (Elisa Fontanesi) for master.

It involves the following packages:

  • L1Trigger/L1TNtuples (l1)

@epalencia, @cmsbuild, @cecilecaillol, @rekovic can you please review it and eventually sign? Thanks.
@dinyar, @missirol, @kreczko, @thomreis, @Martin-Grunewald this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@cecilecaillol
Copy link
Contributor

please test

Copy link
Contributor

@perrotta perrotta left a 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_;
Copy link
Contributor

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

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

@cmsbuild
Copy link
Contributor

-1

Failed Tests: RelVals-INPUT
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-22ebae/21841/summary.html
COMMIT: 25fd42a
CMSSW: CMSSW_12_3_X_2022-01-19-2300/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/36756/21841/install.sh to create a dev area with all the needed externals and cmssw changes.

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

  • 4.764.76_ZMuSkim2012D+ZMuSkim2012D+HLTDSKIM2+RECODR1reHLT2+HARVESTDR1reHLT/step2_ZMuSkim2012D+ZMuSkim2012D+HLTDSKIM2+RECODR1reHLT2+HARVESTDR1reHLT.log

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 2 differences found in the comparisons
  • DQMHistoTests: Total files compared: 43
  • DQMHistoTests: Total histograms compared: 3464860
  • DQMHistoTests: Total failures: 6
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3464832
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 42 files compared)
  • Checked 181 log files, 42 edm output root files, 43 DQM output files
  • TriggerResults: no differences found

@elfontan
Copy link
Contributor Author

@perrotta changes mentioned above should be correctly included, thank you very much for the suggestions!

@cecilecaillol
Copy link
Contributor

@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?

@perrotta
Copy link
Contributor

perrotta commented Jan 21, 2022

@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

@cecilecaillol
Copy link
Contributor

+l1

@cmsbuild
Copy link
Contributor

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)

@perrotta
Copy link
Contributor

+1

  • The fix applies to a couple of plugins only used to privately produce some L1 Trigger DPG ntuples used for L1T developments: as such it cannot affect the output of any workflow, and therefore it is suitable to be merged now for 12_3_0_pre4, even if that pre-release is only intended to integrate the updates/fixes to the Run3 geometry on top of pre3
  • (There is other code in the same area that also needs to be updated at some point)

@perrotta
Copy link
Contributor

merge

@cmsbuild cmsbuild merged commit 131e8b4 into cms-sw:master Jan 21, 2022
@@ -59,10 +59,10 @@ Description: Produce L1 Extra tree
// class declaration
//

class L1CaloTowerTreeProducer : public edm::EDAnalyzer {
class L1CaloTowerTreeProducer : public edm::one::EDAnalyzer<> {
Copy link
Contributor

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

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);

@perrotta
Copy link
Contributor

Thank you @Dr15Jones , indeed we forgot it
A fix following your recipe for the two files touched here is now submitted in #36777
@elfontan (or whoever will take care of migrating the remaining files in this package) will take care of it in the next updates.

@elfontan
Copy link
Contributor Author

@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]

class L1MuonOverlapPhase1ParamsDBProducer : public edm::one::EDAnalyzer<edm::one::WatchRuns> {

[2]
class L1GctTestAnalyzer : public edm::one::EDAnalyzer<> {

@perrotta
Copy link
Contributor

perrotta commented Jan 23, 2022 via email

@Dr15Jones
Copy link
Contributor

@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 one module can be found here
https://twiki.cern.ch/twiki/bin/view/CMSPublic/FWMultithreadedFrameworkOneModuleInterface

The WatchRuns is described here
https://twiki.cern.ch/twiki/bin/view/CMSPublic/FWMultithreadedFrameworkOneModuleInterface#edm_one_WatchRuns

It is only needed if the module in question needs to see beginRun or endRun transitions.

@Dr15Jones
Copy link
Contributor

@perrotta [1] does have a beginRun method

void L1MuonOverlapPhase1ParamsDBProducer::beginRun(edm::Run const& run, edm::EventSetup const& iSetup) {

although it is so trivial as to have all its contents be easily moved to the analyze method instead and then the use of edm::one::WatchRuns could be removed.

@Dr15Jones
Copy link
Contributor

@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.

@elfontan
Copy link
Contributor Author

@Dr15Jones many many thanks for your help and your comments!

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.

None yet

5 participants