NuePlotStyle.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "TString.h"
4 #include "TH1.h"
5 #include "THStack.h"
6 #include "TCanvas.h"
7 #include "TGraphAsymmErrors.h"
8 
9 #include <vector>
10 
11 namespace ana
12 {
14  {
15  public:
16  NuePlotStyle(TString pid, bool third=false);
17  ~NuePlotStyle();
18 
19  TCanvas* MakeSACanvas(std::vector<TH1*> hists);
20  TCanvas* MakeSACanvas(TH1* hist);
21 
22  private:
23  void CenterTitles(TH1* hist);
24  void PIDTag();
25  void PIDDivisions(bool shortaxis);
26  void PIDBinLabels(bool shortaxis);
27  void POTLabel(bool shortaxis);
28  void PID2DAxis(TH1* hist, bool shortaxis);
29 
30  TString fPID;
31  bool fThird;
32  };
33 
34  /// Label the x-axis with fractions of pi
35  void XAxisDeltaCPLabels(TH1* axes, bool t2kunits=false);
36  void FillWithDimColor(TH1* h, bool usealpha=false, float dim = 0.65);
37 
38  // 2017 style - 4 bins
39  void Nue2017FourBinDivisions(const int color = kBlack,
40  const int style = 3);
41  void Nue2017FourBinLabels(const double yNDC = 0.98,
42  const double textsize = 0.031,
43  const int color = kGray+3,
44  const bool merged = false);
45  void Nue2017FourBinAxis(TH1* axes, bool drawLabels = true,
46  bool merged = false);
47 
48 
49  // 2018 style - 3 bins
50  void Nue2018ThreeBinDivisions(bool coreOnly = false, const int color = kBlack,
51  const int style = 3);
52  void Nue2018ThreeBinLabels(const double yNDC = 0.96,
53  const double textsize = 0.06,
54  const int color = kGray+3,
55  const bool nd = false);
56  void Nue2018ThreeBinAxis(TH1* axes, bool drawLabels = true,
57  bool merged = false, bool coreOnly = false);
58  void Nue2018ThreeBinAxis(THStack* axes, bool drawLabels = true,
59  bool merged = false, bool coreOnly = false);
60 
61  void Nue2018ThreeBinDivisions_Reduced(bool coreOnly, const int color, const int style);
62  void Nue2018ThreeBinLabels_Reduced(const double yNDC, const double textsize,
63  const int color, const bool nd);
64 
65  //for ND use coreOnly - merged = true
66  void Nue2018ThreeBinAxis_Reduced(TH1* axes, bool drawLabels, bool merged, bool coreOnly, bool drawTitle = true);
67  void Nue2018ThreeBinAxis_Reduced(THStack* axes, bool drawLabels, bool merged, bool coreOnly, bool drawTitle = true);
68 
69  //more functions for use with the above 2018 style plots
70  //see CAFANa/3flavor/Ana2020/BlessedPlots/plot_predictions.C for example of use
71 
72  TH1* RemoveBins(TH1* h, bool sum=false);
73  TGraphAsymmErrors* PlotErrorBand(TH1*& center, TH1*& nom, std::vector<TH1*>& ups, std::vector<TH1*>& dns, int col, int errCol);
74 
75 
76 }
void Nue2017FourBinLabels(const double yNDC, const double textsize, const int color, const bool merged)
void Nue2018ThreeBinAxis(THStack *axes, bool drawLabels, bool merged, bool coreOnly)
void Nue2017FourBinAxis(TH1 *axes, bool drawLabels, bool merged)
TH1 * RemoveBins(TH1 *h, bool sum)
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
void XAxisDeltaCPLabels(TH1 *axes, bool t2kunits)
Label the x-axis with fractions of pi.
void PIDBinLabels(bool shortaxis)
void Nue2018ThreeBinDivisions_Reduced(bool coreOnly, const int color, const int style)
TString hists[nhists]
Definition: bdt_com.C:3
void POTLabel(bool shortaxis)
TGraphAsymmErrors * PlotErrorBand(TH1 *&center, TH1 *&nom, std::vector< TH1 * > &ups, std::vector< TH1 * > &dns, int col, int errCol)
void CenterTitles(TH1 *hist)
void drawLabels(std::vector< std::string > labels)
void Nue2018ThreeBinDivisions(bool coreOnly, const int color, const int style)
Int_t col[ntarg]
Definition: Style.C:29
NuePlotStyle(TString pid, bool third=false)
TCanvas * MakeSACanvas(std::vector< TH1 * > hists)
void Nue2018ThreeBinLabels(const double yNDC, const double textsize, const int color, const bool nd)
void Nue2017FourBinDivisions(const int color, const int style)
void Nue2018ThreeBinAxis_Reduced(TH1 *axes, bool drawLabels, bool merged, bool coreOnly, bool drawTitle)
Double_t sum
Definition: plot.C:31
void Nue2018ThreeBinLabels_Reduced(const double yNDC, const double textsize, const int color, const bool nd)
void FillWithDimColor(TH1 *h, bool usealpha, float dim)
void PID2DAxis(TH1 *hist, bool shortaxis)
void PIDDivisions(bool shortaxis)