NueExtrap.C
Go to the documentation of this file.
1 #include "CAFAna/Core/Spectrum.h"
3 
4 #include "CAFAna/Cuts/Cuts.h"
9 
11 #include "CAFAna/Vars/Vars.h"
15 
19 
20 #include "CAFAna/Core/Loaders.h"
22 #include "TFile.h"
23 
24 #include <iostream>
25 #include <cmath>
26 using namespace ana;
27 
28 void NueExtrap(string beam = "fhc", string cvntype = "oldpresel")
29 {
30 
32  auto cut_numund = kNumu2020ND;
33  auto axis_nue = kNue2020Axis;
34  auto axis_nue_merged = kNue2020AxisMergedPeripheral;
35  auto cut_nuend = kNue2020ND;
36  auto cut_nuefd = kNue2020FDAllSamples;
37 
39  std::string ldrFDNonSwap = "prod_caf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_v1";
40  std::string ldrFDFlxSwap = "prod_caf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_fluxswap_fhc_nova_v08_full_v1";
41  std::string ldrFDTauSwap = "prod_caf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_tau_fhc_nova_v08_full_v1";
42  std::string ldrNDNonSwap = "prod_caf_R19-11-18-prod5reco.d.h_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_v1";
43  std::string ldrNDData = "prod_caf_R19-11-18-prod5reco.d.f.h_nd_numi_fhc_period235910_v1";
44 
45  if (beam == "rhc"){
46  ldrFDNonSwap = "prod_caf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_nonswap_rhc_nova_v08_full_v1";
47  ldrFDFlxSwap = "prod_caf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_fluxswap_rhc_nova_v08_full_v1";
48  ldrFDTauSwap = "prod_caf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_tau_rhc_nova_v08_full_v1";
49  ldrNDNonSwap = "prod_caf_R19-11-18-prod5reco.d_nd_genie_N1810j0211a_nonswap_rhc_nova_v08_full_v1";
50  ldrNDData = "prod_caf_R19-11-18-prod5reco.g_nd_numi_rhc_full_v1_goodruns";
51  }
52 
58 
60 
61  NueComboExtrapGenerator *decomp_combo = new NueComboExtrapGenerator(axis_nue,
62  axis_numu,
63  cut_nuefd,
64  cut_nuend,
65  cut_numund,
66  kNoShift,
68 
69 
70  IPrediction * pred_extrap_combo = decomp_combo->Generate(loaders).release();
71 
72  IPrediction * pred_extrap_prop;
73  if (beam == "rhc"){
74  NuePropExtrapRHCGenerator *decomp_prop = new NuePropExtrapRHCGenerator(axis_nue,
75  axis_numu,
76  cut_nuefd,
77  cut_nuend,
78  cut_numund,
79  kNoShift,
80  kPPFXFluxCVWgt*kXSecCVWgt2020);
81  pred_extrap_prop = decomp_prop->Generate(loaders).release();
82  }
83  if (beam == "fhc"){
84  NuePropExtrapGenerator *decomp_prop = new NuePropExtrapGenerator(axis_nue,
85  axis_numu,
86  cut_nuefd,
87  cut_nuend,
88  cut_numund,
89  kNoShift,
90  kPPFXFluxCVWgt*kXSecCVWgt2020);
91  pred_extrap_prop = decomp_prop->Generate(loaders).release();
92  }
93 
94  NoExtrapGenerator *noextrap = new NoExtrapGenerator(axis_nue_merged, cut_nuefd, kPPFXFluxCVWgt*kXSecCVWgt2020);
95  IPrediction * pred_noextrap = noextrap->Generate(loaders).release();
96 
97  NoExtrapGenerator *noextrap_for_extand = new NoExtrapGenerator(axis_nue, cut_nuefd, kPPFXFluxCVWgt*kXSecCVWgt2020);
98  IPrediction * pred_noextrap_for_extand = noextrap_for_extand->Generate(loaders).release();
99 
100  loaders.Go();
101 
102  TFile* outFile = new TFile(("fd_nue_pred_"+beam+".root").c_str(),"RECREATE");
103  outFile->cd();
104  pred_extrap_combo->SaveTo(outFile, "extrap_combo");
105  pred_extrap_prop->SaveTo(outFile, "extrap_prop");
106  pred_noextrap->SaveTo(outFile, "noextrap");
107  pred_noextrap_for_extand->SaveTo(outFile, "noextrap_for_extand");
108  outFile->Close();
109 }
110 
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 Cut cut_numund
const Var kPPFXFluxCVWgt
Definition: PPFXWeights.h:16
std::unique_ptr< IPrediction > Generate(Loaders &loaders, const SystShifts &shiftMC=kNoShift) const override
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
const Cut kNumu2020ND
Definition: NumuCuts2020.h:57
virtual void SaveTo(TDirectory *dir, const std::string &name) const
const Cut kNue2020ND
Definition: NueCuts2020.h:178
Generates FD-only predictions (no extrapolation)
const Cut cut_nuend
void Go()
Call Go() on all the loaders.
Definition: Loaders.cxx:162
void SetSpillCut(const SpillCut &cut)
Definition: Loaders.cxx:121
Generates extrapolated Nue predictions using ProportionalDecomp.
TFile * outFile
Definition: PlotXSec.C:135
const HistAxis kNue2020AxisMergedPeripheral("NuE Energy / Analysis Bin", kNue2020BinningMergedPeripheral, kNue2020AnaBinMergedPeripheral)
Definition: NueCuts2020.h:200
const HistAxis kNue2020Axis("NuE Energy / Analysis Bin", kNue2020Binning, kNue2020AnaBin)
Use this Axis for Ana2020, official Axis.
Definition: NueCuts2020.h:195
std::unique_ptr< IPrediction > Generate(Loaders &loaders, const SystShifts &shiftMC=kNoShift) const override
const HistAxis kNumuCCOptimisedAxis("Reconstructed Neutrino Energy (GeV)", kNumuCCEOptimisedBinning, kCCE)
HistAxis that implements optimised numuCCE from L. Vinton. See docdb 16332. This was close to &#39;custC&#39;...
Definition: HistAxes.h:24
const SystShifts kNoShift
Definition: SystShifts.h:115
std::unique_ptr< IPrediction > Generate(Loaders &loaders, const SystShifts &shiftMC=kNoShift) const override
void NueExtrap(string beam="fhc", string cvntype="oldpresel")
Definition: NueExtrap.C:28
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
const HistAxis axis_numu
std::vector< Loaders * > loaders
Definition: syst_header.h:386
Generates extrapolated Nue predictions using Michel+BEN decomposition.
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:46
const Cut kNue2020FDAllSamples
Definition: NueCuts2020.h:84
std::unique_ptr< IPrediction > Generate(Loaders &loaders, const SystShifts &shiftMC=kNoShift) const override
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 Var kXSecCVWgt2020
Definition: XsecTunes.h:106