CMS 3D CMS Logo

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__ (self, dataset, user, options)
 
def addOption (self, parser)
 
def run (self, input)
 
- Public Member Functions inherited from production_tasks.Task
def __init__ (self, name, dataset, user, options, instance=None)
 
def addOption (self, parser)
 
def getname (self)
 
def run (self, input)
 

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 49 of file production_tasks.py.

Constructor & Destructor Documentation

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

Definition at line 51 of file production_tasks.py.

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

Member Function Documentation

def production_tasks.ParseOptions.addOption (   self,
  parser 
)

Definition at line 89 of file production_tasks.py.

89  def addOption(self, parser):
90  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.')
91  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')
92  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 93 of file production_tasks.py.

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

Member Data Documentation

production_tasks.ParseOptions.das

Definition at line 88 of file production_tasks.py.

production_tasks.ParseOptions.dataset

Definition at line 94 of file production_tasks.py.

production_tasks.ParseOptions.user