def __init__(self, name, user, dataset, pattern, splitFactor, tune, setup ): self.name = name print "checking "+self.name self.files = datasetToSource( user, dataset, pattern).fileNames # , True for readCache (?) self.splitFactor = splitFactor self.tune = tune self.setup = setup
def __init__(self, name, user, dataset, pattern, splitFactor, tune, setup): self.name = name print "checking " + self.name self.files = datasetToSource( user, dataset, pattern).fileNames # , True for readCache (?) self.splitFactor = splitFactor self.tune = tune self.setup = setup
def getFiles(datasets, user, pattern): files = [] for d in datasets: ds = datasetToSource(user, d, pattern) files.extend(ds.fileNames) #root://eoscms//eos/cms/store/cmst3/user/wreece/CMG/MultiJet/Run2011A-PromptReco-v6/AOD/V2/PAT_CMG_V2_4_0/L1MultiJetSkim/wreece_051211/susy_tree_CMG_0.root return ['root://eoscms//eos/cms%s' % f for f in files]
def runCfg(cfg, idString, run=True, cmd='', mc=True, file=None): print '*************************' frame = inspect.currentframe() printArgs(frame) print '*************************' outDirName = '{cfg}_{idString}'.format(cfg=cfg, idString=idString) try: os.mkdir(outDirName) except OSError: shutil.rmtree(outDirName) os.mkdir(outDirName) cfg = makeInputCfg(outDirName, cfg, mc) handle = open(cfg, 'r') cfo = imp.load_source("pycfg", cfg, handle) process = cfo.process dsow = 'cmgtools_group' dsna = dataset_name_mc if mc is False: dsna = dataset_name_data if file is None: process.source = datasetToSource(dsow, dsna) else: process.source.fileNames = [':'.join(['file', file])] process.maxEvents = cms.untracked.PSet( input=cms.untracked.int32(maxEvents)) outCfgFileName = 'run_cfg.py' cfgFile = open('/'.join([outDirName, outCfgFileName]), 'w') cfgFile.write('import FWCore.ParameterSet.Config as cms\n\n') cfgFile.write(process.dumpPython()) cfgFile.write('\n') cfgFile.close() if run: oldPwd = os.getcwd() os.chdir(outDirName) cmsRunCmd = ['cmsRun', outCfgFileName] # if cmd == 'nohup': # cmsRunCmd.insert(0, cmd) # cmsRunCmd.append('&') out = subprocess.Popen(cmsRunCmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() print out[0] print out[1] os.chdir(oldPwd) return outDirName
def runCfg( cfg, idString, run=True, cmd='', mc=True, file=None ): print '*************************' frame = inspect.currentframe() printArgs(frame) print '*************************' outDirName = '{cfg}_{idString}'.format(cfg=cfg, idString=idString) try: os.mkdir( outDirName ) except OSError: shutil.rmtree( outDirName ) os.mkdir( outDirName ) cfg = makeInputCfg(outDirName, cfg, mc ) handle = open(cfg, 'r') cfo = imp.load_source("pycfg", cfg, handle) process = cfo.process dsow = 'cmgtools_group' dsna = dataset_name_mc if mc is False: dsna = dataset_name_data if file is None: process.source = datasetToSource( dsow, dsna ) else: process.source.fileNames = [':'.join(['file',file])] process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(maxEvents) ) outCfgFileName = 'run_cfg.py' cfgFile = open( '/'.join([outDirName, outCfgFileName]),'w') cfgFile.write('import FWCore.ParameterSet.Config as cms\n\n') cfgFile.write( process.dumpPython() ) cfgFile.write( '\n' ) cfgFile.close() if run: oldPwd = os.getcwd() os.chdir( outDirName ) cmsRunCmd = ['cmsRun', outCfgFileName] # if cmd == 'nohup': # cmsRunCmd.insert(0, cmd) # cmsRunCmd.append('&') out = subprocess.Popen(cmsRunCmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE ).communicate() print out[0] print out[1] os.chdir( oldPwd ) return outDirName
def getFiles(datasets, user, pattern): files = [] for d in datasets: ds = datasetToSource( user, d, pattern ) files.extend(ds.fileNames) #root://eoscms//eos/cms/store/cmst3/user/wreece/CMG/MultiJet/Run2011A-PromptReco-v6/AOD/V2/PAT_CMG_V2_4_0/L1MultiJetSkim/wreece_051211/susy_tree_CMG_0.root return ['root://eoscms//eos/cms%s' % f for f in files]
process = cms.Process("ANA") process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(2000) ) process.maxLuminosityBlocks = cms.untracked.PSet( input = cms.untracked.int32(-1) ) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'cmgtools_group', '/DoubleMu/Run2012A-13Jul2012-v1/AOD/V5_B', '.*root' ) # reading the first 10 files: nFiles = 5 print 'WARNING: RESTRICTING INPUT TO THE FIRST', nFiles, 'FILES' process.source.fileNames = process.source.fileNames[:nFiles] print process.source.fileNames process.pfLeafCandidates = cms.EDProducer( "CandReducer", src = cms.InputTag("particleFlow") )
import FWCore.ParameterSet.Config as cms process = cms.Process("myprocess") process.load('FWCore.MessageService.MessageLogger_cfi') from CMGTools.Production.datasetToSource import * from CMGTools.Common.Tools.applyJSON_cff import * ##-------------------- Define the source ---------------------------- process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.source = datasetToSource('cmgtools','/DoubleMu/Run2012B-PromptReco-v1/AOD/PAT_CMG_V5_4_0_runrange_194480-195016', 'cmgTuple_.*root') data = createDataset('cmgtools','/DoubleMu/Run2012B-PromptReco-v1/AOD/PAT_CMG_V5_4_0_runrange_195017-195396','cmgTuple_.*root', False) process.source.fileNames.extend(data.listOfGoodFiles()) data = createDataset('cmgtools','/DoubleMu/Run2012B-PromptReco-v1/AOD/PAT_CMG_V5_4_0_runrange_195397-195775','cmgTuple_.*root', False) process.source.fileNames.extend(data.listOfGoodFiles()) data = createDataset('cmgtools','/DoubleMu/Run2012B-PromptReco-v1/AOD/PAT_CMG_V5_4_0_runrange_195776-195947','cmgTuple_.*root', False) process.source.fileNames.extend(data.listOfGoodFiles()) data = createDataset('cmgtools','/DoubleMu/Run2012B-PromptReco-v1/AOD/PAT_CMG_V5_4_0_runrange_195948-196509','cmgTuple_.*root', False) process.source.fileNames.extend(data.listOfGoodFiles()) applyJSON(process,'Cert_190456-196531_8TeV_PromptReco_Collisions12_JSON.txt') process.TFileService=cms.Service("TFileService",fileName=cms.string('flatTree.root')) ############# Format MessageLogger ################# process.MessageLogger.cerr.FwkReport.reportEvery = 1000 ##-------------------- User analyzer -------------------------------- process.zjet = cms.EDAnalyzer('FlatTreeProducer', jets = cms.InputTag('cmgPFJetSel'),
NUM_VHAD_GEN = 1 ## MessageLogger process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.cerr.FwkReport.reportEvery = 10000 ## Input files from CMGTools.Production.datasetToSource import * datasetInfo = ( 'CMS', 'WWJetsTo2L2Nu_TuneZ2star_8TeV-madgraph-tauola/AODSIM', #'/DYJetsToLL_PtZ-100_TuneZ2star_8TeV_ext-madgraph-tarball/Summer12_DR53X-PU_S10_START53_V7C-v1/AODSIM', '.*root') process.source = datasetToSource( *datasetInfo ) process.source.fileNames = process.source.fileNames[:20] # If you want you can overwrite the previous input filenames like this: #####process.source.fileNames = ['file:root://eoscms//eos/cms/store/cmst3/group/cmgtools/CMG/DY2JetsToLL_M-50_TuneZ2Star_8TeV-madgraph/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5_B/PFAOD_0.root'] #process.source.fileNames = ['file:root://eoscms//eos/cms/store/data/Run2012C/DoublePhotonHighPt/AOD/PromptReco-v2/000/200/600/0AA4E2BB-2BE5-E111-B3A8-00237DDC5C24.root'] ##process.source.fileNames = ['file:root://eoscms//eos/cms/store/cmst3/user/bonato/patTuple/2012/EXOVVtest/BulkG_ZZllqq_M1000_c0p2_STEP3_AODSIM_24_1_fvt.root'] #process.source.fileNames = [ # "/store/group/phys_exotica/leptonsPlusJets/ExoDiBosonResonances/tomei/store/user/tomei/BulkG_ZZ_lljj_M2000_G120-JHU/BulkG_ZZ_lljj_M2000_G120-JHU/c8f8ed334db8a7d6f56c62266b1dfa5b/Bulk_AODSIM_6_1_GAz.root" # ] #process.source.fileNames = ['file:root://eoscms//eos/cms/store/cmst3/user/santanas/Samples/AODSIM/BulkG_WW_inclusive_c0p2_M1100_AODSIM_E6E2BD75-6220-E311-98A7-003048FFD79C.root'] process.source.fileNames = [ 'file:root://osg-se.sprace.org.br//store/user/caber/AbelianZprime_M-2000_hZ_tautauqq_LHCC_NEW-Madgraph5_31072013/AbelianZprime_M-2000_hZ_tautauqq_LHCC-Madgraph5_03082013_V2_AODSIM/c8f8ed334db8a7d6f56c62266b1dfa5b/HZ_TAUTAUJJ_AODSIM_1_1_C6P.root' ]
# process.load("CMGTools.Common.sources.SingleMu.Run2011A_May10ReReco_v1.AOD.source_cff") #process.load("CMGTools.Common.sources.HT.Run2011A_May10ReReco_v1.AOD.V2.source_cff") # process.load("CMGTools.Common.sources.VBF_HToTauTau_M_115_7TeV_powheg_pythia6_tauola.Summer11_PU_S4_START42_V11_v1.AODSIM.V2.source_cff") if pickRelVal: process.source = cms.Source( "PoolSource", fileNames=cms.untracked.vstring( pickRelValInputFiles(cmsswVersion='CMSSW_4_3_0_pre2', relVal='RelValZmumuJets_Pt_20_300PU1', globalTag='MC_42_V9_PU_E7TeV_AVE_2_BX2808', numberOfFiles=-1))) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'benitezj', '/WW_TuneZ2_7TeV_pythia6_tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2', 'PFAOD.*root') # print "WARNING!!!!!!!!!!!!!!!! remove the following line (see .cfg) before running on the batch!" #process.source.fileNames = process.source.fileNames[:12] print 'PF2PAT+PAT+CMG for files:' print process.source.fileNames ### DEFINITION OF THE PF2PAT+PAT SEQUENCES ############################################# from CMGTools.Common.Tools.getGlobalTag import getGlobalTag process.GlobalTag.globaltag = cms.string(getGlobalTag(runOnMC)) # load the PAT config process.load("PhysicsTools.PatAlgos.patSequences_cff")
process.setName_('VERTEX') process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.maxLuminosityBlocks = cms.untracked.PSet( input = cms.untracked.int32(-1) ) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'cbern', # '/TTJets_TuneZ2_7TeV-madgraph-tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2/PAT_CMG_V2_3_0/H2TAUTAU_Nov14', # '/DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2/PAT_CMG_V2_3_0/H2TAUTAU_Nov14', '/WJetsToLNu_TuneZ2_7TeV-madgraph-tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2/PAT_CMG_V2_3_0/H2TAUTAU_Nov14', '.*fullsel.*root' ) # reading the first 10 files: # nFiles = 5 # print 'WARNING: RESTRICTING INPUT TO THE FIRST', nFiles, 'FILES' # process.source.fileNames = process.source.fileNames[:nFiles] print process.source.fileNames # output module for EDM event (ntuple) process.out.fileName = cms.untracked.string('h2tautau_fullsel.root') process.out.outputCommands = cms.untracked.vstring( 'keep *',
dataset_user = '******' # dataset_name = '/WJetsToLNu_TuneZ2_7TeV-madgraph-tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2/PAT_CMG_V2_3_0' dataset_name = '/DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2/PAT_CMG_V2_5_0/H2TAUTAU_Feb2' dataset_pattern = 'tauEle_fullsel_.*root' debugEventContent = False ########## # Input & JSON ------------------------------------------------- process.setName_('AEMVA') # creating the source from CMGTools.Production.datasetToSource import * process.source = datasetToSource(dataset_user, dataset_name, dataset_pattern) #process.source = cms.Source( # "PoolSource", # fileNames = cms.untracked.vstring( # '/store/cmst3/user/cbern/CMG/DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2/PAT_CMG_V2_5_0/H2TAUTAU_Feb2/tauEle_fullsel_tree_CMG_1.root' # ) # ) # restricting the number of files to process to a given number if numberOfFilesToProcess > 0: process.source.fileNames = process.source.fileNames[: numberOfFilesToProcess] ###ProductionTaskHook$$$
directory = 'cmgtools_group' elif(sample == "stbar_tW"): sampleLocation = '/Tbar_TuneZ2_tW-channel-DR_7TeV-powheg-tauola/Fall11-PU_S6_START42_V14B-v1/AODSIM/PAT_CMG_5_6_0_B' directory = 'cmgtools_group' # Check triggers here: http://fwyzard.web.cern.ch/fwyzard/hlt/summary. if not runOnData: triggerList = "( getSelectionRegExp(\"HLT_IsoMu24_eta2p1_v*\") )" print "\n Sample locations:" print sampleLocation print directory from CMGTools.Production.datasetToSource import * process.source = datasetToSource(directory, sampleLocation, 'cmgTuple_.*root') #print "WARNING!!!!!!!!!!!!!!!! remove the following line (see .cfg) before running on the batch!" #process.source.fileNames = [process.source.fileNames[0]] print "\n Processing files:" print process.source.fileNames print "\n Processing events:" print process.maxEvents if runOnData: lumiFile = '/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions11/7TeV/Reprocessing/Cert_160404-180252_7TeV_ReRecoNov08_Collisions11_JSON_v2.txt' print "\n Using json file:"
import FWCore.ParameterSet.Config as cms process = cms.Process("myprocess") process.load('FWCore.MessageService.MessageLogger_cfi') process.TFileService=cms.Service("TFileService",fileName=cms.string('flatTree.root')) from CMGTools.Production.datasetToSource import * from CMGTools.Common.Tools.applyJSON_cff import * ##-------------------- Define the source ---------------------------- process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.source = datasetToSource('cmgtools','/DoubleMu/Run2012D-PromptReco-v1/AOD/PAT_CMG_V5_13_0','cmgTuple_.*.root') applyJSON(process,'Cert_190456-208686_8TeV_PromptReco_Collisions12_JSON.txt') ############# hlt filter ######################### process.hltFilter = cms.EDFilter('HLTHighLevel', TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), HLTPaths = cms.vstring( 'HLT_Mu17_Mu8_v*' ), eventSetupPathsKey = cms.string(''), andOr = cms.bool(True), #----- True = OR, False = AND between the HLTPaths throw = cms.bool(False) ) ############# Format MessageLogger ################# process.MessageLogger.cerr.FwkReport.reportEvery = 1000 ##-------------------- User analyzer --------------------------------
import FWCore.ParameterSet.Config as cms import sys import os process = cms.Process("PFAOD") from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'CMS', '/DoubleMu/StoreResults-DoubleMu_2011A_PR_v4_embedded_trans1_tau116_ptmu1_13had1_17_v3-f456bdbb960236e5c696adfe9b04eaae/USER', '.*root') process.options = cms.untracked.PSet(wantSummary=cms.untracked.bool(False)) #WARNING! process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(-1)) process.load("Configuration.EventContent.EventContent_cff") process.out = cms.OutputModule( "PoolOutputModule", process.AODSIMEventContent, fileName=cms.untracked.string('PFAOD.root'), ) from CMGTools.Production.PFAOD.PFAOD_EventContent_cff import V3 process.out.outputCommands.extend(V3) process.endpath = cms.EndPath(process.out) process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.cerr.FwkReport.reportEvery = 100
process.preSkimCounter = cms.EDProducer("EventCountProducer") process.zzSkimPath = cms.Path(process.preSkimCounter + process.goodHzzMuons + process.goodHzzElectrons + process.diHzzMuons + process.diHzzElectrons + process.crossHzzLeptons + process.dilepHzz + process.HzzSkim) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( # to test MC: # 'cmgtools', # '/TauPlusX/Run2011A-May10ReReco-v1/AOD/V3', # 'cmgtools_group', # '/DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola/Fall11-PU_S6_START42_V14B-v1/AODSIM/V3', # to test Data: 'cmgtools_group', #'/DoubleMu/Run2011A-05Aug2011-v1/AOD/V3', '/DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola/Fall11-PU_S6_START42_V14B-v1/AODSIM/V4' #'/GluGluToHToZZTo4L_M-120_7TeV-powheg-pythia6/Fall11-PU_S6_START42_V14B-v1/AODSIM/V4' # '.*root' ) process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(-1)) process.out = cms.OutputModule( "PoolOutputModule", fileName=cms.untracked.string('PFAOD_hzzSkim.root'), outputCommands=cms.untracked.vstring( 'keep *', 'keep edmMergeableCounter_*_*_*',
import FWCore.ParameterSet.Config as cms process = cms.Process("COPY") from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'cbern', '/TauPlusX/Run2012A-PromptReco-v1/RECO/PAT_CMG_V5_4_0_runrange_190605-194076/TAUMU', 'tauMu_fullsel.*root', ) process.options = cms.untracked.PSet(wantSummary=cms.untracked.bool(False)) #WARNING! process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(-1)) process.out = cms.OutputModule( "PoolOutputModule", outputCommands=cms.untracked.vstring('keep *'), fileName=cms.untracked.string('tauMu_fullsel_tree_CMG.root'), ) #from PFAnalyses.TTBar.topDecayFilters_cff import topFilterEventContent #process.out.outputCommands.extend( topFilterEventContent) process.endpath = cms.EndPath(process.out) process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.cerr.FwkReport.reportEvery = 1000
########## sep_line = "-" * 50 print print sep_line print "CMGTools 'ZmumuJets' tutorial" print sep_line ########## process.setName_("CMG") # Pick up the data files (H->ZZ skim). process.source = datasetToSource( "cmgtools", "/DoubleMu/Run2011A-HZZ-PromptSkim-v6/AOD/PAT_CMG_V2_4_0", "patTuple_PF2PAT_.*root") # One can limit the number of files to avoid some of the CASTOR # overhead (i.e., faster start-up). nFilesMax = 10 print "WARNING: Restricting input to the first %d files (of the %d found)" % \ (nFilesMax, len(process.source.fileNames)) if len(process.source.fileNames) > nFilesMax: process.source.fileNames = process.source.fileNames[:nFilesMax - 1] print "Will process the following files:" for fileName in process.source.fileNames: print " %s" % fileName # One can limit the number of events to process.
# fileNames = cms.untracked.vstring( # # DoubleMu # name # ) #) # name = '/DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball/Summer12-PU_S7_START52_V5-v2/AODSIM' # name = '/RelValProdTTbar/CMSSW_5_2_3-START52_V5-v1/AODSIM' name = '/RelValProdQCD_Pt_3000_3500/CMSSW_5_2_3-START52_V5-v1/AODSIM' from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'CMS', name, # '/TTJets_TuneZ2star_8TeV-madgraph-tauola/Summer12-PU_S7_START52_V5-v1/AODSIM', # 'CMS', # '/DoubleMu/Run2012A-PromptReco-v1/AOD' ) process.options = cms.untracked.PSet(wantSummary=cms.untracked.bool(False)) #WARNING! process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(2000)) process.load("Configuration.EventContent.EventContent_cff") process.out = cms.OutputModule( "PoolOutputModule", process.AODSIMEventContent, fileName=cms.untracked.string('AOD_%s.root' % (name.split('/')[1].split('_')[0])), )
# process.load("CMGTools.Common.sources.SingleMu.Run2011A_May10ReReco_v1.AOD.source_cff") #process.load("CMGTools.Common.sources.HT.Run2011A_May10ReReco_v1.AOD.V2.source_cff") # process.load("CMGTools.Common.sources.VBF_HToTauTau_M_115_7TeV_powheg_pythia6_tauola.Summer11_PU_S4_START42_V11_v1.AODSIM.V2.source_cff") if pickRelVal: process.source = cms.Source( "PoolSource", fileNames=cms.untracked.vstring( pickRelValInputFiles(cmsswVersion='CMSSW_4_3_0_pre2', relVal='RelValZmumuJets_Pt_20_300PU1', globalTag='MC_42_V9_PU_E7TeV_AVE_2_BX2808', numberOfFiles=-1))) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'palencia', '/WJetsToLNu_TuneZ2_7TeV-madgraph-tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2', 'PFAOD.*root') # print "WARNING!!!!!!!!!!!!!!!! remove the following line (see .cfg) before running on the batch!" #process.source.fileNames = process.source.fileNames[:12] print 'PF2PAT+PAT+CMG for files:' print process.source.fileNames ### DEFINITION OF THE PF2PAT+PAT SEQUENCES ############################################# from CMGTools.Common.Tools.getGlobalTag import getGlobalTag process.GlobalTag.globaltag = cms.string(getGlobalTag(runOnMC)) # load the PAT config process.load("PhysicsTools.PatAlgos.patSequences_cff")
sampleLocation = '/Tbar_TuneZ2_t-channel_7TeV-powheg-tauola/Fall11-PU_S6_START42_V14B-v1/AODSIM/PAT_CMG_5_6_0_B' directory = 'cmgtools_group' elif (sample == "stbar_tW"): sampleLocation = '/Tbar_TuneZ2_tW-channel-DR_7TeV-powheg-tauola/Fall11-PU_S6_START42_V14B-v1/AODSIM/PAT_CMG_5_6_0_B' directory = 'cmgtools_group' # Check triggers here: http://fwyzard.web.cern.ch/fwyzard/hlt/summary. if not runOnData: triggerList = "( getSelectionRegExp(\"HLT_IsoMu24_eta2p1_v*\") )" print "\n Sample locations:" print sampleLocation print directory from CMGTools.Production.datasetToSource import * process.source = datasetToSource(directory, sampleLocation, 'cmgTuple_.*root') #print "WARNING!!!!!!!!!!!!!!!! remove the following line (see .cfg) before running on the batch!" #process.source.fileNames = [process.source.fileNames[0]] print "\n Processing files:" print process.source.fileNames print "\n Processing events:" print process.maxEvents if runOnData: lumiFile = '/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions11/7TeV/Reprocessing/Cert_160404-180252_7TeV_ReRecoNov08_Collisions11_JSON_v2.txt' print "\n Using json file:" print lumiFile
LOOSE_ID = LOOSE_ID + "&& chargedHadronIso/pt < 0.4" process = cms.Process("CMG") process.RandomNumberGeneratorService = cms.Service( "RandomNumberGeneratorService", sourceSeed=cms.untracked.uint32(414000), moduleSeeds=cms.PSet( patElectronsWithTrigger=cms.untracked.uint32(1041963), )) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'cmgtools', '/TTH_Inclusive_M-125_8TeV_pythia6/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5/PAT_CMG_V5_10_0', #'/WZJetsTo3LNu_TuneZ2_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/PAT_CMG_V5_10_0', #'/TTTo2L2Nu2B_8TeV-powheg-pythia6/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5_B/PAT_CMG_V5_10_0' #'/TTJets_TuneZ2star_8TeV-madgraph-tauola/Summer12-PU_S7_START52_V9-v1/AODSIM/V5_B/PAT_CMG_V5_6_0_B' #'/DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5_B/PAT_CMG_V5_10_0' #'/DoubleMu/Run2012C-PromptReco-v2/AOD/PAT_CMG_V5_10_0_runrange_start-203002' ) ## Maximal Number of Events process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(20000)) print 'loading the main CMG sequence' process.load('CMGTools.Common.PAT.PATCMG_cff') ######################################################## #### VERTICES ########################################################
# Select PFAOD or AOD MC on the HLT trigger bit. # to be used on WJets, in particular. import FWCore.ParameterSet.Config as cms import sys import os process = cms.Process("PFAOD") from CMGTools.Production.datasetToSource import * process.source = datasetToSource( # 'cmgtools_group', # '/WJetsToLNu_TuneZ2_7TeV-madgraph-tauola/Fall11-PU_S6_START42_V14B-v1/AODSIM/V2', # 2.5% 'cmgtools_group', '/DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola/Fall11-PU_S6_START42_V14B-v1/AODSIM/V2', # 33% -> not worth skimming. '.*root') #process.source = cms.Source( # 'PoolSource', # fileNames = cms.untracked.vstring('/store/cmst3/group/cmgtools/CMG/WJetsToLNu_TuneZ2_7TeV-madgraph-tauola/Fall11-PU_S6_START42_V14B-v1/AODSIM/V2/PFAOD_10000_1_Zb0.root') # ) process.source.fileNames = process.source.fileNames[1:2] process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True)) #WARNING! process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) ) process.hltHighLevel = cms.EDFilter("HLTHighLevel",
# Input & JSON ------------------------------------------------- # process.setName_('H2TAUTAU') dataset_user = '******' # dataset_name = '/DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5_B/PAT_CMG_V5_8_0' # dataset_name = '/DoubleMu/Run2011B-16Jan2012-v1/AOD/V5/PAT_CMG_V5_6_0_B' dataset_name = '/DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola/Fall11-PU_S6_START44_V9B-v1/AODSIM/V5_B/PAT_CMG_V5_6_0_B' dataset_files = 'cmgTuple.*root' # creating the source from CMGTools.Production.datasetToSource import * process.source = datasetToSource( dataset_user, dataset_name, dataset_files, ) # restricting the number of files to process to a given number if numberOfFilesToProcess > 0: process.source.fileNames = process.source.fileNames[: numberOfFilesToProcess] import pprint pprint.pprint(process.source.fileNames[:10]) print '.. and so on.' ###ProductionTaskHook$$$ process.load('CMGTools.Common.skims.cmgDiMuonSel_cfi')
import FWCore.ParameterSet.Config as cms process = cms.Process("myprocess") process.load('FWCore.MessageService.MessageLogger_cfi') process.TFileService=cms.Service("TFileService",fileName=cms.string('flatTree.root')) from CMGTools.Production.datasetToSource import * ##-------------------- Define the source ---------------------------- process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.source = datasetToSource('cmgtools','/T_t-channel_TuneZ2star_8TeV-powheg-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5_B/PAT_CMG_V5_13_0','cmgTuple_.*.root') ############# Format MessageLogger ################# process.MessageLogger.cerr.FwkReport.reportEvery = 1000 ##-------------------- User analyzer -------------------------------- process.Hbb = cms.EDAnalyzer('VbfHbbFlatTreeProducer', jets = cms.InputTag('cmgPFJetSel'), genjets = cms.untracked.InputTag('genJetSel'), genparticles = cms.untracked.InputTag('genParticlesPruned'), met = cms.InputTag('cmgPFMETRaw'), rho = cms.InputTag('kt6PFJets','rho'), shiftJES = cms.double(0.0), dEtaMin = cms.double(2.), ptMin = cms.vdouble(60,40,30,20), ## trigger ################################### triggerAlias = cms.vstring('PF','Calo','PF1','PF2','PF3','PF4','Calo1','Calo2','PFJet40','PFJet80','PFnoBtag','CaloNoBtag'), triggerSelection = cms.vstring(
import FWCore.ParameterSet.Config as cms process = cms.Process("myprocess") process.load('FWCore.MessageService.MessageLogger_cfi') process.TFileService=cms.Service("TFileService",fileName=cms.string('flatTree.root')) from CMGTools.Production.datasetToSource import * ##-------------------- Define the source ---------------------------- process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.source = datasetToSource('cmgtools','/VBF_HToBB_M-130_8TeV-powheg-pythia6/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5_B/PAT_CMG_V5_13_0','cmgTuple_.*.root') ############# Format MessageLogger ################# process.MessageLogger.cerr.FwkReport.reportEvery = 100 ##-------------------- User analyzer -------------------------------- process.Hbb = cms.EDAnalyzer('VbfHbbFlatTreeProducer', jets = cms.InputTag('cmgPFJetSel'), genjets = cms.untracked.InputTag('genJetSel'), genparticles = cms.untracked.InputTag('genParticlesPruned'), met = cms.InputTag('cmgPFMETRaw'), rho = cms.InputTag('kt6PFJets','rho'), shiftJES = cms.double(0.0), dEtaMin = cms.double(2.), ptMin = cms.vdouble(60,40,30,20), ## trigger ################################### triggerAlias = cms.vstring('PF','Calo','PF1','PF2','PF3','PF4','Calo1','Calo2','PFJet40','PFJet80'), triggerSelection = cms.vstring(
import FWCore.ParameterSet.Config as cms process = cms.Process("myprocess") process.load('FWCore.MessageService.MessageLogger_cfi') process.TFileService=cms.Service("TFileService",fileName=cms.string('flatTree.root')) from CMGTools.Production.datasetToSource import * ##-------------------- Define the source ---------------------------- process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10000) ) process.source = datasetToSource('cmgtools','/WprimeToWZ_M-1000_TuneZ2star_8TeV-pythia6/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5_B/PAT_CMG_V5_13_0','cmgTuple_.*.root') ############# Format MessageLogger ################# process.MessageLogger.cerr.FwkReport.reportEvery = 1000 ##-------------------- User analyzer -------------------------------- process.wprime = cms.EDAnalyzer('WPrimeFlatTreeProducer', jets = cms.InputTag('cmgPFJetSel'), met = cms.InputTag('cmgPFMETRaw'), muons = cms.InputTag('cmgMuonSel'), electrons = cms.InputTag('cmgElectronSel'), rho = cms.InputTag('kt6PFJets','rho'), minJetPt = cms.double(20.0), maxJetEta = cms.double(2.5), minMuonPt = cms.double(20.0), minElectronPt = cms.double(20.0), btagger = cms.string('combinedSecondaryVertexBJetTags'), pu = cms.untracked.string('addPileupInfo'),
process.flatNtp.runSVFit = 1 #1 old #2 new ### input files inputfiles = "cmgTuple.*root" dataset_name = process.flatNtp.path.value() firstfile = sampleJobIdx * sampleMergeFactor lastfile = (sampleJobIdx + 1) * sampleMergeFactor print dataset_user print dataset_name print inputfiles print firstfile print lastfile #get input files from CMGTools.Production.datasetToSource import * process.source = datasetToSource(dataset_user, dataset_name, inputfiles) process.source.fileNames = process.source.fileNames[firstfile:lastfile] print process.source.fileNames # set up JSON --------------------------------------------------------------- if process.flatNtp.dataType != 0: json = process.flatNtp.jsonfile.value() print 'json:', json from CMGTools.Common.Tools.applyJSON_cff import applyJSON applyJSON(process, json) print process.PoolSource.lumisToProcess ## run the vertex weights if process.flatNtp.dataType == 0: process.load('CMGTools.RootTools.utils.vertexWeight.vertexWeight_cff') process.genSequence = cms.Sequence(process.vertexWeightSequence)
import FWCore.ParameterSet.Config as cms process = cms.Process("myprocess") process.load('FWCore.MessageService.MessageLogger_cfi') process.TFileService=cms.Service("TFileService",fileName=cms.string('flatTree.root')) from CMGTools.Production.datasetToSource import * ##-------------------- Define the source ---------------------------- process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.source = datasetToSource('cmgtools','/DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5_B/PAT_CMG_V5_13_0','cmgTuple_.*.root') ############# Format MessageLogger ################# process.MessageLogger.cerr.FwkReport.reportEvery = 1000 ##-------------------- User analyzer -------------------------------- process.wprime = cms.EDAnalyzer('WPrimeFlatTreeProducer', jets = cms.InputTag('cmgPFJetSel'), met = cms.InputTag('cmgPFMETRaw'), muons = cms.InputTag('cmgMuonSel'), electrons = cms.InputTag('cmgElectronSel'), rho = cms.InputTag('kt6PFJets','rho'), minJetPt = cms.double(20.0), maxJetEta = cms.double(2.5), minMuonPt = cms.double(20.0), minElectronPt = cms.double(20.0), btagger = cms.string('combinedSecondaryVertexBJetTags'), pu = cms.untracked.string('addPileupInfo'),
# oncePerEventMode = cms.untracked.bool(False) # ) ########### # Input # ########### #fullname = "HiggsAna.HLLJJCommon.datasets." + options.infile ####fullname = "HiggsAna.HLLJJCommon.datasets.summer12_GluGluToHToZZ4lTEST525_cff" #print 'Importing dataset from ' #print fullname #process.load(fullname) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'CMS', '/VBF_HToZZTo2L2Q_M-500_8TeV-powheg-pythia6/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM' # '/VBF_HToZZTo2L2Q_M-400_8TeV-powheg-pythia6/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM' # '/GluGluToHToZZTo2L2Q_M-400_8TeV-powheg-pythia6/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM' # '/DYJetsToLL_M-10To50filter_8TeV-madgraph/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM' # '/DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM' # '/TTTo2L2Nu2B_8TeV-powheg-pythia6/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM' ) ###################BEGIN CMG SPECIFIC from CMGTools.Common.Tools.cmsswRelease import isNewerThan sep_line = '-'*67 print sep_line print 'CMG PAT-tuplizer, contact Colin before any modification' print sep_line print sep_line print process.source.fileNames
import FWCore.ParameterSet.Config as cms process = cms.Process("BRs") from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'gpetrucc', '/TTH_Inclusive_M-140_8TeV_pythia6/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5/PAT_CMG_V5_10_0', ) ## Maximal Number of Events process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100000) ) ######################################################## #### GEN H->BB VETO ######################################################## process.genHBB = cms.EDFilter("GenParticleSelector", src = cms.InputTag("genParticlesPruned"), cut = cms.string("pdgId == 25 && (daughterRef(0).pdgId) == 5"), filter = cms.bool(True), ) ######################################################## #### GEN-LEVEL SKIMMING ######################################################## process.genHWWZZtt = cms.EDFilter("GenParticleSelector", src = cms.InputTag("genParticlesPruned"), cut = cms.string("pdgId == 25 && (abs(daughterRef(0).pdgId) == 24 || abs(daughterRef(0).pdgId) == 23 || abs(daughterRef(0).pdgId) == 15)"), filter = cms.bool(True), )
sep_line = "-" * 50 print print sep_line print "CMGTools vertex weight test" print sep_line process.setName_('ANA') process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(-1)) process.maxLuminosityBlocks = cms.untracked.PSet(input=cms.untracked.int32(-1)) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'cmgtools', '/WJetsToLNu_TuneZ2_7TeV-madgraph-tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2/PAT_CMG_V2_3_0', # '/TauPlusX/Run2011A-PromptReco-v6/AOD/V2/PAT_CMG_V2_3_0', 'tree.*root') # reading the first 10 files: nFiles = 5 print 'WARNING: RESTRICTING INPUT TO THE FIRST', nFiles, 'FILES' process.source.fileNames = process.source.fileNames[:nFiles] print process.source.fileNames # output module for EDM event (ntuple) process.out.fileName = cms.untracked.string('tree_testVertexWeight.root') from CMGTools.Common.eventContent.everything_cff import everything process.out.outputCommands = cms.untracked.vstring( 'drop *', 'keep recoVertexs_*_*_*', 'keep double_vertexWeight*_*_*',
def __init__(self, name, user, dataset, splitFactor ): self.name = name self.files = datasetToSource( user, dataset ).fileNames self.splitFactor = splitFactor
import FWCore.ParameterSet.Config as cms process = cms.Process("myprocess") process.load('FWCore.MessageService.MessageLogger_cfi') from CMGTools.Production.datasetToSource import * from CMGTools.Common.Tools.applyJSON_cff import * process.TFileService=cms.Service("TFileService",fileName=cms.string('flatTree.root')) ##-------------------- Define the source ---------------------------- process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10000) ) process.source = datasetToSource('cmgtools','/BJetPlusX/Run2012B-13Jul2012-v1/AOD/PAT_CMG_V5_12_0','cmgTuple_.*.root') applyJSON(process,'Cert_190456-196531_8TeV_13Jul2012ReReco_Collisions12_JSON_v2.txt') ############# hlt filter ######################### process.hltFilter = cms.EDFilter('HLTHighLevel', TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), HLTPaths = cms.vstring( 'HLT_QuadJet75_55_35_20_BTagIP_VBF_v*', 'HLT_QuadJet75_55_38_20_BTagIP_VBF_v*', 'HLT_QuadPFJet75_55_35_20_BTagCSV_VBF_v*', 'HLT_QuadPFJet75_55_38_20_BTagCSV_VBF_v*', 'HLT_QuadPFJet78_61_44_31_BTagCSV_VBF_v*', 'HLT_QuadPFJet82_65_48_35_BTagCSV_VBF_v*', 'HLT_DiPFJetAve40_v*', 'HLT_DiPFJetAve80_v*',
# process.load("CMGTools.Common.sources.SingleMu.Run2011A_May10ReReco_v1.AOD.source_cff") #process.load("CMGTools.Common.sources.HT.Run2011A_May10ReReco_v1.AOD.V2.source_cff") # process.load("CMGTools.Common.sources.VBF_HToTauTau_M_115_7TeV_powheg_pythia6_tauola.Summer11_PU_S4_START42_V11_v1.AODSIM.V2.source_cff") if pickRelVal: process.source = cms.Source( "PoolSource", fileNames=cms.untracked.vstring( pickRelValInputFiles(cmsswVersion='CMSSW_4_3_0_pre2', relVal='RelValZmumuJets_Pt_20_300PU1', globalTag='MC_42_V9_PU_E7TeV_AVE_2_BX2808', numberOfFiles=-1))) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'cmgtools_group', '/QCD_Pt-15to3000_TuneZ2_Flat_7TeV_pythia6/Fall11-PU_S6_START42_V14B-v1/AODSIM/V2a', 'PFAOD.*root') # print "WARNING!!!!!!!!!!!!!!!! remove the following line (see .cfg) before running on the batch!" #process.source.fileNames = process.source.fileNames[:12] print 'PF2PAT+PAT+CMG for files:' print process.source.fileNames ### DEFINITION OF THE PF2PAT+PAT SEQUENCES ############################################# from CMGTools.Common.Tools.getGlobalTag import getGlobalTag process.GlobalTag.globaltag = cms.string(getGlobalTag(runOnMC)) # load the PAT config process.load("PhysicsTools.PatAlgos.patSequences_cff")
# A simple cfg to prescale input events. Used to test the production system. import FWCore.ParameterSet.Config as cms process = cms.Process("AOD") from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'cbern', '/DoubleMu/Run2012B-PromptReco-v1/AOD/V5_Test', '.*root' ) process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False)) #WARNING! process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) ) process.pre = cms.EDFilter("Prescaler", prescaleFactor = cms.int32(2), prescaleOffset = cms.int32(0) ) process.p = cms.Path( process.pre ) process.out = cms.OutputModule(
process = cms.Process("PAT") print 'querying database for source files' runOnMC = True runJetSubstructure = True from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'CMS', '/DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball/Summer12-PU_S7_START52_V5-v2/AODSIM', # '/TTJets_TuneZ2star_8TeV-madgraph-tauola/Summer12-PU_S7_START52_V5-v1/AODSIM', # 'CMS', # '/DoubleMu/Run2012A-PromptReco-v1/AOD' ) if runOnMC is False: print 'OVERRIDING datasetToSource TO TEST RUNNING ON DATA' process.source.fileNames = ['/store/data/Run2012A/DoubleMu/AOD/PromptReco-v1/000/191/859/66D9EE0B-EC8C-E111-9346-001D09F2AD84.root'] print sep_line print process.source.fileNames print sep_line ## Maximal Number of Events process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(2000) )
print sep_line process.setName_('ANA') process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.maxLuminosityBlocks = cms.untracked.PSet( input = cms.untracked.int32(-1) ) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'cbern', '/QCD_Pt-30to50_TuneZ2_7TeV_pythia6/Summer11-PU_S3_START42_V11-v2/AODSIM/V2', 'PFAOD.*root' ) # reading the first 10 files: nFiles = 10 print 'WARNING: RESTRICTING INPUT TO THE FIRST', nFiles, 'FILES' # process.source.fileNames = process.source.fileNames[:nFiles] print process.source.fileNames # output module for EDM event (ntuple) process.out.fileName = cms.untracked.string('tree_pi0s.root') from CMGTools.Common.eventContent.everything_cff import everything process.out.outputCommands = everything
process.setName_('ANA') process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(5000) ) process.maxLuminosityBlocks = cms.untracked.PSet( input = cms.untracked.int32(-1) ) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'cmgtools', '/TauPlusX/Run2011A-PromptReco-v4/AOD/V2/PAT_CMG_V2_3_0', 'tree.*root') # reading the first 10 files: nFiles = 5 print 'WARNING: RESTRICTING INPUT TO THE FIRST', nFiles, 'FILES' process.source.fileNames = process.source.fileNames[:nFiles] print process.source.fileNames # output module for EDM event (ntuple) process.out.fileName = cms.untracked.string('tree_testTauScaler.root') from CMGTools.Common.eventContent.everything_cff import everything process.out.outputCommands = cms.untracked.vstring( 'drop *',
process.GlobalTag.globaltag = getGlobalTag(runOnMC, runOld5XGT) print "Global tag : ", process.GlobalTag.globaltag process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(1000)) process.maxLuminosityBlocks = cms.untracked.PSet(input=cms.untracked.int32(-1)) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( "cmgtools", # '/VBF_HToTauTau_M-125_8TeV-powheg-pythia6/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5_B/PAT_CMG_V5_8_0', # '/DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5_B/PAT_CMG_V5_10_0', "/DoubleMu/Run2012A-13Jul2012-v1/AOD/V5_B/PAT_CMG_V5_10_0", "cmgTuple.*root", ) # reading the first 10 files: nFiles = 5 print "WARNING: RESTRICTING INPUT TO THE FIRST", nFiles, "FILES" process.source.fileNames = process.source.fileNames[:nFiles] print process.source.fileNames from CMGTools.Common.miscProducers.cmgPFJetCorrector_cfi import cmgPFJetCorrector process.cmgPFJetSel = cmgPFJetCorrector.clone()
sep_line = "-" * 50 print print sep_line print "CMGTools pi0 reconstruction" print sep_line process.setName_('ANA') process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(-1)) process.maxLuminosityBlocks = cms.untracked.PSet(input=cms.untracked.int32(-1)) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'cbern', '/QCD_Pt-30to50_TuneZ2_7TeV_pythia6/Summer11-PU_S3_START42_V11-v2/AODSIM/V2', 'PFAOD.*root') # reading the first 10 files: nFiles = 10 print 'WARNING: RESTRICTING INPUT TO THE FIRST', nFiles, 'FILES' # process.source.fileNames = process.source.fileNames[:nFiles] print process.source.fileNames # output module for EDM event (ntuple) process.out.fileName = cms.untracked.string('tree_pi0s.root') from CMGTools.Common.eventContent.everything_cff import everything process.out.outputCommands = everything process.out.outputCommands.extend( ['keep *_particleFlow__*', 'keep *_diPhotonSel_*_*'])
dataset_pattern = 'tauEle_fullsel_.*root' debugEventContent = False ########## # Input & JSON ------------------------------------------------- process.setName_('AEMVA') # creating the source from CMGTools.Production.datasetToSource import * process.source = datasetToSource( dataset_user, dataset_name, dataset_pattern) #process.source = cms.Source( # "PoolSource", # fileNames = cms.untracked.vstring( # '/store/cmst3/user/cbern/CMG/DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2/PAT_CMG_V2_5_0/H2TAUTAU_Feb2/tauEle_fullsel_tree_CMG_1.root' # ) # ) # restricting the number of files to process to a given number if numberOfFilesToProcess > 0: process.source.fileNames = process.source.fileNames[:numberOfFilesToProcess] ###ProductionTaskHook$$$
sep_line = "-" * 50 print print sep_line print "CMGTools JSON" print "For a speedy analysis, better to apply that at the very end on your final sample!" print sep_line process = cms.Process("JSON") process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(-1)) process.maxLuminosityBlocks = cms.untracked.PSet(input=cms.untracked.int32(-1)) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'cmgtools', '/TauPlusX/Run2011A-PromptReco-v6/AOD/V2/PAT_CMG_V2_3_0', 'tree.*root') from CMGTools.Common.Tools.applyJSON_cff import * # always check that your JSON is compatible with your source... json = '/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions11/7TeV/Prompt/Cert_160404-178078_7TeV_PromptReco_Collisions11_JSON.txt' applyJSON(process, json) print process.source process.out = cms.OutputModule( "PoolOutputModule", outputCommands=cms.untracked.vstring('keep *'), fileName=cms.untracked.string('json.root'),
# inputfiles = "tauMu_fullsel_tree_CMG_.*root" inputfiles = "cmgTuple_.*root" dataset_name = process.flatNtp.path.value() + sampleTag firstfile = sampleJobIdx * sampleMergeFactor lastfile = (sampleJobIdx + 1) * sampleMergeFactor print dataset_user print dataset_name print inputfiles print firstfile print lastfile # get input files from CMGTools.Production.datasetToSource import * process.source = datasetToSource(dataset_user, dataset_name, inputfiles) process.source.fileNames = process.source.fileNames[firstfile:lastfile] ############## # process.source.eventsToProcess = cms.untracked.VEventRange('1:6486','1:20430','1:28387','1:88240','1:105383','1:121208','1:165752','1:183902') # process.source.eventsToProcess = cms.untracked.VEventRange('1:4394', '1:82155', '1:172226', '1:178770', '1:184091') # process.source.eventsToProcess = cms.untracked.VEventRange('1:15599','1:20873','1:20916','1:20991','1:21008') # process.source.eventsToProcess = cms.untracked.VEventRange( # '1:102743', # '1:102968', # '1:103009', # '1:105167', # '1:105438', # '1:14591', # '1:149032',
# Message logger setup. process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.cerr.FwkReport.reportEvery = 500 process.options = cms.untracked.PSet(wantSummary=cms.untracked.bool(True)) # source process.maxEvents = cms.untracked.PSet( input=cms.untracked.int32(options.maxEvents)) process.maxLuminosityBlocks = cms.untracked.PSet(input=cms.untracked.int32(-1)) print "\n Sample locations:" print options.sampleLocation from CMGTools.Production.datasetToSource import * process.source = datasetToSource('cmgtools', options.sampleLocation, 'cmgTuple_.*root') #print "WARNING!!!!!!!!!!!!!!!! remove the following line (see .cfg) before running on the batch!" #process.source.fileNames = [process.source.fileNames[0]] print "\n Processing files:" print process.source.fileNames print "\n Processing events:" print process.maxEvents #https://twiki.cern.ch/twiki/bin/view/CMS/PdmV2012Analysis#DATA if runOnData: if '13Jul2012' in options.sampleLocation: lumiFile = '/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions12/8TeV/Reprocessing/Cert_190456-196531_8TeV_13Jul2012ReReco_Collisions12_JSON_v2.txt' if '06Aug2012' in options.sampleLocation:
if pickRelVal: process.source = cms.Source( "PoolSource", fileNames = cms.untracked.vstring( pickRelValInputFiles( cmsswVersion = 'CMSSW_4_3_0_pre2' , relVal = 'RelValZmumuJets_Pt_20_300PU1' , globalTag = 'MC_42_V9_PU_E7TeV_AVE_2_BX2808' , numberOfFiles = -1 ) ) ) from CMGTools.Production.datasetToSource import * process.source = datasetToSource('palencia', '/WJetsToLNu_TuneZ2_7TeV-madgraph-tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2', 'PFAOD.*root') # print "WARNING!!!!!!!!!!!!!!!! remove the following line (see .cfg) before running on the batch!" #process.source.fileNames = process.source.fileNames[:12] print 'PF2PAT+PAT+CMG for files:' print process.source.fileNames ### DEFINITION OF THE PF2PAT+PAT SEQUENCES ############################################# from CMGTools.Common.Tools.getGlobalTag import getGlobalTag process.GlobalTag.globaltag = cms.string(getGlobalTag(runOnMC)) # load the PAT config process.load("PhysicsTools.PatAlgos.patSequences_cff")
import FWCore.ParameterSet.Config as cms process = cms.Process("TOP") ######################## ## SOURCES ## ######################## from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'lucieg', '/T2tt/TEST/', 'cmgTuple_.*root' ) #process.source.fileNames = cms.untracked.vstring('file:/data/lucieg/boostedTops/NoPU/533/cmgTuple_TTbar_300_400.root') process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) ######################## ## PATHS ## ######################## process.load('Lucie.T1tttt.playingWithTop_cff') process.pAllHadronic = cms.Path( process.playingWithTopAllHadronic )
import FWCore.ParameterSet.Config as cms process = cms.Process("myprocess") process.load('FWCore.MessageService.MessageLogger_cfi') process.TFileService=cms.Service("TFileService",fileName=cms.string('flatTree.root')) from CMGTools.Production.datasetToSource import * ##-------------------- Define the source ---------------------------- process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.source = datasetToSource('cmgtools','/QCD_HT-500To1000_TuneZ2star_8TeV-madgraph-pythia6/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5_B/PAT_CMG_V5_13_0','cmgTuple_.*.root') ############# Format MessageLogger ################# process.MessageLogger.cerr.FwkReport.reportEvery = 100 ##-------------------- User analyzer -------------------------------- process.Hbb = cms.EDAnalyzer('VbfHbbFlatTreeProducer', jets = cms.InputTag('cmgPFJetSel'), genjets = cms.untracked.InputTag('genJetSel'), genparticles = cms.untracked.InputTag('genParticlesPruned'), met = cms.InputTag('cmgPFMETRaw'), rho = cms.InputTag('kt6PFJets','rho'), shiftJES = cms.double(0.0), dEtaMin = cms.double(2.), ptMin = cms.vdouble(60,40,30,20), ## trigger ################################### triggerAlias = cms.vstring('PF','Calo','PF1','PF2','PF3','PF4','Calo1','Calo2','PFJet40','PFJet80','PFnoBtag','CaloNoBtag'), triggerSelection = cms.vstring(
runCMG = True skimOnTrigger = True process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True)) process.setName_('L1Skim') process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) ) process.MessageLogger.cerr.FwkReport.reportEvery = 10 ### SOURCE DEFINITION ################################################################ from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'cmgtools', '/MultiJet/Run2011A-PromptReco-v6/AOD/V2/PAT_CMG_V2_4_0', 'patTuple_PF2PAT_.*root' ) ### DEFINITION OF THE PF2PAT+PAT SEQUENCES ############################################# from CMGTools.Common.Tools.getGlobalTag import getGlobalTag process.GlobalTag.globaltag = cms.string(getGlobalTag(runOnMC)) process.load('CMGTools.Common.gen_cff') ### PATH DEFINITION ############################################# process.p = cms.Path() if skimOnTrigger:
import FWCore.ParameterSet.Config as cms process = cms.Process("myprocess") process.load('FWCore.MessageService.MessageLogger_cfi') from CMGTools.Production.datasetToSource import * from CMGTools.Common.Tools.applyJSON_cff import * ##-------------------- Define the source ---------------------------- process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.source = datasetToSource('cmgtools','/BJetPlusX/Run2012D-PromptReco-v1/AOD/PAT_CMG_V5_12_0','cmgTuple_.*.root') applyJSON(process,'Cert_190456-208686_8TeV_PromptReco_Collisions12_JSON.txt') ############# Format MessageLogger ################# process.MessageLogger.cerr.FwkReport.reportEvery = 1000 ##-------------------- User analyzer -------------------------------- process.json = cms.EDAnalyzer('JSONProducer', filename = cms.string("json_BJetPlusX-Run2012D.txt") ) process.p = cms.Path(process.json)
########## sep_line = "-" * 50 print print sep_line print "CMGTools 'ZmumuJets' tutorial" print sep_line ########## process.setName_("CMG") # Pick up the data files (H->ZZ skim). process.source = datasetToSource( "cmgtools", "/DoubleMu/Run2011A-HZZ-PromptSkim-v6/AOD/PAT_CMG_V2_4_0", "patTuple_PF2PAT_.*root" ) # One can limit the number of files to avoid some of the CASTOR # overhead (i.e., faster start-up). nFilesMax = 10 print "WARNING: Restricting input to the first %d files (of the %d found)" % \ (nFilesMax, len(process.source.fileNames)) if len(process.source.fileNames) > nFilesMax: process.source.fileNames = process.source.fileNames[:nFilesMax - 1] print "Will process the following files:" for fileName in process.source.fileNames: print " %s" % fileName
parser = OptionParser() parser.usage = "%prog [options] <dataset>\nPrints information on a sample." parser.add_option("-w", "--wildcard", dest="wildcard", default='*tree*root', help='UNIX style wildcard for root file printout') parser.add_option("-u", "--user", dest="user", default=os.environ['USER'], help='user owning the dataset') (options, args) = parser.parse_args() if len(args) != 1: parser.print_help() sys.exit(1) user = options.user dataset = args[0] pattern = fnmatch.translate(options.wildcard) source = datasetToSource(user, dataset, pattern) dump = 'source = ' dump += source.dumpPython() dump = dump.replace("'/store", "\n'/store") print 'import FWCore.ParameterSet.Config as cms' print dump
#sample='qStar-qZ-1000' #sample='qStar-qZ-2000' #sample='Wfast' #sample='QCDfast' #sample='May22-v1' #sample='Prompt-v4' #sample='Aug05-v1' #sample='Prompt-v6' #sample='Prompt-v1' process = cms.Process("Dijet") from CMGTools.Production.datasetToSource import * if sample=='QCD': process.source = datasetToSource('hinzmann', '/QCD_Pt-15to3000_TuneZ2_Flat_7TeV_pythia6/Fall11-PU_S6_START42_V14B-v1/AODSIM/PAT_CMG_Hinzmann', 'tree.*root') elif sample=='WW': process.source = datasetToSource('hinzmann', '/WW_TuneZ2_7TeV_pythia6_tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2/PAT_CMG_Hinzmann6', 'tree.*root') elif sample=='W1Jet': process.source = datasetToSource('hinzmann', '/W1Jet_TuneZ2_7TeV-madgraph-tauola/Fall11-PU_S6_START42_V14B-v1/AODSIM/V2', 'tree.*root') elif sample=='W': process.source = datasetToSource('hinzmann', '/WJetsToLNu_TuneZ2_7TeV-madgraph-tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2/PAT_CMG_Hinzmann6', 'tree.*root') elif sample=='graviton-ZZ-1000': process.source = cms.Source ("PoolSource",fileNames = cms.untracked.vstring(['file:cmgtrees/pythia6_gravitonZZ_1000_tree_CMG.root']))
# Input & JSON ------------------------------------------------- #dataset_user = '******' #dataset_name = '/GluGluToHToTauTau_M-120_8TeV-powheg-pythia6/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/PAT_CMG_V5_16_0' dataset_user = '******' # dataset_name = '/DoubleMuParked/StoreResults-Run2012B_22Jan2013_v1_RHembedded_trans1_tau132_pthad1_30had2_30_v1-f456bdbb960236e5c696adfe9b04eaae/USER/V5_B/PAT_CMG_V5_16_0_B' dataset_name = '/DoubleMu/StoreResults-Run2012A_22Jan2013_v1_PFembedded_trans1_tau132_pthad1_30had2_30_v1-5ef1c0fd428eb740081f19333520fdc8/USER/PAT_CMG_V5_16_0' # dataset_name = '/TauParked/Run2012D-22Jan2013-v1/AOD/PAT_CMG_V5_16_0' dataset_files = 'cmgTuple.*root' # creating the source from CMGTools.Production.datasetToSource import * process.source = datasetToSource( dataset_user, dataset_name, dataset_files, ) process.source.inputCommands=cms.untracked.vstring( 'keep *', 'drop cmgStructuredPFJets_cmgStructuredPFJetSel__PAT' ) # process.source.fileNames = ['file:VBF_HToTauTau.root'] # restricting the number of files to process to a given number if numberOfFilesToProcess>0: process.source.fileNames = process.source.fileNames[:numberOfFilesToProcess]
dataset_name = '/DYJetsToLL_TuneZ2_M-50_7TeV-madgraph-tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2/PAT_CMG_V2_5_0/H2TAUTAU_Feb2' dataset_pattern = 'tauMu_fullsel_tree.*root' ########## # Input & JSON ------------------------------------------------- process.setName_('LORTREE') from CMGTools.Production.datasetToSource import * process.source = datasetToSource( dataset_user, dataset_name, 'tauMu_fullsel.*root') # process.source.fileNames = ['file:h2TauTau_fullsel_tree_CMG.root'] # Sequence & path definition ------------------------------------------------- process.muTauStreamAnalyzer = cms.EDAnalyzer( "MuTauStreamAnalyzer", diTaus = cms.InputTag("cmgTauMuCorSVFitFullSel"), jets = cms.InputTag("cmgPFJetSel"), newJets = cms.InputTag(""), #COLIN warning uncorrected MET. corrected MET can be obtained from the diTau (I think) met = cms.InputTag("cmgPFMET"), rawMet = cms.InputTag("cmgPFMET"),
## JetMet filter JET_KINCUT = ("pt > 100") MET_KINCUT = ("et > 50") ## MessageLogger process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.cerr.FwkReport.reportEvery = 10000 ## Input files from CMGTools.Production.datasetToSource import * datasetInfo = ( 'CMS', '/DYJetsToLL_PtZ-100_TuneZ2star_8TeV_ext-madgraph-tarball/Summer12_DR53X-PU_S10_START53_V7C-v1/AODSIM', '.*root') process.source = datasetToSource(*datasetInfo) process.source.fileNames = process.source.fileNames[:20] # If you want you can overwrite the previous input filenames like this: #####process.source.fileNames = ['file:root://eoscms//eos/cms'/store/cmst3/group/cmgtools/CMG/DY2JetsToLL_M-50_TuneZ2Star_8TeV-madgraph/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5_B/PFAOD_0.root'] #process.source.fileNames = ['file:root://eoscms//eos/cms'/store/data/Run2012C/DoublePhotonHighPt/AOD/PromptReco-v2/000/200/600/0AA4E2BB-2BE5-E111-B3A8-00237DDC5C24.root'] ##process.source.fileNames = ['file:root://eoscms//eos/cms'/store/cmst3/user/bonato/patTuple/2012/EXOVVtest/BulkG_ZZllqq_M1000_c0p2_STEP3_AODSIM_24_1_fvt.root'] process.source.fileNames = [ '/store/data/Run2012D/JetHT/AOD/22Jan2013-v1/10002/E841A6AE-2798-E211-870D-E0CB4E1A118F.root', '/store/data/Run2012D/JetHT/AOD/22Jan2013-v1/10002/E8416FFA-8197-E211-9ABE-90E6BA19A214.root', '/store/data/Run2012D/JetHT/AOD/22Jan2013-v1/10002/E816B170-E597-E211-8C3E-90E6BA0D09CE.root', '/store/data/Run2012D/JetHT/AOD/22Jan2013-v1/10002/E6BCE747-9897-E211-BBD3-20CF305616D0.root', '/store/data/Run2012D/JetHT/AOD/22Jan2013-v1/10002/E8F31E8D-0A98-E211-981C-20CF30561711.root', '/store/data/Run2012D/JetHT/AOD/22Jan2013-v1/10002/E89A7E5D-9D97-E211-A76F-90E6BA19A205.root', '/store/data/Run2012D/JetHT/AOD/22Jan2013-v1/10002/E888E66D-4B97-E211-B24B-E0CB4E29C4DE.root', '/store/data/Run2012D/JetHT/AOD/22Jan2013-v1/10002/E853050A-3D98-E211-9E26-00259073E398.root',
sep_line = "-" * 50 print print sep_line print "CMGTools slim CMGCandidates test" print sep_line process = cms.Process("ANA") process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(2000)) process.maxLuminosityBlocks = cms.untracked.PSet(input=cms.untracked.int32(-1)) from CMGTools.Production.datasetToSource import * process.source = datasetToSource( 'cmgtools_group', #'/DoubleMu/Run2012A-13Jul2012-v1/AOD/V5_B', #'/MuHad/Run2012A-13Jul2012-v1/AOD/V5_B', '/TTJets_MassiveBinDECAY_TuneZ2star_8TeV-madgraph-tauola/Summer12_DR53X-PU_S10_START53_V7A-v1/AODSIM/V5_B', ) nFiles = 1 print 'WARNING: RESTRICTING INPUT TO THE FIRST', nFiles, 'FILES' process.source.fileNames = process.source.fileNames[:nFiles] print process.source.fileNames process.load("CMGTools.Common.cmgCandidates_cfi") from CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi import * process.goodOfflinePrimaryVertices = goodOfflinePrimaryVertices.clone() from RecoJets.JetProducers.ak5PFJets_cfi import *