# This script runs Lumi macros for the full Sim #-- fix params of simulation -------------------------------------------------- #numer of events used for resolution study SIMEVENTS=100000 #Declare array with elements for knoss stat. study ARRAY=(100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000) #ARRAY=(100000 100000 100000 100000 100000 100000 100000 100000 100000 100000) # get number of elements in the array ELEMENTS=${#ARRAY[@]} #Declare array with elements for misalignment scale #ARRAYD=(0 10 20 30 40 50 70 100 150 200 250 300 350 400 450 500) #mum #ARRAYD=(0 10 50 100 150 200 250 300 350 400 450 500) #mum ARRAYD=(150) #mum ELEMENTSD=${#ARRAYD[@]} #ARRAYA=(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) # 1e-3 rad ARRAYA=(0 3 6 9) # 1e-3 rad #ARRAYA=(0) # 1e-3 rad # get number of elements in the array ELEMENTSA=${#ARRAYA[@]} #--------------------------------------------------------------------------------------- # reads number of Events, name of run and verbose Level path="test" #verbose=0 mom=0 #echo Enter storage-folder: #read folder #echo "Storage Path: $folder!" # echo Enter verbosity Level: # read verbose # echo "Verbosity Level is: $verbose!" echo Enter momentum from "1.5, 4.06, 8.9, 11.91, 15 [GeV/c]": read mom echo "Beam momentum is: $mom!" momStr=`echo $mom | sed -e '{ s/\./_/g; }'` #echo ${path} # make data directory, if not there. all data file go there, makes them easier to move around # let's go for (( j=0;j<$ELEMENTSD;j++)); do for (( ia=0;ia<$ELEMENTSA;ia++)); do for (( i=0;i<$ELEMENTS;i++)); do T="$(date)" echo ${T} ": Now we'll do test with "${ARRAY[${i}]} "events for misalignment ~ "${ARRAYD[${j}]} "mum and" ${ARRAYA[${ia}]} "*10e-3 rad">> logSTAT path="/home/karavdin/datastorage/AlignmentSamplesStudy/momentum_"${momStr}"/"misalign_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}_10e-3radDOF111111_${ARRAY[${i}]}_events_${i} if [ ! -d $path ]; then mkdir -p $path fi #echo "Output files will be saved in $path" if [ ! -d jobs/momentum_${momStr} ]; then mkdir -p jobs/momentum_${momStr} fi misalignfile=${path}"/lumi.misalign.par" cd /home/karavdin/pandaRoot12/macro/lmd source config.sh time root -l -b -q create_misalignment_lumi.C\(${ARRAYD[${j}]},${ARRAYA[${ia}]},\"${misalignfile}\"\) &> ${path}/0-misalign_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log cd /home/karavdin/myScripts cat >jobs/momentum_${momStr}/job_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad_${i}.sh < ${path}/0-sim_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log time root -l -b -q runLumi1Digi.C\(${SIMEVENTS},0,"\"${path}\""\) &> ${path}/1-digi_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log time root -l -b -q runLumi2Reco.C\(${SIMEVENTS},0,"\"${path}\""\) &> ${path}/2-rechit_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log time root -l -b -q runLumi3Finder.C\(${SIMEVENTS},0,"\"${path}\"",0,\"CA\",false\) &> ${path}/3-trksearch_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log time root -l -b -q runLumi4Fitter.C\(${SIMEVENTS},0,"\"${path}\""\) &> ${path}/4-fit_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log time root -l -b -q runLumi5Geane.C\(${SIMEVENTS},$mom,0,"\"${path}\""\) &> ${path}/5-geane_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log cd /home/karavdin/pandaRoot12/build/bin ./rec_mc_match -s 0 -n ${SIMEVENTS} -mom ${mom} -path ${path} ./hits_align -s 0 -n ${ARRAY[${i}]} -path ${path} -out "${path}/TrackForAlign.txt" -outhist "${path}/ResidualsHist_before.root" -v 0 &> ${path}/6-hitres_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log cd /home/karavdin/pandaRoot12/mySandbox/myKnossos ./knossos -i "${path}/TrackForAlign.txt" -o "${path}/LumiAlignConst.txt" -n ${ARRAY[${i}]} -r 1 &> ${path}/7-knossos_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log head -14 ${path}/lumi.misalign.par >> ${path}/lumi.misalign_after.par ./analyze -in '${path}/lumi.misalign.par' -out '${path}/LumiAlignConst.txt' -outroot '${path}/Results.root' -new '${path}/lumi.misalign_after.par' &> ${path}/9-alignresults.log mv ${path}/lumi.misalign.par ${path}/lumi.misalign_before_${i}.par cp ${path}/lumi.misalign_after.par ${path}/lumi.misalign_${i}.par mv ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0.root ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_before_${i}.root cp /home/karavdin/pandaRoot12/mySandbox/myKnossos/Results.root ${path}/Results_${i}.root rm ${path}/FairRunInfo* rm ${path}/Lumi_MC_0.root rm ${path}/Lumi_Params_0.root rm ${path}/Lumi_digi_0.root rm ${path}/Lumi_reco_0.root rm ${path}/Lumi_TCand_0.root rm ${path}/Lumi_Track_0.root rm ${path}/Lumi_Geane_0.root exit 0 EOF ### submit job to batch system qsub jobs/momentum_${momStr}/job_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad_${i}.sh echo "Output files will be saved in $path" done done done exit