make_extrap_figure_hists.C
Go to the documentation of this file.
1 // This is the macro to make the inputs for make_extrap_figure.C
2 //
3 // It sets up the very simplest numu extrapolation and dumps the debug
4 // histograms.
5 
6 #include "CAFAna/Core/Loaders.h"
7 #include "CAFAna/Core/OscCurve.h"
15 #include "CAFAna/Analysis/Calcs.h"
16 using namespace ana;
17 
18 #include "OscLib/IOscCalc.h"
19 
20 #include "TFile.h"
21 
22 #include <iostream>
23 
24 const double pot = 9e20;
25 
27 {
28  const std::string fname("prod_sumdecaf_R17-03-01-prod3reco.k_fd_genie_nonswap_fhc_nova_v08_full_nue_or_numu_or_nus_contain_v1");
29  const std::string fnameSwap("prod_sumdecaf_R17-03-01-prod3reco.k_fd_genie_fluxswap_fhc_nova_v08_full_nue_or_numu_or_nus_contain_v1");
30  const std::string fnameTau("prod_sumdecaf_R17-03-01-prod3reco.k_fd_genie_tau_fhc_nova_v08_full_nue_or_numu_or_nus_contain_v1");
31 
32  const std::string fnameNDData("prod_sumdecaf_R17-03-01-prod3reco.h_nd_numi_fhc_full_nue_or_numu_or_nus_contain_v1_goodruns");
33  const std::string fnameNDMC("prod_sumdecaf_R17-03-01-prod3reco.d_nd_genie_nonswap_fhc_nova_v08_full_nue_or_numu_or_nus_contain_v1");
34 
36 
37  loaders.SetLoaderPath(fname, caf::kFARDET, Loaders::kMC,
39  loaders.SetLoaderPath(fnameSwap, caf::kFARDET, Loaders::kMC,
41  loaders.SetLoaderPath(fnameTau, caf::kFARDET, Loaders::kMC,
43  loaders.SetLoaderPath(fnameNDData, caf::kNEARDET, Loaders::kData);
44  loaders.SetLoaderPath(fnameNDMC, caf::kNEARDET, Loaders::kMC);
45 
47 
48  const HistAxis axis("Reconstructed Energy (GeV)", kNumuEnergyBinning, kCCE);
49 
51 
52  IPrediction* pred = gen.Generate(loaders).release();
53 
54 
55  loaders.Go();
56 
57 
58  TFile* fout = new TFile("extrap_hists.root", "RECREATE");
59 
61 
62  extrap->SavePlotsNumu(fout, pot);
63 
65 
66  OscCurve curve(calc, 14, 14);
67  curve.ToTH1()->Write("osc");
68 
69  std::cout << "Wrote extrap_hists.root" << std::endl;
70 }
Near Detector underground.
Definition: SREnums.h:10
Far Detector at Ash River.
Definition: SREnums.h:11
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kPPFXFluxCVWgt
Definition: PPFXWeights.h:16
string fnameSwap
Definition: demo4.py:6
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
General interface to oscillation calculators.
Definition: StanTypedefs.h:23
const Cut kNumuFD
Definition: NumuCuts.h:53
osc::OscCalcDumb calc
osc::IOscCalcAdjustable * DefaultOscCalc()
Create a new calculator with default assumptions for all parameters.
Definition: Calcs.cxx:49
Generates extrapolated Numu predictions.
void Go()
Call Go() on all the loaders.
Definition: Loaders.cxx:162
void SetSpillCut(const SpillCut &cut)
Definition: Loaders.cxx:121
void SavePlotsNumu(TDirectory *dir, double potFD) const
const Binning kNumuEnergyBinning
Definition: Binnings.cxx:13
TH1D * ToTH1(bool title=false) const
Definition: OscCurve.cxx:59
const Cut kNumuND
Definition: NumuCuts.h:55
const Var kCCE
Definition: NumuVars.h:21
std::unique_ptr< IPrediction > Generate(Loaders &loaders, const SystShifts &shiftMC=kNoShift) const override
const SystShifts kNoShift
Definition: SystShifts.cxx:22
OStream cout
Definition: OStream.cxx:6
Transition probability for any one channel as a function of energy.
Definition: OscCurve.h:11
std::vector< Loaders * > loaders
Definition: syst_header.h:386
void GetExtrap(PredictionNoExtrap *all, PredictionNoExtrap *sel, osc::IOscCalc *calc, TString title)
void make_extrap_figure_hists(string ana="nue")
Standard interface to all prediction techniques.
Definition: IPrediction.h:57
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
Take the output of an extrapolation and oscillate it as required.
const Var kXSecCVWgt2017
Definition: XsecTunes.h:36
Extrapolate each component using a separate ModularExtrapComponent.
Definition: ModularExtrap.h:23
void SetLoaderPath(const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via wildcard path.
Definition: Loaders.cxx:25
const double pot
enum BeamMode string