@@ -510,10 +510,60 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
510510 return common + " --shm-segment-size ${SHMSIZE:-50000000000} "
511511 else :
512512 return common
513-
513+
514+
515+ # prefetch the aligned geometry object (for use in reconstruction)
516+ GEOM_PREFETCH_TASK = createTask (name = 'geomprefetch' , cpu = '0' )
517+ # We need to query the config if this is done with or without parallel world. This needs to be improved
518+ # as it could be defaulted in the ConfigKey system
519+ with_parallel_world = 1 if args .confKey .find ("useParallelWorld=1" ) != - 1 else 0
520+ geom_cmd = f'''
521+ # -- Create aligned geometry using ITS ideal alignment to avoid overlaps in geant
522+ ENABLEPW={ with_parallel_world }
523+
524+ # when parallel world processing is disabled we need to switch off ITS alignment
525+ if [ "${{ENABLEPW}}" == "0" ]; then
526+ CCDBOBJECTS_IDEAL_MC="ITS/Calib/Align"
527+ TIMESTAMP_IDEAL_MC=1
528+ ${{O2_ROOT}}/bin/o2-ccdb-downloadccdbfile --host http://alice-ccdb.cern.ch/ -p ${{CCDBOBJECTS_IDEAL_MC}} \
529+ -d ${{ALICEO2_CCDB_LOCALCACHE}} --timestamp ${{TIMESTAMP_IDEAL_MC}}
530+ CCDB_RC="$?"
531+ if [ ! "${{CCDB_RC}}" == "0" ]; then
532+ echo "Problem during CCDB prefetching of ${{CCDBOBJECTS_IDEAL_MC}}. Exiting."
533+ exit ${{CCDB_RC}}
534+ fi
535+ fi
536+
537+ if [ "$ENABLEPW" == "0" ]; then
538+ REMAP_OPT="--condition-remap=file://${{ALICEO2_CCDB_LOCALCACHE}}=ITS/Calib/Align"
539+ else
540+ REMAP_OPT=""
541+ fi
542+
543+ # fetch the global alignment geometry
544+ ${{O2_ROOT}}/bin/o2-create-aligned-geometry-workflow ${{ALIEN_JDL_CCDB_CONDITION_NOT_AFTER:+--condition-not-after $ALIEN_JDL_CCDB_CONDITION_NOT_AFTER}} \
545+ --configKeyValues "HBFUtils.startTime={ args .timestamp } " -b --run ${{REMAP_OPT}}
546+
547+ # copy the object into the CCDB cache
548+ mkdir -p $ALICEO2_CCDB_LOCALCACHE/GLO/Config/GeometryAligned
549+ ln -s -f $PWD/o2sim_geometry-aligned.root $ALICEO2_CCDB_LOCALCACHE/GLO/Config/GeometryAligned/snapshot.root
550+ if [ "$ENABLEPW" == "0" ]; then
551+ [[ -f $PWD/its_GeometryTGeo.root ]] && mkdir -p $ALICEO2_CCDB_LOCALCACHE/ITS/Config/Geometry && ln -s -f $PWD/its_GeometryTGeo.root $ALICEO2_CCDB_LOCALCACHE/ITS/Config/Geometry/snapshot.root
552+ fi
553+
554+ # MFT
555+ [[ -f $PWD/mft_GeometryTGeo.root ]] && mkdir -p $ALICEO2_CCDB_LOCALCACHE/MFT/Config/Geometry && ln -s -f $PWD/mft_GeometryTGeo.root $ALICEO2_CCDB_LOCALCACHE/MFT/Config/Geometry/snapshot.root
556+ '''
557+
558+ with open ("geomprefetcher_script.sh" ,'w' ) as f :
559+ f .write (geom_cmd )
560+ GEOM_PREFETCH_TASK ['cmd' ] = 'chmod +x ${PWD}/geomprefetcher_script.sh; ${PWD}/geomprefetcher_script.sh'
561+ workflow ['stages' ].append (GEOM_PREFETCH_TASK )
562+
563+
514564# create/publish the GRPs and other GLO objects for consistent use further down the pipeline
515565orbitsPerTF = int (args .orbitsPerTF )
516- GRP_TASK = createTask (name = 'grpcreate' , cpu = '0' )
566+ GRP_TASK = createTask (name = 'grpcreate' , needs = [ "geomprefetch" ], cpu = '0' )
517567GRP_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
518568GRP_TASK ['cmd' ] += ' --readoutDets ' + " " .join (activeDetectors ) + ' --print ' + ('' ,'--lhcif-CCDB' )[args .run_anchored ]
519569if (not args .run_anchored == True ) and len (args .bcPatternFile ) > 0 :
0 commit comments