3 bool concat =
true,
bool rhc =
false) {
15 bool concat =
true,
bool rhc =
false)
20 if (detector ==
"nd") nd =
true;
21 else if (detector ==
"fd") nd =
false;
22 else throw std::runtime_error(
"Detector string must be \"nd\" or \"fd\"; \"" 23 + detector +
"\" is not understood.");
25 if (job < 1 || job > 5)
throw std::runtime_error(
"Job int must be in range 1 -> 5!");
31 TFile*
f =
new TFile(filename.c_str(),
"RECREATE");
33 std::vector<Var> kPPFXFluxUnivWgts;
34 for (
unsigned int i = 0;
i < 100; ++
i) {
37 if (sr->
mc.
nnu != 1)
return 1.f;
38 if (sr->
mc.
nu[0].rwgt.ppfx.vuniv[
i] <= 0)
return 1.f;
39 return (
float)sr->
mc.
nu[0].rwgt.ppfx.vuniv[
i];
41 kPPFXFluxUnivWgts.push_back(tempPPFXWgt);
44 for (
int n = 20 * (job-1);
n < 20 *
job; ++
n) {
49 const Var kPPFXFluxUnivWgt = kPPFXFluxUnivWgts[
n];
56 if (nd) loaders->
SetND(
true);
66 universe.SaveTo(f, Form(
"universe_%i",
n));
75 universe.SaveTo(f, Form(
"universe_%i",
n));
Implements systematic errors by interpolation between shifted templates.
Cuts and Vars for the 2020 FD DiF Study.
const Var kNus18Energy([](const caf::SRProxy *sr){bool h_FHC=sr->spill.isFHC;bool h_RHC=sr->spill.isRHC;double cale=sr->slc.calE;double recoE=0.;if(h_FHC &&sr->hdr.det==caf::kFARDET) recoE=FDscaleCalE18 *cale;else if(h_FHC &&sr->hdr.det==caf::kNEARDET) recoE=NDscaleCalE18 *cale;else if(h_RHC &&sr->hdr.det==caf::kFARDET) recoE=FDscaleCalE18RHC *cale;else if(h_RHC &&sr->hdr.det==caf::kNEARDET) recoE=NDscaleCalE18RHC *cale;return recoE;})
caf::Proxy< caf::SRHeader > hdr
Proxy for caf::StandardRecord.
Collection of SpectrumLoaders for many configurations.
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Adapt the PMNS_Sterile calculator to standard interface.
caf::Proxy< short int > nnu
void Go()
Call Go() on all the loaders.
void SetSpillCut(const SpillCut &cut)
osc::OscCalcSterile * DefaultSterileCalc(int nflavors)
Create a sterile calculator with default assumptions for all parameters.
const Binning kNus18EnergyBinning
Energy binnings for Nus18 for nus analysis.
void MakePPFXRatios(std::string detector, int job, bool concat=true, bool rhc=false)
const Cut kNus18ND
Full Nus18 ND analysis selection.
const SystShifts kNoShift
caf::Proxy< caf::SRTruthBranch > mc
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
std::string to_string(ModuleType mt)
For nominal spectra and reweighting systs (xsec/flux)
Prevent histograms being added to the current directory.
Generates Near Detector predictions.