test_nuwro.C
Go to the documentation of this file.
1 #include "CAFAna/Core/Binning.h"
2 #include "CAFAna/Core/Ratio.h"
3 #include "CAFAna/Core/Spectrum.h"
7 #include "CAFAna/Vars/Vars.h"
9 
10 using namespace ana;
11 
12 #include "TCanvas.h"
13 #include "TH1.h"
14 
15 void test_nuwro()
16 {
17  SpectrumLoader loader("$NOVA_PROD/mc/FA14-12-29/genie/nd/caf/000103/10377/neardet_genie_fhc_nonswap*s9*.caf.root");
18 
19  HistAxis axis("Reconstructed energy (GeV)", kNumuEnergyBinning, kCCE);
20 
21  Spectrum sNom(loader, axis, kNumuND, kNoShift);
22  Spectrum sUp(loader, axis, kNumuND, SystShifts(&kNuWROReweightEnu, +1));
23  Spectrum sDn(loader, axis, kNumuND, SystShifts(&kNuWROReweightEnu, -1));
24 
25  loader.Go();
26 
27  sNom.ToTH1(18e20)->Draw("hist");
28 
29  TH1* hup = sUp.ToTH1(18e20);
30  hup->SetLineColor(kRed);
31  hup->Draw("hist same");
32 
33  TH1* hdn = sDn.ToTH1(18e20);
34  hdn->SetLineColor(kBlue);
35  hdn->Draw("hist same");
36 
37  new TCanvas;
38  Ratio rUp(sUp, sNom);
39  TH1* hrup = rUp.ToTH1();
40  hrup->SetLineColor(kRed);
41  hrup->Draw("hist");
42  hrup->GetYaxis()->SetRangeUser(.8, 1.2);
43  Ratio rDn(sDn, sNom);
44  TH1* hrdn = rDn.ToTH1();
45  hrdn->SetLineColor(kBlue);
46  hrdn->Draw("hist same");
47 }
enum BeamMode kRed
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
TH1D * ToTH1(Color_t col=kBlack, Style_t style=kSolid) const
Definition: Ratio.cxx:67
TH1D * ToTH1(double exposure, Color_t col=kBlack, Style_t style=kSolid, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Histogram made from this Spectrum, scaled to some exposure.
Definition: Spectrum.cxx:176
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:39
void test_nuwro()
Definition: test_nuwro.C:15
const Binning kNumuEnergyBinning
Definition: Binnings.cxx:13
const Cut kNumuND
Definition: NumuCuts.h:55
const Var kCCE
Definition: NumuVars.h:21
virtual void Go() override
Load all the registered spectra.
loader
Definition: demo0.py:10
Represent the ratio between two spectra.
Definition: Ratio.h:8
const SystShifts kNoShift
Definition: SystShifts.cxx:22
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const NuWROSyst kNuWROReweightEnu(NuWROSyst::EReweightVar::kEnu)
Definition: NuWROSysts.h:60
enum BeamMode kBlue