#!/bin/bash ################################################################ ## script for running sim&rec for LMD ## [with pixels sensors set-up!] ## 13/11/2012 ## A.Karavdina ################################################################ pathG=${VMCWORKDIR}/macro/lmd/testPixel/10042013/ mkdir -p ${pathG} MOM=(15 1.5 4.06 8.9 11.91) #GeV #MOM=(1.5 15) #GeV MOMN=${#MOM[@]} for (( jp=0;jp<$MOMN;jp++)); do pbeam=${MOM[${jp}]} momStr=`echo $pbeam | sed -e '{ s/\./_/g; }'` path=${pathG}/mom_${momStr}/ mkdir -p ${path} numTrks=1 mergedHits=true numEv=100000 ## numEv=100 cd /panda/pandaroot/macro/lmd root -l -b -q runLumiPixel0SimBox.C\(${numEv},0,${pbeam},"\"${path}\"",0,-2212,${numTrks}\) root -l -b -q runLumiPixel1Digi.C\(${numEv},0,"\"${path}\""\) useMSerr=true rm ${path}/Lumi_Geane_0.root rm ${path}/Lumi_reco_0.root rm ${path}/Lumi_recoMerged_0.root rm ${path}/Lumi_TCand_0.root rm ${path}/Lumi_Track_0.root root -l -b -q runLumiPixel2Reco.C\(${numEv},0,"\"${path}\"",0,${useMSerr},false\) # ### Merge hits root -l -b -q runLumiPixel2bHitMerge.C\(${numEv},0,"\"${path}\""\) # ### CA can use merged or single(not merged) hits # ### change "CA" --> "Follow" if you want to use Trk-Following as trk-search algorithm # ### NB: Trk-Following can't use single(not merged) hits! # ### change true --> false if you don't want to use missing search algorithm root -l -b -q runLumiPixel3Finder.C\(${numEv},0,"\"${path}\"",0,"\"CA\"",true,${mergedHits}\) # # ##Miniut root -l -b -q runLumiPixel4Fitter.C\(${numEv},0,"\"${path}\"",0,${mergedHits}\) # use GEANE for back-propagation root -l -b -q runLumi5Geane.C\(${numEv},${pbeam},0,"\"${path}\"",0,${mergedHits}\) cd ${VMCWORKDIR}/buildPanda/bin # # valgrind --leak-check=yes ./rec_mc_match -s 0 -n ${numEv} -t ${numTrks} -mom ${pbeam} -npx 1 -mh 0 -v 0 -path ${path} ./rec_mc_match -s 0 -n ${numEv} -t ${numTrks} -mom ${pbeam} -npx 1 -mh 0 -v 0 -path ${path} mv ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0.root ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_MINUIT_BPGEANE.root cd /panda/pandaroot/macro/lmd echo "${pbeam} GeV: for Minuit and BP=GEANE" &> ${path}/RESULTS_${momStr}.txt root -l -b -q Anastasia/test_macros/TrksFitterResults.C\("\"${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_MINUIT_BPGEANE.root\""\) >> ${path}/RESULTS_${momStr}.txt rm ${path}/Lumi_Geane_0.root ## use Runge-Kutta for back-propagation root -l -b -q runLumi5RungeKutta.C\(${numEv},${pbeam},0,"\"${path}\"",0,${mergedHits}\) cd ${VMCWORKDIR}/buildPanda/bin # # valgrind --leak-check=yes ./rec_mc_match -s 0 -n ${numEv} -t ${numTrks} -mom ${pbeam} -npx 1 -mh 0 -v 0 -path ${path} ./rec_mc_match -s 0 -n ${numEv} -t ${numTrks} -mom ${pbeam} -npx 1 -mh 0 -v 0 -path ${path} mv ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0.root ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_MINUIT_BPRK.root cd /panda/pandaroot/macro/lmd echo "${pbeam} GeV: for Minuit and BP=RK" >> ${path}/RESULTS_${momStr}.txt root -l -b -q Anastasia/test_macros/TrksFitterResults.C\("\"${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_MINUIT_BPRK.root\""\) >> ${path}/RESULTS_${momStr}.txt rm ${path}/Lumi_Geane_0.root rm ${path}/Lumi_reco_0.root rm ${path}/Lumi_recoMerged_0.root rm ${path}/Lumi_TCand_0.root rm ${path}/Lumi_Track_0.root useMSerr=false root -l -b -q runLumiPixel2Reco.C\(${numEv},0,"\"${path}\"",0,${useMSerr},false\) # ### Merge hits root -l -b -q runLumiPixel2bHitMerge.C\(${numEv},0,"\"${path}\""\) # ### CA can use merged or single(not merged) hits # ### change "CA" --> "Follow" if you want to use Trk-Following as trk-search algorithm # ### NB: Trk-Following can't use single(not merged) hits! # ### change true --> false if you don't want to use missing search algorithm root -l -b -q runLumiPixel3Finder.C\(${numEv},0,"\"${path}\"",0,"\"CA\"",true,${mergedHits}\) # ### or Kalman Fillter with GEANE root -l -b -q runLumi4KalmanFitter.C\(${numEv},0,"\"${path}\"",0,1,${mergedHits},"\"GEANE\""\) # use GEANE for back-propagation root -l -b -q runLumi5Geane.C\(${numEv},${pbeam},0,"\"${path}\"",0,${mergedHits}\) cd ${VMCWORKDIR}/buildPanda/bin # # valgrind --leak-check=yes ./rec_mc_match -s 0 -n ${numEv} -t ${numTrks} -mom ${pbeam} -npx 1 -mh 0 -v 0 -path ${path} ./rec_mc_match -s 0 -n ${numEv} -t ${numTrks} -mom ${pbeam} -npx 1 -mh 0 -v 0 -path ${path} mv ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0.root ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_KALMANGEANE_BPGEANE.root cd /panda/pandaroot/macro/lmd echo "${pbeam} GeV: for Kalman=GEANE and BP=GEANE" >> ${path}/RESULTS_${momStr}.txt root -l -b -q Anastasia/test_macros/TrksFitterResults.C\("\"${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_KALMANGEANE_BPGEANE.root\""\) >> ${path}/RESULTS_${momStr}.txt rm ${path}/Lumi_Geane_0.root ## use Runge-Kutta for back-propagation root -l -b -q runLumi5RungeKutta.C\(${numEv},${pbeam},0,"\"${path}\"",0,${mergedHits}\) cd ${VMCWORKDIR}/buildPanda/bin # # valgrind --leak-check=yes ./rec_mc_match -s 0 -n ${numEv} -t ${numTrks} -mom ${pbeam} -npx 1 -mh 0 -v 0 -path ${path} ./rec_mc_match -s 0 -n ${numEv} -t ${numTrks} -mom ${pbeam} -npx 1 -mh 0 -v 0 -path ${path} mv ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0.root ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_KALMANGEANE_BPRK.root cd /panda/pandaroot/macro/lmd echo "${pbeam} GeV: for Kalman=GEANE and BP=RK" >> ${path}/RESULTS_${momStr}.txt root -l -b -q Anastasia/test_macros/TrksFitterResults.C\("\"${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_KALMANGEANE_BPRK.root\""\) >> ${path}/RESULTS_${momStr}.txt rm ${path}/Lumi_Geane_0.root # ### or Kalman Fillter with Runge-Kutta root -l -b -q runLumi4KalmanFitter.C\(${numEv},0,"\"${path}\"",0,1,${mergedHits},"\"RK\""\) # use GEANE for back-propagation root -l -b -q runLumi5Geane.C\(${numEv},${pbeam},0,"\"${path}\"",0,${mergedHits}\) cd ${VMCWORKDIR}/buildPanda/bin # # valgrind --leak-check=yes ./rec_mc_match -s 0 -n ${numEv} -t ${numTrks} -mom ${pbeam} -npx 1 -mh 0 -v 0 -path ${path} ./rec_mc_match -s 0 -n ${numEv} -t ${numTrks} -mom ${pbeam} -npx 1 -mh 0 -v 0 -path ${path} mv ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0.root ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_KALMANRK_BPGEANE.root cd /panda/pandaroot/macro/lmd echo "${pbeam} GeV: for Kalman=RK and BP=GEANE" >> ${path}/RESULTS_${momStr}.txt root -l -b -q Anastasia/test_macros/TrksFitterResults.C\("\"${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_KALMANRK_BPGEANE.root\""\) >> ${path}/RESULTS_${momStr}.txt rm ${path}/Lumi_Geane_0.root ## use Runge-Kutta for back-propagation root -l -b -q runLumi5RungeKutta.C\(${numEv},${pbeam},0,"\"${path}\"",0,${mergedHits}\) cd ${VMCWORKDIR}/buildPanda/bin # # valgrind --leak-check=yes ./rec_mc_match -s 0 -n ${numEv} -t ${numTrks} -mom ${pbeam} -npx 1 -mh 0 -v 0 -path ${path} ./rec_mc_match -s 0 -n ${numEv} -t ${numTrks} -mom ${pbeam} -npx 1 -mh 0 -v 0 -path ${path} mv ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0.root ${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_KALMANRK_BPRK.root cd /panda/pandaroot/macro/lmd echo "${pbeam} GeV: for Kalman=RK and BP=RK" >> ${path}/RESULTS_${momStr}.txt root -l -b -q Anastasia/test_macros/TrksFitterResults.C\("\"${path}/Lumi_out_MC_and_REC_trks_matches_with_IDs0_KALMANRK_BPRK.root\""\) >> ${path}/RESULTS_${momStr}.txt rm ${path}/Lumi_Geane_0.root echo "----------------------------------------------------------------------------------" >> ${path}/RESULTS_${momStr}.txt echo "======================================" >> ${path}/RESULTS_${momStr}.txt echo " " >> ${path}/RESULTS_${momStr}.txt done cd /panda/pandaroot/macro/lmd # root -l -b -q Anastasia/test_macros/TrksFitBPPullsCompar_alltogether.C \("\"${pathG}\""\) >> ${pathG}/RESULTS.txt root -l -b -q Anastasia/test_macros/TrksFitBPPullsCompar_alltogether.C >> ${pathG}/RESULTS.txt