Angular analysis of B+->K*+(K+pi0)mumu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

183 lines
8.5 KiB

  1. #!/bin/bash
  2. # first set up proper enviroment with
  3. # LbLogin -c x86_64-slc6-gcc49-opt
  4. echoWrongChannel(){
  5. echo "Wrong decay channel!"
  6. echo "Options are BtoKstMuMu, BtoKstJpsi, PHSP, BtoXJpsi, B0toKstMuMu, B0toKstJpsi, BtoK1MuMu or BtoK1Jpsi"
  7. }
  8. containsChannel() { #Check if list contains a word
  9. channel=$1
  10. declare -a DecayList=("BtoKstMuMu" "BtoKstJpsi" "PHSP" "BtoXJpsi" "B0toKstMuMu" "B0toKstJpsi" "BtoK1MuMu" "BtoK1Jpsi");
  11. arrLen=${#DecayList[@]}
  12. #echo lenght: $arrLen
  13. flag=0
  14. for (( i=0; i<${arrLen}; i++ ));
  15. do
  16. if [[ "$channel" = "${DecayList[$i]}" ]]; then
  17. flag=1
  18. break;
  19. fi
  20. done
  21. #echo $flag
  22. }
  23. containsAllYears() { #Check if list contains a word
  24. channel=$1
  25. declare -a AllAvailableSamplesList=("BtoKstMuMu" "PHSP" "BtoXJpsi" "B0toKstMuMu" "B0toKstJpsi");
  26. arrLen=${#AllAvailableSamplesList[@]}
  27. #echo lenght: $arrLen
  28. flag=0
  29. for (( i=0; i<${arrLen}; i++ ));
  30. do
  31. if [[ "$channel" = "${AllAvailableSamplesList[$i]}" ]]; then
  32. flag=1
  33. break;
  34. fi
  35. done
  36. #echo $flag
  37. }
  38. #declare BtoKstMuMu = ('2011' '2012' '2015' '2016'),
  39. #declare BtoKstJpsi = ('2011' '2012'),
  40. #declare PHSP = ('2011' '2012' '2015' '2016'),
  41. #declare BtoXJpsi = ('2011' '2012' '2016'),
  42. #declare B0toKstMuMu = ('2011' '2012' '2015' '2016'),
  43. #declare B0toKstJpsi = ('2011' '2012' '2015' '2016'),
  44. #declare BtoK1MuMu = ('2011' '2012'),
  45. #declare BtoK1Jpsi = ('2012')
  46. #CHECKING THE TUPLES: DecayTree->Draw("pi_zero_resolved_M", "pi_zero_resolved_TRUEID==22 && pi_zero_resolved_MC_MOTHER_ID == 111 && pi_zero_resolved_MC_GD_MOTHER_ID == 323 && pi_zero_resolved_MC_GD_GD_MOTHER_ID == 521")
  47. defPath=/afs/cern.ch/work/r/rekopecn/public/B_2_KstarMuMu
  48. mainPath=${defPath}/DaVinciDev_v41r2/tuplecreation
  49. logPath=${mainPath}/background_tests/log_files/
  50. buildFolder=build.x86_64-slc6-gcc49-opt
  51. cd ${defPath}/DaVinciDev_v41r2/
  52. #make configure
  53. #make install
  54. cd ${buildFolder}
  55. E_NO_ARGS=65
  56. if [ $# -eq 3 ]; then
  57. channel=$1
  58. containsChannel $channel
  59. if [ "$flag" = 1 ]; then
  60. year=$2
  61. magnet=$3
  62. cd ${defPath}/DaVinciDev_v41r2/
  63. #cd ${defPath}/DaVinciDev_v38r1p3/build.x86_64-slc6-gcc49-opt
  64. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/$year$magnet.py | tee ${logPath}${channel}_${year}${magnet}.txt
  65. else
  66. echoWrongChannel
  67. fi
  68. elif [ $# -eq 2 ]; then
  69. doTest=$1
  70. if [ "$doTest" = "test" ]; then
  71. echo "##########################"
  72. echo "# #"
  73. echo "# TEST #"
  74. echo "# #"
  75. echo "##########################"
  76. channel=$2
  77. containsChannel $channel
  78. if [ $? ]; then
  79. if [ "$channel" = "BtoKstMuMu" ] ; then
  80. cd ${defPath}/DaVinciDev_v38r1p3/build.x86_64-slc6-gcc49-opt
  81. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2011MagDown.py | tee ${logPath}${channel}_2011MagDown.txt
  82. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2012MagDown.py | tee ${logPath}${channel}_2012MagDown.txt
  83. cd ${defPath}/DaVinciDev_v41r2/build.x86_64-slc6-gcc49-opt
  84. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2015MagDown.py | tee ${logPath}${channel}_2015MagDown.txt
  85. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2016MagDown.py | tee ${logPath}${channel}_2016MagDown.txt
  86. elif [ "$channel" = "BtoXJpsi" ] ; then
  87. #cd ${defPath}/DaVinciDev_v38r1p3/build.x86_64-slc6-gcc49-opt
  88. #./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2011MagDown.py | tee ${logPath}${channel}_2011MagDown.txt
  89. #./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2012MagDown.py | tee ${logPath}${channel}_2012MagDown.txt
  90. cd ${defPath}/DaVinciDev_v41r2
  91. #./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2015MagDown.py | tee ${logPath}${channel}_2015MagDown.txt
  92. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2016MagDown.py | tee ${logPath}${channel}_2016MagDown.txt
  93. elif [ "$channel" = "PHSP" ] || [ "$channel" = "B0toKstMuMu" ] || [ "$channel" = "B0toKstJpsi" ]; then
  94. cd ${defPath}/DaVinciDev_v38r1p3/build.x86_64-slc6-gcc49-opt
  95. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2011MagDown.py | tee ${logPath}${channel}_2011MagDown.txt
  96. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2012MagDown.py | tee ${logPath}${channel}_2012MagDown.txt
  97. cd ${defPath}/DaVinciDev_v41r2/build.x86_64-slc6-gcc49-opt
  98. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2015MagDown.py | tee ${logPath}${channel}_2015MagDown.txt
  99. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2016MagDown.py | tee ${logPath}${channel}_2016MagDown.txt
  100. elif [ "$channel" = "BtoKstJpsi" ] || [ "$channel" = "BtoK1MuMu" ]; then
  101. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2011MagDown.py | tee ${logPath}${channel}_2011MagDown.txt
  102. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2012MagDown.py | tee ${logPath}${channel}_2012MagDown.txt
  103. elif [ "$channel" = "BtoK1Jpsi" ]; then
  104. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2012MagDown.py | tee ${logPath}${channel}_2012MagDown.txt
  105. else
  106. echo "Wrong decay channel!"
  107. echo "Options are BtoKstMuMu, BtoKstJpsi, PHSP, BtoXJpsi, B0toKstMuMu, B0toKstJpsi, BtoK1MuMu or BtoK1Jpsi"
  108. fi
  109. else
  110. echoWrongChannel
  111. fi
  112. fi
  113. elif [ $# -eq 1 ]; then
  114. channel=$1
  115. containsChannel $channel
  116. if [ "$flag" = 1 ]; then
  117. containsAllYears $channel #check if to be run on all years
  118. if [ "$flag" = 1 ] ; then
  119. cd ${defPath}/DaVinciDev_v38r1p3/build.x86_64-slc6-gcc49-opt
  120. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2011MagDown.py | tee ${logPath}${channel}_2011MagDown.txt
  121. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2011MagUp.py | tee ${logPath}${channel}_2011MagUp.txt
  122. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2012MagDown.py | tee ${logPath}${channel}_2012MagDown.txt
  123. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2012MagUp.py | tee ${logPath}${channel}_2012MagUp.txt
  124. cd ${defPath}/DaVinciDev_v41r2/build.x86_64-slc6-gcc49-opt
  125. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2015MagDown.py | tee ${logPath}${channel}_2015MagDown.txt
  126. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2015MagUp.py | tee ${logPath}${channel}_2015MagUp.txt
  127. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2016MagDown.py | tee ${logPath}${channel}_2016MagDown.txt
  128. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2016MagUp.py | tee ${logPath}${channel}_2016MagUp.txt
  129. elif [ "$channel" = "BtoKstJpsi" ] || [ "$channel" = "BtoK1MuMu" ]; then
  130. cd ${defPath}/DaVinciDev_v38r1p3/build.x86_64-slc6-gcc49-opt
  131. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2011MagDown.py | tee ${logPath}${channel}_2011MagDown.txt
  132. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2011MagUp.py | tee ${logPath}${channel}_2011MagUp.txt
  133. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2012MagDown.py | tee ${logPath}${channel}_2012MagDown.txt
  134. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2012MagUp.py | tee ${logPath}${channel}_2012MagUp.txt
  135. elif [ "$channel" = "BtoK1Jpsi" ]; then
  136. cd ${defPath}/DaVinciDev_v38r1p3/build.x86_64-slc6-gcc49-opt
  137. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2012MagDown.py | tee ${logPath}${channel}_2012MagDown.txt
  138. ./run gaudirun.py ${mainPath}/background_tests/optfiles/$channel/2012MagUp.py | tee ${logPath}${channel}_2012MagUp.txt
  139. fi
  140. else
  141. echoWrongChannel
  142. fi
  143. else
  144. echo
  145. echo
  146. echo "For testing run with 2 arguments: ./run_local_tests_all.sh test channel"
  147. echo
  148. echo
  149. echo "Please run with either 3 arguments:"
  150. echo " channel year magnet"
  151. echo
  152. echo "or with only 1 argument: channel"
  153. echo
  154. echo "Example: bash ./run_local_tests_all.sh BtoKstMuMu 2011 MagDown"
  155. echo
  156. echo
  157. echo "--------- exiting ---------"
  158. echo
  159. exit $E_NO_ARGS
  160. fi