|
34 | 34 |
|
35 | 35 | sys.path.append(join(dirname(__file__), '.', 'o2dpg_workflow_utils')) |
36 | 36 |
|
37 | | -from o2dpg_workflow_utils import createTask, createGlobalInitTask, dump_workflow, adjust_RECO_environment, isActive, activate_detector, deactivate_detector, compute_n_workers |
| 37 | +from o2dpg_workflow_utils import createTask, createGlobalInitTask, dump_workflow, adjust_RECO_environment, isActive, activate_detector, deactivate_detector, compute_n_workers, merge_dicts |
38 | 38 | from o2dpg_qc_finalization_workflow import include_all_QC_finalization |
39 | 39 | from o2dpg_sim_config import create_sim_config, create_geant_config, constructConfigKeyArg |
40 | 40 |
|
|
51 | 51 | parser.add_argument('--conditionDB',help="CCDB url for QC workflows", default='http://alice-ccdb.cern.ch') |
52 | 52 | parser.add_argument('--qcdbHost',help="QCDB url for QC object uploading", default='http://ali-qcdbmc-gpn.cern.ch:8083') |
53 | 53 | parser.add_argument('--condition-not-after', type=int, help="only consider CCDB objects not created after this timestamp (for TimeMachine)", default=3385078236000) |
54 | | -parser.add_argument('--orbitsPerTF', type=int, help="Timeframe size in number of LHC orbits", default=128) |
55 | | -parser.add_argument('--anchor-config',help="JSON file to contextualise workflow with external configs (config values etc.) for instance comping from data reco workflows.", default='') |
| 54 | +parser.add_argument('--orbitsPerTF', type=int, help="Timeframe size in number of LHC orbits", default=32) |
| 55 | +parser.add_argument('--anchor-config',help="JSON file to contextualise workflow with external configs (config values etc.) for instance coming from data reco workflows.", default='') |
| 56 | +parser.add_argument('--overwrite-config',help="extra JSON file with configs (config values etc.) overwriting defaults or the config coming from --anchor-config", default='') |
56 | 57 | parser.add_argument('--dump-config',help="Dump JSON file with all settings used in workflow", default='user_config.json') |
57 | 58 | parser.add_argument('-ns',help='number of signal events / timeframe', default=20) |
58 | 59 | parser.add_argument('-gen',help='generator: pythia8, extgen', default='') |
@@ -195,6 +196,13 @@ def load_external_config(configfile): |
195 | 196 | # we load a generic config |
196 | 197 | print ("** Using generic config **") |
197 | 198 | anchorConfig = create_sim_config(args) |
| 199 | +# we apply additional external user choices for the configuration |
| 200 | +# this will overwrite config from earlier stages |
| 201 | +if args.overwrite_config != '': |
| 202 | + # apply final JSON overwrite |
| 203 | + config_overwrite = load_external_config(args.overwrite_config) |
| 204 | + # merge the dictionaries into anchorConfig, the latter takes precedence |
| 205 | + merge_dicts(anchorConfig, config_overwrite) |
198 | 206 |
|
199 | 207 | # write this config |
200 | 208 | config_key_param_path = args.dump_config |
@@ -977,7 +985,7 @@ def createRestDigiTask(name, det='ALLSMALLER'): |
977 | 985 | FT0FV0EMCCTPDIGItask['cmd'] = ('','ln -nfs ../bkg_HitsFT0.root . ; ln -nfs ../bkg_HitsFV0.root . ;')[doembedding] |
978 | 986 | FT0FV0EMCCTPDIGItask['cmd'] += '${O2_ROOT}/bin/o2-sim-digitizer-workflow ' + getDPL_global_options() + ' -n ' + str(args.ns) + simsoption \ |
979 | 987 | + ' --onlyDet FT0,FV0,EMC,CTP --interactionRate ' + str(INTRATE) + ' --incontext ' + str(CONTEXTFILE) \ |
980 | | - + ' --disable-write-ini' + putConfigValuesNew(localCF={"DigiParams.seed" : str(TFSEED)}) \ |
| 988 | + + ' --disable-write-ini' + putConfigValuesNew(listOfMainKeys=['EMCSimParam'], localCF={"DigiParams.seed" : str(TFSEED)}) \ |
981 | 989 | + (' --combine-devices','')[args.no_combine_dpl_devices] + ('',' --disable-mc')[args.no_mc_labels] + QEDdigiargs \ |
982 | 990 | + ' --forceSelectedDets' |
983 | 991 | workflow['stages'].append(FT0FV0EMCCTPDIGItask) |
|
0 commit comments