make_nueFDprediction_kinematics_FHC.C
Go to the documentation of this file.
1 // Analysis
6 
7 // Core
8 #include "CAFAna/Core/Binning.h"
9 #include "CAFAna/Core/Cut.h"
10 #include "CAFAna/Core/HistAxis.h"
12 #include "CAFAna/Core/Spectrum.h"
15 
16 // Cuts
17 #include "CAFAna/Cuts/Cuts.h"
20 #include "CAFAna/Cuts/SpillCuts.h"
22 
23 // Predict
26 
27 // Vars
28 #include "CAFAna/Vars/XsecTunes.h"
29 #include "CAFAna/Vars/TruthVars.h"
32 #include "CAFAna/Vars/Vars.h"
34 
36 
37 #include <iostream>
38 #include <iomanip>
39 
40 using namespace ana;
41 
43 {
44  const std::string outfilename = "FDprediction_kinematics_FHC.root";
45  const std::string sample = "NOReweight";
46 
49 
50  struct GenDef{
51  const IPredictionGenerator *gen;
52  const TString cutname;
53  const TString varname;
54  };
55 
56  std::vector <GenDef> gens;
57  std::vector <IPrediction * > predictions;
58 
60  sample.c_str(), "nueAxis_NoExtrap"});
61 
62  gens.push_back({new NueSignalExtrapGenerator( kNue2020Axis,
66  kNoShift,
68  sample.c_str(), "nueAxis_NueSignalExtrap"});
69 
70  for(auto & gen:gens){
71  predictions.push_back(gen.gen->Generate(loaders).release());
72  }
73 
74  loaders.Go();
75 
76  TFile* file = new TFile(outfilename.c_str(),"RECREATE");
77  for (int i = 0 ; i < (int)gens.size(); ++i){
78  auto dir = file->GetDirectory(gens[i].cutname);
79  if(!dir) dir = file->mkdir(gens[i].cutname);
80  predictions[i]->SaveTo(dir, gens[i].varname);
81  }
82 
83  file->Close();
84 
85 }
std::map< TString, IPredictionGenerator * > gens
Definition: syst_header.h:387
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kPPFXFluxCVWgt
Definition: PPFXWeights.h:16
const Cut kNumu2020ND
Definition: NumuCuts2020.h:57
const HistAxis kNumuCCOptimisedAxis2020("Reconstructed Neutrino Energy (GeV)", kNumuCCEOptimisedBinning, kNumuE2020)
Definition: HistAxes.h:25
Generates FD-only predictions (no extrapolation)
void Go()
Call Go() on all the loaders.
Definition: Loaders.cxx:162
void SetSpillCut(const SpillCut &cut)
Definition: Loaders.cxx:121
string outfilename
knobs that need extra care
For nominal spectra and reweighting systs (xsec/flux)
Definition: Prod5Loaders.h:101
const HistAxis kNue2020Axis("NuE Energy / Analysis Bin", kNue2020Binning, kNue2020AnaBin)
Use this Axis for Ana2020, official Axis.
Definition: NueCuts2020.h:195
Generates extrapolated Nue signal-only predictions.
void make_nueFDprediction_kinematics_FHC(const std::string &outfilename="FDprediction_kinematics_FHC.root")
const SystShifts kNoShift
Definition: SystShifts.cxx:22
TDirectory * dir
Definition: macro.C:5
std::vector< Loaders * > loaders
Definition: syst_header.h:386
TFile * file
Definition: cellShifts.C:17
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
Given loaders and an MC shift, Generate() generates an IPrediction.
const Cut kNue2020FDAllSamples
Definition: NueCuts2020.h:84
const Var kXSecCVWgt2020
Definition: XsecTunes.h:105
enum BeamMode string