#!/bin/csh # set nargs = $#argv if ( $nargs == 0 ) then echo " Provide the machine number XX (va0XX)." echo " Usage: source embed_10percent_production2.sh 2 " exit endif # Will read DSTsimul inputs labeled 1-32 set machine = $argv[1] ####################### INSTALLATION ####################### source /common/b2/phoncs/enterria/path0.csh setenv WORKDIR /common/b2/phoncs/enterria/embed_files_10percent_smearing setenv SCRATCH /scratch/phnxemc/enterria/batch_logs setenv DSTREALDIR /common/b2/phoncs/enterria/run2_dsts setenv DSTSIMULDIR /common/b2/phoncs/enterria/simul_dsts_set1 ####################### EMBED ####################### setenv OO_FD_BOOT ${PHENIX_FD_BOOT} set limit = ${machine} @ limit *= 7 # each machine will do 7 jobs (31 x 7 = 217 simul files). There are actually 192 files *_b.root set counter = ${limit} # we start at limit-7 @ counter -= 7 set counter_real = ${counter} while (${counter}<${limit}) set inDSTsimul = ${DSTSIMULDIR}/A_${counter}.root set inDSTreal = ${DSTREALDIR}/B_${counter_real}.root set outMergeFile = ${WORKDIR}/merge_A_${counter}_with_B_${counter_real}.root echo "Merging ${inDSTsimul} and ${inDSTreal}." echo "Output written into ${outMergeFile}." echo "ROOT messages output being written in ${SCRATCH}/merge_A${counter}_with_B${counter_real}_10percent.log" if (-f ${outMergeFile}) then echo ${outMergeFile} ' exists already. Skipping it ...' @ counter += 1 @ counter_real += 1 end else root -b < ${SCRATCH}/merge_A${counter}_with_B${counter_real}_10percent.log TStopwatch timer; gSystem.Load("/common/b2/phoncs/enterria/install/lib/libemcEmbedRun2.so"); doutfileopen("${outMergeFile}"); setPercentageOfSimEnergySmearing(0.10); setverbose(1); dfileopen("${inDSTreal}"); dfileopen2("${inDSTsimul}"); drun(-1); dexit(); timer.Print(); EOF endif @ counter += 1 @ counter_real += 1 end