Angular analysis of B+->K*+(K+pi0)mumu
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.

163 lines
5.4 KiB

  1. //Script used to make pretty plots of the Q2 veto
  2. //Renata Kopecna
  3. #include "../GlobalFunctions.hh"
  4. #include "../Paths.hpp"
  5. #include "../Utils.hpp"
  6. #include "../Design.hpp"
  7. double phi_low = 0.98;
  8. double phi_up = 1.1;
  9. double jpsi_low= 8.0;
  10. double jpsi_up = 11.0;
  11. double psi_low = 12.5;
  12. double psi_up = 15.0;
  13. int makePrettyQ2plot(){
  14. LHCbStyle();
  15. //Load the files
  16. TChain* theTree = new TChain("DecayTree");
  17. for (auto &yr: yearsData(12)){
  18. theTree->Add(GetBDTinputFile(yr, false, false, false,false).c_str());
  19. coutDebug("Reading " + GetBDTinputFile(yr, false, false, false,false));
  20. }
  21. //init the histogram
  22. string hist_name = "hist";
  23. TH2D* hist = new TH2D(hist_name.c_str(),hist_name.c_str(),200,cut_B_plus_M_low,cut_B_plus_M_high,200,0.1,19.0);
  24. //Define the plotting options
  25. string B_branch = UseDTF ? "B_plus_M_DTF" : "B_plus_M";
  26. string plot_branch = "Q2/1000000:" + B_branch;
  27. string plot_opts = "COLZ";
  28. string drawCommand = plot_branch + ">>" + hist_name;
  29. coutDebug("Drawing this: " + drawCommand);
  30. //Draw into the histogram
  31. theTree->Draw(drawCommand.c_str());
  32. //Design histograms
  33. design_TH2F(hist,"K^{+}#pi^{0}#mu^{+}#mu^{-} [MeV]","q^{2} [MeV^{2}]","Entries [a.u.]");
  34. hist->GetXaxis()->SetLabelSize(0.05);
  35. hist->GetYaxis()->SetLabelSize(0.05);
  36. hist->GetYaxis()->SetTitleOffset(1.0);
  37. hist->GetZaxis()->SetTitleOffset(1.2);
  38. //Add the resonance lines
  39. TLine *linePhiOne = design_veto_line(cut_B_plus_M_low,phi_low,cut_B_plus_M_high,phi_low,kRed);
  40. TLine *linePhiTwo = design_veto_line(cut_B_plus_M_low,phi_up,cut_B_plus_M_high,phi_up,kRed);
  41. TLine *lineJspiOne = design_veto_line(cut_B_plus_M_low,jpsi_low,cut_B_plus_M_high,jpsi_low, kRed);
  42. TLine *lineJspiTwo = design_veto_line(cut_B_plus_M_low,jpsi_up,cut_B_plus_M_high,jpsi_up,kRed);
  43. TLine *linePsiOne = design_veto_line(cut_B_plus_M_low,psi_low,cut_B_plus_M_high,psi_low,kRed);
  44. TLine *linePsiTwo = design_veto_line(cut_B_plus_M_low,psi_up,cut_B_plus_M_high,psi_up,kRed);
  45. //Save the histogram
  46. TCanvas *canvas = c_TH2F("q2_veto");
  47. canvas->SetRightMargin(0.18);
  48. canvas->SetLeftMargin(0.12);
  49. canvas->cd();
  50. canvas->SetLogz();
  51. hist->Draw(plot_opts.c_str());
  52. linePhiOne->Draw("SAME");
  53. linePhiTwo->Draw("SAME");
  54. lineJspiOne->Draw("SAME");
  55. lineJspiTwo->Draw("SAME");
  56. linePsiOne->Draw("SAME");
  57. linePsiTwo->Draw("SAME");
  58. canvas->SaveAs("./q2_veto.eps");
  59. canvas->SaveAs("./q2_veto.root");
  60. return 1;
  61. }
  62. int makePrettyQ2dist(){
  63. LHCbStyle();
  64. //Load the files
  65. TChain* theTree = new TChain("DecayTree");
  66. for (auto &yr: yearsData(12)){
  67. theTree->Add(GetBDTinputFile(yr, false, false, false,false).c_str());
  68. coutDebug("Reading " + GetBDTinputFile(yr, false, false, false,false));
  69. }
  70. //init the histogram
  71. string hist_name = "hist";
  72. TH1D* hist = new TH1D(hist_name.c_str(),hist_name.c_str(),200,0.1,19.0);
  73. //Define the plotting options
  74. string B_branch = UseDTF ? "B_plus_M_DTF" : "B_plus_M";
  75. string plot_branch = "Q2/1000000";
  76. string plot_opts = "";
  77. string plot_cut = to_string(cut_B_plus_M_low) +"<"+ B_branch +" && "+ B_branch +"<"+ to_string(cut_B_plus_M_high);
  78. string drawCommand = plot_branch + ">>" + hist_name;
  79. coutDebug("Drawing this: " + drawCommand);
  80. coutDebug("with a cut: " + plot_cut);
  81. //Draw into the histogram
  82. theTree->Draw(drawCommand.c_str(),plot_cut.c_str());
  83. //Design histograms
  84. design_lines(hist,"q^{2} [GeV^{2}]","Entries (a.u.)", kAzure+2);
  85. hist->GetXaxis()->SetLabelSize(0.05);
  86. hist->GetYaxis()->SetLabelSize(0.05);
  87. hist->GetYaxis()->SetRangeUser(20,260000);
  88. hist->GetYaxis()->SetTitleOffset(1.2);
  89. //Add the resonance lines
  90. TH1D* histPhi = new TH1D("phi", "phi", 1, phi_low, phi_up);
  91. TH1D* histJpsi = new TH1D("jpsi","jspi",1, jpsi_low,jpsi_up);
  92. TH1D* histPsi = new TH1D("psi", "psi", 1, psi_low, psi_up);
  93. histPhi->SetBinContent(1,260000);
  94. histJpsi->SetBinContent(1,260000);
  95. histPsi->SetBinContent(1,260000);
  96. //TLine *linePhiOne = design_veto_line(phi_low, 20, phi_low, 260000, kRed);
  97. //TLine *linePhiTwo = design_veto_line(phi_up, 20, phi_up, 260000, kRed);
  98. //TLine *lineJspiOne = design_veto_line(jpsi_low , 20, jpsi_low, 260000, kRed);
  99. //TLine *lineJspiTwo = design_veto_line(jpsi_up, 20, jpsi_up, 260000, kRed);
  100. //TLine *linePsiOne = design_veto_line(psi_low, 20, psi_low, 260000, kRed);
  101. //TLine *linePsiTwo = design_veto_line(psi_up, 20, psi_up, 260000, kRed);
  102. string main_name = "q2_dist";
  103. histPhi->SetFillStyle(3444); //3344
  104. histPhi->SetFillColor(kRed+1);
  105. histPhi->SetLineWidth(0);
  106. histJpsi->SetFillStyle(3444); //3344
  107. histJpsi->SetFillColor(kRed+1);
  108. histJpsi->SetLineWidth(0);
  109. histPsi->SetFillStyle(3444); //3344
  110. histPsi->SetFillColor(kRed+1);
  111. histPsi->SetLineWidth(0);
  112. //Save the histogram
  113. TCanvas *canvas = c_canvas(main_name);
  114. canvas->SetLeftMargin(0.12);
  115. canvas->cd();
  116. canvas->SetLogy();
  117. hist->Draw(plot_opts.c_str());
  118. histPhi->Draw("SAME");
  119. histJpsi->Draw("SAME");
  120. histPsi->Draw("SAME");
  121. //linePhiOne->Draw("SAME");
  122. //linePhiTwo->Draw("SAME");
  123. //lineJspiOne->Draw("SAME");
  124. //lineJspiTwo->Draw("SAME");
  125. //linePsiOne->Draw("SAME");
  126. //linePsiTwo->Draw("SAME");
  127. canvas->SaveAs(Form("%s.eps",main_name.c_str()));
  128. canvas->SaveAs(Form("%s.root",main_name.c_str()));
  129. return 1;
  130. }