# This script runs Lumi macros for the full Sim #number of samples used in sim SAMPLENUM=100 #-- fix params of simulation -------------------------------------------------- #numer of events used for resolution study SIMEVENTS=100000 #Declare array with elements for knoss stat. study ARRAY=(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=(0 10 50 100 150 200 250 300 350 400 450 500) #mum ARRAYD=(150) #mum #ARRAYD=(0 10 50 100 150 200 250 300 350 400 450 500) #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) # 1e-3 rad #ARRAYA=(0 3 6 9) # 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 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" #pathold="/home/karavdin/datastorage/AlignmentSamplesStudy/mom_"${momStr}"/"misalign_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}_10e-3radDOF111111_${ARRAY[${i}]}"_events_0" pathold="/home/karavdin/datastorage/AlignmentSamplesStudy/momentum_"${momStr}"/"misalign_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}_10e-3radDOF111111_100000_events_0 resfileold="/home/karavdin/datastorage/AlignmentSamplesStudy/momentum_"${momStr}"/SamplesStudy_"${ARRAYD[${j}]}"mum_"${ARRAYA[${ia}]}"mrad_"${SAMPLENUM}"samples.txt" cat >jobs/momentum_${momStr}/job_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad_${ARRAY[${i}]}events.sh <> ${path}/lumi.misalign_after.par cd /home/karavdin/pandaRoot12/mySandbox/myKnossos ./analyze -in '${pathold}/lumi.misalign_before_0.par' -out '${resfileold}' -outroot '${path}/Results.root' -new '${path}/lumi.misalign_after.par' &> ${path}/0p2-alignresults.log cp ${pathold}/lumi.misalign_before_0.par ${path}/lumi.misalign_before.par cp ${path}/lumi.misalign_after.par ${path}/lumi.misalign.par cp ${pathold}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_before_0.root ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_before.root cp ${pathold}/ResidualsHist_before.root ${path}/ResidualsHist_before.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 cd /home/karavdin/pandaRoot12/macro/lmd source config.sh time root -l -b -q runLumi0SimBox.C\(${SIMEVENTS},$mom,"\"${path}\""\) &> ${path}/10-sim_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log time root -l -b -q runLumi1Digi.C\(${SIMEVENTS},0,"\"${path}\""\) &> ${path}/11-digi_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log time root -l -b -q runLumi2Reco.C\(${SIMEVENTS},0,"\"${path}\""\) &> ${path}/12-rechit_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log time root -l -b -q runLumi3Finder.C\(${SIMEVENTS},0,"\"${path}\"",0,\"CA\",false\) &> ${path}/13-trksearch_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log time root -l -b -q runLumi4Fitter.C\(${SIMEVENTS},0,"\"${path}\""\) &> ${path}/14-fit_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log time root -l -b -q runLumi5Geane.C\(${SIMEVENTS},$mom,0,"\"${path}\""\) &> ${path}/15-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_after.root" -v 0 &> ${path}/16-hitres_${ARRAYD[${j}]}mum_${ARRAYA[${ia}]}e-3rad.log mv ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0.root ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_after.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_${ARRAY[${i}]}events.sh echo "Output files will be saved in $path" done done done exit