#!/bin/bash export PREFIX=/cvmfs/comet.egi.eu/ICEDUST_CMAKE export ICEPREFIX=$PREFIX/icedust.simg/cvmfs_copy/ICEDUST source $ICEPREFIX/ICEDUST_install/setup.sh export ICEDUST_FIELDMAPS=$ICEPREFIX/../fieldmaps/150630_defaultFieldmap/ export SH_RUN_NUMBER=$1 # Must be greater than 0 RTs_list=./comet.j-parc.jp-user-r-roden.derveni-MC6-ustrm.lfns num=`wc -l < $RTs_list` #${#RTs[@]} RTs=`sed -n $SH_RUN_NUMBER'p' $RTs_list` #($(ls /comet.j-parc.jp/user/r/roden.derveni/MC6/ustrm/*.rootracker)) # Change to /cvmfs if this needs to be READ from Cvmfs instead - in which case these also need to be uploaded to cvmfs RT_IDX=$(( $SH_RUN_NUMBER % $num )) # Is necessary to enforce n_jobs per file RT_FILE=$RTs #LFN:RTs #${RTs[$RT_IDX]} mkdir -p data_dstrm export OUTPUT_DIR=data_dstrm_tmp/ export SH_SUBRUN=0 export SH_NUM_EVENTS=10 # Should be identical to ds_num_events x number of batched-up files? No, we haven't batched anything. export INPUT_FILE=oa_${RT_FILE#*oa_} # Selects only the filename from the path. "oa_" is also removed as a result, so lazy implementation to add it back in export SEED_ADD=$(($SH_RUN_NUMBER/$num)) export SEED_ADD=$( printf "%.0f" $SEED_ADD ) # If there are num rootracker files, and we run 10*num jobs, we want the seed for each set of num jobs to be identical. i.e for 100 rootracker files, the first 0-99 jobs have SEED_ADD=1, then 100-199 have SEED_ADD=2, etc., so that the seed is consistent with what we use for upstream production - NB: This isn't true, the seeds aren't consistent as the files aren't ordered by seed. Would need to extract seed from mac or log file if desired export SH_RANDOM_SEED=$(( (5<<16) + $SEED_ADD )) $ICEPREFIX/ICEDUST_install/IcedustControl/app/RunIcedustControl -c $PREFIX/downstream.cfg -u $SH_NUM_EVENTS #done