All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Functions
Plots.cxx File Reference
#include "sbnana/CAFAna/Analysis/Plots.h"
#include "sbnana/CAFAna/Analysis/Style.h"
#include "sbnana/CAFAna/Prediction/IPrediction.h"
#include "sbnana/CAFAna/Core/Ratio.h"
#include "sbnana/CAFAna/Core/Spectrum.h"
#include "sbnana/CAFAna/Core/SystShifts.h"
#include "sbnana/CAFAna/Core/MathUtil.h"
#include "TCanvas.h"
#include "TFeldmanCousins.h"
#include "TGraph.h"
#include "TGraphAsymmErrors.h"
#include "TH1.h"
#include "TH2.h"
#include "THStack.h"
#include "TLegend.h"
#include "TLine.h"
#include "TList.h"
#include <algorithm>
#include <iostream>
#include <cmath>
#include <ctime>
#include <functional>
#include <memory>

Go to the source code of this file.

Namespaces

 ana
 Oscillation analysis framework, runs over CAF files outside of ART.
 

Functions

TH1 * ana::DataMCComparison (const Spectrum &data, const Spectrum &mc)
 
TH1 * ana::DataMCComparisonAreaNormalized (const Spectrum &data, const Spectrum &mc)
 
TH1 * ana::DataMCComparisonComponents (const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc)
 Plot MC broken down into flavour components, overlayed with data. More...
 
TH1 * ana::GetMCSystTotal (const IPrediction *mc, osc::IOscCalc *calc, const SystShifts &shift, std::string hist_name, double pot, bool force1D)
 
TH1 * ana::GetMCTotal (const IPrediction *mc, osc::IOscCalc *calc, std::string hist_name, double pot, bool force1D)
 
std::vector< TH1 * > ana::GetMCComponents (const IPrediction *mc, osc::IOscCalc *calc, std::string hist_name, double pot, bool force1D)
 
std::vector< TH1 * > ana::GetMCSystComponents (const IPrediction *mc, osc::IOscCalc *calc, const SystShifts &shift, std::string hist_name, double pot, bool force1D)
 
std::vector< TH1 * > ana::GetMCTotalForSystShifts (const IPrediction *mc, osc::IOscCalc *calc, const ISyst *syst, std::string hist_base_name, double pot, bool force1D)
 
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::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::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::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::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::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)
 Plot prediction with +/-1sigma error band. More...
 
void 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)
 Plot prediction with error band. More...
 
THStack * ana::ToTHStack (const std::vector< std::pair< Spectrum, Color_t >> &s, double pot)
 Can call like ToTHStack({{h1, kRed}, {h2, kBlue}}, pot) More...
 
double ana::PointDistanceToBox (double x, double y, double x0, double y0, double x1, double y1)
 Helper for AutoPlaceLegend. More...
 
TLegend * ana::AutoPlaceLegend (double dx, double dy, double yPin=-1)
 Create a legend, maximizing distance from all histograms. More...
 
TGraphAsymmErrors * ana::GraphWithPoissonErrors (const TH1 *h, bool noErrorsXaxis=false, bool drawEmptyBins=true)
 Calculate statistical errors appropriate for small Poisson numbers. More...
 
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...