CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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__
 
def addOption
 
def run
 
- Public Member Functions inherited from production_tasks.Task
def __init__
 
def addOption
 
def getname
 
def run
 

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

Constructor & Destructor Documentation

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

Definition at line 325 of file production_tasks.py.

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

Member Function Documentation

def production_tasks.SourceCFG.addOption (   self,
  parser 
)

Definition at line 327 of file production_tasks.py.

328  def addOption(self, parser):
329  parser.add_option("--min-run", dest="min_run", default=-1, type=int, help='When querying DBS, require runs >= than this run')
330  parser.add_option("--max-run", dest="max_run", default=-1, type=int, help='When querying DBS, require runs <= than this run')
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 331 of file production_tasks.py.

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

332  def run(self, input):
333 
334  jobdir = input['CreateJobDirectory']['JobDir']
335  pattern = fnmatch.translate(self.options.wildcard)
336 
337  run_range = (self.options.min_run, self.options.max_run)
338  data = createDataset(self.user, self.dataset, pattern, run_range = run_range)
339  good_files = data.listOfGoodFilesWithPrescale(self.options.prescale)
340  #will mark prescale removed files as bad in comments
341  bad_files = [fname for fname in data.listOfFiles() if not fname in good_files]
342 
343  source = os.path.join(jobdir,'source_cfg.py')
344  output = file(source,'w')
345  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) )
346  output.write('files = ' + str(good_files) + '\n')
347  for bad_file in bad_files:
348  output.write("###SourceCFG:\tBadInMask '%s'\n" % bad_file)
349  output.close()
350  return {'SourceCFG':source}
351 
def createDataset
Definition: dataset.py:426