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.

127 lines
3.7 KiB

  1. void beamenergyfile_int_p()
  2. {
  3. //=========Macro generated from canvas: c1_n2/c1_n2
  4. //========= (Tue Dec 5 12:03:43 2017) by ROOT version6.06/02
  5. TCanvas *c1_n2 = new TCanvas("c1_n2", "c1_n2",10,71,700,500);
  6. gStyle->SetOptStat(0);
  7. gStyle->SetOptTitle(0);
  8. c1_n2->Range(-616.6917,-4.050633,3788.249,21.26582);
  9. c1_n2->SetFillColor(0);
  10. c1_n2->SetBorderMode(0);
  11. c1_n2->SetBorderSize(2);
  12. c1_n2->SetTickx(1);
  13. c1_n2->SetTicky(1);
  14. c1_n2->SetLeftMargin(0.14);
  15. c1_n2->SetRightMargin(0.08);
  16. c1_n2->SetTopMargin(0.05);
  17. c1_n2->SetBottomMargin(0.16);
  18. c1_n2->SetFrameLineWidth(2);
  19. c1_n2->SetFrameBorderMode(0);
  20. c1_n2->SetFrameLineWidth(2);
  21. c1_n2->SetFrameBorderMode(0);
  22. Double_t Graph0_fx1003[10] = {
  23. 77.5122,
  24. 116.351,
  25. 193.951,
  26. 310.193,
  27. 387.817,
  28. 581.737,
  29. 776.317,
  30. 1164.85,
  31. 1948.34,
  32. 3130.55};
  33. Double_t Graph0_fy1003[10] = {
  34. 0.429555,
  35. 0.643733,
  36. 1.0764,
  37. 1.72565,
  38. 2.16159,
  39. 3.24754,
  40. 4.33832,
  41. 6.52111,
  42. 10.9109,
  43. 17.5223};
  44. Double_t Graph0_fex1003[10] = {
  45. 0,
  46. 0,
  47. 0,
  48. 0,
  49. 0,
  50. 0,
  51. 0,
  52. 0,
  53. 0,
  54. 0};
  55. Double_t Graph0_fey1003[10] = {
  56. 0.000673582,
  57. 0.000994535,
  58. 0.00168363,
  59. 0.00264345,
  60. 0.0034271,
  61. 0.00536572,
  62. 0.00688484,
  63. 0.00997276,
  64. 0.015779,
  65. 0.0260387};
  66. TGraphErrors *gre = new TGraphErrors(10,Graph0_fx1003,Graph0_fy1003,Graph0_fex1003,Graph0_fey1003);
  67. gre->SetName("Graph0");
  68. gre->SetTitle("Protons");
  69. gre->SetFillColor(1);
  70. gre->SetLineWidth(2);
  71. gre->SetMarkerStyle(20);
  72. TH1F *Graph_Graph1003 = new TH1F("Graph_Graph1003","Protons",100,0,3435.854);
  73. Graph_Graph1003->SetMinimum(0);
  74. Graph_Graph1003->SetMaximum(20);
  75. Graph_Graph1003->SetDirectory(0);
  76. Graph_Graph1003->SetStats(0);
  77. Graph_Graph1003->SetLineWidth(2);
  78. Graph_Graph1003->SetMarkerStyle(21);
  79. Graph_Graph1003->GetXaxis()->SetTitle("Intensity / 10^{6}s^{-1}");
  80. Graph_Graph1003->GetXaxis()->SetNdivisions(505);
  81. Graph_Graph1003->GetXaxis()->SetLabelFont(22);
  82. Graph_Graph1003->GetXaxis()->SetLabelOffset(0.015);
  83. Graph_Graph1003->GetXaxis()->SetLabelSize(0.05);
  84. Graph_Graph1003->GetXaxis()->SetTitleSize(0.06);
  85. Graph_Graph1003->GetXaxis()->SetTitleFont(22);
  86. Graph_Graph1003->GetYaxis()->SetTitle("#bar{A}_{BPM} / 10^{3} a.u.");
  87. Graph_Graph1003->GetYaxis()->SetLabelFont(22);
  88. Graph_Graph1003->GetYaxis()->SetLabelSize(0.05);
  89. Graph_Graph1003->GetYaxis()->SetTitleSize(0.06);
  90. Graph_Graph1003->GetYaxis()->SetTitleFont(22);
  91. Graph_Graph1003->GetZaxis()->SetLabelFont(22);
  92. Graph_Graph1003->GetZaxis()->SetLabelSize(0.05);
  93. Graph_Graph1003->GetZaxis()->SetTitleSize(0.06);
  94. Graph_Graph1003->GetZaxis()->SetTitleFont(22);
  95. gre->SetHistogram(Graph_Graph1003);
  96. TF1 *pol11004 = new TF1("pol1","pol1",0,3435.854);
  97. pol11004->SetFillStyle(0);
  98. pol11004->SetMarkerStyle(21);
  99. pol11004->SetLineWidth(2);
  100. pol11004->SetChisquare(16.16133);
  101. pol11004->SetNDF(8);
  102. pol11004->GetXaxis()->SetNdivisions(505);
  103. pol11004->GetXaxis()->SetLabelFont(22);
  104. pol11004->GetXaxis()->SetLabelOffset(0.015);
  105. pol11004->GetXaxis()->SetLabelSize(0.05);
  106. pol11004->GetXaxis()->SetTitleSize(0.06);
  107. pol11004->GetXaxis()->SetTitleFont(22);
  108. pol11004->GetYaxis()->SetLabelFont(22);
  109. pol11004->GetYaxis()->SetLabelSize(0.05);
  110. pol11004->GetYaxis()->SetTitleSize(0.06);
  111. pol11004->GetYaxis()->SetTitleFont(22);
  112. pol11004->SetParameter(0,-0.005407782);
  113. pol11004->SetParError(0,0.0006990141);
  114. pol11004->SetParLimits(0,0,0);
  115. pol11004->SetParameter(1,0.005593003);
  116. pol11004->SetParError(1,3.747116e-06);
  117. pol11004->SetParLimits(1,0,0);
  118. gre->GetListOfFunctions()->Add(pol11004);
  119. gre->Draw("ap");
  120. c1_n2->Modified();
  121. c1_n2->cd();
  122. c1_n2->SetSelected(c1_n2);
  123. }