CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
production_tasks.ParseOptions Class Reference
Inheritance diagram for production_tasks.ParseOptions:
production_tasks.Task

Public Member Functions

def __init__
 
def addOption
 
def run
 
- Public Member Functions inherited from production_tasks.Task
def __init__
 
def addOption
 
def getname
 
def run
 

Public Attributes

 das
 
 dataset
 
 user
 
- Public Attributes inherited from production_tasks.Task
 dataset
 
 instance
 
 name
 
 options
 
 user
 

Detailed Description

Common options for the script __main__: used by all production tasks

Definition at line 45 of file production_tasks.py.

Constructor & Destructor Documentation

def production_tasks.ParseOptions.__init__ (   self,
  dataset,
  user,
  options 
)

Definition at line 47 of file production_tasks.py.

47 
48  def __init__(self, dataset, user, options):
49  Task.__init__(self,'ParseOptions', dataset, user, options)
50 
51  usage = """%prog [options] <dataset>
52 
53 The %prog script aims to take a list of samples and process them on the batch system. Submission
54 may be done serially (by setting --max_threads to 1), or in parallel (the default).
55 
56 The basic flow is:
57 
58  1) Check that the sample to run on exists
59  2) Generate a source CFG
60  3) Run locally and check everything works with a small number of events
61  4) Submit to the batch system
62  5) Wait until the jobs are finished
63  6) Check the jobs ran OK and that the files are good
64 
65 Example:
66 
67 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
68 
69 It is often useful to store the sample names in a file, in which case you could instead do:
70 
71 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`
72 
73 An example file might contain:
74 
75 palencia%/Tbar_TuneZ2_tW-channel-DR_7TeV-powheg-tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2
76 benitezj%/ZZ_TuneZ2_7TeV_pythia6_tauola/Summer11-PU_S4_START42_V11-v1/AODSIM/V2
77 wreece%/ZJetsToNuNu_100_HT_200_7TeV-madgraph/Summer11-PU_S4_START42_V11-v1/AODSIM/V2
78 
79 The CASTOR username for each sample is given before the '%'.
80 
81 Each step in the flow has a task associated with it, which may set options. The options for each task are
82 documented below.
83 
84 """
self.das = Das.DASOptionParser(usage=usage)

Member Function Documentation

def production_tasks.ParseOptions.addOption (   self,
  parser 
)

Definition at line 85 of file production_tasks.py.

85 
86  def addOption(self, parser):
87  parser.add_option("-u", "--user", dest="user", default=os.getlogin(),help='The username to use when looking at mass storage devices. Your login username is used by default.')
88  parser.add_option("-w", "--wildcard", dest="wildcard", default='*.root',help='A UNIX style wildcard to specify which input files to check before submitting the jobs')
parser.add_option("--max_threads", dest="max_threads", default=None,help='The maximum number of threads to use in the production')
def production_tasks.ParseOptions.run (   self,
  input 
)

Definition at line 89 of file production_tasks.py.

89 
90  def run(self, input):
91  self.options, self.dataset = self.das.get_opt()
92  self.dataset = [d for d in self.dataset if not d.startswith('#')]
93  self.user = self.options.user
94  if not self.dataset:
95  raise Exception('TaskError: No dataset specified')
96  return {'Options':self.options, 'Dataset':self.dataset}

Member Data Documentation

production_tasks.ParseOptions.das

Definition at line 84 of file production_tasks.py.

production_tasks.ParseOptions.dataset

Definition at line 90 of file production_tasks.py.

production_tasks.ParseOptions.user

Definition at line 92 of file production_tasks.py.

Referenced by cmsPerfSuite.PerfSuite.optionParse().