Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-27 07:02:38

0001 #!/bin/bash
0002 # Script; shyam kumar; INFN Bari, Italy
0003 # shyam.kumar@ba.infn.it; shyam055119@gmail.com
0004 rm -rf truthseed/ realseed/ *.root
0005 mkdir -p truthseed/pi-/mom realseed/pi-/mom truthseed/pi-/dca realseed/pi-/dca
0006 mom_array=(0.5 1.0 2.0 5.0 10.0 15.0)
0007 particle_array=("pi-")
0008 filename=("tracking_output") 
0009 etabin_array=(-3.5 -2.5 -1.0 1.0 2.5 3.5)
0010 nevents=10000
0011 
0012 # run the simulation
0013 source ../epic/install/bin/thisepic.sh 
0014 dd_web_display --export -o epic_craterlake_tracking_only.root ../epic/install/share/epic/epic_craterlake_tracking_only.xml
0015 for ((i=0; i<${#mom_array[@]}; i++)); do
0016 npsim --compactFile ../epic/install/share/epic/epic_craterlake_tracking_only.xml --outputFile sim${mom_array[i]}.edm4hep.root --numberOfEvents $nevents --enableGun --gun.thetaMin 3*deg --gun.thetaMax 177*deg --gun.distribution eta --gun.particle pi- --gun.momentumMin ${mom_array[i]}*GeV --gun.momentumMax ${mom_array[i]}*GeV --gun.multiplicity 1 --random.seed 100000
0017 done
0018 # run the reconstruction
0019 source ../epic/install/setup.sh 
0020 source ../EICrecon/install/bin/eicrecon-this.sh
0021 
0022 for ((i=0; i<${#mom_array[@]}; i++)); do
0023 eicrecon \
0024  -Pnthreads=1 \
0025  -Pjana:debug_plugin_loading=1 \
0026  -Pjana:nevents=$nevents \
0027  -Pacts:MaterialMap=calibrations/materials-map.cbor \
0028  -Ppodio:output_file="${filename}"_${mom_array[i]}.edm4eic.root \
0029  -Pdd4hep:xml_files=../epic/install/share/epic/epic_craterlake_tracking_only.xml   \
0030  -Ppodio:output_collections="MCParticles,CentralCKFTrajectories,CentralCKFTrackParameters,CentralCKFSeededTrackParameters,CentralTrackVertices" \
0031  sim${mom_array[i]}.edm4hep.root
0032 done 
0033 
0034 # run the analysis
0035 for ((iparticle=0; iparticle<${#particle_array[@]}; iparticle++)); do
0036 # truth seeding
0037 for ((i=0; i<${#mom_array[@]}; i++)); do
0038 Form("./%s_%1.1f",,mom)
0039 root -b -l -q Tracking_Performances.C'("./'${filename}$(printf "%.1f" ${mom_array[i]})'.edm4eic.root","'${particle_array[iparticle]}'",'${mom_array[i]}',0.15,"")'
0040 done
0041 
0042 # real seeding
0043 for ((i=0; i<${#mom_array[@]}; i++)); do
0044 root -b -l -q Tracking_Performances.C'("./'${filename}$(printf "%.1f" ${mom_array[i]})'.edm4eic.root","'${particle_array[iparticle]}'",'${mom_array[i]}',0.15,"Seeded")'
0045 done
0046 done
0047 cd truthseed/pi-/dca
0048 hadd final_hist_dca_truthseed.root *.root
0049 cd ../../../realseed/pi-/dca/
0050 hadd final_hist_dca_realseed.root *.root
0051 cd ../../../
0052 
0053 rm -rf Final_Results/ Debug_Plots/ 
0054 mkdir -p Final_Results/pi-/mom Final_Results/pi-/dca  Debug_Plots/truth/pi-/mom  Debug_Plots/truth/pi-/dca  Debug_Plots/real/pi-/mom Debug_Plots/real/pi-/dca
0055 # loop over particles
0056 for ((iparticle=0; iparticle<${#particle_array[@]}; iparticle++)); do
0057 for ((i=0; i<${#etabin_array[@]}-1; i++)); do
0058 xmax_hist=0.3 
0059 if [ $i == 2 || $i == 1 ]; then 
0060 xmax_hist=0.01 
0061 fi
0062 root -b -l -q doCompare_truth_real_widebins_mom.C'("'${particle_array[iparticle]}'",'${etabin_array[i]}','${etabin_array[i+1]}','$xmax_hist')'
0063 done
0064 done
0065