#include "TCanvas.h"
#include "TFile.h"
#include "TGraph.h"
#include "TGraphAsymmErrors.h"
#include "TH1D.h"
#include "TLine.h"
#include "TLatex.h"
#include "TLegend.h"
#include "TStyle.h"
#include "TSystem.h"
#include "CAFAna/Analysis/Exposures.h"
#include "CAFAna/Analysis/Plots.h"
#include "CAFAna/Core/Binning.h"
#include "CAFAna/Core/Spectrum.h"
#include "CAFAna/Core/SpectrumLoader.h"
#include "OscLib/OscCalcPMNSOpt.h"
#include "CAFAna/Analysis/Calcs.h"
#include "CAFAna/Prediction/PredictionNoExtrap.h"
#include "Utilities/rootlogon.C"
#include "TFeldmanCousins.h"
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <string>
#include <TROOT.h>
Go to the source code of this file.
Classes | |
struct | LoadedHistograms |
Functions | |
LoadedHistograms | LoadFile_GetHists (TFile *InFile, std::string CTier, int FileType) |
TH1D * | GetSpectToHist (TFile *MyF, std::string LoadName, std::string Axis, int FileType) |
void | ProducePlots (std::vector< LoadedHistograms > AllTheHists, std::string CTier) |
TGraph * | graphAsymmError (TH1 *hDataScaled, TH1 *hData) |
TH1D * | MakeRatio (TH1D *num, TH1D *denom, int Col, std::string FType) |
void | SetRange (std::vector< TH1D * > Histos, std::vector< TH1D * > Ratios, double XLow, double XHigh, double H_YLow, double H_YHigh, double R_YLow, double R_YHigh) |
void | FindAxisRange (double &XLow, double &XHigh, double &H_YLow, double &H_YHigh, double &R_YLow, double &R_YHigh, double MaxVal, bool &SetLogy, std::string Name) |
void | MakeSplitCans (std::string PlotName, std::string CutTier, std::string CanTitle, std::string PlotDir, TFile *OutFile, std::vector< TH1D * > Hists) |
void | PlotHistProp (TH1D *Hist, TLegend *L) |
void | CornerLabel (std::string Str) |
void | MakeTextFile (std::string Cut, std::string PTitle, std::string Name) |
void | MakeThePlots (bool Horn, bool FullDataset=true, bool UsingCAFs=false) |
Variables | |
double | POTNom = 1 |
double | LivNom = 1 |
bool | IsFHC = true |
bool | AllPer = true |
std::string | sFHC = "fhc" |
std::string | sPer = "full" |
const int | NumCut = 4 |
const std::string | CutNames [NumCut] |
const int | NumQuant = 5 |
const std::string | QuantNames [NumQuant] |
unsigned int | NPlot = 5 |
const int | Colours [5] = { kBlack , kViolet-5 , kGreen-6 , kGray+1 , kAzure+1 } |
std::string | LegNames [5] = { "FD data", "Best Fit Pred", "Wrong Sign", "Total Bkg.", "Cosmic Bkg." } |
const bool | SingleCut = true |
const bool | SingleQuant = false |
const bool | PlotMean = false |
const bool | PlotTest = false |
const bool | SaveRatio = false |
const bool | SaveHists = true |
const std::string | CornName [4] = { "TopL", "TopR", "BotL", "BotR" } |
void CornerLabel | ( | std::string | Str | ) |
Definition at line 687 of file MakeThePlots.C.
Referenced by MakeSplitCans().
void FindAxisRange | ( | double & | XLow, |
double & | XHigh, | ||
double & | H_YLow, | ||
double & | H_YHigh, | ||
double & | R_YLow, | ||
double & | R_YHigh, | ||
double | MaxVal, | ||
bool & | SetLogy, | ||
std::string | Name | ||
) |
Definition at line 497 of file MakeThePlots.C.
References IsFHC.
Referenced by MakeSplitCans().
TH1D * GetSpectToHist | ( | TFile * | MyF, |
std::string | LoadName, | ||
std::string | Axis, | ||
int | FileType | ||
) |
Definition at line 338 of file MakeThePlots.C.
References Add(), std::asin(), calc, ana::CenterTitles(), IsFHC, ana::Flavors::kAll, ana::Flavors::kAllNuE, ana::Flavors::kAllNuMu, ana::Flavors::kAllNuTau, ana::Sign::kAntiNu, ana::Sign::kBoth, ana::Current::kCC, ana::kLivetime, ana::Current::kNC, ana::Sign::kNu, ana::Flavors::kNuEToNuMu, LivNom, ana::PredictionNoExtrap::LoadFrom(), ana::Spectrum::LoadFrom(), M_PI, POTNom, ana::ResetOscCalcToDefault(), std::sqrt(), and wrongs.
Referenced by LoadFile_GetHists().
TGraph* graphAsymmError | ( | TH1 * | hDataScaled, |
TH1 * | hData | ||
) |
Definition at line 412 of file MakeThePlots.C.
References bin, make_associated_cosmic_defs::fc, and submit_syst::y.
Referenced by MakeSplitCans().
LoadedHistograms LoadFile_GetHists | ( | TFile * | InFile, |
std::string | CTier, | ||
int | FileType | ||
) |
Definition at line 254 of file MakeThePlots.C.
References CornName, GetSpectToHist(), LoadedHistograms::hCor_HadEn, LoadedHistograms::hCor_HFrEn, LoadedHistograms::hCor_MuoEn, LoadedHistograms::hCor_RecEn, LoadedHistograms::hCVNCosmicScor, LoadedHistograms::hCVNNuMuID2017, LoadedHistograms::hCVNNuMuIDScor, LoadedHistograms::hFirstHitCell, LoadedHistograms::hHadFracEnergy, LoadedHistograms::hHadroEnPerHit, LoadedHistograms::hHadronEnergy, LoadedHistograms::hHitsPerSlice, LoadedHistograms::hKalMostBakCel, LoadedHistograms::hKalMostFwdCel, LoadedHistograms::hKalTrBeamAng, LoadedHistograms::hKalTrDir_Y, LoadedHistograms::hKalTrLength, LoadedHistograms::hKalTrVer_MaxY, LoadedHistograms::hKalTrVer_MaxZ, LoadedHistograms::hLastHitCell, LoadedHistograms::hMaxActivity_Y, LoadedHistograms::hMaxActivity_Z, LoadedHistograms::hMinActivity_Y, LoadedHistograms::hMinActivity_Z, LoadedHistograms::hMinCellToEdge, LoadedHistograms::hMuonEnergy, LoadedHistograms::hMuonEnPerHit, LoadedHistograms::hNumKalTracks, LoadedHistograms::hNumKalTrHits, LoadedHistograms::hNuMuContPID, LoadedHistograms::hRatKalHitSlc, LoadedHistograms::hReconstEnergy, LoadedHistograms::hRemIDdEdxLLH, LoadedHistograms::hRemIDMeasFrac, LoadedHistograms::hRemIDScatLLH, LoadedHistograms::hRemIDScore, LoadedHistograms::hReTrOverTrNuE, LoadedHistograms::hSANuMuContPID, LoadedHistograms::hScattKalTrLen, LoadedHistograms::hSliceTimeFull, LoadedHistograms::hSliceTimeZoom, LoadedHistograms::hTrkEndX, LoadedHistograms::hTrkEndY, LoadedHistograms::hTrkEndZ, LoadedHistograms::hTrkLenXY, LoadedHistograms::hTrkStartX, LoadedHistograms::hTrkStartY, LoadedHistograms::hTrkStartZ, LoadedHistograms::hTrueNuEnergy, IsFHC, sPer, and string.
Referenced by MakeThePlots().
TH1D* MakeRatio | ( | TH1D * | num, |
TH1D * | denom, | ||
int | Col, | ||
std::string | FType | ||
) |
Definition at line 442 of file MakeThePlots.C.
References ana::CenterTitles(), and art::to_string().
Referenced by MakeSplitCans().
void MakeSplitCans | ( | std::string | PlotName, |
std::string | CutTier, | ||
std::string | CanTitle, | ||
std::string | PlotDir, | ||
TFile * | OutFile, | ||
std::vector< TH1D * > | Hists | ||
) |
Definition at line 714 of file MakeThePlots.C.
References Add(), AddEntry(), cd(), plot_validation_datamc::Clone(), Colours, CornerLabel(), Draw(), FindAxisRange(), make_mec_shifts_plots::GetMaximum(), GetXaxis(), graphAsymmError(), ana::GraphWithPoissonErrors(), analysePickle::hist, IsFHC, LegNames, MakeRatio(), MakeTextFile(), NPlot, PlotMean, Preliminary(), Rebin(), SaveAs(), Scale(), SetBorderSize(), SetFillColor(), SetFillStyle(), SetLineColor(), SetLineWidth(), SetLogy(), SetMarkerStyle(), SetRange(), SetTextSize(), string, and Write().
Referenced by ProducePlots().
void MakeTextFile | ( | std::string | Cut, |
std::string | PTitle, | ||
std::string | Name | ||
) |
Definition at line 696 of file MakeThePlots.C.
References om::cout, allTimeWatchdog::endl, confusionMatrixTree::out, and string.
Referenced by MakeSplitCans().
void MakeThePlots | ( | bool | Horn, |
bool | FullDataset = true , |
||
bool | UsingCAFs = false |
||
) |
Definition at line 174 of file MakeThePlots.C.
References AllPer, om::cout, cut, CutNames, allTimeWatchdog::endl, IsFHC, LegNames, LivNom, LoadFile_GetHists(), ana::Spectrum::LoadFrom(), NumCut, NumQuant, POTNom, ProducePlots(), QuantNames, sFHC, SingleCut, SingleQuant, sPer, and string.
void PlotHistProp | ( | TH1D * | Hist, |
TLegend * | L | ||
) |
Definition at line 677 of file MakeThePlots.C.
References AddEntry().
void ProducePlots | ( | std::vector< LoadedHistograms > | AllTheHists, |
std::string | CTier | ||
) |
Definition at line 990 of file MakeThePlots.C.
References om::cout, allTimeWatchdog::endl, MakeSplitCans(), NPlot, OutFile, sFHC, sPer, and string.
Referenced by MakeThePlots().
void SetRange | ( | std::vector< TH1D * > | Histos, |
std::vector< TH1D * > | Ratios, | ||
double | XLow, | ||
double | XHigh, | ||
double | H_YLow, | ||
double | H_YHigh, | ||
double | R_YLow, | ||
double | R_YHigh | ||
) |
Definition at line 468 of file MakeThePlots.C.
References GetXaxis(), GetYaxis(), analysePickle::hist, and NPlot.
Referenced by MakeSplitCans().
bool AllPer = true |
Definition at line 109 of file MakeThePlots.C.
Referenced by MakeThePlots().
Definition at line 132 of file MakeThePlots.C.
Referenced by MakeSplitCans().
const std::string CornName[4] = { "TopL", "TopR", "BotL", "BotR" } |
Definition at line 144 of file MakeThePlots.C.
Referenced by LoadFile_GetHists().
const std::string CutNames[NumCut] |
Definition at line 114 of file MakeThePlots.C.
Referenced by MakeThePlots().
bool IsFHC = true |
Definition at line 108 of file MakeThePlots.C.
Referenced by FindAxisRange(), GetSpectToHist(), LoadFile_GetHists(), MakeSplitCans(), and MakeThePlots().
std::string LegNames[5] = { "FD data", "Best Fit Pred", "Wrong Sign", "Total Bkg.", "Cosmic Bkg." } |
Definition at line 133 of file MakeThePlots.C.
Referenced by MakeSplitCans(), and MakeThePlots().
double LivNom = 1 |
Definition at line 107 of file MakeThePlots.C.
Referenced by GetSpectToHist(), and MakeThePlots().
unsigned int NPlot = 5 |
Definition at line 130 of file MakeThePlots.C.
Referenced by MakeSplitCans(), ProducePlots(), and SetRange().
const int NumCut = 4 |
Definition at line 113 of file MakeThePlots.C.
Referenced by MakeThePlots().
const int NumQuant = 5 |
Definition at line 121 of file MakeThePlots.C.
Referenced by MakeThePlots().
const bool PlotMean = false |
Definition at line 138 of file MakeThePlots.C.
Referenced by MakeSplitCans().
const bool PlotTest = false |
Definition at line 139 of file MakeThePlots.C.
double POTNom = 1 |
Definition at line 106 of file MakeThePlots.C.
Referenced by GetSpectToHist(), and MakeThePlots().
const std::string QuantNames[NumQuant] |
Definition at line 122 of file MakeThePlots.C.
Referenced by MakeThePlots().
const bool SaveHists = true |
Definition at line 141 of file MakeThePlots.C.
const bool SaveRatio = false |
Definition at line 140 of file MakeThePlots.C.
std::string sFHC = "fhc" |
Definition at line 110 of file MakeThePlots.C.
Referenced by MakeThePlots(), and ProducePlots().
const bool SingleCut = true |
Definition at line 136 of file MakeThePlots.C.
Referenced by MakeThePlots().
const bool SingleQuant = false |
Definition at line 137 of file MakeThePlots.C.
Referenced by MakeThePlots().
std::string sPer = "full" |
Definition at line 111 of file MakeThePlots.C.
Referenced by Compare_NoExtrap(), Compare_Spectra(), LoadFile_GetHists(), MakeThePlots(), and ProducePlots().