CMS 3D CMS Logo

List of all members | Public Member Functions
production_tasks.SourceCFG Class Reference
Inheritance diagram for production_tasks.SourceCFG:
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)
 

Additional Inherited Members

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

Detailed Description

Generate a source CFG using 'sourceFileList.py' by listing the CASTOR directory specified. Applies the file wildcard, '--wildcard'

Definition at line 327 of file production_tasks.py.

Constructor & Destructor Documentation

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

Definition at line 329 of file production_tasks.py.

329  def __init__(self, dataset, user, options):
330  Task.__init__(self,'SourceCFG', dataset, user, options)
def __init__(self, dataset, user, options)

Member Function Documentation

def production_tasks.SourceCFG.addOption (   self,
  parser 
)

Definition at line 331 of file production_tasks.py.

331  def addOption(self, parser):
332  parser.add_option("--min-run", dest="min_run", default=-1, type=int, help='When querying DBS, require runs >= than this run')
333  parser.add_option("--max-run", dest="max_run", default=-1, type=int, help='When querying DBS, require runs <= than this run')
334  parser.add_option("--input-prescale", dest="prescale", default=1, type=int, help='Randomly prescale the number of good files by this factor.')
def production_tasks.SourceCFG.run (   self,
  input 
)

Definition at line 335 of file production_tasks.py.

References dataset.createDataset(), production_tasks.Task.dataset, edmIntegrityCheck.IntegrityCheck.dataset, genericValidation.GenericValidationData.dataset, FrontierConditions_GlobalTag_cff.file, str, EcalTPGParamReaderFromDB.user, dataset.BaseDataset.user, production_tasks.Task.user, popcon::RPCObPVSSmapData.user, popcon::RpcDataV.user, popcon::RpcDataT.user, popcon::RpcObGasData.user, popcon::RpcDataUXC.user, popcon::RpcDataI.user, popcon::RpcDataS.user, popcon::RpcDataGasMix.user, popcon::RpcDataFebmap.user, MatrixInjector.MatrixInjector.user, and EcalDBConnection.user.

335  def run(self, input):
336 
337  jobdir = input['CreateJobDirectory']['JobDir']
338  pattern = fnmatch.translate(self.options.wildcard)
339 
340  run_range = (self.options.min_run, self.options.max_run)
341  data = createDataset(self.user, self.dataset, pattern, run_range = run_range)
342  good_files = data.listOfGoodFilesWithPrescale(self.options.prescale)
343  #will mark prescale removed files as bad in comments
344  bad_files = [fname for fname in data.listOfFiles() if not fname in good_files]
345 
346  source = os.path.join(jobdir,'source_cfg.py')
347  output = file(source,'w')
348  output.write('###SourceCFG:\t%d GoodFiles; %d BadFiles found in mask; Input prescale factor %d\n' % (len(good_files),len(bad_files),self.options.prescale) )
349  output.write('files = ' + str(good_files) + '\n')
350  for bad_file in bad_files:
351  output.write("###SourceCFG:\tBadInMask '%s'\n" % bad_file)
352  output.close()
353  return {'SourceCFG':source}
354 
355 
def createDataset(user, dataset, pattern, readcache=False, basedir=None, run_range=None)
Definition: dataset.py:430
#define str(s)