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

Constructor & Destructor Documentation

◆ __init__()

def DTCalibrationWorker.DTCalibrationWorker.__init__ (   self,
  options 
)

Definition at line 21 of file DTCalibrationWorker.py.

21  def __init__(self, options):
22  self.options = options
23  if not self.has_crab3_env:
24  self.setup_crab_env()
25 
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 55 of file DTCalibrationWorker.py.

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 but workflow exists in %s" %
64  (class_name, DTCalibrationWorker)
65  )
66 
67 

◆ has_crab3_env()

def DTCalibrationWorker.DTCalibrationWorker.has_crab3_env (   self)

Definition at line 35 of file DTCalibrationWorker.py.

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

◆ run()

def DTCalibrationWorker.DTCalibrationWorker.run (   self)

Definition at line 26 of file DTCalibrationWorker.py.

References DTCalibrationWorker.DTCalibrationWorker.options.

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

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
33 

◆ setup_crab_env()

def DTCalibrationWorker.DTCalibrationWorker.setup_crab_env (   self)

Definition at line 40 of file DTCalibrationWorker.py.

References print(), python.rootplot.root2matplotlib.replace(), and submitPVValidationJobs.split().

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, executable = '/bin/bash', stdout = subprocess.PIPE)
45 
46  print('setting up crab')
47  for line in proc.stdout:
48  (key, _, value) = line.partition(b"=")
49  os.environ[key.decode()] = value.decode().replace("\n","")
50  for path in os.environ['PYTHONPATH'].split(':'):
51  sys.path.append(path)
52  proc.communicate()
53 
def replace(string, replacements)
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 22 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.add_raw_option(), 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().