5 #include "CAFAna/Cuts/NueCutsSecondAna.h" 27 std::string ldrNDData =
"prod_sumdecaf_R17-03-01-prod3reco.d_nd_numi_fhc_full_v1_goodruns_nue2017";
28 std::string ldrNDMC =
"prod_sumdecaf_R17-03-01-prod3reco.d_nd_genie_nonswap_fhc_nova_v08_full_v1_nue2017";
29 std::string ldrNonSwap =
"prod_sumdecaf_R17-03-01-prod3reco.g_fd_genie_nonswap_fhc_nova_v08_full_v1_nue2017";
30 std::string ldrFlxSwap =
"prod_sumdecaf_R17-03-01-prod3reco.g_fd_genie_fluxswap_fhc_nova_v08_full_v1_nue2017";
31 std::string ldrTauSwap =
"prod_sumdecaf_R17-03-01-prod3reco.g_fd_genie_tau_fhc_nova_v08_full_v1_nue2017";
34 ldrNDData =
"prod_decaf_R17-03-01-prod3reco.d_nd_numi_fhc_full_nue_or_numu_or_nus_contain_v1_goodruns";
35 ldrNDMC =
"prod_decaf_R17-03-01-prod3reco.d_nd_genie_nonswap_fhc_nova_v08_full_nue_or_numu_or_nus_contain_v1";
36 ldrNonSwap =
"prod_decaf_R17-03-01-prod3reco.g_fd_genie_nonswap_fhc_nova_v08_full_nue_or_numu_or_nus_contain_v1";
37 ldrFlxSwap =
"prod_decaf_R17-03-01-prod3reco.g_fd_genie_fluxswap_fhc_nova_v08_full_nue_or_numu_or_nus_contain_v1";
38 ldrTauSwap =
"prod_decaf_R17-03-01-prod3reco.g_fd_genie_tau_fhc_nova_v08_full_nue_or_numu_or_nus_contain_v1";
57 TString suffix =
"test")
59 TString
filename =
"pred_xsec_fhc_" + suffix +
".root";
74 std::vector <ShiDef> shifts;
75 shifts.push_back({
"no_shift",
kNoShift });
77 for (
auto sigma:{+1, -1}) {
78 TString sig_str = (
sigma == 1 ?
"plus" :
"minus");
80 shifts.push_back({
"MEC_enushape_" + sig_str,
82 shifts.push_back({
"MEC_q0shape_" + sig_str,
84 shifts.push_back({
"MEC_NPfrac_" + sig_str,
86 shifts.push_back({
"MEC_scaleSA_" + sig_str,
88 shifts.push_back({
"MEC_all3_" + sig_str,
100 bool use_decafs = (suffix.Contains(
"test") ||
101 suffix.Contains(
"decaf"));
108 std::vector <IPrediction*> v_pred_prop;
109 std::vector <IPrediction*> v_pred_nxp;
110 std::vector <TString>
names;
115 for (
auto weight:weights) {
121 for (
auto shift:shifts) {
123 if (shift.name ==
"no_shift" ||
weight.name ==
"ppfx_xsec") {
133 auto pred_prop = generator_prop.Generate(loaders,
135 auto pred_nxp = generator_nxp .Generate(loaders,
138 v_pred_prop.emplace_back(pred_prop.release());
139 v_pred_nxp. emplace_back(pred_nxp.
release());
141 names.push_back (shift.name +
"_" +
weight.name);
148 TFile*
file =
new TFile(filename,
"recreate");
150 for (
int i = 0 ;
i < (
int) names.size() ; ++
i) {
151 v_pred_nxp [
i]->SaveTo(file,
"pred_nxp_" + names[
i]);
152 v_pred_prop[
i]->SaveTo(file,
"pred_xp_prop_" + names[i]);
161 TFile*
file =
new TFile (filename,
"READ");
162 TFile* outfile_xpplots =
new TFile(
"plots/xp/modExtrapNuePlots.root",
164 bool printtable_numu = 1;
165 bool printtable_nue = 1;
171 TDirectory* dir_pred_no, * dir_pred_sh;
172 TDirectory* dir_decomp_no, * dir_decomp_sh;
173 TString dirname_decomp, plot_title,
plot_name;
175 for (
auto weight:weights) {
176 if (
weight.name !=
"ppfx_xsec")
177 for (TString xp: {
"nxp",
"xp_prop"}) {
179 dir_pred_no = file->GetDirectory (
"pred_" + xp +
180 "_no_shift_ppfx_xsec");
181 dir_pred_sh = file->GetDirectory (
"pred_" + xp +
185 if (xp ==
"xp_prop") {
187 dirname_decomp =
"extrap/MEextrap/Decomp";
188 dir_decomp_no = dir_pred_no->GetDirectory (dirname_decomp);
189 dir_decomp_sh = dir_pred_sh->GetDirectory (dirname_decomp);
191 plot_title =
weight.name +
" (NearDet MC);" +
192 " Non-Quasielastic Energy Estimator (GeV); Events / Bin";
193 plot_name =
"compare_numu_ND_" +
weight.name;
196 plot_title, plot_name,
"Numu",
200 dirname_decomp =
"extrap/EEextrap/Decomp/";
201 plot_title =
weight.name +
" (NearDet MC)"+
202 "; Neutrino Energy Estimator (GeV) X CVN; Events / Bin";
203 plot_name =
"compare_nue_ND_" +
weight.name;
205 dir_decomp_no = dir_pred_no->GetDirectory (dirname_decomp);
206 dir_decomp_sh = dir_pred_sh->GetDirectory (dirname_decomp);
208 plot_title, plot_name,
"CVN",
209 printtable_nue, pidaxes);
213 plot_title =
weight.name +
214 (xp !=
"nxp" ?
" FarDet Extrap":
" (FarDet MC)") +
215 ";Neutrino Energy Estimator (GeV) X CVN;"+
"Events / Bin";
216 plot_name =
"compare_" + xp +
"_" +
weight.name;
222 printtable, pidaxes);
225 if (xp ==
"xp_prop") {
228 xp->SavePlotsNue (outfile_xpplots->mkdir (
229 "plots_xp_" +
weight.name), 9E20);
231 if (
"weight.name" ==
"no_weight") {
234 xp->SavePlotsNue (outfile_xpplots->mkdir (
235 "plots_xp_ppfx_xsec"), 9E20);
242 TDirectory* dir_pred_pl, * dir_pred_mi;
243 TDirectory* dir_decomp_pl, * dir_decomp_mi;
246 for (TString shiftname: {
"MEC_enushape",
"MEC_q0shape",
247 "MEC_NPfrac",
"MEC_scaleSA",
250 for (TString xp: {
"nxp",
"xp_prop"}) {
252 auto dir_pred_no = file->GetDirectory (
"pred_" + xp +
253 "_no_shift_ppfx_xsec");
254 auto dir_pred_pl = file->GetDirectory (
"pred_" + xp +
257 auto dir_pred_mi = file->GetDirectory (
"pred_" + xp +
262 if (xp ==
"xp_prop") {
263 dirname_decomp =
"extrap/MEextrap/Decomp/";
264 plot_title = shiftname +
" (NearDet MC)" +
265 "; Non-Quasielastic Energy Estimator (GeV); Events / Bin";
266 plot_name =
"compare_numu_ND_" + shiftname;
268 dir_decomp_no = dir_pred_no->GetDirectory (dirname_decomp);
269 dir_decomp_pl = dir_pred_pl->GetDirectory (dirname_decomp);
270 dir_decomp_mi = dir_pred_mi->GetDirectory (dirname_decomp);
273 plot_title, plot_name,
"Numu",
277 dirname_decomp =
"extrap/EEextrap/Decomp/";
278 plot_title = shiftname +
" (NearDet MC)" +
279 "; Neutrino Energy Estimator (GeV) X CVN; Events / Bin";
280 plot_name =
"compare_nue_ND_" + shiftname;
282 dir_decomp_no = dir_pred_no->GetDirectory (dirname_decomp);
283 dir_decomp_pl = dir_pred_pl->GetDirectory (dirname_decomp);
284 dir_decomp_mi = dir_pred_mi->GetDirectory (dirname_decomp);
287 plot_title, plot_name,
"CVN",
288 printtable_nue, pidaxes);
292 plot_title = shiftname +
293 (xp !=
"nxp" ?
" FarDet Extrap" :
" (FarDet MC)") +
294 ";Neutrino Energy Estimator (GeV) X CVN;"+
"Events / Bin";
295 plot_name =
"compare_" + xp +
"_" + shiftname;
302 printtable, pidaxes);
Near Detector underground.
Far Detector at Ash River.
Cuts and Vars for the 2020 FD DiF Study.
Simple record of shifts applied to systematic parameters.
Collection of SpectrumLoaders for many configurations.
const NOvARwgtSyst kMECScaleSystSA("mecScale","MEC Scale", novarwgt::kMECScaleSystSA)
const NOvARwgtSyst kMECEnuShapeSyst2017("MECEnuShape","MEC E_{#nu} shape", novarwgt::kMECEnuShapeSyst2017)
void Go()
Call Go() on all the loaders.
void SetSpillCut(const SpillCut &cut)
void CompareNDDataMC(TDirectory *d_no, TDirectory *d_sh, TString plottitle, TString out_name, TString pidtag, bool printtable=true, bool pidaxis=0)
std::unique_ptr< IPrediction > LoadFrom< IPrediction >(TDirectory *dir, const std::string &label)
const SystShifts kNoShift
const NOvARwgtSyst kMECq0ShapeSyst2017("MECq0Shape","MEC q_{0} shape", novarwgt::kMECq0ShapeSyst2017)
void GetExtrap(PredictionNoExtrap *all, PredictionNoExtrap *sel, osc::IOscCalc *calc, TString title)
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
void ComparePredictions(IPrediction *pred_no, IPrediction *pred_sh, TString plottitle, TString out_name, TString pidtag, bool printtable=true, bool pidaxis=false)
void SetLoaderPath(const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via wildcard path.
const NOvARwgtSyst kMECInitStateNPFracSyst2017("MECInitStateNPFrac","MEC initial state np fraction", novarwgt::kMECInitStateNPFracSyst2017)