Newer
Older
Presentations / NuFact_2016 / LongLive / images / test.C
@mchrzasz mchrzasz on 11 Aug 2016 1 KB addedd NuFact slides
  1. // Simple test macro that produces a plot similar to Fig 2 in Supplemental
  2. // Material of the Letter.
  3. // tau: lifetime [ps]
  4. // type: 0 = relative, 1 = absolute limits
  5. void test(double tau, int type){
  6. gROOT->ProcessLine(".L getUL.C");
  7.  
  8. TFile f("lhcb_2015_036.root");
  9. TGraph *gm = (TGraph*)f.Get("g_masses");
  10. char name[100];
  11. int nm = gm->GetN();
  12. double ul[2000];
  13. for(int i=0; i<nm-1; i++){
  14. ul[i] = getUL(gm->GetX()[i],tau,type);
  15. }
  16. TCanvas *c1 = new TCanvas("c1","",25,25,1400,500);
  17. c1->cd();
  18. c1->SetBorderMode(0);
  19. c1->SetTopMargin(0.05);
  20. c1->SetBottomMargin(0.15);
  21. c1->SetLeftMargin(0.1);
  22. c1->SetRightMargin(0.03);
  23. gPad->SetLogy();
  24.  
  25. TH1F h("h","",1000,214,4350);
  26. h.GetXaxis()->SetTitleFont(132);
  27. h.GetXaxis()->SetTitleSize(0.06);
  28. h.GetYaxis()->SetTitleFont(132);
  29. h.GetYaxis()->SetTitleSize(0.06);
  30. h.GetXaxis()->SetTitle("#it{m(#mu^{+}#mu^{-})} [MeV]");
  31. h.GetXaxis()->SetLabelSize(0.05);
  32. h.GetYaxis()->SetLabelSize(0.05);
  33. h.GetXaxis()->SetLabelFont(132);
  34. h.GetYaxis()->SetLabelFont(132);
  35. h.GetYaxis()->SetTitleOffset(0.8);
  36. if(type == 0) h.GetYaxis()->SetTitle("relative UL at 95% CL");
  37. else h.GetYaxis()->SetTitle("absolute UL at 95% CL");
  38. if(type == 0){
  39. h.SetMinimum(2e-3);
  40. h.SetMaximum(1);
  41. }
  42. else{
  43. h.SetMinimum((2e-3)*(1.6e-7));
  44. h.SetMaximum(1.6e-7);
  45. }
  46. h.DrawCopy();
  47. TGraph *gul = new TGraph(nm-1,gm->GetX(),ul);
  48. gul->SetMarkerStyle(20);
  49. gul->Draw("psame");
  50. }