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.

78 lines
4.0 KiB

  1. {
  2. gROOT->ProcessLine(".x lhcbStyle.C");
  3. TCanvas c1_mg1_e9;
  4. TGraph * ge9_p = new TGraph("energylist_p_bpmbeta1.txt","%lg %lg ");
  5. TGraph * ge9_he = new TGraph("energylist_he_bpmbeta1.txt","%lg %lg");
  6. TGraph * ge9_c = new TGraph("energylist_c_bpmbeta1.txt","%lg %lg ");
  7. TGraph * ge9_o = new TGraph("energylist_o_bpmbeta1.txt","%lg %lg ");
  8. TMultiGraph * mg_e9 = new TMultiGraph();
  9. mg_e9->Add(ge9_p,"p"); ge9_p->SetMarkerStyle(20);
  10. mg_e9->Add(ge9_he,"p"); ge9_he->SetMarkerStyle(21);
  11. mg_e9->Add(ge9_c,"p"); ge9_c->SetMarkerStyle(22);
  12. mg_e9->Add(ge9_o,"p"); ge9_o->SetMarkerStyle(23);
  13. // mg_e9->Add(ge9_sum,"p"); ge9_sum->SetMarkerStyle(1);
  14. TF1 * tf1_btvbeta1 = 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,1);
  15. tf1_btvbeta1->SetParLimits(0,0,1.5);
  16. tf1_btvbeta1->SetParLimits(1,0,1E4.);
  17. tf1_btvbeta1->SetParLimits(2,0.001,.03);
  18. tf1_btvbeta1->SetParameters(1,0, 0.01);
  19. TF1 * tf1_btvbeta2 = 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 ))*4*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,1);
  20. tf1_btvbeta2->SetParLimits(0,0,1.5);
  21. tf1_btvbeta2->SetParLimits(1,0,1E4.);
  22. tf1_btvbeta2->SetParLimits(2,0.001,.03);
  23. tf1_btvbeta2->SetParameters(1,0.002, 0.01);
  24. TF1 * tf1_btvbeta3 = 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 ))*36*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,1);
  25. tf1_btvbeta3->SetParLimits(0,0,2.5);
  26. tf1_btvbeta3->SetParLimits(1,0,1E4.);
  27. tf1_btvbeta3->SetParLimits(2,0.001,0.03);
  28. tf1_btvbeta3->SetParameters(1,9.7E3, 0.01);
  29. TF1 * tf1_btvbeta4 = 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 ))*64*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,1);
  30. tf1_btvbeta4->SetParLimits(0,0,2.5);
  31. tf1_btvbeta4->SetParLimits(1,0,1E4.);
  32. tf1_btvbeta4->SetParLimits(2,0.01,0.03);
  33. tf1_btvbeta4->SetParameters(1,9.7E3, 0.01);
  34. mg_e9->Draw("a");
  35. mg_e9->SetTitle(" ");
  36. mg_e9->GetXaxis()->SetTitle("Lorentz #beta");
  37. mg_e9->GetYaxis()->SetTitle("#frac{dA}{dE}");
  38. mg_e9->SetMinimum(0.0);
  39. // mg_e9->SetMaximum(40.);
  40. // gPad->SetLogx();
  41. ge9_p->Fit(tf1_btvbeta1);
  42. ge9_he->Fit(tf1_btvbeta2);
  43. ge9_c->Fit(tf1_btvbeta3);
  44. ge9_o->Fit(tf1_btvbeta4);
  45. mylegende9 = new TLegend(0.70,0.7,0.9,0.9);
  46. mylegende9->SetFillColor(0); // white background
  47. mylegende9->SetTextFont(22);
  48. mylegende9->SetBorderSize(0); // get rid of the box
  49. mylegende9->SetTextSize(0.047); // set text size
  50. mylegende9->AddEntry(ge9_p,"Protons","p"); // options: p,l,f
  51. mylegende9->AddEntry(ge9_he,"Helium","p"); // options: p,l,f
  52. mylegende9->AddEntry(ge9_c,"Carbon","p"); // options: p,l,f
  53. mylegende9->AddEntry(ge9_o,"Oxygen","p"); // options: p,l,f
  54. // mylegende9->AddEntry(tf1_pow1,"[1]#upointpow(#beta,[2])}","l"); // options: p,l,f
  55. mylegende9->Draw();
  56. gPad->Modified();
  57. c1_mg1_e9->SaveAs("figs/bpmbeta1.pdf");
  58. c1_mg1_e9->SaveAs("figs/bpmbeta1.png");
  59. c1_mg1_e9->SaveAs("figs/bpmbeta1.C");
  60. }