data analysis scripts
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.

303 lines
14 KiB

  1. {
  2. gROOT->ProcessLine(".x lhcbStyle.C");
  3. TCanvas c1_mg1_e1;
  4. TGraphErrors * ge1_p1 = new TGraphErrors("inlistE255_p_bpm1_diff.txt","%lg %lg %lg");
  5. TGraphErrors * ge1_p2 = new TGraphErrors("inlistE21_p_bpm1_diff.txt","%lg %lg %lg");
  6. TGraphErrors * ge1_ic1 = new TGraphErrors("inlistE255_p_ic1_diff.txt","%lg %lg %lg");
  7. TGraphErrors * ge1_ic2 = new TGraphErrors("inlistE21_p_ic1_diff.txt","%lg %lg %lg");
  8. TMultiGraph * mg_e1 = new TMultiGraph();
  9. mg_e1->Add(ge1_p1,"pc"); ge1_p1->SetMarkerStyle(20);ge1_p1->SetLineStyle(3);
  10. mg_e1->Add(ge1_p2,"pc"); ge1_p2->SetMarkerStyle(24);ge1_p2->SetLineStyle(3);
  11. mg_e1->Add(ge1_ic1,"p"); ge1_ic1->SetMarkerStyle(29);
  12. mg_e1->Add(ge1_ic2,"p"); ge1_ic2->SetMarkerStyle(30);
  13. mg_e1->Draw("a");
  14. mg_e1->SetTitle(" ");
  15. mg_e1->GetXaxis()->SetTitle("Intensity / 10^{6}s^{-1}");
  16. mg_e1->GetYaxis()->SetTitle("#sqrt{2}#upoint #sigma(A_{1}-A_{2}) / (A_{1}+A_{2})");
  17. // mg_e1->GetXaxis()->SetRangeUser(0,600);
  18. //mg_e1->GetYaxis()->SetRangeUser(0,1);
  19. mg_e1->SetMinimum(0.);
  20. mg_e1->SetMaximum(0.18);
  21. TLegend *mylegend = new TLegend(0.60,0.6,0.9,0.9);
  22. mylegend->SetFillColor(0); // white background
  23. mylegend->SetTextFont(22);
  24. mylegend->SetBorderSize(0); // get rid of the box
  25. mylegend->SetTextSize(0.045); // set text size
  26. mylegend->AddEntry(ge1_p1,"BPM (221 MeV)","pl"); // options: p,l,f
  27. mylegend->AddEntry(ge1_p2,"BPM (70 MeV)","pl"); // options: p,l,f
  28. mylegend->AddEntry(ge1_ic1,"IC (221 MeV)","p"); // options: p,l,f
  29. mylegend->AddEntry(ge1_ic2,"IC (70 MeV)","p"); // options: p,l,f
  30. mylegend->Draw();
  31. gPad->Modified();
  32. c1_mg1_e1.SaveAs("figs/inlist_p_bpm_diff.pdf");
  33. c1_mg1_e1.SaveAs("figs/inlist_p_bpm_diff.png");
  34. c1_mg1_e1.SaveAs("figs/inlist_p_bpm_diff.C");
  35. TCanvas c1_mg1_e2;
  36. TGraphErrors * ge2_p1 = new TGraphErrors("inlistE255_c_bpm1_diff.txt","%lg %lg %lg");
  37. TGraphErrors * ge2_p2 = new TGraphErrors("inlistE21_c_bpm1_diff.txt","%lg %lg %lg");
  38. TGraphErrors * ge2_ic1 = new TGraphErrors("inlistE255_c_ic1_diff.txt","%lg %lg %lg");
  39. TGraphErrors * ge2_ic2 = new TGraphErrors("inlistE21_c_ic1_diff.txt","%lg %lg %lg");
  40. TMultiGraph * mg_e2 = new TMultiGraph();
  41. mg_e2->Add(ge2_p1,"pc"); ge2_p1->SetMarkerStyle(22);ge2_p1->SetLineStyle(3);
  42. mg_e2->Add(ge2_p2,"pc"); ge2_p2->SetMarkerStyle(26);ge2_p2->SetLineStyle(3);
  43. mg_e2->Add(ge2_ic1,"p"); ge2_ic1->SetMarkerStyle(29);
  44. mg_e2->Add(ge2_ic2,"p"); ge2_ic2->SetMarkerStyle(30);
  45. mg_e2->Draw("a");
  46. mg_e2->SetTitle(" ");
  47. mg_e2->GetXaxis()->SetTitle("Intensity / 10^{6}s^{-1}");
  48. mg_e2->GetYaxis()->SetTitle("#sqrt{2}#upoint #sigma(A_{1}-A_{2}) / (A_{1}+A_{2})");
  49. // mg_e2->GetXaxis()->SetRangeUser(0,600);
  50. //mg_e2->GetYaxis()->SetRangeUser(0,1);
  51. mg_e2->SetMinimum(0.);
  52. mg_e2->SetMaximum(0.1);
  53. TLegend * mylegend2 = new TLegend(0.60,0.6,0.9,0.9);
  54. mylegend2->SetFillColor(0); // white background
  55. mylegend2->SetTextFont(22);
  56. mylegend2->SetBorderSize(0); // get rid of the box
  57. mylegend2->SetTextSize(0.045); // set text size
  58. mylegend2->AddEntry(ge2_p1,"BPM (430 MeV/u)","pl"); // options: p,l,f
  59. mylegend2->AddEntry(ge2_p2,"BPM (130 MeV/u)","pl"); // options: p,l,f
  60. mylegend2->AddEntry(ge2_ic1,"IC (430 MeV/u)","p"); // options: p,l,f
  61. mylegend2->AddEntry(ge2_ic2,"IC (130 MeV/u)","p"); // options: p,l,f
  62. mylegend2->Draw();
  63. gPad->Modified();
  64. c1_mg1_e2.SaveAs("figs/inlist_c_bpm_diff.pdf");
  65. c1_mg1_e2.SaveAs("figs/inlist_c_bpm_diff.png");
  66. c1_mg1_e2.SaveAs("figs/inlist_c_bpm_diff.C");
  67. ///////////////////////////////////////////////
  68. TCanvas c1_mg1_e3;
  69. TGraphErrors * ge3_p1 = new TGraphErrors("inlistE255_p_posfit_diff.txt","%lg %lg %lg");
  70. TGraphErrors * ge3_p2 = new TGraphErrors("inlistE21_p_posfit_diff.txt","%lg %lg %lg");
  71. // TGraphErrors * ge3_c1 = new TGraphErrors("inlistE255_c_posfit_diff.txt","%lg %lg %lg");
  72. // TGraphErrors * ge3_c2 = new TGraphErrors("inlistE21_c_posfit_diff.txt","%lg %lg %lg");
  73. TMultiGraph * mg_e3 = new TMultiGraph();
  74. mg_e3->Add(ge3_p1,"pc"); ge3_p1->SetMarkerStyle(20);ge3_p1->SetLineStyle(3);
  75. mg_e3->Add(ge3_p2,"pc"); ge3_p2->SetMarkerStyle(24);ge3_p2->SetLineStyle(3);
  76. // mg_e3->Add(ge3_ic1,"p"); ge3_ic1->SetMarkerStyle(29);
  77. // mg_e3->Add(ge3_ic2,"p"); ge3_ic2->SetMarkerStyle(30);
  78. mg_e3->Draw("a");
  79. mg_e3->SetTitle(" ");
  80. mg_e3->GetXaxis()->SetTitle("Intensity / 10^{6}s^{-1}");
  81. mg_e3->GetYaxis()->SetTitle("#sigma(X_{1}-X_{2})/#sqrt{2} / mm");
  82. // mg_e3->GetXaxis()->SetRangeUser(0,600);
  83. //mg_e3->GetYaxis()->SetRangeUser(0,1);
  84. mg_e3->SetMinimum(0.);
  85. // mg_e3->SetMaximum(0.1);
  86. TLegend *mylegend3 = new TLegend(0.60,0.6,0.9,0.9);
  87. mylegend3->SetFillColor(0); // white background
  88. mylegend3->SetTextFont(22);
  89. mylegend3->SetBorderSize(0); // get rid of the box
  90. mylegend3->SetTextSize(0.045); // set text size
  91. mylegend3->AddEntry(ge3_p1,"BPM (221 MeV)","pl"); // options: p,l,f
  92. mylegend3->AddEntry(ge3_p2,"BPM (70 MeV)","pl"); // options: p,l,f
  93. // mylegend3->AddEntry(ge3_ic1,"IC (430 MeV/u)","p"); // options: p,l,f
  94. // mylegend3->AddEntry(ge3_ic2,"IC (130 MeV/u)","p"); // options: p,l,f
  95. mylegend3->Draw();
  96. gPad->Modified();
  97. c1_mg1_e3.SaveAs("figs/inlist_p_posfit_diff.pdf");
  98. c1_mg1_e3.SaveAs("figs/inlist_p_posfit_diff.png");
  99. c1_mg1_e3.SaveAs("figs/inlist_p_possfit_diff.C");
  100. TCanvas c1_mg1_e4;
  101. TGraphErrors * ge4_p1 = new TGraphErrors("inlistE255_c_posfit_diff.txt","%lg %lg %lg");
  102. TGraphErrors * ge4_p2 = new TGraphErrors("inlistE21_c_posfit_diff.txt","%lg %lg %lg");
  103. // TGraphErrors * ge4_c1 = new TGraphErrors("inlistE255_c_posfit_diff.txt","%lg %lg %lg");
  104. // TGraphErrors * ge4_c2 = new TGraphErrors("inlistE21_c_posfit_diff.txt","%lg %lg %lg");
  105. TMultiGraph * mg_e4 = new TMultiGraph();
  106. mg_e4->Add(ge4_p1,"pc"); ge4_p1->SetMarkerStyle(22);ge4_p1->SetLineStyle(3);
  107. mg_e4->Add(ge4_p2,"pc"); ge4_p2->SetMarkerStyle(26);ge4_p2->SetLineStyle(3);
  108. // mg_e4->Add(ge4_ic1,"p"); ge4_ic1->SetMarkerStyle(29);
  109. // mg_e4->Add(ge4_ic2,"p"); ge4_ic2->SetMarkerStyle(30);
  110. mg_e4->Draw("a");
  111. mg_e4->SetTitle(" ");
  112. mg_e4->GetXaxis()->SetTitle("Intensity / 10^{6}s^{-1}");
  113. mg_e4->GetYaxis()->SetTitle("#sigma(X_{1}-X_{2})/#sqrt{2} / mm");
  114. // mg_e4->GetXaxis()->SetRangeUser(0,600);
  115. //mg_e4->GetYaxis()->SetRangeUser(0,1);
  116. mg_e4->SetMinimum(0.);
  117. // mg_e4->SetMaximum(0.1);
  118. TLegend *mylegend4 = new TLegend(0.60,0.6,0.9,0.9);
  119. mylegend4->SetFillColor(0); // white background
  120. mylegend4->SetTextFont(22);
  121. mylegend4->SetBorderSize(0); // get rid of the box
  122. mylegend4->SetTextSize(0.045); // set text size
  123. mylegend4->AddEntry(ge4_p1,"BPM (430 MeV/u)","pl"); // options: p,l,f
  124. mylegend4->AddEntry(ge4_p2,"BPM (130 MeV/u)","pl"); // options: p,l,f
  125. // mylegend4->AddEntry(ge4_ic1,"IC (430 MeV/u)","p"); // options: p,l,f
  126. // mylegend4->AddEntry(ge4_ic2,"IC (130 MeV/u)","p"); // options: p,l,f
  127. mylegend4->Draw();
  128. gPad->Modified();
  129. c1_mg1_e4.SaveAs("figs/inlist_c_posfit_diff.pdf");
  130. c1_mg1_e4.SaveAs("figs/inlist_c_posfit_diff.png");
  131. c1_mg1_e4.SaveAs("figs/inlist_c_possfit_diff.C");
  132. ///////////////////////////////////////////////
  133. TCanvas c1_mg1_e5;
  134. TGraphErrors * ge5_p1 = new TGraphErrors("inlistE255_p_focusfit_diff.txt","%lg %lg %lg");
  135. TGraphErrors * ge5_p2 = new TGraphErrors("inlistE21_p_focusfit_diff.txt","%lg %lg %lg");
  136. // TGraphErrors * ge5_c1 = new TGraphErrors("inlistE255_c_posfit_diff.txt","%lg %lg %lg");
  137. // TGraphErrors * ge5_c2 = new TGraphErrors("inlistE21_c_posfit_diff.txt","%lg %lg %lg");
  138. TMultiGraph * mg_e5 = new TMultiGraph();
  139. mg_e5->Add(ge5_p1,"pc"); ge5_p1->SetMarkerStyle(20);ge5_p1->SetLineStyle(3);
  140. mg_e5->Add(ge5_p2,"pc"); ge5_p2->SetMarkerStyle(24);ge5_p2->SetLineStyle(3);
  141. // mg_e5->Add(ge5_ic1,"p"); ge5_ic1->SetMarkerStyle(29);
  142. // mg_e5->Add(ge5_ic2,"p"); ge5_ic2->SetMarkerStyle(30);
  143. mg_e5->Draw("a");
  144. mg_e5->SetTitle(" ");
  145. mg_e5->GetXaxis()->SetTitle("Intensity / 10^{6}s^{-1}");
  146. //mg_e5->GetYaxis()->SetTitle("#sqrt{2}#upoint#sigma(F_{1}-F_{2})/(F_{1}+F_{2})");
  147. mg_e5->GetYaxis()->SetTitle("#sigma(F_{1}-F_{2})/#sqrt{2} / mm");
  148. // mg_e5->GetXaxis()->SetRangeUser(0,600);
  149. //mg_e5->GetYaxis()->SetRangeUser(0,1);
  150. mg_e5->SetMinimum(0.);
  151. // mg_e5->SetMaximum(0.1);
  152. TLegend * mylegend5 = new TLegend(0.60,0.6,0.9,0.9);
  153. mylegend5->SetFillColor(0); // white background
  154. mylegend5->SetTextFont(22);
  155. mylegend5->SetBorderSize(0); // get rid of the box
  156. mylegend5->SetTextSize(0.045); // set text size
  157. mylegend5->AddEntry(ge5_p1,"BPM (221 MeV)","pl"); // options: p,l,f
  158. mylegend5->AddEntry(ge5_p2,"BPM (70 MeV)","pl"); // options: p,l,f
  159. // mylegend5->AddEntry(ge5_ic1,"IC (430 MeV/u)","p"); // options: p,l,f
  160. // mylegend5->AddEntry(ge5_ic2,"IC (130 MeV/u)","p"); // options: p,l,f
  161. mylegend5->Draw();
  162. gPad->Modified();
  163. c1_mg1_e5.SaveAs("figs/inlist_p_focusfit_diff.pdf");
  164. c1_mg1_e5.SaveAs("figs/inlist_p_focusfit_diff.png");
  165. c1_mg1_e5.SaveAs("figs/inlist_p_focusfit_diff.C");
  166. TCanvas c1_mg1_e6;
  167. TGraphErrors * ge6_p1 = new TGraphErrors("inlistE255_c_focusfit_diff.txt","%lg %lg %lg");
  168. TGraphErrors * ge6_p2 = new TGraphErrors("inlistE21_c_focusfit_diff.txt","%lg %lg %lg");
  169. // TGraphErrors * ge6_c1 = new TGraphErrors("inlistE255_c_posfit_diff.txt","%lg %lg %lg");
  170. // TGraphErrors * ge6_c2 = new TGraphErrors("inlistE21_c_posfit_diff.txt","%lg %lg %lg");
  171. TMultiGraph * mg_e6 = new TMultiGraph();
  172. mg_e6->Add(ge6_p1,"pc"); ge6_p1->SetMarkerStyle(22);ge6_p1->SetLineStyle(3);
  173. mg_e6->Add(ge6_p2,"pc"); ge6_p2->SetMarkerStyle(26);ge6_p2->SetLineStyle(3);
  174. // mg_e6->Add(ge6_ic1,"p"); ge6_ic1->SetMarkerStyle(29);
  175. // mg_e6->Add(ge6_ic2,"p"); ge6_ic2->SetMarkerStyle(30);
  176. mg_e6->Draw("a");
  177. mg_e6->SetTitle(" ");
  178. mg_e6->GetXaxis()->SetTitle("Intensity / 10^{6}s^{-1}");
  179. mg_e6->GetYaxis()->SetTitle("#sqrt{2}#upoint#sigma(F_{1}-F_{2})/(F_{1}+F_{2})");
  180. mg_e6->GetYaxis()->SetTitle("#sigma(F_{1}-F_{2})/#sqrt{2} / mm");
  181. // mg_e6->GetXaxis()->SetRangeUser(0,600);
  182. //mg_e6->GetYaxis()->SetRangeUser(0,1);
  183. mg_e6->SetMinimum(0.);
  184. // mg_e6->SetMaximum(0.1);
  185. TLegend * mylegend6 = new TLegend(0.60,0.6,0.9,0.9);
  186. mylegend6->SetFillColor(0); // white background
  187. mylegend6->SetTextFont(22);
  188. mylegend6->SetBorderSize(0); // get rid of the box
  189. mylegend6->SetTextSize(0.045); // set text size
  190. mylegend6->AddEntry(ge6_p1,"BPM (430 MeV/u)","pl"); // options: p,l,f
  191. mylegend6->AddEntry(ge6_p2,"BPM (130 MeV/u)","pl"); // options: p,l,f
  192. // mylegend6->AddEntry(ge6_ic1,"IC (430 MeV/u)","p"); // options: p,l,f
  193. // mylegend6->AddEntry(ge6_ic2,"IC (130 MeV/u)","p"); // options: p,l,f
  194. mylegend6->Draw();
  195. gPad->Modified();
  196. c1_mg1_e6.SaveAs("figs/inlist_c_focusfit_diff.pdf");
  197. c1_mg1_e6.SaveAs("figs/inlist_c_focusfit_diff.png");
  198. c1_mg1_e6.SaveAs("figs/inlist_c_focusfit_diff.C");
  199. TCanvas c1_mg1_e7;
  200. TGraphErrors * ge7_p1 = new TGraphErrors("inlistE255_c_peakfit.txt","%lg %lg %lg");
  201. TGraphErrors * ge7_p2 = new TGraphErrors("inlistE21_c_peakfit.txt","%lg %lg %lg");
  202. // TGraphErrors * ge7_c1 = new TGraphErrors("inlistE255_c_posfit_diff.txt","%lg %lg %lg");
  203. // TGraphErrors * ge7_c2 = new TGraphErrors("inlistE21_c_posfit_diff.txt","%lg %lg %lg");
  204. TMultiGraph * mg_e7 = new TMultiGraph();
  205. mg_e7->Add(ge7_p1,"pc"); ge7_p1->SetMarkerStyle(22);ge7_p1->SetLineStyle(1);
  206. mg_e7->Add(ge7_p2,"pc"); ge7_p2->SetMarkerStyle(26);ge7_p2->SetLineStyle(1);
  207. // mg_e7->Add(ge7_ic1,"p"); ge7_ic1->SetMarkerStyle(29);
  208. // mg_e7->Add(ge7_ic2,"p"); ge7_ic2->SetMarkerStyle(30);
  209. mg_e7->Draw("a");
  210. mg_e7->SetTitle(" ");
  211. mg_e7->GetXaxis()->SetTitle("Intensity / 10^{6}s^{-1}");
  212. mg_e7->GetYaxis()->SetTitle("SNR");
  213. //mg_e7->GetYaxis()->SetTitle("#sigma(F_{1}-F_{2})/#sqrt{2}");
  214. // mg_e7->GetXaxis()->SetRangeUser(0,600);
  215. //mg_e7->GetYaxis()->SetRangeUser(0,1);
  216. mg_e7->SetMinimum(1.);
  217. gPad->SetLogy();
  218. // mg_e7->SetMaximum(0.1);
  219. TLegend *mylegende7 = new TLegend(0.60,0.2,0.9,0.5);
  220. mylegende7->SetFillColor(0); // white background
  221. mylegende7->SetTextFont(22);
  222. mylegende7->SetBorderSize(0); // get rid of the box
  223. mylegende7->SetTextSize(0.045); // set text size
  224. mylegende7->AddEntry(ge7_p1,"BPM (430 MeV/u)","p"); // options: p,l,f
  225. mylegende7->AddEntry(ge7_p2,"BPM (130 MeV/u)","p"); // options: p,l,f
  226. // mylegend6->AddEntry(ge7_ic1,"IC (430 MeV/u)","p"); // options: p,l,f
  227. // mylegend6->AddEntry(ge7_ic2,"IC (130 MeV/u)","p"); // options: p,l,f
  228. mylegende7->Draw();
  229. gPad->Modified();
  230. c1_mg1_e7.SaveAs("figs/inlist_c_peakfit.pdf");
  231. c1_mg1_e7.SaveAs("figs/inlist_c_peakfit.png");
  232. c1_mg1_e7.SaveAs("figs/inlist_c_peakfit.C");
  233. TCanvas c1_mg1_e8;
  234. TGraphErrors * ge8_p1 = new TGraphErrors("inlistE255_p_peakfit.txt","%lg %lg %lg");
  235. TGraphErrors * ge8_p2 = new TGraphErrors("inlistE21_p_peakfit.txt","%lg %lg %lg");
  236. // TGraphErrors * ge8_c1 = new TGraphErrors("inlistE255_c_posfit_diff.txt","%lg %lg %lg");
  237. // TGraphErrors * ge8_c2 = new TGraphErrors("inlistE21_c_posfit_diff.txt","%lg %lg %lg");
  238. TMultiGraph * mg_e8 = new TMultiGraph();
  239. mg_e8->Add(ge8_p1,"pc"); ge8_p1->SetMarkerStyle(20);ge8_p1->SetLineStyle(1);
  240. mg_e8->Add(ge8_p2,"pc"); ge8_p2->SetMarkerStyle(24);ge8_p2->SetLineStyle(1);
  241. // mg_e8->Add(ge8_ic1,"p"); ge8_ic1->SetMarkerStyle(29);
  242. // mg_e8->Add(ge8_ic2,"p"); ge8_ic2->SetMarkerStyle(30);
  243. mg_e8->Draw("a");
  244. mg_e8->SetTitle(" ");
  245. mg_e8->GetXaxis()->SetTitle("Intensity / 10^{6}s^{-1}");
  246. mg_e8->GetYaxis()->SetTitle("SNR");
  247. //mg_e8->GetYaxis()->SetTitle("#sigma(F_{1}-F_{2})/#sqrt{2}");
  248. // mg_e8->GetXaxis()->SetRangeUser(0,600);
  249. //mg_e8->GetYaxis()->SetRangeUser(0,1);
  250. mg_e8->SetMinimum(1.);
  251. gPad->SetLogy();
  252. // mg_e8->SetMaximum(0.1);
  253. TLegend * mylegende8 = new TLegend(0.60,0.2,0.9,0.5);
  254. mylegende8->SetFillColor(0); // white background
  255. mylegende8->SetTextFont(22);
  256. mylegende8->SetBorderSize(0); // get rid of the box
  257. mylegende8->SetTextSize(0.045); // set text size
  258. mylegende8->AddEntry(ge8_p1,"BPM (221 MeV/u)","p"); // options: p,l,f
  259. mylegende8->AddEntry(ge8_p2,"BPM (70 MeV/u)","p"); // options: p,l,f
  260. // mylegend6->AddEntry(ge8_ic1,"IC (430 MeV/u)","p"); // options: p,l,f
  261. // mylegend6->AddEntry(ge8_ic2,"IC (130 MeV/u)","p"); // options: p,l,f
  262. mylegende8->Draw();
  263. gPad->Modified();
  264. c1_mg1_e8.SaveAs("figs/inlist_p_peakfit.pdf");
  265. c1_mg1_e8.SaveAs("figs/inlist_p_peakfit.png");
  266. c1_mg1_e8.SaveAs("figs/inlist_p_peakfit.C");
  267. }