1 from __future__
import print_function
2 from __future__
import absolute_import
5 from .tools
import loadCmsProcess
6 from .DTWorkflow
import DTWorkflow
7 from .DTTtrigWorkflow
import DTttrigWorkflow
8 from .DTVdriftWorkflow
import DTvdriftWorkflow
9 from .DTT0WireWorkflow
import DTT0WireWorkflow
12 log = logging.getLogger(__name__)
16 """ This class serves as a top level helper to perform all available 17 workflows. Additional workflow classes should use the naming scheme 18 DT${WORKFLOWNAME}Workflow and implement a classmethod function add_parser_options. 20 available_workflows = [
"ttrig",
"vdrift",
"T0Wire"]
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
36 if not "/crabclient/3" in os.environ[
"PATH"]:
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)
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(
':'):
56 workflow_parser = DTWorkflow.add_parser_options(parser)
57 for workflow
in cls.available_workflows:
58 class_name =
"DT" + workflow +
"Workflow" 60 workflow_class = eval( class_name )
61 workflow_class.add_parser_options(workflow_parser)
63 log.error(
"No class with name: %s exists but workflow exists in %s" %
64 (class_name, DTCalibrationWorker)
def replace(string, replacements)
def __init__(self, options)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
def split(sequence, size)
def add_arguments(cls, parser)