|
61 | 61 | parser.add_argument('-ini',help='generator init parameters file (full paths required), for example: ${O2DPG_ROOT}/MC/config/PWGHF/ini/GeneratorHF.ini', default='') |
62 | 62 | parser.add_argument('-confKey',help='generator or trigger configuration key values, for example: "GeneratorPythia8.config=pythia8.cfg;A.x=y"', default='') |
63 | 63 | parser.add_argument('--readoutDets',help='comma separated string of detectors readout (does not modify material budget - only hit creation)', default='all') |
| 64 | +parser.add_argument('--material-params-ccdb', dest='material_params_ccdb', action='store_true', help='to fetch the material parameters used during transport from CCDB') |
64 | 65 |
|
65 | 66 | parser.add_argument('-interactionRate',help='Interaction rate, used in digitization', default=-1) |
66 | 67 | parser.add_argument('-bcPatternFile',help='Bunch crossing pattern file, used in digitization (a file name or "ccdb")', default='') |
@@ -362,6 +363,24 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True): |
362 | 363 | if (includeLocalQC or includeFullQC) and not isdir(qcdir): |
363 | 364 | mkdir(qcdir) |
364 | 365 |
|
| 366 | +# prepare fetching and configuration for MaterialManagerParam |
| 367 | +transport_needs = [] |
| 368 | +if args.material_params_ccdb: |
| 369 | + # the target file name |
| 370 | + mat_mgr_file_name = 'material_manager_params.json' |
| 371 | + # the path on CCDB |
| 372 | + ccdb_path = 'SIM_TEST/ALIBI/SIM_CUTS' |
| 373 | + # this is the full local path of where the parameter file will be copied to |
| 374 | + mat_mgr_file_path = f'${{ALICEO2_CCDB_LOCALCACHE}}/{ccdb_path}/{mat_mgr_file_name}' |
| 375 | + # simply append, the last one takes precedence |
| 376 | + args.confKey += f';MaterialManagerParam.inputFile={mat_mgr_file_path}' |
| 377 | + args.confKeyBkg += f';MaterialManagerParam.inputFile={mat_mgr_file_path}' |
| 378 | + |
| 379 | + MAT_PARAMS_DOWNLOADER_TASK = createTask(name='download_mat_mgr_params', cpu=0) |
| 380 | + MAT_PARAMS_DOWNLOADER_TASK['cmd'] = f'${{O2_ROOT}}/bin/o2-ccdb-downloadccdbfile --host http://ccdb-test.cern.ch:8080 -p {ccdb_path} --timestamp -1 -d ${{ALICEO2_CCDB_LOCALCACHE}} -o {mat_mgr_file_name}' |
| 381 | + workflow['stages'].append(MAT_PARAMS_DOWNLOADER_TASK) |
| 382 | + transport_needs.append(MAT_PARAMS_DOWNLOADER_TASK['name']) |
| 383 | + |
365 | 384 | # create/publish the GRPs and other GLO objects for consistent use further down the pipeline |
366 | 385 | orbitsPerTF=int(args.orbitsPerTF) |
367 | 386 | GRP_TASK = createTask(name='grpcreate', cpu='0') |
@@ -455,7 +474,7 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True): |
455 | 474 | # determine final configKey values for background transport |
456 | 475 | CONFKEYBKG = constructConfigKeyArg(create_geant_config(args, args.confKeyBkg)) |
457 | 476 |
|
458 | | - BKGtask=createTask(name='bkgsim', lab=["GEANT"], needs=[BKG_CONFIG_task['name'], GRP_TASK['name']], cpu=NWORKERS ) |
| 477 | + BKGtask=createTask(name='bkgsim', lab=["GEANT"], needs=[BKG_CONFIG_task['name'], GRP_TASK['name']] + transport_needs, cpu=NWORKERS ) |
459 | 478 | BKGtask['cmd']='${O2_ROOT}/bin/o2-sim -e ' + SIMENGINE + ' -j ' + str(NWORKERS) + ' -n ' + str(NBKGEVENTS) \ |
460 | 479 | + ' -g ' + str(GENBKG) + ' ' + str(MODULES) + ' -o bkg ' + str(INIBKG) \ |
461 | 480 | + ' --field ccdb ' + str(CONFKEYBKG) \ |
@@ -700,7 +719,7 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True): |
700 | 719 | # ----------------- |
701 | 720 | # transport signals |
702 | 721 | # ----------------- |
703 | | - signalneeds=[ SGN_CONFIG_task['name'], GRP_TASK['name'] ] |
| 722 | + signalneeds=[ SGN_CONFIG_task['name'], GRP_TASK['name'] ] + transport_needs |
704 | 723 | if (args.pregenCollContext == True): |
705 | 724 | signalneeds.append(PreCollContextTask['name']) |
706 | 725 |
|
|
0 commit comments