Skip to content

Commit d3e6126

Browse files
benedikt-voelkelBenedikt Volkel
andauthored
[SimWF] Small fixes (#1476)
* o2dpg_sim_workflow_anchored.py * remove unused function from CCDBAccessor due to undefined utility function that is used inside it * fix variable name * o2dpg_sim_workflow.py * fix dependency of cleanup task * o2dpg-workflow-tools.py * use return value of function correctly Co-authored-by: Benedikt Volkel <benedikt.volkel@cern.ch>
1 parent 26319e4 commit d3e6126

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

MC/bin/o2dpg-workflow-tools.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ def extend(args):
1515
is kept
1616
"""
1717
# load workflows
18-
workflow_orig = read_workflow(args.orig_wf)
19-
workflow_extend = read_workflow(args.extend_wf)
18+
workflow_orig, meta = read_workflow(args.orig_wf)
19+
workflow_extend, _ = read_workflow(args.extend_wf)
2020

2121
# extend
2222
workflow_orig.extend(workflow_extend)
2323

2424
# dump in new file
2525
filename = args.output if args.output else args.orig_wf
26-
dump_workflow(workflow_orig, filename)
26+
# propagate meta information from original workflow that is extended
27+
dump_workflow(workflow_orig, filename, meta)
2728

2829

2930
def create(args):

MC/bin/o2dpg_sim_workflow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ def getDigiTaskName(det):
10391039
TOFRECOtask['cmd'] = '${O2_ROOT}/bin/o2-tof-reco-workflow --use-ccdb ' + getDPL_global_options() + putConfigValuesNew() + ('',' --disable-mc')[args.no_mc_labels]
10401040
workflow['stages'].append(TOFRECOtask)
10411041

1042-
1042+
10431043
toftpcmatchneeds = [TOFRECOtask['name'], TPCRECOtask['name'], ITSTPCMATCHtask['name'], TRDTRACKINGtask2['name']]
10441044
toftracksrcdefault = anchorConfig.get('o2-tof-matcher-workflow-options', {}).get('track-sources', 'TPC,ITS-TPC,TPC-TRD,ITS-TPC-TRD')
10451045
TOFTPCMATCHERtask = createTask(name='toftpcmatch_'+str(tf), needs=toftpcmatchneeds, tf=tf, cwd=timeframeworkdir, lab=["RECO"], mem='1000')
@@ -1407,10 +1407,10 @@ def addQCPerTF(taskName, needs, readerCommand, configFilePath, objectsFile=''):
14071407
# taking away digits, clusters and other stuff as soon as possible.
14081408
# TODO: cleanup by labels or task names
14091409
if args.early_tf_cleanup == True:
1410-
TFcleanup = createTask(name='tfcleanup_'+str(tf), needs= [ AOD_merge_task['name'] ], tf=tf, cwd=timeframeworkdir, lab=["CLEANUP"], mem='0', cpu='1')
1410+
TFcleanup = createTask(name='tfcleanup_'+str(tf), needs= [ AODtask['name'] ], tf=tf, cwd=timeframeworkdir, lab=["CLEANUP"], mem='0', cpu='1')
14111411
TFcleanup['cmd'] = 'rm *digi*.root;'
14121412
TFcleanup['cmd'] += 'rm *cluster*.root'
1413-
workflow['stages'].append(TFcleanup);
1413+
workflow['stages'].append(TFcleanup)
14141414

14151415
# AOD merging as one global final step
14161416
aodmergerneeds = ['aod_' + str(tf) for tf in range(1, NTIMEFRAMES + 1)]

MC/bin/o2dpg_sim_workflow_anchored.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,6 @@ def __init__(self, url):
5050
# we allow nullptr responsens and will treat it ourselves
5151
o2.ccdb.BasicCCDBManager.instance().setFatalWhenNull(False)
5252

53-
def list(self, path, dump_path=None):
54-
ret = self.api.list(path, False, "application/json")
55-
ret = json.loads(ret)
56-
if ret and "objects" in ret:
57-
ret = ret["objects"]
58-
if ret and dump_path:
59-
print(f"CCDB object information for path {path} stored in {dump_path}")
60-
dump_json(ret, dump_path)
61-
return ret
62-
6353
def fetch(self, path, obj_type, timestamp=None, meta_info=None):
6454
"""
6555
TODO We could use CcdbApi::snapshot at some point, needs revision
@@ -95,7 +85,7 @@ def retrieve_sor_eor(ccdbreader, run_number):
9585
path_run_info = "RCT/Info/RunInformation"
9686
header = ccdbreader.fetch_header(path_run_info, run_number)
9787
if not header:
98-
print(f"WARNING: Cannot find run information for run number {r}")
88+
print(f"WARNING: Cannot find run information for run number {run_number}")
9989
return None
10090
# return this a dictionary
10191
return {"SOR": int(header["SOR"]), "EOR": int(header["EOR"])}

0 commit comments

Comments
 (0)