def __init__(self, dataset, user, options): Task.__init__(self, 'ParseOptions', dataset, user, options) usage = """%prog [options] <dataset> The %prog script aims to take a list of samples and process them on the batch system. Submission may be done serially (by setting --max_threads to 1), or in parallel (the default). The basic flow is: 1) Check that the sample to run on exists 2) Generate a source CFG 3) Run locally and check everything works with a small number of events 4) Submit to the batch system 5) Wait until the jobs are finished 6) Check the jobs ran OK and that the files are good Example: ProductionTasks.py -u cbern -w 'PFAOD*.root' -c -N 1 -q 8nh -t PAT_CMG_V5_10_0 --output_wildcard '*.root' --cfg PATCMG_cfg.py /QCD_Pt-1800_TuneZ2_7TeV_pythia6/Summer11-PU_S3_START42_V11-v2/AODSIM/V2 It is often useful to store the sample names in a file, in which case you could instead do: ProductionTasks.py -w '*.root' -c -N 1 -q 8nh -t PAT_CMG_V5_10_0 --output_wildcard '*.root' --cfg PATCMG_cfg.py `cat samples_mc.txt` An example file might contain: palencia%/Tbar_TuneZ2_tW-channel-DR_7TeV-powheg-tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2 benitezj%/ZZ_TuneZ2_7TeV_pythia6_tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2 wreece%/ZJetsToNuNu_100_HT_200_7TeV-madgraph/Summer11-PU_S4_START42_V11-v1/AODSIM/V2 The CASTOR username for each sample is given before the '%'. Each step in the flow has a task associated with it, which may set options. The options for each task are documented below. """ self.das = Das.DASOptionParser(usage=usage)
from __future__ import print_function from PhysicsTools.HeppyCore.utils.edmIntegrityCheck import PublishToFileSystem, IntegrityCheck import das import copy, os if __name__ == '__main__': from optparse import OptionParser, OptionGroup usage = """usage: %prog [options] /Sample/Name/On/Castor e.g.: %prog -u wreece -p -w 'PFAOD_*.root' /MultiJet/Run2011A-05Aug2011-v1/AOD/V2 """ das = das.DASOptionParser(usage=usage) group = OptionGroup(das.parser, 'edmIntegrityCheck Options', 'Options related to checking files on CASTOR') group.add_option("-d", "--device", dest="device", default='cmst3', help="The storage device to write to, e.g. 'cmst3'") group.add_option( "-n", "--name", dest="name", default=None, help='The name of the dataset in DAS. Will be guessed if not specified' )