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.

446 lines
12 KiB

  1. void betadedxz2()
  2. {
  3. //=========Macro generated from canvas: c1_n12/c1_n12
  4. //========= (Tue Dec 5 12:04:04 2017) by ROOT version6.06/02
  5. TCanvas *c1_n12 = new TCanvas("c1_n12", "c1_n12",10,71,700,500);
  6. gStyle->SetOptStat(0);
  7. gStyle->SetOptTitle(0);
  8. c1_n12->Range(0.2050384,-0.2837461,0.7948584,1.489667);
  9. c1_n12->SetFillColor(0);
  10. c1_n12->SetBorderMode(0);
  11. c1_n12->SetBorderSize(2);
  12. c1_n12->SetTickx(1);
  13. c1_n12->SetTicky(1);
  14. c1_n12->SetLeftMargin(0.14);
  15. c1_n12->SetRightMargin(0.08);
  16. c1_n12->SetTopMargin(0.05);
  17. c1_n12->SetBottomMargin(0.16);
  18. c1_n12->SetFrameLineWidth(2);
  19. c1_n12->SetFrameBorderMode(0);
  20. c1_n12->SetFrameLineWidth(2);
  21. c1_n12->SetFrameBorderMode(0);
  22. TMultiGraph *multigraph = new TMultiGraph();
  23. multigraph->SetName("");
  24. multigraph->SetTitle(" ");
  25. Double_t Graph_fx9[26] = {
  26. 0.308525,
  27. 0.340994,
  28. 0.366173,
  29. 0.386744,
  30. 0.404198,
  31. 0.419413,
  32. 0.432945,
  33. 0.44518,
  34. 0.456345,
  35. 0.466617,
  36. 0.476154,
  37. 0.485023,
  38. 0.493348,
  39. 0.501186,
  40. 0.508639,
  41. 0.515744,
  42. 0.522563,
  43. 0.529111,
  44. 0.53538,
  45. 0.541398,
  46. 0.549576,
  47. 0.557429,
  48. 0.564849,
  49. 0.571868,
  50. 0.578541,
  51. 0.5849};
  52. Double_t Graph_fy9[26] = {
  53. 1.17009,
  54. 1.22548,
  55. 1.25412,
  56. 1.26762,
  57. 1.27924,
  58. 1.28926,
  59. 1.29822,
  60. 1.30487,
  61. 1.31167,
  62. 1.31966,
  63. 1.32693,
  64. 1.33277,
  65. 1.33748,
  66. 1.342,
  67. 1.34494,
  68. 1.34552,
  69. 1.34422,
  70. 1.34555,
  71. 1.34837,
  72. 1.35181,
  73. 1.35453,
  74. 1.35491,
  75. 1.35663,
  76. 1.35679,
  77. 1.35989,
  78. 1.36464};
  79. TGraph *graph = new TGraph(26,Graph_fx9,Graph_fy9);
  80. graph->SetName("Graph");
  81. graph->SetTitle("energylist_p_bpmbeta1.txt");
  82. graph->SetFillColor(1);
  83. graph->SetLineWidth(2);
  84. graph->SetMarkerStyle(20);
  85. TH1F *Graph_Graph9 = new TH1F("Graph_Graph9","energylist_p_bpmbeta1.txt",100,0.2808875,0.6125375);
  86. Graph_Graph9->SetMinimum(1.150635);
  87. Graph_Graph9->SetMaximum(1.384095);
  88. Graph_Graph9->SetDirectory(0);
  89. Graph_Graph9->SetStats(0);
  90. Graph_Graph9->SetLineWidth(2);
  91. Graph_Graph9->SetMarkerStyle(21);
  92. Graph_Graph9->GetXaxis()->SetNdivisions(505);
  93. Graph_Graph9->GetXaxis()->SetLabelFont(22);
  94. Graph_Graph9->GetXaxis()->SetLabelOffset(0.015);
  95. Graph_Graph9->GetXaxis()->SetLabelSize(0.05);
  96. Graph_Graph9->GetXaxis()->SetTitleSize(0.06);
  97. Graph_Graph9->GetXaxis()->SetTitleFont(22);
  98. Graph_Graph9->GetYaxis()->SetLabelFont(22);
  99. Graph_Graph9->GetYaxis()->SetLabelSize(0.05);
  100. Graph_Graph9->GetYaxis()->SetTitleSize(0.06);
  101. Graph_Graph9->GetYaxis()->SetTitleFont(22);
  102. Graph_Graph9->GetZaxis()->SetLabelFont(22);
  103. Graph_Graph9->GetZaxis()->SetLabelSize(0.05);
  104. Graph_Graph9->GetZaxis()->SetTitleSize(0.06);
  105. Graph_Graph9->GetZaxis()->SetTitleFont(22);
  106. graph->SetHistogram(Graph_Graph9);
  107. TF1 *tf1_btvbeta110 = new TF1("tf1_btvbeta1","[0]*( (1- 0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1] -x*x) )/TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7 -x*x) ) / (1+[2]*(1- 0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1] -x*x) )/TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7 -x*x) )*1*1.65901*TMath::Power(x,-1.7218))+ (0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1] -x*x) )/TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7 -x*x) ) )",0.2808875,0.6125375);
  108. tf1_btvbeta110->SetFillStyle(0);
  109. tf1_btvbeta110->SetMarkerStyle(21);
  110. tf1_btvbeta110->SetLineWidth(2);
  111. tf1_btvbeta110->SetChisquare(0.001127477);
  112. tf1_btvbeta110->SetNDF(23);
  113. tf1_btvbeta110->GetXaxis()->SetNdivisions(505);
  114. tf1_btvbeta110->GetXaxis()->SetLabelFont(22);
  115. tf1_btvbeta110->GetXaxis()->SetLabelOffset(0.015);
  116. tf1_btvbeta110->GetXaxis()->SetLabelSize(0.05);
  117. tf1_btvbeta110->GetXaxis()->SetTitleSize(0.06);
  118. tf1_btvbeta110->GetXaxis()->SetTitleFont(22);
  119. tf1_btvbeta110->GetYaxis()->SetLabelFont(22);
  120. tf1_btvbeta110->GetYaxis()->SetLabelSize(0.05);
  121. tf1_btvbeta110->GetYaxis()->SetTitleSize(0.06);
  122. tf1_btvbeta110->GetYaxis()->SetTitleFont(22);
  123. tf1_btvbeta110->SetParameter(0,1.18145);
  124. tf1_btvbeta110->SetParError(0,0.00692424);
  125. tf1_btvbeta110->SetParLimits(0,0,0);
  126. tf1_btvbeta110->SetParameter(1,0.05757586);
  127. tf1_btvbeta110->SetParError(1,0.001610998);
  128. tf1_btvbeta110->SetParLimits(1,0,0);
  129. tf1_btvbeta110->SetParameter(2,-1.345384);
  130. tf1_btvbeta110->SetParError(2,0.02225413);
  131. tf1_btvbeta110->SetParLimits(2,0,0);
  132. graph->GetListOfFunctions()->Add(tf1_btvbeta110);
  133. multigraph->Add(graph,"p");
  134. Double_t Graph_fx11[26] = {
  135. 0.347272,
  136. 0.371222,
  137. 0.391037,
  138. 0.408018,
  139. 0.422922,
  140. 0.436235,
  141. 0.447968,
  142. 0.459299,
  143. 0.470415,
  144. 0.478846,
  145. 0.487649,
  146. 0.495887,
  147. 0.503656,
  148. 0.510991,
  149. 0.517959,
  150. 0.524572,
  151. 0.530889,
  152. 0.536926,
  153. 0.542699,
  154. 0.550671,
  155. 0.558452,
  156. 0.565815,
  157. 0.565815,
  158. 0.572799,
  159. 0.579449,
  160. 0.585785};
  161. Double_t Graph_fy11[26] = {
  162. 1.15061,
  163. 1.18124,
  164. 1.20539,
  165. 1.21968,
  166. 1.22856,
  167. 1.23451,
  168. 1.24983,
  169. 1.2618,
  170. 1.26521,
  171. 1.26492,
  172. 1.26371,
  173. 1.27061,
  174. 1.27334,
  175. 1.27687,
  176. 1.2796,
  177. 1.28062,
  178. 1.28058,
  179. 1.28007,
  180. 1.27389,
  181. 1.27711,
  182. 1.28057,
  183. 1.28576,
  184. 1.28604,
  185. 1.29318,
  186. 1.29729,
  187. 1.29912};
  188. graph = new TGraph(26,Graph_fx11,Graph_fy11);
  189. graph->SetName("Graph");
  190. graph->SetTitle("energylist_he_bpmbeta1.txt");
  191. graph->SetFillColor(1);
  192. graph->SetLineWidth(2);
  193. graph->SetMarkerStyle(21);
  194. TH1F *Graph_Graph11 = new TH1F("Graph_Graph11","energylist_he_bpmbeta1.txt",100,0.3234207,0.6096363);
  195. Graph_Graph11->SetMinimum(1.135759);
  196. Graph_Graph11->SetMaximum(1.313971);
  197. Graph_Graph11->SetDirectory(0);
  198. Graph_Graph11->SetStats(0);
  199. Graph_Graph11->SetLineWidth(2);
  200. Graph_Graph11->SetMarkerStyle(21);
  201. Graph_Graph11->GetXaxis()->SetNdivisions(505);
  202. Graph_Graph11->GetXaxis()->SetLabelFont(22);
  203. Graph_Graph11->GetXaxis()->SetLabelOffset(0.015);
  204. Graph_Graph11->GetXaxis()->SetLabelSize(0.05);
  205. Graph_Graph11->GetXaxis()->SetTitleSize(0.06);
  206. Graph_Graph11->GetXaxis()->SetTitleFont(22);
  207. Graph_Graph11->GetYaxis()->SetLabelFont(22);
  208. Graph_Graph11->GetYaxis()->SetLabelSize(0.05);
  209. Graph_Graph11->GetYaxis()->SetTitleSize(0.06);
  210. Graph_Graph11->GetYaxis()->SetTitleFont(22);
  211. Graph_Graph11->GetZaxis()->SetLabelFont(22);
  212. Graph_Graph11->GetZaxis()->SetLabelSize(0.05);
  213. Graph_Graph11->GetZaxis()->SetTitleSize(0.06);
  214. Graph_Graph11->GetZaxis()->SetTitleFont(22);
  215. graph->SetHistogram(Graph_Graph11);
  216. multigraph->Add(graph,"p");
  217. Double_t Graph_fx12[26] = {
  218. 0.407871,
  219. 0.44884,
  220. 0.479338,
  221. 0.503822,
  222. 0.524858,
  223. 0.543065,
  224. 0.5589,
  225. 0.573741,
  226. 0.586721,
  227. 0.59808,
  228. 0.608891,
  229. 0.619196,
  230. 0.628229,
  231. 0.636893,
  232. 0.645213,
  233. 0.653209,
  234. 0.6609,
  235. 0.667643,
  236. 0.674162,
  237. 0.681086,
  238. 0.689547,
  239. 0.698204,
  240. 0.705926,
  241. 0.713327,
  242. 0.719927,
  243. 0.726761};
  244. Double_t Graph_fy12[26] = {
  245. 0.70017,
  246. 0.75557,
  247. 0.795619,
  248. 0.823137,
  249. 0.846695,
  250. 0.867102,
  251. 0.886679,
  252. 0.902141,
  253. 0.91659,
  254. 0.929151,
  255. 0.94155,
  256. 0.952243,
  257. 0.961937,
  258. 0.970188,
  259. 0.976903,
  260. 0.987228,
  261. 0.994266,
  262. 1.00407,
  263. 1.00707,
  264. 1.01511,
  265. 1.02523,
  266. 1.03263,
  267. 1.04101,
  268. 1.04986,
  269. 1.05878,
  270. 1.06459};
  271. graph = new TGraph(26,Graph_fx12,Graph_fy12);
  272. graph->SetName("Graph");
  273. graph->SetTitle("energylist_c_bpmbeta1.txt");
  274. graph->SetFillColor(1);
  275. graph->SetLineWidth(2);
  276. graph->SetMarkerStyle(22);
  277. TH1F *Graph_Graph12 = new TH1F("Graph_Graph12","energylist_c_bpmbeta1.txt",100,0.375982,0.75865);
  278. Graph_Graph12->SetMinimum(0.663728);
  279. Graph_Graph12->SetMaximum(1.101032);
  280. Graph_Graph12->SetDirectory(0);
  281. Graph_Graph12->SetStats(0);
  282. Graph_Graph12->SetLineWidth(2);
  283. Graph_Graph12->SetMarkerStyle(21);
  284. Graph_Graph12->GetXaxis()->SetNdivisions(505);
  285. Graph_Graph12->GetXaxis()->SetLabelFont(22);
  286. Graph_Graph12->GetXaxis()->SetLabelOffset(0.015);
  287. Graph_Graph12->GetXaxis()->SetLabelSize(0.05);
  288. Graph_Graph12->GetXaxis()->SetTitleSize(0.06);
  289. Graph_Graph12->GetXaxis()->SetTitleFont(22);
  290. Graph_Graph12->GetYaxis()->SetLabelFont(22);
  291. Graph_Graph12->GetYaxis()->SetLabelSize(0.05);
  292. Graph_Graph12->GetYaxis()->SetTitleSize(0.06);
  293. Graph_Graph12->GetYaxis()->SetTitleFont(22);
  294. Graph_Graph12->GetZaxis()->SetLabelFont(22);
  295. Graph_Graph12->GetZaxis()->SetLabelSize(0.05);
  296. Graph_Graph12->GetZaxis()->SetTitleSize(0.06);
  297. Graph_Graph12->GetZaxis()->SetTitleFont(22);
  298. graph->SetHistogram(Graph_Graph12);
  299. multigraph->Add(graph,"p");
  300. Double_t Graph_fx13[21] = {
  301. 0.436386,
  302. 0.479001,
  303. 0.511349,
  304. 0.537325,
  305. 0.559062,
  306. 0.577647,
  307. 0.594124,
  308. 0.608731,
  309. 0.621998,
  310. 0.634024,
  311. 0.645051,
  312. 0.655227,
  313. 0.664724,
  314. 0.673476,
  315. 0.681811,
  316. 0.689682,
  317. 0.697243,
  318. 0.704219,
  319. 0.710969,
  320. 0.717113,
  321. 0.726111};
  322. Double_t Graph_fy13[21] = {
  323. 0.637511,
  324. 0.682739,
  325. 0.716111,
  326. 0.740358,
  327. 0.761285,
  328. 0.780592,
  329. 0.797751,
  330. 0.814711,
  331. 0.828105,
  332. 0.838841,
  333. 0.851544,
  334. 0.861821,
  335. 0.871405,
  336. 0.881324,
  337. 0.891275,
  338. 0.901056,
  339. 0.909476,
  340. 0.915073,
  341. 0.921715,
  342. 0.925899,
  343. 0.939145};
  344. graph = new TGraph(21,Graph_fx13,Graph_fy13);
  345. graph->SetName("Graph");
  346. graph->SetTitle("energylist_o_bpmbeta1.txt");
  347. graph->SetFillColor(1);
  348. graph->SetLineWidth(2);
  349. graph->SetMarkerStyle(23);
  350. TH1F *Graph_Graph13 = new TH1F("Graph_Graph13","energylist_o_bpmbeta1.txt",100,0.4074135,0.7550835);
  351. Graph_Graph13->SetMinimum(0.6073476);
  352. Graph_Graph13->SetMaximum(0.9693084);
  353. Graph_Graph13->SetDirectory(0);
  354. Graph_Graph13->SetStats(0);
  355. Graph_Graph13->SetLineWidth(2);
  356. Graph_Graph13->SetMarkerStyle(21);
  357. Graph_Graph13->GetXaxis()->SetNdivisions(505);
  358. Graph_Graph13->GetXaxis()->SetLabelFont(22);
  359. Graph_Graph13->GetXaxis()->SetLabelOffset(0.015);
  360. Graph_Graph13->GetXaxis()->SetLabelSize(0.05);
  361. Graph_Graph13->GetXaxis()->SetTitleSize(0.06);
  362. Graph_Graph13->GetXaxis()->SetTitleFont(22);
  363. Graph_Graph13->GetYaxis()->SetLabelFont(22);
  364. Graph_Graph13->GetYaxis()->SetLabelSize(0.05);
  365. Graph_Graph13->GetYaxis()->SetTitleSize(0.06);
  366. Graph_Graph13->GetYaxis()->SetTitleFont(22);
  367. Graph_Graph13->GetZaxis()->SetLabelFont(22);
  368. Graph_Graph13->GetZaxis()->SetLabelSize(0.05);
  369. Graph_Graph13->GetZaxis()->SetTitleSize(0.06);
  370. Graph_Graph13->GetZaxis()->SetTitleFont(22);
  371. graph->SetHistogram(Graph_Graph13);
  372. multigraph->Add(graph,"p");
  373. multigraph->Draw("a");
  374. multigraph->GetXaxis()->SetTitle("Lorentz #beta");
  375. multigraph->GetXaxis()->SetNdivisions(505);
  376. multigraph->GetXaxis()->SetLabelFont(22);
  377. multigraph->GetXaxis()->SetLabelOffset(0.015);
  378. multigraph->GetXaxis()->SetLabelSize(0.05);
  379. multigraph->GetXaxis()->SetTitleSize(0.06);
  380. multigraph->GetXaxis()->SetTitleFont(22);
  381. multigraph->GetYaxis()->SetTitle("#frac{dA}{dE}");
  382. multigraph->GetYaxis()->SetLabelFont(22);
  383. multigraph->GetYaxis()->SetLabelSize(0.05);
  384. multigraph->GetYaxis()->SetTitleSize(0.06);
  385. multigraph->GetYaxis()->SetTitleFont(22);
  386. TLegend *leg = new TLegend(0.7,0.7,0.9,0.9,NULL,"brNDC");
  387. leg->SetBorderSize(0);
  388. leg->SetTextFont(22);
  389. leg->SetTextSize(0.047);
  390. leg->SetLineColor(1);
  391. leg->SetLineStyle(1);
  392. leg->SetLineWidth(2);
  393. leg->SetFillColor(0);
  394. leg->SetFillStyle(0);
  395. TLegendEntry *entry=leg->AddEntry("Graph","Protons","p");
  396. entry->SetLineColor(1);
  397. entry->SetLineStyle(1);
  398. entry->SetLineWidth(1);
  399. entry->SetMarkerColor(1);
  400. entry->SetMarkerStyle(20);
  401. entry->SetMarkerSize(1);
  402. entry->SetTextFont(22);
  403. entry=leg->AddEntry("Graph","Helium","p");
  404. entry->SetLineColor(1);
  405. entry->SetLineStyle(1);
  406. entry->SetLineWidth(1);
  407. entry->SetMarkerColor(1);
  408. entry->SetMarkerStyle(21);
  409. entry->SetMarkerSize(1);
  410. entry->SetTextFont(22);
  411. entry=leg->AddEntry("Graph","Carbon","p");
  412. entry->SetLineColor(1);
  413. entry->SetLineStyle(1);
  414. entry->SetLineWidth(1);
  415. entry->SetMarkerColor(1);
  416. entry->SetMarkerStyle(22);
  417. entry->SetMarkerSize(1);
  418. entry->SetTextFont(22);
  419. entry=leg->AddEntry("Graph","Oxygen","p");
  420. entry->SetLineColor(1);
  421. entry->SetLineStyle(1);
  422. entry->SetLineWidth(1);
  423. entry->SetMarkerColor(1);
  424. entry->SetMarkerStyle(23);
  425. entry->SetMarkerSize(1);
  426. entry->SetTextFont(22);
  427. leg->Draw();
  428. c1_n12->Modified();
  429. c1_n12->cd();
  430. c1_n12->SetSelected(c1_n12);
  431. }