@@ -362,9 +362,36 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
362362if (includeLocalQC or includeFullQC ) and not isdir (qcdir ):
363363 mkdir (qcdir )
364364
365+ # prepare fetching and configuration for MaterialManagerParam
366+ # MaterialManagerParam only has an effect when given to signal confKey
367+ mat_mgr_params = create_geant_config (args , args .confKey ).get ('MaterialManagerParam' , {}).get ('inputFile' , None )
368+ # the target file name
369+ mat_mgr_file_name = 'material_manager_params.json'
370+ # the path on CCDB
371+ ccdb_path = 'SIM_TEST/ALIBI/SIM_CUTS'
372+ # this is the full path of where the parameter file will be copied to
373+ mat_mgr_file_path = f'${{ALICEO2_CCDB_LOCALCACHE}}/{ ccdb_path } /{ mat_mgr_file_name } '
374+
375+ if mat_mgr_params is None :
376+ mat_mgr_cmd = 'echo "placeholder / dummy task"'
377+ mat_mgr_file_path = None
378+ elif mat_mgr_params == 'ccdb' :
379+ mat_mgr_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 } '
380+ else :
381+ mat_mgr_cmd = f'[[ ! -d ${{ALICEO2_CCDB_LOCALCACHE}}/{ ccdb_path } ]] && {{mkdir ${{ALICEO2_CCDB_LOCALCACHE}}/{ ccdb_path } ; cp { mat_mgr_params } ${{ALICEO2_CCDB_LOCALCACHE}}/{ ccdb_path } ; }}'
382+
383+ if mat_mgr_params :
384+ # we can simply append, the last one takes precedence
385+ args .confKey += f';MaterialManagerParam.inputFile={ mat_mgr_file_path } '
386+ args .confKeyBkg += f';MaterialManagerParam.inputFile={ mat_mgr_file_path } '
387+
388+ MATMGR_TASK = createTask (name = 'download_mat_mgr_params' , cpu = 0 )
389+ MATMGR_TASK ['cmd' ] = mat_mgr_cmd
390+ workflow ['stages' ].append (MATMGR_TASK )
391+
365392# create/publish the GRPs and other GLO objects for consistent use further down the pipeline
366393orbitsPerTF = int (args .orbitsPerTF )
367- GRP_TASK = createTask (name = 'grpcreate' , cpu = '0' )
394+ GRP_TASK = createTask (name = 'grpcreate' , cpu = '0' , needs = [ MATMGR_TASK [ 'name' ]] )
368395GRP_TASK ['cmd' ] = 'o2-grp-simgrp-tool createGRPs --timestamp ' + str (args .timestamp ) + ' --run ' + str (args .run ) + ' --publishto ${ALICEO2_CCDB_LOCALCACHE:-.ccdb} -o grp --hbfpertf ' + str (orbitsPerTF ) + ' --field ' + args .field
369396GRP_TASK ['cmd' ] += ' --readoutDets ' + " " .join (activeDetectors ) + ' --print ' + ('' ,'--lhcif-CCDB' )[args .run_anchored ]
370397if (not args .run_anchored == True ) and len (args .bcPatternFile ) > 0 :
0 commit comments