get_fdmc_spectra.C
Go to the documentation of this file.
2 #include "CAFAna/Core/Binning.h"
6 #include "CAFAna/Core/Binning.h"
13 
14 //#include "/nova/app/users/ecatanom/nova_code/releases/rel_oct11/CAFAna/nue/Ana2017/sidebands/vars.h"
15 using namespace ana;
16 void get_fdmc_spectra(std::string suffix = "full", bool extrapolate = false)
17 {
19  // Prod3NomLoaders loaders(ana::kDecaf); //test
21 
22  auto axis_numu2017 = kNumuCCOptimisedAxis;
23  auto cut_numund2017 = kNumuCutND2017;
24  auto axis_nue2017 = kNue2017AxisMergedPeripheral;
25  auto cut_nuend2017 = kNue2017NDCVNSsb;
27 
28  struct GenDef{
29  const IPredictionGenerator *gen;
30  const TString cutname;
31  const TString varname;
32  };
33 
34  std::vector <GenDef> gens;
35  std::vector <IPrediction * > predictions;
36 
37  for(int selIdx = 0; selIdx < kNumSels; ++selIdx){
38  for(int varIdx=0; varIdx < kNumVars; ++varIdx){
39  auto axis = defs[varIdx].axis;
40  gens.push_back({new NoExtrapGenerator(axis, sels[selIdx], weight),
41  selNames[selIdx], defs[varIdx].name});
42 
43  if(extrapolate) {
44  gens.push_back({new NueComboExtrapGenerator( axis,
45  axis_numu2017,
46  sels[selIdx],
47  cut_nuend2017,
48  cut_numund2017,
49  kNoShift,
50  weight),
51  selNames[selIdx], defs[varIdx].name+"_extrap_combo"});
52  gens.push_back({new NuePropExtrapGenerator( axis,
53  axis_numu2017,
54  sels[selIdx],
55  cut_nuend2017,
56  cut_numund2017,
57  kNoShift,
58  weight),
59  selNames[selIdx], defs[varIdx].name+"_extrap_prop"});
60  }//end if extrapolation
61  } //end var
62  }//end selection
63 
64  for(auto & gen:gens){
65  predictions.push_back(gen.gen->Generate(loaders).release());
66  }
67 
68  loaders.Go();
69 
70  TFile* file = new TFile(("fhc_preds_all_epochs_fdnue_cuts_" + suffix + ".root").c_str(),"recreate");
71 
72  for (int i = 0 ; i < (int)gens.size(); ++i){
73  auto dir = file->GetDirectory(gens[i].cutname);
74  if(!dir) dir = file->mkdir(gens[i].cutname);
75  predictions[i]->SaveTo(dir, gens[i].varname);
76  }
77 
78 }
For nominal spectra and reweighting systs (xsec/flux)
Definition: Prod3Loaders.h:40
const int kNumVars
Definition: vars.h:14
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 Var weight
std::string name
Definition: NuePlotLists.h:12
const Cut kNue2017NDCVNSsb
Definition: NueCuts2017.h:302
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
Generates extrapolated Nue predictions using ProportionalDecomp.
const Cut sels[kNumSels]
Definition: vars.h:44
void get_fdmc_spectra(std::string suffix="full", bool extrapolate=false)
const Cut kNumuCutND2017
Definition: NumuCuts2017.h:41
const HistDef defs[kNumVars]
Definition: vars.h:15
const int kNumSels
Definition: vars.h:43
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
HistAxis axis
Definition: NuePlotLists.h:13
const SystShifts kNoShift
Definition: SystShifts.h:115
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
TDirectory * dir
Definition: macro.C:5
std::vector< Loaders * > loaders
Definition: syst_header.h:386
Generates extrapolated Nue predictions using Michel+BEN decomposition.
TFile * file
Definition: cellShifts.C:17
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:46
Given loaders and an MC shift, Generate() generates an IPrediction.
const std::string selNames[kNumSels]
Definition: vars.h:46
const Var kXSecCVWgt2017
Definition: XsecTunes.h:37
const HistAxis kNue2017AxisMergedPeripheral("NuE Energy / Analysis Bin", kNue2017BinningMergedPeripheral, kNue2017AnaBinMergedPeripheral)
Definition: NueCuts2017.h:321