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.

123 lines
3.6 KiB

  1. void beamenergyfile_int_c()
  2. {
  3. //=========Macro generated from canvas: c1/c1
  4. //========= (Tue Dec 5 12:03:42 2017) by ROOT version6.06/02
  5. TCanvas *c1 = new TCanvas("c1", "c1",10,71,700,500);
  6. gStyle->SetOptStat(0);
  7. gStyle->SetOptTitle(0);
  8. c1->Range(-9.855094,-1.21519,60.53843,6.379747);
  9. c1->SetFillColor(0);
  10. c1->SetBorderMode(0);
  11. c1->SetBorderSize(2);
  12. c1->SetTickx(1);
  13. c1->SetTicky(1);
  14. c1->SetLeftMargin(0.14);
  15. c1->SetRightMargin(0.08);
  16. c1->SetTopMargin(0.05);
  17. c1->SetBottomMargin(0.16);
  18. c1->SetFrameLineWidth(2);
  19. c1->SetFrameBorderMode(0);
  20. c1->SetFrameLineWidth(2);
  21. c1->SetFrameBorderMode(0);
  22. Double_t Graph0_fx1001[9] = {
  23. 1.99418,
  24. 2.99221,
  25. 4.99357,
  26. 8.00451,
  27. 9.96037,
  28. 14.9624,
  29. 19.9591,
  30. 29.9598,
  31. 50.0967};
  32. Double_t Graph0_fy1001[9] = {
  33. 0.209056,
  34. 0.321651,
  35. 0.538085,
  36. 0.863684,
  37. 1.08222,
  38. 1.62381,
  39. 2.1691,
  40. 3.2634,
  41. 5.44883};
  42. Double_t Graph0_fex1001[9] = {
  43. 0,
  44. 0,
  45. 0,
  46. 0,
  47. 0,
  48. 0,
  49. 0,
  50. 0,
  51. 0};
  52. Double_t Graph0_fey1001[9] = {
  53. 0.000432816,
  54. 0.000558112,
  55. 0.000941916,
  56. 0.00144775,
  57. 0.00311746,
  58. 0.00313547,
  59. 0.00429978,
  60. 0.00679122,
  61. 0.00971554};
  62. TGraphErrors *gre = new TGraphErrors(9,Graph0_fx1001,Graph0_fy1001,Graph0_fex1001,Graph0_fey1001);
  63. gre->SetName("Graph0");
  64. gre->SetTitle("Carbon Ions");
  65. gre->SetFillColor(1);
  66. gre->SetLineWidth(2);
  67. gre->SetMarkerStyle(22);
  68. TH1F *Graph_Graph1001 = new TH1F("Graph_Graph1001","Carbon Ions",100,0,54.90695);
  69. Graph_Graph1001->SetMinimum(0);
  70. Graph_Graph1001->SetMaximum(6);
  71. Graph_Graph1001->SetDirectory(0);
  72. Graph_Graph1001->SetStats(0);
  73. Graph_Graph1001->SetLineWidth(2);
  74. Graph_Graph1001->SetMarkerStyle(21);
  75. Graph_Graph1001->GetXaxis()->SetTitle("Intensity / 10^{6}s^{-1}");
  76. Graph_Graph1001->GetXaxis()->SetNdivisions(505);
  77. Graph_Graph1001->GetXaxis()->SetLabelFont(22);
  78. Graph_Graph1001->GetXaxis()->SetLabelOffset(0.015);
  79. Graph_Graph1001->GetXaxis()->SetLabelSize(0.05);
  80. Graph_Graph1001->GetXaxis()->SetTitleSize(0.06);
  81. Graph_Graph1001->GetXaxis()->SetTitleFont(22);
  82. Graph_Graph1001->GetYaxis()->SetTitle("#bar{A}_{BPM} / 10^{3} a.u.");
  83. Graph_Graph1001->GetYaxis()->SetLabelFont(22);
  84. Graph_Graph1001->GetYaxis()->SetLabelSize(0.05);
  85. Graph_Graph1001->GetYaxis()->SetTitleSize(0.06);
  86. Graph_Graph1001->GetYaxis()->SetTitleFont(22);
  87. Graph_Graph1001->GetZaxis()->SetLabelFont(22);
  88. Graph_Graph1001->GetZaxis()->SetLabelSize(0.05);
  89. Graph_Graph1001->GetZaxis()->SetTitleSize(0.06);
  90. Graph_Graph1001->GetZaxis()->SetTitleFont(22);
  91. gre->SetHistogram(Graph_Graph1001);
  92. TF1 *pol11002 = new TF1("pol1","pol1",0,54.90695);
  93. pol11002->SetFillStyle(0);
  94. pol11002->SetMarkerStyle(21);
  95. pol11002->SetLineWidth(2);
  96. pol11002->SetChisquare(32.73371);
  97. pol11002->SetNDF(7);
  98. pol11002->GetXaxis()->SetNdivisions(505);
  99. pol11002->GetXaxis()->SetLabelFont(22);
  100. pol11002->GetXaxis()->SetLabelOffset(0.015);
  101. pol11002->GetXaxis()->SetLabelSize(0.05);
  102. pol11002->GetXaxis()->SetTitleSize(0.06);
  103. pol11002->GetXaxis()->SetTitleFont(22);
  104. pol11002->GetYaxis()->SetLabelFont(22);
  105. pol11002->GetYaxis()->SetLabelSize(0.05);
  106. pol11002->GetYaxis()->SetTitleSize(0.06);
  107. pol11002->GetYaxis()->SetTitleFont(22);
  108. pol11002->SetParameter(0,-0.007111445);
  109. pol11002->SetParError(0,0.0004586831);
  110. pol11002->SetParLimits(0,0,0);
  111. pol11002->SetParameter(1,0.1090771);
  112. pol11002->SetParError(1,0.0001024792);
  113. pol11002->SetParLimits(1,0,0);
  114. gre->GetListOfFunctions()->Add(pol11002);
  115. gre->Draw("ap");
  116. c1->Modified();
  117. c1->cd();
  118. c1->SetSelected(c1);
  119. }