CMS 3D CMS Logo

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

Public Member Functions

def __init__
 
def add_arguments
 
def has_crab3_env
 
def run
 
def setup_crab_env
 

Public Attributes

 options
 

Static Public Attributes

list available_workflows = ["ttrig","vdrift","T0Wire"]
 

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 14 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 54 of file DTCalibrationWorker.py.

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

Definition at line 34 of file DTCalibrationWorker.py.

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

Definition at line 25 of file DTCalibrationWorker.py.

References DTCalibrationWorker.DTCalibrationWorker.options, and validateAlignments.ValidationJobMultiIOV.options.

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

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

Definition at line 39 of file DTCalibrationWorker.py.

References print(), and submitPVValidationJobs.split().

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

Member Data Documentation

list DTCalibrationWorker.DTCalibrationWorker.available_workflows = ["ttrig","vdrift","T0Wire"]
static

Definition at line 19 of file DTCalibrationWorker.py.

DTCalibrationWorker.DTCalibrationWorker.options

Definition at line 21 of file DTCalibrationWorker.py.

Referenced by betterConfigParser.BetterConfigParser.__updateDict(), submitPVValidationJobs.BetterConfigParser.__updateDict(), DTWorkflow.DTWorkflow.add_local_custom_db(), confdb.HLTProcess.buildOptions(), DTWorkflow.DTWorkflow.check_missing_options(), betterConfigParser.BetterConfigParser.checkInput(), CrabHelper.CrabHelper.crab_config_filename(), CrabHelper.CrabHelper.crab_taskname(), DTWorkflow.DTWorkflow.dump_options(), CrabHelper.CrabHelper.fill_options_from_crab_config(), confdb.HLTProcess.fixPrescales(), DTWorkflow.DTWorkflow.load_options(), DTWorkflow.DTWorkflow.prepare_common_submit(), 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(), and DTWorkflow.DTWorkflow.user().