import FWCore.ParameterSet.Config as cms import os relBase = os.environ['CMSSW_BASE'] ## PARSE ARGUMENTS from FWCore.ParameterSet.VarParsing import VarParsing options = VarParsing('analysis') options.register('isMC', '', VarParsing.multiplicity.singleton, VarParsing.varType.bool, 'Is MC') options.register('isTTbar', '', VarParsing.multiplicity.singleton, VarParsing.varType.bool, 'Is TTbar') options.isMC = True options.isTTbar = False options.inputFiles = [ #matched with ~jmanagan/nobackup/LJMet94X_1lep_013019_logs/nominal/TTTT_TuneCP5_PSweights_13TeV-amcatnlo-pythia8/producer_TTTT_TuneCP5_PSweights_13TeV-amcatnlo-pythia8_1.py 'root://cmsxrootd.fnal.gov//store/mc/RunIIFall17MiniAODv2/TTTT_TuneCP5_PSweights_13TeV-amcatnlo-pythia8/MINIAODSIM/PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/70000/0ED34A55-DD52-E811-91CC-E0071B73B6B0.root', 'root://cmsxrootd.fnal.gov//store/mc/RunIIFall17MiniAODv2/TTTT_TuneCP5_PSweights_13TeV-amcatnlo-pythia8/MINIAODSIM/PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/70000/E2A4455F-FA53-E811-8017-E0071B7A8560.root', #'root://cmsxrootd.fnal.gov//store/data/Run2017B/SingleMuon/MINIAOD/31Mar2018-v1/80000/4462B46E-653C-E811-BA97-0025905A6064.root' #'root://cmsxrootd.fnal.gov//store/mc/RunIIFall17MiniAODv2/TprimeTprime_M-1800_TuneCP5_13TeV-madgraph-pythia8/MINIAODSIM/PU2017_12Apr2018_94X_mc2017_realistic_v14-v2/80000/12A585B9-F46B-E811-A775-FA163EFD0C51.root' #'root://cmsxrootd.fnal.gov//store/mc/RunIIFall17MiniAODv2/TTToSemiLeptonic_TuneCP5_PSweights_13TeV-powheg-pythia8/MINIAODSIM/PU2017_12Apr2018_94X_mc2017_realistic_v14-v1/50000/5E7E4AA9-0743-E811-999A-0CC47A7C35A8.root' ] options.maxEvents = 100 options.parseArguments() isMC = options.isMC isTTbar = options.isTTbar ## LJMET process = cms.Process("LJMET")
# Try to guess the dataset from filename datasetRE = re.compile(".*/store.*/([^/]*)/([^/]*)/(MINIAODSIM|MINIAOD)/([^/]*).*root") m = datasetRE.match(process.source.fileNames[0]) if m: (era, dataset, dataTier, condition) = m.groups() conditions = era + '-' + condition else: (dataset, conditions, dataTier) = options.crabDataset.split('/')[1:] # Its a little annoying that this cannot be filled when using CRAB # since it evaluates the PSet at job submission process.source.fileNames = [] # Guess isMC if possible if dataset != 'Unknown': if dataTier == 'MINIAOD': options.isMC = False elif dataTier == 'MINIAODSIM': options.isMC = True # Choose a global tag # Reference: https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideFrontierConditions process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') if options.isMC: if 'RunIISpring16' in conditions: process.GlobalTag.globaltag = cms.string('80X_mcRun2_asymptotic_2016_miniAODv2_v1') elif 'RunIISummer16' in conditions: process.GlobalTag.globaltag = cms.string('80X_mcRun2_asymptotic_2016_TrancheIV_v8') else: print "WARNING: could not guess the global tag from dataset!" process.GlobalTag.globaltag = cms.string('80X_mcRun2_asymptotic_2016_miniAODv2_v1') else: