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

Constructor & Destructor Documentation

◆ __init__()

def DTCalibrationWorker.DTCalibrationWorker.__init__ (   self,
  options 
)

Definition at line 20 of file DTCalibrationWorker.py.

20  def __init__(self, options):
21  self.options = options
22  if not self.has_crab3_env:
23  self.setup_crab_env()
24 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ add_arguments()

def DTCalibrationWorker.DTCalibrationWorker.add_arguments (   cls,
  parser 
)

Definition at line 54 of file DTCalibrationWorker.py.

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

◆ has_crab3_env()

def DTCalibrationWorker.DTCalibrationWorker.has_crab3_env (   self)

Definition at line 34 of file DTCalibrationWorker.py.

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

◆ run()

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  def run(self):
26  # get class object dependent on workflow
27  class_name = "DT" + self.options.workflow + "Workflow"
28  workflow_class = eval(class_name)
29  workflow_class_instance = workflow_class(self.options)
30  workflow_class_instance.run()
31  return workflow_class_instance.local_path
32 

◆ setup_crab_env()

def DTCalibrationWorker.DTCalibrationWorker.setup_crab_env (   self)

Definition at line 39 of file DTCalibrationWorker.py.

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

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

Member Data Documentation

◆ options

DTCalibrationWorker.DTCalibrationWorker.options

Definition at line 21 of file DTCalibrationWorker.py.

Referenced by betterConfigParser.BetterConfigParser.__updateDict(), submitPVValidationJobs.BetterConfigParser.__updateDict(), DTWorkflow.DTWorkflow.add_local_calib_db(), DTWorkflow.DTWorkflow.add_local_custom_db(), DTWorkflow.DTWorkflow.add_local_t0_db(), DTWorkflow.DTWorkflow.add_local_vdrift_db(), DTWorkflow.DTWorkflow.add_preselection(), DTWorkflow.DTWorkflow.all(), confdb.HLTProcess.buildOptions(), CrabHelper.CrabHelper.check_crabtask(), DTWorkflow.DTWorkflow.check_missing_options(), betterConfigParser.BetterConfigParser.checkInput(), CrabHelper.CrabHelper.crab_config_filename(), CrabHelper.CrabHelper.crab_config_filepath(), CrabHelper.CrabHelper.crab_taskname(), DTWorkflow.DTWorkflow.dump_options(), CrabHelper.CrabHelper.fill_options_from_crab_config(), confdb.HLTProcess.fixPrescales(), DTWorkflow.DTWorkflow.get_config_name(), confdb.HLTProcess.getRawConfigurationFromDB(), confdb.HLTProcess.getSetupConfigurationFromDB(), edmIntegrityCheck.IntegrityCheck.listFiles(), DTWorkflow.DTWorkflow.load_options(), DTWorkflow.DTWorkflow.load_options_command(), DTWorkflow.DTWorkflow.local_path(), production_tasks.MonitorJobs.monitor(), DTWorkflow.DTWorkflow.outpath_workflow_mode_tag(), DTWorkflow.DTWorkflow.prepare_common_submit(), DTWorkflow.DTWorkflow.prepare_common_write(), DTVdriftWorkflow.DTvdriftWorkflow.prepare_meantimer_dump(), DTVdriftWorkflow.DTvdriftWorkflow.prepare_meantimer_submit(), DTVdriftWorkflow.DTvdriftWorkflow.prepare_meantimer_write(), DTTtrigWorkflow.DTttrigWorkflow.prepare_residuals_correction(), DTTtrigWorkflow.DTttrigWorkflow.prepare_residuals_dump(), DTTtrigWorkflow.DTttrigWorkflow.prepare_residuals_submit(), DTVdriftWorkflow.DTvdriftWorkflow.prepare_segment_dump(), DTVdriftWorkflow.DTvdriftWorkflow.prepare_segment_write(), DTTtrigWorkflow.DTttrigWorkflow.prepare_timeboxes_correction(), DTTtrigWorkflow.DTttrigWorkflow.prepare_timeboxes_dump(), DTTtrigWorkflow.DTttrigWorkflow.prepare_validation_submit(), DTTtrigWorkflow.DTttrigWorkflow.prepare_validation_write(), DTT0WireWorkflow.DTT0WireWorkflow.prepare_workflow(), DTVdriftWorkflow.DTvdriftWorkflow.prepare_workflow(), DTTtrigWorkflow.DTttrigWorkflow.prepare_workflow(), edmIntegrityCheck.IntegrityCheck.query(), production_tasks.BaseDataset.query(), DTWorkflow.DTWorkflow.remote_out_path(), edmIntegrityCheck.IntegrityCheck.report(), DTCalibrationWorker.DTCalibrationWorker.run(), cmsswPreprocessor.CmsswPreprocessor.run(), DTWorkflow.DTWorkflow.run(), production_tasks.CheckDatasetExists.run(), production_tasks.BaseDataset.run(), production_tasks.GenerateMask.run(), production_tasks.CreateJobDirectory.run(), production_tasks.SourceCFG.run(), production_tasks.FullCFG.run(), production_tasks.WriteToDatasets.run(), production_tasks.RunCMSBatch.run(), production_tasks.MonitorJobs.run(), production_tasks.CheckJobStatus.run(), production_tasks.WriteJobReport.run(), production_tasks.CleanJobFiles.run(), DTWorkflow.DTWorkflow.runCMSSWtask(), edmIntegrityCheck.IntegrityCheck.structured(), CrabHelper.CrabHelper.submit_crab_task(), DTWorkflow.DTWorkflow.tag(), edmIntegrityCheck.IntegrityCheck.test(), DTWorkflow.DTWorkflow.user(), and CrabHelper.CrabHelper.write_crabConfig().