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.

198 lines
6.5 KiB

  1. from ROOT import TStyle, TText, TLatex, TPaveText, gROOT
  2. from Globals import *
  3. from array import array
  4. lhcbStyle = TStyle("lhcbStyle", "LHCb official plots style")
  5. lhcbLabel = TText()
  6. lhcbLatex = TLatex()
  7. lhcb7TeVPrelimL = TPaveText()
  8. lhcb0_9TeVPrelimL = TPaveText()
  9. def LHCbStyle(colzPlot=False, NCont=25):
  10. # ##################################
  11. # # PURPOSE:
  12. # #
  13. # # This file defines a reasonable style for (black-and-white)
  14. # # "publication quality" ROOT plots. The default settings contain
  15. # # many features that are either not desirable for printing on white
  16. # # paper or impair the general readability of plots.
  17. # #
  18. # # USAGE:
  19. #
  20. # Simply add the line
  21. # from LHCbStyle import LHCbStyle
  22. # at the beginning of your root program (and make sure LHCbStyle.py is
  23. # in a location accessible to the compiler). Then add the line
  24. # lhcbStyle()
  25. # somewhere at the beginning of your program
  26. #
  27. # SOME COMMENTS:
  28. #
  29. # Statistics and fit boxes:
  30. #
  31. # "Decorative" items around the histogram are kept to a minimum.
  32. # In particular there is no box with statistics or fit information.
  33. # You can easily change this either by editing your private copy
  34. # of this style file or by calls to "gStyle" in your macro.
  35. # For example,
  36. # gStyle->SetOptFit(1011);
  37. # will add some fit information.
  38. #
  39. # Font:
  40. #
  41. # The font is chosen to be 62, i.e.helvetica-bold-r-normal with
  42. # precision 2. Font is of course a matter of taste, but most people
  43. # will probably agree that Helvetica bold gives close to optimal
  44. # readibility in presentations. It appears to be the ROOT default,
  45. # and since there are still some features in ROOT that simply won't
  46. # respond to any font requests, it is the wise choice to avoid
  47. # ugly font mixtures on the same plot... The precision of the font (2)
  48. # is chosen in order to have a rotatable and scalable font. Be sure
  49. # to use true-type fonts! I.e.
  50. # Unix.*.Root.UseTTFonts: true in your .rootrc file.
  51. #
  52. # "Landscape histograms":
  53. #
  54. # The style here is designed for more or less quadratic plots.
  55. # For very long histograms, adjustements are needed. For instance,
  56. # for a canvas with 1x5 histograms:
  57. # TCanvas* c1 = new TCanvas("c1", "L0 muons", 600, 800);
  58. # c1->Divide(1,5);
  59. # adaptions like the following will be needed:
  60. # gStyle->SetTickLength(0.05,"x");
  61. # gStyle->SetTickLength(0.01,"y");
  62. # gStyle->SetLabelSize(0.15,"x");
  63. # gStyle->SetLabelSize(0.1,"y");
  64. # gStyle->SetStatW(0.15);
  65. # gStyle->SetStatH(0.5);
  66. #
  67. ##################################
  68. lhcbFont = 132 # Old LHCb style: 62
  69. lhcbWidth = 2 # Old LHCb style: 3.00
  70. lhcbTSize = 0.06
  71. lhcbStyle.SetFillColor(1)
  72. lhcbStyle.SetFillStyle(1001) # solid
  73. lhcbStyle.SetFrameFillColor(0)
  74. lhcbStyle.SetFrameBorderMode(0)
  75. lhcbStyle.SetPadBorderMode(0)
  76. lhcbStyle.SetPadColor(0)
  77. lhcbStyle.SetCanvasBorderMode(0)
  78. lhcbStyle.SetCanvasColor(0)
  79. lhcbStyle.SetStatColor(0)
  80. lhcbStyle.SetLegendBorderSize(0)
  81. lhcbStyle.SetLegendFont(132)
  82. # If you want the usual gradient palette (blue . red)
  83. lhcbStyle.SetPalette(1)
  84. # If you want colors that correspond to gray scale in black and white:
  85. palette = array('i',[0, 5, 7, 3, 6, 2, 4, 1])
  86. lhcbStyle.SetPalette(8, palette)
  87. # set the paper & margin sizes
  88. lhcbStyle.SetPaperSize(20, 26)
  89. lhcbStyle.SetPadTopMargin(0.05)
  90. lhcbStyle.SetPadRightMargin(0.05) # increase for colz plots
  91. lhcbStyle.SetPadBottomMargin(0.16)
  92. lhcbStyle.SetPadLeftMargin(0.14)
  93. # use large fonts
  94. lhcbStyle.SetTextFont(lhcbFont)
  95. lhcbStyle.SetTextSize(lhcbTSize)
  96. lhcbStyle.SetLabelFont(lhcbFont, "x")
  97. lhcbStyle.SetLabelFont(lhcbFont, "y")
  98. lhcbStyle.SetLabelFont(lhcbFont, "z")
  99. lhcbStyle.SetLabelSize(lhcbTSize, "x")
  100. lhcbStyle.SetLabelSize(lhcbTSize, "y")
  101. lhcbStyle.SetLabelSize(lhcbTSize, "z")
  102. lhcbStyle.SetTitleFont(lhcbFont)
  103. lhcbStyle.SetTitleFont(lhcbFont, "x")
  104. lhcbStyle.SetTitleFont(lhcbFont, "y")
  105. lhcbStyle.SetTitleFont(lhcbFont, "z")
  106. lhcbStyle.SetTitleSize(1.2*lhcbTSize, "x")
  107. lhcbStyle.SetTitleSize(1.2*lhcbTSize, "y")
  108. lhcbStyle.SetTitleSize(1.2*lhcbTSize, "z")
  109. # use medium bold lines and thick markers
  110. lhcbStyle.SetLineWidth(lhcbWidth)
  111. lhcbStyle.SetFrameLineWidth(lhcbWidth)
  112. lhcbStyle.SetHistLineWidth(lhcbWidth)
  113. lhcbStyle.SetFuncWidth(lhcbWidth)
  114. lhcbStyle.SetGridWidth(lhcbWidth)
  115. lhcbStyle.SetLineStyleString(2, "[12 12]") # postscript dashes
  116. lhcbStyle.SetMarkerStyle(20)
  117. lhcbStyle.SetMarkerSize(1.0)
  118. # label offsets
  119. lhcbStyle.SetLabelOffset(0.010, "X")
  120. lhcbStyle.SetLabelOffset(0.010, "Y")
  121. # by default, do not display histogram decorations:
  122. lhcbStyle.SetOptStat(0)
  123. #lhcbStyle.SetOptStat("emr"); # show only nent -e , mean - m , rms -r
  124. # full opts at http:#root.cern.ch/root/html/TStyle.html#TStyle:SetOptStat
  125. lhcbStyle.SetStatFormat("6.3g") # specified as c printf options
  126. lhcbStyle.SetOptTitle(0)
  127. lhcbStyle.SetOptFit(0)
  128. #lhcbStyle.SetOptFit(1011); # order is probability, Chi2, errors, parameters
  129. #titles
  130. lhcbStyle.SetTitleOffset(0.95, "X")
  131. lhcbStyle.SetTitleOffset(0.95, "Y")
  132. lhcbStyle.SetTitleOffset(1.2, "Z")
  133. lhcbStyle.SetTitleFillColor(0)
  134. lhcbStyle.SetTitleStyle(0)
  135. lhcbStyle.SetTitleBorderSize(0)
  136. lhcbStyle.SetTitleFont(lhcbFont, "title")
  137. lhcbStyle.SetTitleX(0.0)
  138. lhcbStyle.SetTitleY(1.0)
  139. lhcbStyle.SetTitleW(1.0)
  140. lhcbStyle.SetTitleH(0.05)
  141. # look of the statistics box:
  142. lhcbStyle.SetStatBorderSize(0)
  143. lhcbStyle.SetStatFont(lhcbFont)
  144. lhcbStyle.SetStatFontSize(0.05)
  145. lhcbStyle.SetStatX(0.9)
  146. lhcbStyle.SetStatY(0.9)
  147. lhcbStyle.SetStatW(0.25)
  148. lhcbStyle.SetStatH(0.15)
  149. # put tick marks on top and RHS of plots
  150. lhcbStyle.SetPadTickX(1)
  151. lhcbStyle.SetPadTickY(1)
  152. # histogram divisions: only 5 in x to avoid label overlaps
  153. lhcbStyle.SetNdivisions(505, "x")
  154. lhcbStyle.SetNdivisions(510, "y")
  155. ## add LHCb label
  156. #lhcbName = new TPaveText(gStyle.GetPadLeftMargin() + 0.05,
  157. # 0.87 - gStyle.GetPadTopMargin(),
  158. # gStyle.GetPadLeftMargin() + 0.20,
  159. # 0.95 - gStyle.GetPadTopMargin(),
  160. # "BRNDC");
  161. #lhcbName.AddText("LHCb");
  162. #lhcbName.SetFillColor(0);
  163. #lhcbName.SetTextAlign(12);
  164. #lhcbName.SetBorderSize(0);
  165. lhcbLabel.SetTextFont(lhcbFont)
  166. lhcbLabel.SetTextColor(1)
  167. lhcbLabel.SetTextSize(lhcbTSize)
  168. lhcbLabel.SetTextAlign(12)
  169. lhcbLatex.SetTextFont(lhcbFont)
  170. lhcbLatex.SetTextColor(1)
  171. lhcbLatex.SetTextSize(lhcbTSize)
  172. lhcbLatex.SetTextAlign(12)
  173. gROOT.SetStyle("lhcbStyle")
  174. gROOT.ForceStyle()
  175. return