Plots.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "CAFAna/Core/ISyst.h"
7 
9 
10 #include <map>
11 #include <vector>
12 
13 #include "Rtypes.h"
14 
15 class TCanvas;
16 class TGraph;
17 class TGraphAsymmErrors;
18 class TH1;
19 class TH2;
20 class THStack;
21 class TLegend;
22 class TMarker;
23 class TPad;
24 class TPaveText;
25 
26 namespace ana
27 {
28  class IPrediction;
29  class SystShifts;
30 
31  /// Overlay MC spectrum with data spectrum
32  ///
33  /// \return The first histogram drawn so you can alter axis labels etc
34  TH1* DataMCComparison(const Spectrum& data, const Spectrum& mc, EBinType bintype = kBinContent);
35 
36 
37  /// Overlay MC spectrum with data spectrum
38  ///
39  /// \return The first histogram drawn so you can alter axis labels etc
40  TH1* DataMCComparison(const Spectrum& data,
41  const IPrediction* mc,
43  const SystShifts & shifts = kNoShift,
44  EBinType bintype = kBinContent);
45 
46  /// Overlay MC spectrum with data spectrum, area normalized
47  ///
48  /// \return The first histogram drawn so you can alter axis labels etc
50 
51  /// Overlay MC spectrum with data spectrum, area normalized
52  ///
53  /// \return The first histogram drawn so you can alter axis labels etc
55  const IPrediction* mc,
57 
58 
59  /// \brief Plot MC broken down into flavour components, overlayed with data
60  ///
61  /// \return The first histogram drawn so you can alter axis labels etc
63  const IPrediction* mc,
65 
66  /// Plot data/MC ratio for the given spectrum. Normalize MC to Data by area
68  double miny = 0, double maxy = 3);
69 
70  /// Plot data/MC ratio for the given spectrum. Normalize MC to Data by area
72  const IPrediction* mc,
74  double miny = 0, double maxy = 3);
75 
76  /// Plot data/MC ratio for the given spectrum. Normalize MC to Data by POT
77  void DataMCRatio(const Spectrum& data, const Spectrum& mc,
78  double miny = 0, double maxy = 3);
79 
80  /// Plot data/MC ratio for the given spectrum. Normalize MC to Data by POT
81  void DataMCRatio(const Spectrum& data,
82  const IPrediction* mc,
84  double miny = 0, double maxy = 3);
85 
86  /// Plot data/expected, compared with fit/expected
87  void RatioPlot(const Spectrum& data,
88  const Spectrum& expected,
89  const Spectrum& fit,
90  double miny = 0, double maxy = 1.2);
91 
92  /// Return TH1 vectors of the +/-1sigma syst shifted prediction
93  ///
94  /// \param calc Oscillation parameters
95  /// \param pred The prediction. Must be able to generate shifted spectra
96  /// \param systs List of systematics to include in error band
97  /// \param hUps Empty TH1* vector to return the +1sigma shifted hists
98  /// \param hDns Empty TH1* vector to return the -1sigma shifted hists
99  /// \param pot POT to scale the prediction to
101  const IPrediction* pred,
102  std::vector<const ISyst*> systs,
103  std::vector<TH1*> &hUps,
104  std::vector<TH1*> &hDns,
105  double pot,
109 
110  /// Return TH1 vectors of the +/-1sigma syst shifted prediction
111  /// with a given set of best fit systematic pulls
112  ///
113  /// \param calc Oscillation parameters
114  /// \param pred The prediction. Must be able to generate shifted spectra
115  /// \param systs List of systematics to include in error band
116  /// \param bfshifts Systematic shifts determined by the best fit
117  /// \param hUps Empty TH1* vector to return the +1sigma shifted hists
118  /// \param hDns Empty TH1* vector to return the -1sigma shifted hists
119  /// \param pot POT to scale the prediction to
121  const IPrediction* pred,
122  std::vector<const ISyst*> systs,
123  const SystShifts &bfshifts,
124  std::vector<TH1*> &hUps,
125  std::vector<TH1*> &hDns,
126  double pot,
130 
131 
132  /// \brief Plot prediction with +/-1sigma error band
133  ///
134  /// When multiple systematics are used, the errors are the quadrature sum
135  ///
136  /// \param pred The prediction. Must be able to generate shifted spectra
137  /// \param systs List of systematics to include in error band
138  /// \param calc Oscillation parameters
139  /// \param pot POT to evaluate prediction at
140  /// \param col Color of the prediction, default kRed
141  /// \param errCol Color of the shading, default col-7 (kRed-7 is light red)
142  /// \param headroom Fraction of maximum bin for headroom, default 30%
143  /// \param alpha Control transparency of error bands, default is no transparency
144  TGraphAsymmErrors* PlotWithSystErrorBand(IPrediction* pred,
145  const std::vector<const ISyst*>& systs,
147  double pot,
148  int col = -1, int errCol = -1,
149  float headroom = 1.3,
150  bool newaxis = true,
151  EBinType bintype = kBinContent,
152  double alpha=1);
153 
154  /// \brief Plot prediction with error band
155  ///
156  /// When multiple systematics are used, the errors are the quadrature sum
157  ///
158  /// \param nominal Nominal spectrum
159  /// \param upShifts Vector of spectra which have + shifts
160  /// \param downShifts Vector of spectra which have - shifts, same order as +
161  /// \param pot POT to scale spectra to
162  /// \param col Color of the prediction, default kRed
163  /// \param errCol Color of the shading, default col-7(kRed-7 is light red)
164  /// \param headroom Fraction of maximum bin for headroom, default 30%
165  /// \param alpha Control transparency of error bands, default is no transparency
166  TGraphAsymmErrors* PlotWithSystErrorBand(const Spectrum& nominal,
167  const std::vector<Spectrum>& upShifts,
168  const std::vector<Spectrum>& downShifts,
169  double pot,
170  int col = -1, int errCol = -1,
171  float headroom = 1.3, bool newaxis=true,
172  EBinType bintype = kBinContent,
173  double alpha=1);
174 
175  TGraphAsymmErrors* PlotWithSystErrorBand(TH1*& nominal,
176  std::vector<TH1*>& upShifts,
177  std::vector<TH1*>& downShifts,
178  int col = -1, int errCol = -1,
179  float headroom = 1.3,
180  bool newaxis = true,
181  double alpha=1);
182 
183  /// \brief Plot two different predictions with +/-1sigma shape-only error bands
184  void PlotWithSystErrorBandTwoPreds(const Spectrum& nominal,
185  const std::vector<Spectrum>& upShifts,
186  const std::vector<Spectrum>& downShifts,
187  const Spectrum& nominal2,
188  const std::vector<Spectrum>& upShifts2,
189  const std::vector<Spectrum>& downShifts2,
190  double pot,
191  int col = -1, int errCol = -1,
192  float headroom = 1.3, bool newaxis=true,
193  EBinType bintype = kBinContent);
194 
195 
196 
197  /// Equivalent default PlotWithSystErrorBand but adding the option for numu quartiles
198  ///
199  /// All quartile pads should idealy share the same maximum for easier complarison
200  /// TGraph is usually bad behaved when plotted with histograms, so have to force a
201  /// maximum from here: changing float headroom to float maxY
202  TGraphAsymmErrors* PlotWithSystErrorBand_Quant(const int quant,
203  IPrediction* pred,
204  const std::vector<const ISyst*>& systs,
206  double pot,
207  int col = -1, int errCol = -1,
208  float maxy = 8.0,
209  bool newaxis = true);
210 
211 
212  TGraphAsymmErrors* PlotWithSystErrorBand_Quant(const int quant,
213  const Spectrum& nominal,
214  const std::vector<Spectrum>& upShifts,
215  const std::vector<Spectrum>& downShifts,
216  double pot,
217  int col = -1, int errCol = -1,
218  float mayy = 8.0,
219  bool newaxis=true);
220 
221 
222  TGraphAsymmErrors* PlotWithSystErrorBand_Quant(const int quant,
223  TH1*& nominal,
224  std::vector<TH1*>& upShifts,
225  std::vector<TH1*>& downShifts,
226  int col = -1, int errCol = -1,
227  float maxy = 8.0,
228  bool newaxis = true);
229 
230 
231  /// \brief Plot prediction with +/-1sigma shape-only error band
232  ///
233  /// When multiple systematics are used, the errors are the quadrature sum
234  ///
235  /// \param pred The prediction. Must be able to generate shifted spectra
236  /// \param systs List of systematics to include in error band
237  /// \param calc Oscillation parameters
238  /// \param pot POT to evaluate prediction at
239  /// \param col Color of the prediction, default kRed
240  /// \param errCol Color of the shading, default col-7 (kRed-7 is light red)
241  /// \param headroom Fraction of maximum bin for headroom, default 30%
242  void PlotWithAreaSystErrorBand(IPrediction* pred,
243  const std::vector<const ISyst*>& systs,
245  double pot,
246  int col = -1, int errCol = -1,
247  float headroom = 1.3,
248  bool newaxis = true,
249  EBinType bintype = kBinContent);
250 
251  /// \brief Plot prediction with error band where syst(s) is (are) shape-only
252  ///
253  /// When multiple systematics are used, the errors are the quadrature sum.
254  /// Systs are area normalized to nominal.
255  ///
256  /// \param nominal Nominal spectrum
257  /// \param upShifts Vector of spectra which have + shifts
258  /// \param downShifts Vector of spectra which have - shifts, same order as +
259  /// \param pot POT to scale spectra to
260  /// \param col Color of the prediction, default kRed
261  /// \param errCol Color of the shading, default col-7(kRed-7 is light red)
262  /// \param headroom Fraction of maximum bin for headroom, default 30%
263  void PlotWithAreaSystErrorBand(const Spectrum& nominal,
264  std::vector<Spectrum> upShifts, // yup, copy them.
265  std::vector<Spectrum> downShifts, // we need to change their normalizations
266  double pot,
267  int col = -1, int errCol = -1,
268  float headroom = 1.3, bool newaxis=true,
269  EBinType bintype = kBinContent);
270 
271 
272  /// Can call like ToTHStack({{h1, kRed}, {h2, kBlue}}, pot)
273  THStack* ToTHStack(const std::vector<std::pair<const Spectrum&, Color_t>>& s,
274  double pot);
275 
276 
277  /// \brief Create a legend, maximizing distance from all histograms
278  ///
279  /// \param dx Width of the legend, fraction of pad width
280  /// \param dy Height of the legend, fraction of pad height
281  /// \param yPin, height in NDC (frac) to pin center of legend, i.e only move x
282  TLegend* AutoPlaceLegend(double dx, double dy, double yPin = -1);
283 
284  /// \brief Make a simple plot of relative size of different errors
285  ///
286  /// \param systs Map from error label to -, + size
287  /// \param statErr Percentage statistical error. Optional.
288  /// \param label Label you want on the axis.
289  void ErrorBarChart(const std::map<std::string, std::pair<double, double>>& systErrors,
290  const std::pair<double, double> & statErr = std::make_pair(0., 0.),
291  const std::string & label = "Error" );
292 
293  /// \brief Make a simple plot of relative size of different errors
294  ///
295  /// \param systs Map from error label to size in percent
296  /// \param statErr Percentage statistical error. Optional.
297  /// \param bkgdOrSig Label axis for background or signal. Default (false) = bkgd
298  void CountingExperimentErrorBarChart(const std::map<std::string, double>& systs, double statErr = 0, bool bkgdOrSig = false, bool shortchart=false);
299 
300  /// Calculate statistical errors appropriate for small Poisson numbers
301  TGraphAsymmErrors* GraphWithPoissonErrors(const TH1* h, bool noErrorsXaxis = false, bool drawEmptyBins = true);
302 
303  /// Same as above but use a reference histogram to determine which empty bins to draw
304  TGraphAsymmErrors* GraphWithPoissonErrors2(const TH1* h, const TH1* h2, bool noErrorsXaxis = false, bool drawEmptyBins = true);
305 
306  /// Returns graph with the right size of error for a scaled histogram
307  /// Mosty for use in numu reconstructed energy spectra when scaled by 0.1 GeV and binwidth
308  /// But scaleFactor can be of course modified locally
309  /// Takes a the histogram already saled and the original
310  TGraph* graphAsymmErrorScaled(TH1* histScaled, TH1* hist, double overallScale = 0.1);
311 
312  /// Returns graph with the right size of error for a scaled histogram
313  /// Mosty for use in numu reconstructed energy spectra when scaled by 0.1 GeV and binwidth
314  /// But scaleFactor can be of course modified locally
315  /// This implementation is slightly different than graphAsymmErrorScaled as here the
316  /// scaling is manually reversed so there is no need for unscaled hists to be included.
317  /// Takes scaled hists of data and estimated background.
318  TGraph* graphAsymmErrorWithBkgScaled(TH1* data, TH1* bkgd, double overallScale = 0.1);
319 
320  /// Returns graph with the right size of error for a ratio histogram
321  /// Hists need to be unscaled
322  TGraph* RatioAsymmError(TH1* data, TH1* pred);
323 
324  /// Returns graph with the right size of error for a ratio histogram
325  /// For histograms that have been scaled by bin width. This implementation
326  /// is slightly different than graphAsymmErrorScaled as here the scaling is
327  /// manually reversed so there is no need for unscaled hists to be included
328  TGraph* RatioAsymmErrorScaled(TH1* data, TH1* pred, double overallScale = 0.1);
329 
330  /// Returns graph with the right size of error for a ratio histogram
331  /// where you have a measure of the background. Hists need to be unscaled
332  TGraph* RatioAsymmErrorWithBkg(TH1* data, TH1* pred, TH1* bkg);
333 
334  /// Returns graph with the right size of error for a ratio histogram
335  /// where you have a measure of the background. Hists need to be unscaled
336  TGraph* RatioAsymmErrorWithBkgScaled(TH1* data, TH1* pred, TH1* bkg, double overallScale = 0.1);
337 
338  /// Gives a TGraph with the area between two histograms. Do Draw("f") to draw
339  /// this area. By default it has a lighter version of the colour of hmin
340  TGraph* ShadeBetweenHistograms(TH1* hmin, TH1* hmax);
341 
342  /// Calculate profile with error bars corresponding to specified quantiles of a 2D distribution (by default, 68% coverage)
343  TGraphAsymmErrors * ProfileQuantile(const TH2 * hist, const std::string & axis_name, const std::string & graph_name="", const std::pair<double, double> & quantile_divisions={0.159, 0.841});
344 
345 
346  /// Draw a single BF point
347  void drawBFSingle(double bfSin, double bfDm, Color_t color, Style_t marker, double size);
348 
349  /// Draw best fit at both octants. Truth for neutrinos, not sure about antineutrinos
350  void drawBFMirror(double bfSin, double bfDm, Color_t color, Style_t marker, double size);
351 
352  /// Make histogram be ready for use in SplitCanvas_Quant
353  /// Depending the quantile, this sets the axes size to zero so they dont overlay with each other
354  void MakeHistCanvasReady_Quant(const int quant, TH1* hist, double ymax);
355 
356 
357  /// Pimp histogram once and for all
358  void PimpHist(TH1* hist, Style_t linestyle, Color_t linecolor, int linewidth, Style_t markerstyle, Color_t markercolor, double markersize);
359 
360 
361  /// \brief Split the current pad into two vertically stacked pieces, suitable
362  /// for ratio plots and so on.
363  ///
364  /// This is better than TCanvas::Divide() in that it keeps axis label font
365  /// sizes as expected, and doesn't truncate the zero on the top y-axis. It's
366  /// worse in that you won't be able to interact graphically with the bottom
367  /// pad.
368  ///
369  /// \param ysplit The y position (between zero and one) where the current
370  /// pad will be split.
371  /// \param[out] p1 Returns the top canvas created by the function
372  /// \param[out] p2 Returns the bottom canvas created by the function
373  void SplitCanvas(double ysplit, TPad*& p1, TPad*& p2);
374 
375  /// Split canvas in four pads for easy drawing of 4 quantiles
376  /// TO DO: Educate ROOT so it doesnt overlay the x-axes
377  void SplitCanvasQuant(TCanvas *& canvas, TPad *& pad1, TPad *& pad2, TPad *& pad3, TPad *& pad4);
378 
379  void CenterTitles(TH1* histo);
380 
381  /// Create a simple summary of systematic shifts.
382  /// Systematic short names in the X axis, and n sigma in the y axis.
383  /// Paints a TCanvas, and returns a pointer to the TH1 for further editing
384  TH1* PlotSystShifts(const SystShifts & shifts, bool sortName = true);
385 
386  /// Join graphs and set a fill color. Useful for contours
387  TGraph* JoinGraphs(TGraph* a, TGraph* b, int fillcol = 0);
388 
389  /// Add two points to a TGraph so it reaches the top, and set a fill color.
390  /// Default is for a nue dCP x ssth23 contour
391  TGraph* ExtendGraphToTop(TGraph* g, int col = 0, double xmin = 0,
392  double xmax = 2, double y = 1);
393 
394  /// Put the standardized beam label in the left corner of the active canvas
395  TPaveText* DrawBeamLabel(bool isFHC = true);
396 
397  /// Put hadEQuant labels on the active canvas or pad
398  /// quant = 0 is All Quartiles
399  TPaveText* DrawQuantLabel(int quant);
400 
401 
402 }
void PlotWithAreaSystErrorBand(IPrediction *pred, const std::vector< const ISyst * > &systs, osc::IOscCalc *calc, double pot, int col, int errCol, float headroom, bool newaxis, EBinType bintype)
Plot prediction with +/-1sigma shape-only error band.
Definition: Plots.cxx:419
void DataMCRatio(const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc, double miny, double maxy)
Plot data/MC ratio for the given spectrum. Normalize MC to Data by POT.
Definition: Plots.cxx:167
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
std::map< std::string, double > xmax
TH1 * PlotSystShifts(const SystShifts &shifts, bool sortName)
Definition: Plots.cxx:1497
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
void MakeHistCanvasReady_Quant(const int quant, TH1 *hist, double ymax)
Definition: Plots.cxx:1365
double maxy
TGraphAsymmErrors * PlotWithSystErrorBand(IPrediction *pred, const std::vector< const ISyst * > &systs, osc::IOscCalc *calc, double pot, int col, int errCol, float headroom, bool newaxis, EBinType bintype, double alpha)
Plot prediction with +/-1sigma error band.
Definition: Plots.cxx:304
General interface to oscillation calculators.
Definition: StanTypedefs.h:22
TPaveText * DrawQuantLabel(int quant)
Definition: Plots.cxx:1576
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
void CenterTitles(TH1 *histo)
Definition: Plots.cxx:1483
TGraphAsymmErrors * GraphWithPoissonErrors(const TH1 *h, bool noErrorsXaxis, bool drawEmptyBins)
Calculate statistical errors appropriate for small Poisson numbers.
Definition: Plots.cxx:912
void SplitCanvas(double ysplit, TPad *&p1, TPad *&p2)
Split the current pad into two vertically stacked pieces, suitable for ratio plots and so on...
Definition: Plots.cxx:1419
TCanvas * canvas(const char *nm, const char *ti, const char *a)
Definition: pass1_plots.C:36
osc::OscCalcDumb calc
void GetSystBands(osc::IOscCalc *calc, const IPrediction *pred, std::vector< const ISyst * > systs, std::vector< TH1 * > &hUps, std::vector< TH1 * > &hDns, double pot, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign)
Definition: Plots.cxx:244
TGraph * RatioAsymmError(TH1 *data, TH1 *pred)
Definition: Plots.cxx:1069
TGraphAsymmErrors * ProfileQuantile(const TH2 *hist, const std::string &axisName, const std::string &graphName, const std::pair< double, double > &quantileDivisions)
Calculate profile with error bars corresponding to specified quantiles of a 2D distribution (by defau...
Definition: Plots.cxx:1260
const char * label
void PimpHist(TH1 *hist, Style_t linestyle, Color_t linecolor, int linewidth, Style_t markerstyle, Color_t markercolor, double markersize)
Pimp histogram once and for all.
Definition: Plots.cxx:1408
const XML_Char const XML_Char * data
Definition: expat.h:268
Double_t ymax
Definition: plot.C:25
EBinType
Definition: UtilsExt.h:28
void drawBFSingle(double bfSin, double bfDm, Color_t color, Style_t marker, double size=1.5)
Draw a single BF point.
Definition: Plots.cxx:1333
const XML_Char * s
Definition: expat.h:262
Interactions of both types.
Definition: IPrediction.h:42
double dy[NP][NC]
double dx[NP][NC]
void PlotWithSystErrorBandTwoPreds(const Spectrum &nominal, const std::vector< Spectrum > &upShifts, const std::vector< Spectrum > &downShifts, const Spectrum &alternative, const std::vector< Spectrum > &upShiftsAlt, const std::vector< Spectrum > &downShiftsAlt, double pot, int col1, int col2, float headroom, bool newaxis, EBinType bintype)
Plot two different predictions with +/-1sigma shape-only error bands.
Definition: Plots.cxx:470
TH1 * DataMCComparisonAreaNormalized(const Spectrum &data, const Spectrum &mc)
Definition: Plots.cxx:74
TGraph * graphAsymmErrorScaled(TH1 *histScaled, TH1 *hist, double overallScale)
Definition: Plots.cxx:980
TPaveText * DrawBeamLabel(bool isFHC)
Put the standardized beam label in the left corner of the active canvas.
Definition: Plots.cxx:1557
Int_t col[ntarg]
Definition: Style.C:29
const double a
TGraph * ShadeBetweenHistograms(TH1 *hmin, TH1 *hmax)
Definition: Plots.cxx:1236
TGraphAsymmErrors * GraphWithPoissonErrors2(const TH1 *h, const TH1 *h2, bool noErrorsXaxis, bool drawEmptyBins)
Same as above but use a reference histogram to determine which empty bins to draw.
Definition: Plots.cxx:944
#define pot
TGraph * ExtendGraphToTop(TGraph *g, int col, double xmin, double xmax, double y)
Definition: Plots.cxx:1546
TH2D * histo
std::vector< float > Spectrum
Definition: Constants.h:728
Regular histogram.
Definition: UtilsExt.h:30
static bool isFHC
TGraph * JoinGraphs(TGraph *a, TGraph *b, int fillcol)
Join graphs and set a fill color. Useful for contours.
Definition: Plots.cxx:1531
const SystShifts kNoShift
Definition: SystShifts.cxx:22
TH1F * h2
Definition: plot.C:45
TGraph * RatioAsymmErrorWithBkg(TH1 *data, TH1 *pred, TH1 *bkgd)
Definition: Plots.cxx:1150
void CountingExperimentErrorBarChart(const std::map< std::string, double > &systbars, double statErr, bool bkgdOrSig, bool shortchart)
Make a simple plot of relative size of different errors.
Definition: Plots.cxx:898
void DataMCAreaNormalizedRatio(const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc, double miny, double maxy)
Plot data/MC ratio for the given spectrum. Normalize MC to Data by area.
Definition: Plots.cxx:196
TGraph * graphAsymmErrorWithBkgScaled(TH1 *data, TH1 *bkgd, double overallScale)
Definition: Plots.cxx:1022
TH1 * DataMCComparisonComponents(const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc)
Plot MC broken down into flavour components, overlayed with data.
Definition: Plots.cxx:114
TGraphAsymmErrors * PlotWithSystErrorBand_Quant(const int quant, IPrediction *pred, const std::vector< const ISyst * > &systs, osc::IOscCalc *calc, double pot, int col, int errCol, float maxy, bool newaxis)
Definition: Plots.cxx:543
void GetBFSystBands(osc::IOscCalc *calc, const IPrediction *pred, std::vector< const ISyst * > systs, const SystShifts &bfshifts, std::vector< TH1 * > &hUps, std::vector< TH1 * > &hDns, double pot, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign)
Definition: Plots.cxx:271
TGraph * RatioAsymmErrorWithBkgScaled(TH1 *data, TH1 *pred, TH1 *bkgd, double overallScale)
Definition: Plots.cxx:1190
const hit & b
Definition: hits.cxx:21
void ErrorBarChart(const std::map< std::string, std::pair< double, double >> &systErrors, const std::pair< double, double > &statErr, const std::string &label)
Make a simple plot of relative size of different errors.
Definition: Plots.cxx:800
THStack * ToTHStack(const std::vector< std::pair< const Spectrum &, Color_t >> &s, double pot)
Can call like ToTHStack({{h1, kRed}, {h2, kBlue}}, pot)
Definition: Plots.cxx:676
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
TPad * pad3
Definition: analysis.C:13
TLegend * AutoPlaceLegend(double dx, double dy, double yPin)
Create a legend, maximizing distance from all histograms.
Definition: Plots.cxx:717
void SplitCanvasQuant(TCanvas *&canvas, TPad *&pad1, TPad *&pad2, TPad *&pad3, TPad *&pad4)
Definition: Plots.cxx:1439
TGraph * RatioAsymmErrorScaled(TH1 *data, TH1 *pred, double overallScale)
Definition: Plots.cxx:1107
TPad * pad2
Definition: analysis.C:13
TH1 * DataMCComparison(const Spectrum &data, const Spectrum &mc, EBinType bintype)
Definition: Plots.cxx:35
All neutrinos, any flavor.
Definition: IPrediction.h:26
TCanvas * RatioPlot(std::vector< TH1 * > topHistos, std::vector< TString > topOption, std::vector< TH1 * > bottomHistos, std::vector< TString > bottomOption, TString pidtag, bool pidaxis=false)
void drawBFMirror(double bfSin, double bfDm, Color_t color, Style_t marker, double size=1.5)
Draw best fit at both octants. Truth for neutrinos, not sure about antineutrinos. ...
Definition: Plots.cxx:1344
def sign(x)
Definition: canMan.py:197
TPad * pad1
Definition: analysis.C:13
enum BeamMode string