10 #include "CAFAna/Core/Var.h" 25 gStyle->SetStatFormat(
"6.3g");
26 gStyle->SetPaintTextFormat(
"6.3g");
27 gStyle->SetFitFormat(
"6.3g");
28 gStyle->SetTitleOffset(1.15,
"x");
29 gStyle->SetTitleOffset(0.95,
"y");
30 gStyle->SetPadLeftMargin(0.12);
31 gStyle->SetPadBottomMargin(0.15);
32 gStyle->SetHistLineWidth(3);
49 geniefiles =
"prod_sumdecaf_R17-11-14-prod4reco" + prodgen +
"_fd_genie_nonswap_" + horn +
"_nova_v08_full_v1_numu2018";
50 outfile = horn +
"_energyResolution_numu2018.root";
54 if(sr->
mc.
nnu == 0)
return -10.0;
59 quantpath =
"/nova/ana/nu_mu_ana/Ana2018/Quantiles/quantiles__" + horn +
"_full__numu2018.root";
60 TFile* quantfile = TFile::Open(
pnfs2xrootd(quantpath).c_str());
61 TH2* quanthist = (TH2*)quantfile->FindObjectAny(
"FDSpec2D");
75 std::map< TString, Spectrum* > specMap;
87 TFile
fout(outfile.c_str(),
"recreate");
88 TH1D*
histTotal = specTotal -> ToTH1(pot);
89 histTotal ->
Write(
"rmtot_comb");
92 TH1D*
hist = specMap[Form(
"rmtot_q%d",(
i+1))] -> ToTH1(pot);
93 hist ->
Write(Form(
"rmtot_q%d",(
i+1)));
103 TFile
fout(outfile.c_str());
107 TCanvas*
c =
new TCanvas();
108 TLegend *
leg =
new TLegend(0.15,0.45,0.48,0.85);
109 histTotal ->
GetYaxis() -> SetRangeUser(0, 1.3 * histTotal->GetMaximum());
110 histTotal ->
Draw(
"hist");
111 histTotal ->
GetXaxis() -> CenterTitle();
112 double rms = histTotal -> GetRMS();
113 double mean = histTotal -> GetMean();
114 leg ->
AddEntry(histTotal,
"Combined",
"l");
115 leg ->
AddEntry(histTotal, Form(
"Mean:%.03lf, RMS:%.03lf",mean,rms),
"l");
118 TH1D*
hist = (TH1D*)
fout.Get(Form(
"rmtot_q%d",(
i+1)));
121 hist ->
Draw(
"histsame");
122 double rms = hist -> GetRMS();
123 double mean = hist -> GetMean();
124 leg ->
AddEntry(hist, Form(
"Q%d",(
i+1)),
"l");
125 leg ->
AddEntry(hist, Form(
"Mean:%.03lf, RMS:%.03lf",mean,rms),
"l");
130 c ->
SaveAs((horn+
"_energyResSpec.pdf").c_str());
bin1_2sigma SetFillColor(3)
Cuts and Vars for the 2020 FD DiF Study.
correl_xv GetYaxis() -> SetDecimals()
Proxy for caf::StandardRecord.
const HistAxis kHadEFracAxis("E_{had.} / E_{#nu}", Binning::Simple(200, 0, 1), kHadEFrac)
HistAxis that implements Hadronic Energy fraction binning used by L.Vinton to derive Hadronic Energy ...
caf::Proxy< short int > nnu
void SetSpillCut(const SpillCut &cut)
std::string pnfs2xrootd(std::string loc, bool unauth)
ntuple SetFillStyle(1001)
Representation of a spectrum in any variable, with associated POT.
const double kAna2018RHCPOT
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
const Var kTrueE([](const caf::SRProxy *sr){assert(sr->mc.nnu==1);return sr->mc.nu[0].E;})
correl_xv GetXaxis() -> SetDecimals()
leg AddEntry(GRdata,"data","p")
virtual void Go() override
Load all the registered spectra.
std::vector< float > Spectrum
const HistAxis kNumuCCOptimisedAxis("Reconstructed Neutrino Energy (GeV)", kNumuCCEOptimisedBinning, kCCE)
HistAxis that implements optimised numuCCE from L. Vinton. See docdb 16332. This was close to 'custC'...
const SystShifts kNoShift
caf::Proxy< caf::SRTruthBranch > mc
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
std::vector< Cut > QuantileCutsFromTH2(TH2 *quantileHist, const HistAxis &independentAxis, const HistAxis &quantileAxis, const unsigned int &numQuantiles, const bool verbose)
: Do the same as the QuantileCuts function but taking in the TH2 instead of making it...
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
const double kAna2018FHCPOT
Prevent histograms being added to the current directory.
cosmicTree SaveAs("cosmicTree.root")
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
const double kAna2018FHCLivetime
void energyResolution(bool fhc=true, bool isFirstRun=false)
const double kAna2018RHCLivetime