3 # set job and simulation variables as :
7 # --- Function to run a command and check return code ---------------
18 echo "* $type : $scr" >&2
20 echo "Starting ${type} ${scr}" >> $log
22 if test $noact -gt 0 ; then
23 echo "Would execute aliroot -b -q -x $scr"
28 time aliroot -b -q -x $scr 2> /dev/stdout | tee -a $log
32 if test -f syswatch.log ; then
33 mv syswatch.log `basename $log .log`watch.log
36 if [ "$ext" -ne "$exp" ]; then
37 echo "*! $scr failed with exitcode $ext, expecting $exp"
38 echo "*! $scr failed with exitcode $ext, expecting $exp" >&2
39 echo "$scr failed with exitcode $ext, expecting $exp" \
40 > validation_error.message
43 echo "* $scr finished with the expected exit code ($exp), moving on"
44 echo "* $scr finished with the expected exit code ($exp), moving on" >&2
47 echo "End of ${type} ${scr}" >> $log
49 echo "Disk usage in kB per file:" >> $log
50 du -sk * | sort -n -r >> $log
51 echo "Total disk usage: " >> $log
57 # --- Function to clean up rec-points --------------------------------
58 function cleanRecPoints()
61 if test $alsoITS -gt 0 ; then
62 rm -f *.RecPoints.root
65 for i in *.RecPoints.root ; do
66 if test ! -f $i ; then continue ; fi
74 # --- Default values of variables ------------------------------------
75 # Define the pt hard bin arrays
76 pthardbin_loweredges=( 0 5 11 21 36 57 84 117 152 191 234 )
77 pthardbin_higheredges=( 5 11 21 36 57 84 117 152 191 234 -1)
79 CONFIG_SEED=$((ALIEN_PROC_ID%1000000000))
81 CONFIG_RUN_TYPE="default"
93 # --- Process command line options -----------------------------------
96 while test $# -gt 0 ; do
98 if test "x$option" = "x" ; then continue ; fi
100 --*) option=`echo $option | sed 's/^--//'` ;;
106 run) DC_RUN="$1"; shift ;;
107 event) DC_EVENT="$1"; shift ;;
108 backend) CONFIG_BACKEND="$1"; shift ;;
109 process) CONFIG_RUN_TYPE="$1"; shift ;;
110 field) : ; shift ;; # No-op
111 energy) : ; shift ;; # No-op
112 physicslist) : ; shift ;; # No-op
113 bmin) CONFIG_BMIN="$1"; shift ;;
114 bmax) CONFIG_BMAX="$1"; shift ;;
115 pthardbin) : ; shift ;; # No-op
116 quench) CONFIG_QUENCHING="$1"; shift ;;
118 number) number="$1"; shift ;;
120 aod) runAODTrain=1 ;;
122 no-aod) runAODTrain=0 ;;
123 no-qa) runQATrain=0 ;;
124 no-check) runCheck=0 ;;
125 no-action) noact=1 ;;
126 *) echo "Unkown option: $option" >&2
131 # --- Process options ------------------------------------------------
132 processOptions `echo $@ | tr ':' ' '`
134 # --- Set the sed ----------------------------------------------------
135 if [ "$CONFIG_SEED" -eq 0 ]; then
136 CONFIG_SEED=$(((DC_RUN*100000+DC_EVENT)%1000000000))
137 echo "* MC Seed is $CONFIG_SEED (based on run / counter : $DC_RUN / $DC_EVENT)"
139 echo "* MC Seed is $CONFIG_SEED (based on AliEn job ID)"
142 if [ "$CONFIG_SEED" -eq 0 ]; then
143 echo "*! WARNING! Seeding variable for MC is 0 !" >&2
146 # --- Move some files out of the way ---------------------------------
148 test -f galice.root && mv galice.root ./input/galice.root
149 test -f Kinematics && mv Kinematics.root ./input/Kinematics.root
152 # --- Export some setting to the environment -------------------------
160 export ALIMDC_RAWDB1="./mdc1"
161 export ALIMDC_RAWDB2="./mdc2"
162 export ALIMDC_TAGDB="./mdc1/tag"
163 export ALIMDC_RUNDB="./mdc1/meta"
165 # --- Special for geant 4 --------------------------------------------
166 if [ -f "$G4INSTALL/bin/geant4.sh" ]; then
167 echo "* Sourcing G4 environment from $G4INSTALL/bin/geant4.sh"
168 source $G4INSTALL/bin/geant4.sh
171 # --- Print our set-up -----------------------------------------------
178 Event generator: $CONFIG_RUN_TYPE
180 Impact parameter: ${CONFIG_BMIN}-${CONFIG_BMAX}
181 Quenching: $CONFIG_QUENCHING
185 Content of current directory:
189 echo "SIMRUN: Now read to process"
191 # --- Run simulation (out: hits, digits, sdigits) --------------------
192 runcommand "SIMULATION" "Simulate.C($DC_EVENT,$DC_RUN)" sim.log 5
194 type=`echo $CONFIG_RUN_TYPE | tr '[A-Z]' '[a-z]'`
197 rm -f *.Digits.root *.SDigits.root
203 # --- Run reconstruction (in: digits, sdigits, raw out: ESDs) --------
204 runcommand "RECONSTRUCTION" "Reconstruct.C($DC_RUN)" rec.log 10
205 rm -f *.Digits.root *.SDigits.root
208 # --- Create tags (in: ESDs) -----------------------------------------
209 runcommand "TAG" "Tag.C" tag.log 50
211 # --- Run the check --------------------------------------------------
212 if test $runCheck -gt 0 ; then
213 runcommand "CHECK" "Check.C" check.log 60
216 # --- Possibly run QA analysis ---------------------------------------
217 if test $runQATrain -gt 0 ; then
218 runcommand "QA" "QA.C($DC_RUN)" qa.log 100
221 # --- Possibly run AOD analysis --------------------------------------
222 if test $runAODTrain -gt 0 ; then
223 runcommand "AOD" "AOD.C($DC_RUN)" aod.log 100