CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
DTCalibrationWorker.DTCalibrationWorker Class Reference
Inheritance diagram for DTCalibrationWorker.DTCalibrationWorker:

Public Member Functions

def __init__ (self, options)
 
def add_arguments (cls, parser)
 
def has_crab3_env (self)
 
def run (self)
 
def setup_crab_env (self)
 

Public Attributes

 options
 

Detailed Description

This class serves as a top level helper to perform all available
    workflows. Additional workflow classes should use the naming scheme
    DT${WORKFLOWNAME}Workflow and implement a classmethod function add_parser_options.

Definition at line 12 of file DTCalibrationWorker.py.

Constructor & Destructor Documentation

def DTCalibrationWorker.DTCalibrationWorker.__init__ (   self,
  options 
)

Member Function Documentation

def DTCalibrationWorker.DTCalibrationWorker.add_arguments (   cls,
  parser 
)

Definition at line 52 of file DTCalibrationWorker.py.

52  def add_arguments(cls, parser):
53  workflow_parser = DTWorkflow.add_parser_options(parser)
54  for workflow in cls.available_workflows:
55  class_name = "DT" + workflow + "Workflow"
56  try:
57  workflow_class = eval( class_name )
58  workflow_class.add_parser_options(workflow_parser)
59  except:
60  log.error("No class with name: %s exists bot workflow exists in %s" %
61  (class_name, DTCalibrationWorker)
62  )
63 
def DTCalibrationWorker.DTCalibrationWorker.has_crab3_env (   self)

Definition at line 32 of file DTCalibrationWorker.py.

32  def has_crab3_env(self):
33  if not "/crabclient/3" in os.environ["PATH"]:
34  return False
35  return True
36 
def DTCalibrationWorker.DTCalibrationWorker.run (   self)

Definition at line 23 of file DTCalibrationWorker.py.

References DTCalibrationWorker.DTCalibrationWorker.options.

Referenced by DTWorkflow.DTWorkflow.all(), Types.EventID.cppID(), Types.LuminosityBlockID.cppID(), and o2olib.O2OTool.execute().

23  def run(self):
24  # get class object dependent on workflow
25  class_name = "DT" + self.options.workflow + "Workflow"
26  workflow_class = eval(class_name)
27  workflow_class_instance = workflow_class(self.options)
28  workflow_class_instance.run()
29  return workflow_class_instance.local_path
30 
def DTCalibrationWorker.DTCalibrationWorker.setup_crab_env (   self)

Definition at line 37 of file DTCalibrationWorker.py.

References split.

37  def setup_crab_env(self):
38  # following
39  #http://.com/questions/3503719/emulating-bash-source-in-python
40  command = ['bash', '-c', 'unset module;source /cvmfs/cms.cern.ch/crab3/crab.sh && env']
41  proc = subprocess.Popen(command, stdout = subprocess.PIPE)
42 
43  print 'setting up crab'
44  for line in proc.stdout:
45  (key, _, value) = line.partition("=")
46  os.environ[key] = value.replace("\n","")
47  for path in os.environ['PYTHONPATH'].split(':'):
48  sys.path.append(path)
49  proc.communicate()
50 
double split
Definition: MVATrainer.cc:139

Member Data Documentation

DTCalibrationWorker.DTCalibrationWorker.options

Definition at line 19 of file DTCalibrationWorker.py.

Referenced by DOTExport.DotProducer.__call__(), betterConfigParser.BetterConfigParser.__updateDict(), DTWorkflow.DTWorkflow.add_local_custom_db(), confdb.HLTProcess.buildOptions(), DTWorkflow.DTWorkflow.check_missing_options(), betterConfigParser.BetterConfigParser.checkInput(), DOTExport.DotProducer.connectTags(), CrabHelper.CrabHelper.crab_config_filename(), CrabHelper.CrabHelper.crab_taskname(), DTWorkflow.DTWorkflow.dump_options(), DOTExport.DotExport.export(), CrabHelper.CrabHelper.fill_options_from_crab_config(), confdb.HLTProcess.fixPrescales(), confdb.HLTProcess.getRawConfigurationFromDB(), confdb.HLTProcess.getSetupConfigurationFromDB(), DOTExport.DotProducer.getTopLevel(), DTWorkflow.DTWorkflow.load_options(), DOTExport.DotProducer.makePath(), DOTExport.DotProducer.nodeLabel(), DOTExport.DotProducer.nodeURL(), DTWorkflow.DTWorkflow.prepare_common_submit(), DOTExport.DotProducer.produceLegend(), DOTExport.DotProducer.produceNodes(), DOTExport.DotProducer.producePaths(), DOTExport.DotProducer.produceServices(), DOTExport.DotProducer.produceSource(), edmIntegrityCheck.IntegrityCheck.query(), DTCalibrationWorker.DTCalibrationWorker.run(), cmsswPreprocessor.CmsswPreprocessor.run(), DTWorkflow.DTWorkflow.run(), production_tasks.BaseDataset.run(), production_tasks.GenerateMask.run(), production_tasks.RunCMSBatch.run(), production_tasks.MonitorJobs.run(), production_tasks.CheckJobStatus.run(), production_tasks.CleanJobFiles.run(), DOTExport.DotProducer.seqRecurseChildren(), FileExportPlugin.FileExportPlugin.setOption(), DTWorkflow.DTWorkflow.user(), and DOTExport.DotExport.write_output().