cms-jet / JetToolbox

Python framework for configuration of jet tools via the jet toolbox.
https://twiki.cern.ch/twiki/bin/viewauth/CMS/JetToolbox
7 stars 36 forks source link

Unrunnable schedule in jettoolbox102X_v2 #74

Closed mschnepf closed 4 years ago

mschnepf commented 5 years ago

Hi, we updated the jettoolbox used in CMSSW 10_6_5 (and CMSSW 10_2_10) to the newest version (commit https://github.com/cms-jet/JetToolbox/commit/4cc5a6c398353a62589227291ca17ecd567ccda4) . Since then, we got the following error message:

An exception of category 'ScheduleExecutionFailure' occurred while
   [0] Calling beginJob
Exception Message:
Unrunnable schedule
Module run order problem found: 
patJetsAK4PF after patJetsAK8PFPuppiPATJetswithUserData [path path], patJetsAK8PFPuppiPATJetswithUserData after ak8PFJetsPuppiConstituents [path path], ak8PFJetsPuppiConstituents after ak8PFJetsPuppi [path path], ak8PFJetsPuppi after patJetsAK8PFCHSPATJetswithUserData [path path], patJetsAK8PFCHSPATJetswithUserData after ak8PFJetsCHSConstituents [path path], ak8PFJetsCHSConstituents after ak8PFJetsCHS [path path], ak8PFJetsCHS after patJetsAK8PFPATJetswithUserData [path path], patJetsAK8PFPATJetswithUserData after ak8PFJetsConstituents [path path], ak8PFJetsConstituents after ak8PFJets [path path], ak8PFJets after patJetsAK4PFPuppiPATJetswithUserData [path path], patJetsAK4PFPuppiPATJetswithUserData after ak4PFJetsPuppiConstituents [path path], ak4PFJetsPuppiConstituents after ak4PFJetsPuppi [path path], ak4PFJetsPuppi after puppi [path path], puppi after AK4PFCHSpileupJetIdEvaluator [path path], AK4PFCHSpileupJetIdEvaluator after AK4PFCHSpileupJetIdCalculator [path path], AK4PFCHSpileupJetIdCalculator after patJetsAK4PFCHSPATJetswithUserData [path path], patJetsAK4PFCHSPATJetswithUserData after ak4PFJetsCHSConstituents [path path], ak4PFJetsCHSConstituents after ak4PFJetsCHS [path path], ak4PFJetsCHS after chs [path path], chs after patJetsAK4PFPATJetswithUserData [path path], patJetsAK4PFPATJetswithUserData consumes patJetsAK4PF
 Running in the threaded framework would lead to indeterminate results.
 Please change order of modules in mentioned Path(s) to avoid inconsistent module ordering.

Switching to an older commit (https://github.com/cms-jet/JetToolbox/commit/88aa03cc1e8c40ab2bbfd2a311b0139e6f402439) tagged as jettoolbox_102X_v1solved the problem. For both version we used the same config except for dataTier / miniAOD option.

Are there any other configurations required that are not meantioned in the wiki (https://twiki.cern.ch/twiki/bin/viewauth/CMS/JetToolbox)?

Best Regards, Matthias

alefisico commented 5 years ago

Hi Matthias just to make sure, are you using the jetToolbox with tag jetToolbox_102X_v2 or cloning the jetToolbox_102X branch? The 102X branch is a development branch and can contain errors. If you use the tag, then can you please give me more information to replicate your error? Which sample are you trying to access and can you add which configuration of the jetToolbox are you trying to run. And yes, the configuration between 102X_v1 and 102X_V2 must be the same except for the dataTier/miniAOD option.

cheers,

mschnepf commented 5 years ago

I cloned the jetToolbox_102X and tested it if the current commit as well as with the 102X_V2 tagged version. We tested it with the MINIAOD file root://xrootd-cms.infn.it//store/data/Run2017B/SingleMuon/MINIAOD/09Aug2019_UL2017-v1/50000/F738CB6B-FEB4-AC4D-A549-F25912F0C896.root Our configuration is:

for _jet_algo_radius in ('ak4', 'ak8'):
    for _PU_method in ("", "CHS", "Puppi"):
        _seq_name = "{}{}{}".format(jtb_sequence_name, _jet_algo_radius, _PU_method)
        _do_PUJetID = False
        if _jet_algo_radius == 'ak4' and _PU_method == "CHS":
            _do_PUJetID = True
        # create jet sequence with jet toolbox
        jetToolbox(process,
                   _jet_algo_radius,
                   _seq_name,
                   'out',
                   dataTier='miniAOD',
                   #miniAOD=True,
                   runOnMC=not options.isData,
                   JETCorrLevels=['L1FastJet', 'L2Relative', 'L3Absolute', 'L2L3Residual'],
                   PUMethod=_PU_method,    # PU subtraction method
                   addPruning=False,
                   addSoftDrop=False,
                   addPrunedSubjets=False,
                   addNsub=False,
                   maxTau=6,
                   addTrimming=False,
                   addFiltering=False,
                   addNsubSubjets=False,
                   #bTagDiscriminators=None,
                   addPUJetID=_do_PUJetID)
        # add jet sequence to process
        process.path *= getattr(process, _seq_name)
        # add PUJetID calculator and evaluator to process
        if _do_PUJetID:
            process.path *= getattr(process, "{}PF{}pileupJetIdCalculator".format(_jet_algo_radius.upper(), _PU_method))
            process.path *= getattr(process, "{}PF{}pileupJetIdEvaluator".format(_jet_algo_radius.upper(), _PU_method))
alefisico commented 5 years ago

thanks, I'll try to replicate the error and fix it asap. In the meantime, if the jetToolbox_102X_v1 works for you, I suggest to use that version. In v2 we include some nanoAOD functionality that might be creating some errors, but besides that the two versions should be the same for what you want to do.

alefisico commented 4 years ago

Hi @mschnepf sorry but I cannot reproduce your error. I tried in CMSSW_10_2_15 with a different file (because your file was made in an advance release) and it runs perfectly. Similarly in CMSSW_10_6_5 with your file. This is the config file that I am running:

import FWCore.ParameterSet.Config as cms
from Configuration.StandardSequences.Eras import eras
process = cms.Process('jetToolbox', eras.Run2_2017)

process.load("Configuration.EventContent.EventContent_cff")
process.load('Configuration.Geometry.GeometryRecoDB_cff')
process.load('Configuration.StandardSequences.MagneticField_38T_cff')
process.load('Configuration.StandardSequences.Services_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff')
process.GlobalTag.globaltag = '92X_upgrade2017_realistic_v1'

process.load('FWCore.MessageLogger.MessageLogger_cfi')
process.MessageLogger.cerr.FwkReport.reportEvery = 100
process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
process.options.allowUnscheduled = cms.untracked.bool(True)

from JMEAnalysis.JetToolbox.jetToolbox_cff import jetToolbox

for _jet_algo_radius in ('ak4', 'ak8'):
    for _PU_method in ("", "CHS", "Puppi"):
        _seq_name = "{}{}{}".format('dummy', _jet_algo_radius, _PU_method)
        _do_PUJetID = False
        if _jet_algo_radius == 'ak4' and _PU_method == "CHS":
            _do_PUJetID = True
        # create jet sequence with jet toolbox
        jetToolbox(process,
                   _jet_algo_radius,
                   _seq_name,
                   'out',
                   dataTier='miniAOD',
                   #miniAOD=True,
                   runOnMC=False,
                   JETCorrLevels=['L1FastJet', 'L2Relative', 'L3Absolute', 'L2L3Residual'],
                   PUMethod=_PU_method,    # PU subtraction method
                   addPruning=False,
                   addSoftDrop=False,
                   addPrunedSubjets=False,
                   addNsub=False,
                   maxTau=6,
                   addTrimming=False,
                   addFiltering=False,
                   addNsubSubjets=False,
                   #bTagDiscriminators=None,
                   addPUJetID=_do_PUJetID)

process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) )
process.source = cms.Source("PoolSource",
                fileNames = cms.untracked.vstring(
                    '/store/data/Run2017B/SingleMuon/MINIAOD/09Aug2019_UL2017-v1/50000/F738CB6B-FEB4-AC4D-A549-F25912F0C896.root'
            ),
        )
mschnepf commented 4 years ago

Hi Alejandro, thanks for your help. We needed some time to find out that we include some tasks which are included now by the jettoolbox. We removed *pileupJetIdEvaluator and *pileupJetIdCalculator as well as some PAT-jets tasks. This solved the conflict.