NueExtrap.C
Go to the documentation of this file.
1 #include "CAFAna/Core/Spectrum.h"
3 
4 #include "CAFAna/Cuts/Cuts.h"
9 
10 #include "CAFAna/Vars/Vars.h"
11 #include "CAFAna/Vars/NueVars.h"
14 
18 
19 #include "CAFAna/Core/Loaders.h"
21 #include "TFile.h"
22 
23 #include <iostream>
24 #include <cmath>
25 using namespace ana;
26 
27 void NueExtrap(string beam = "fhc", string cvntype = "oldpresel")
28 {
29 
31  auto cut_numund = kNumu2020NDOldPresel;
32  auto axis_nue = kNue2020OldPreselAxis;
33  auto axis_nue_merged = kNue2020OldPreselAxisMergedPeripheral;
35  auto cut_nuefd = kNue2020FDOldPreselAllSamples && kNue2017Veto;
36 
37  if (cvntype == "looseptp") {
38  cut_numund = kNumu2020NDLoosePTP;
39  axis_nue = kNue2020LoosePTPAxis;
40  axis_nue_merged = kNue2020LoosePTPAxisMergedPeripheral;
43  }
44 
46  std::string ldrFDNonSwap = "prod_caf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_v1";
47  std::string ldrFDFlxSwap = "prod_caf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_fluxswap_fhc_nova_v08_full_v1";
48  std::string ldrFDTauSwap = "prod_caf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_tau_fhc_nova_v08_full_v1";
49  std::string ldrNDNonSwap = "prod_caf_R19-11-18-prod5reco.d.h_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_v1";
50  std::string ldrNDData = "prod_caf_R19-11-18-prod5reco.d.f.h_nd_numi_fhc_period235910_v1";
51 
52  if (beam == "rhc"){
53  ldrFDNonSwap = "prod_caf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_nonswap_rhc_nova_v08_full_v1";
54  ldrFDFlxSwap = "prod_caf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_fluxswap_rhc_nova_v08_full_v1";
55  ldrFDTauSwap = "prod_caf_R19-11-18-prod5reco.f_fd_genie_N1810j0211a_tau_rhc_nova_v08_full_v1";
56  ldrNDNonSwap = "prod_caf_R19-11-18-prod5reco.d_nd_genie_N1810j0211a_nonswap_rhc_nova_v08_full_v1";
57  ldrNDData = "prod_caf_R19-11-18-prod5reco.g_nd_numi_rhc_full_v1_goodruns";
58  }
59 
65 
67 
68  NueComboExtrapGenerator *decomp_combo = new NueComboExtrapGenerator(axis_nue,
69  axis_numu,
70  cut_nuefd,
71  cut_nuend,
72  cut_numund,
73  kNoShift,
75 
76 
77  IPrediction * pred_extrap_combo = decomp_combo->Generate(loaders).release();
78 
79  IPrediction * pred_extrap_prop;
80  if (beam == "rhc"){
81  NuePropExtrapRHCGenerator *decomp_prop = new NuePropExtrapRHCGenerator(axis_nue,
82  axis_numu,
83  cut_nuefd,
84  cut_nuend,
85  cut_numund,
86  kNoShift,
87  kPPFXFluxCVWgt*kXSecCVWgt2020);
88  pred_extrap_prop = decomp_prop->Generate(loaders).release();
89  }
90  if (beam == "fhc"){
91  NuePropExtrapGenerator *decomp_prop = new NuePropExtrapGenerator(axis_nue,
92  axis_numu,
93  cut_nuefd,
94  cut_nuend,
95  cut_numund,
96  kNoShift,
97  kPPFXFluxCVWgt*kXSecCVWgt2020);
98  pred_extrap_prop = decomp_prop->Generate(loaders).release();
99  }
100 
101  NoExtrapGenerator *noextrap = new NoExtrapGenerator(axis_nue_merged, cut_nuefd, kPPFXFluxCVWgt*kXSecCVWgt2020);
102  IPrediction * pred_noextrap = noextrap->Generate(loaders).release();
103 
104  NoExtrapGenerator *noextrap_for_extand = new NoExtrapGenerator(axis_nue, cut_nuefd, kPPFXFluxCVWgt*kXSecCVWgt2020);
105  IPrediction * pred_noextrap_for_extand = noextrap_for_extand->Generate(loaders).release();
106 
107  loaders.Go();
108 
109  TFile* outFile = new TFile(("fd_regular_pred_"+beam+"_"+cvntype+".root").c_str(),"RECREATE");
110  outFile->cd();
111  pred_extrap_combo->SaveTo(outFile->mkdir("extrap_combo"));
112  pred_extrap_prop->SaveTo(outFile->mkdir("extrap_prop"));
113  pred_noextrap->SaveTo(outFile->mkdir("noextrap"));
114  pred_noextrap_for_extand->SaveTo(outFile->mkdir("noextrap_for_extand"));
115  outFile->Close();
116 }
117 
Near Detector underground.
Definition: SREnums.h:10
std::unique_ptr< IPrediction > Generate(Loaders &loaders, const SystShifts &shiftMC=kNoShift) const override
Far Detector at Ash River.
Definition: SREnums.h:11
Oscillation analysis framework, runs over CAF files outside of ART.
const Cut kNue2017Veto([](const caf::SRProxy *sr){return sr->sel.veto.keep;})
cosmic veto cut for FD
Definition: NueCuts2017.h:47
const Var kPPFXFluxCVWgt
Definition: PPFXWeights.h:16
virtual void SaveTo(TDirectory *dir) const
const Cut kNue2020FDLoosePTPAllSamples
Definition: NueCuts2020.h:97
const Cut cut_nuend
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:17
std::unique_ptr< IPrediction > Generate(Loaders &loaders, const SystShifts &shiftMC=kNoShift) const override
Generates FD-only predictions (no extrapolation)
const HistAxis axis_numu
void Go()
Call Go() on all the loaders.
Definition: Loaders.cxx:170
void SetSpillCut(const SpillCut &cut)
Definition: Loaders.cxx:121
Generates extrapolated Nue predictions using ProportionalDecomp.
TFile * outFile
Definition: PlotXSec.C:135
const HistAxis kNue2020LoosePTPAxisMergedPeripheral("NuE Energy / Analysis Bin", kNue2020BinningMergedPeripheral, kNue2020LoosePTPAnaBinMergedPeripheral)
const Cut kNue2020NDOldPresel
Definition: NueCuts2020.h:121
std::unique_ptr< IPrediction > Generate(Loaders &loaders, const SystShifts &shiftMC=kNoShift) const override
const Cut cut_numund
const HistAxis kNue2020OldPreselAxisMergedPeripheral("NuE Energy / Analysis Bin", kNue2020BinningMergedPeripheral, kNue2020OldPreselAnaBinMergedPeripheral)
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;...
const SystShifts kNoShift
Definition: SystShifts.h:112
std::unique_ptr< IPrediction > Generate(Loaders &loaders, const SystShifts &shiftMC=kNoShift) const override
void NueExtrap(string beam="fhc", string cvntype="oldpresel")
Definition: NueExtrap.C:27
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
const HistAxis kNue2020LoosePTPAxis("NuE Energy / Analysis Bin", kNue2020Binning, kNue2020LoosePTPAnaBin)
Use this Axis for Ana2020LoosePTP, official Axis.
std::vector< Loaders * > loaders
Definition: syst_header.h:385
Generates extrapolated Nue predictions using Michel+BEN decomposition.
const HistAxis kNue2020OldPreselAxis("NuE Energy / Analysis Bin", kNue2020Binning, kNue2020OldPreselAnaBin)
Use this Axis for Ana2020OldPresel, official Axis.
Standard interface to all prediction techniques.
Definition: IPrediction.h:57
const Cut kNue2020FDOldPreselAllSamples
Definition: NueCuts2020.h:98
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:28
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 Cut kNue2020NDLoosePTP
Definition: NueCuts2020.h:120
const Var kXSecCVWgt2020
Definition: XsecTunes.h:112