Namespaces | Functions
Plots.h File Reference
#include "CAFAna/Core/FwdDeclare.h"
#include "CAFAna/Core/ISyst.h"
#include "CAFAna/Core/SystShifts.h"
#include "CAFAna/Core/Utilities.h"
#include "CAFAna/Prediction/IPrediction.h"
#include <map>
#include <vector>
#include "Rtypes.h"

Go to the source code of this file.

Namespaces

 ana
 Cuts and Vars for the 2020 FD DiF Study.
 

Functions

TH1 * ana::DataMCComparison (const Spectrum &data, const Spectrum &mc, EBinType bintype)
 
TH1 * ana::DataMCComparison (const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc, const SystShifts &shifts, EBinType bintype)
 
TH1 * ana::DataMCComparisonAreaNormalized (const Spectrum &data, const Spectrum &mc)
 
TH1 * ana::DataMCComparisonAreaNormalized (const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc)
 
TH1 * ana::DataMCComparisonComponents (const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc)
 Plot MC broken down into flavour components, overlayed with data. More...
 
void ana::DataMCAreaNormalizedRatio (const Spectrum &data, const Spectrum &mc, double miny=0, double maxy=3)
 Plot data/MC ratio for the given spectrum. Normalize MC to Data by area. More...
 
void ana::DataMCAreaNormalizedRatio (const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc, double miny=0, double maxy=3)
 Plot data/MC ratio for the given spectrum. Normalize MC to Data by area. More...
 
void ana::DataMCRatio (const Spectrum &data, const Spectrum &mc, double miny=0, double maxy=3)
 Plot data/MC ratio for the given spectrum. Normalize MC to Data by POT. More...
 
void ana::DataMCRatio (const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc, double miny=0, double maxy=3)
 Plot data/MC ratio for the given spectrum. Normalize MC to Data by POT. More...
 
void ana::RatioPlot (const Spectrum &data, const Spectrum &expected, const Spectrum &fit, double miny=0, double maxy=1.2)
 Plot data/expected, compared with fit/expected. More...
 
void ana::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)
 
void ana::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)
 
TGraphAsymmErrors * ana::PlotWithSystErrorBand (IPrediction *pred, const std::vector< const ISyst * > &systs, osc::IOscCalc *calc, double pot, int col=-1, int errCol=-1, float headroom=1.3, bool newaxis=true, EBinType bintype=kBinContent)
 Plot prediction with +/-1sigma error band. More...
 
TGraphAsymmErrors * ana::PlotWithSystErrorBand (const Spectrum &nominal, const std::vector< Spectrum > &upShifts, const std::vector< Spectrum > &downShifts, double pot, int col=-1, int errCol=-1, float headroom=1.3, bool newaxis=true, EBinType bintype=kBinContent)
 Plot prediction with error band. More...
 
TGraphAsymmErrors * ana::PlotWithSystErrorBand (TH1 *&nom, std::vector< TH1 * > &ups, std::vector< TH1 * > &dns, int col, int errCol, float headroom, bool newaxis)
 
void ana::PlotWithSystErrorBandTwoPreds (const Spectrum &nominal, const std::vector< Spectrum > &upShifts, const std::vector< Spectrum > &downShifts, const Spectrum &nominal2, const std::vector< Spectrum > &upShifts2, const std::vector< Spectrum > &downShifts2, double pot, int col=-1, int errCol=-1, float headroom=1.3, bool newaxis=true, EBinType bintype=kBinContent)
 Plot two different predictions with +/-1sigma shape-only error bands. More...
 
TGraphAsymmErrors * ana::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)
 
TGraphAsymmErrors * ana::PlotWithSystErrorBand_Quant (const int quant, const Spectrum &nominal, const std::vector< Spectrum > &upShifts, const std::vector< Spectrum > &downShifts, double pot, int col, int errCol, float maxy, bool newaxis)
 
TGraphAsymmErrors * ana::PlotWithSystErrorBand_Quant (const int quant, TH1 *&nom, std::vector< TH1 * > &ups, std::vector< TH1 * > &dns, int col, int errCol, float maxy, bool newaxis)
 
void ana::PlotWithAreaSystErrorBand (IPrediction *pred, const std::vector< const ISyst * > &systs, osc::IOscCalc *calc, double pot, int col=-1, int errCol=-1, float headroom=1.3, bool newaxis=true, EBinType bintype=kBinContent)
 Plot prediction with +/-1sigma shape-only error band. More...
 
void ana::PlotWithAreaSystErrorBand (const Spectrum &nominal, std::vector< Spectrum > upShifts, std::vector< Spectrum > downShifts, double pot, int col=-1, int errCol=-1, float headroom=1.3, bool newaxis=true, EBinType bintype=kBinContent)
 Plot prediction with error band where syst(s) is (are) shape-only. More...
 
THStack * ana::ToTHStack (const std::vector< std::pair< const Spectrum &, Color_t >> &s, double pot)
 Can call like ToTHStack({{h1, kRed}, {h2, kBlue}}, pot) More...
 
TLegend * ana::AutoPlaceLegend (double dx, double dy, double yPin=-1)
 Create a legend, maximizing distance from all histograms. More...
 
void ana::ErrorBarChart (const std::map< std::string, std::pair< double, double >> &systErrors, const std::pair< double, double > &statErr=std::make_pair(0., 0.), const std::string &label="Error")
 Make a simple plot of relative size of different errors. More...
 
void ana::CountingExperimentErrorBarChart (const std::map< std::string, double > &systs, double statErr=0, bool bkgdOrSig=false, bool shortchart=false)
 Make a simple plot of relative size of different errors. More...
 
TGraphAsymmErrors * ana::GraphWithPoissonErrors (const TH1 *h, bool noErrorsXaxis=false, bool drawEmptyBins=true)
 Calculate statistical errors appropriate for small Poisson numbers. More...
 
TGraphAsymmErrors * ana::GraphWithPoissonErrors2 (const TH1 *h, const TH1 *h2, bool noErrorsXaxis=false, bool drawEmptyBins=true)
 Same as above but use a reference histogram to determine which empty bins to draw. More...
 
TGraph * ana::graphAsymmErrorScaled (TH1 *histScaled, TH1 *hist, double overallScale)
 
TGraph * ana::graphAsymmErrorWithBkgScaled (TH1 *data, TH1 *bkgd, double overallScale)
 
TGraph * ana::RatioAsymmError (TH1 *data, TH1 *pred)
 
TGraph * ana::RatioAsymmErrorScaled (TH1 *data, TH1 *pred, double overallScale)
 
TGraph * ana::RatioAsymmErrorWithBkg (TH1 *data, TH1 *pred, TH1 *bkgd)
 
TGraph * ana::RatioAsymmErrorWithBkgScaled (TH1 *data, TH1 *pred, TH1 *bkgd, double overallScale)
 
TGraph * ana::ShadeBetweenHistograms (TH1 *hmin, TH1 *hmax)
 
TGraphAsymmErrors * ana::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})
 Calculate profile with error bars corresponding to specified quantiles of a 2D distribution (by default, 68% coverage) More...
 
void ana::drawBFSingle (double bfSin, double bfDm, Color_t color, Style_t marker, double size)
 Draw a single BF point. More...
 
void ana::drawBFMirror (double bfSin, double bfDm, Color_t color, Style_t marker, double size)
 Draw best fit at both octants. Truth for neutrinos, not sure about antineutrinos. More...
 
void ana::MakeHistCanvasReady_Quant (const int quant, TH1 *hist, double ymax)
 
void ana::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. More...
 
void ana::SplitCanvas (double ysplit, TPad *&p1, TPad *&p2)
 Split the current pad into two vertically stacked pieces, suitable for ratio plots and so on. More...
 
void ana::SplitCanvasQuant (TCanvas *&canvas, TPad *&pad1, TPad *&pad2, TPad *&pad3, TPad *&pad4)
 
void ana::CenterTitles (TH1 *histo)
 
TH1 * ana::PlotSystShifts (const SystShifts &shifts, bool sortName)
 
TGraph * ana::JoinGraphs (TGraph *a, TGraph *b, int fillcol=0)
 Join graphs and set a fill color. Useful for contours. More...
 
TGraph * ana::ExtendGraphToTop (TGraph *g, int col, double xmin, double xmax, double y)
 
TPaveText * ana::DrawBeamLabel (bool isFHC=true)
 Put the standardized beam label in the left corner of the active canvas. More...
 
TPaveText * ana::DrawQuantLabel (int quant)