13 #include "TObjString.h" 21 REGISTER_LOADFROM(
"PredictionSystJoint2018", IPrediction, PredictionSystJoint2018);
27 const std::vector<const ISyst*>&
systs,
35 gROOT->SetMustClean(
false);
42 << (mergePeripheral ?
"true" :
"false") <<
std::endl;
44 std::cout <<
"use FakeNDData predictions is " 45 << (isFakeData ?
"true" :
"false") <<
std::endl;
48 if (extrap ==
kCombo) extrapStr +=
"xp_combo";
49 if (extrap ==
kNoExtrap) extrapStr +=
"nxp";
51 if (extrap ==
kFake) extrapStr +=
"xp_prop";
67 else if (
IsFHC() && !isFakeData)
68 fnameSyst =
"/nova/ana/nu_e_ana/Ana2018/Predictions/provisional_singles/NueProd4SystematicsOnRealNDData_2018-05-22/pred_allxp_Nue2018Axis_full_FHCAllSyst_nueconcat_realNDData_2018-05-22.root";
69 else if (!
IsFHC() && !isFakeData)
70 fnameSyst =
"/nova/ana/nu_e_ana/Ana2018/Predictions/provisional_singles/NueProd4SystematicsOnRealNDData_2018-05-22/pred_allxp_Nue2018Axis_full_RHCAllSyst_nueconcat_realNDData_2018-05-22.root";
71 else if (
IsFHC() && isFakeData)
72 fnameSyst =
"/nova/ana/nu_e_ana/Ana2018/Predictions/provisional_singles/NueProd4SystematicsOnFakeNDData_2018-05-23/pred_allxp_Nue2018Axis_full_FHCAllSysts_nueconcat_fakeNDData_05_22_2018_pass1_merged.root";
73 else if (!
IsFHC() && isFakeData)
74 fnameSyst =
"/nova/ana/nu_e_ana/Ana2018/Predictions/provisional_singles/NueProd4SystematicsOnFakeNDData_2018-05-23/pred_allxp_Nue2018Axis_full_RHCAllSysts_nueconcat_fakeNDData_05_22_2018_pass1_merged.root";
76 TFile* fSyst = TFile::Open(fnameSyst.c_str(),
"read");
77 if(fSyst->IsZombie()){
87 PredictionNoExtrap* nomNoExtrap = ana::LoadFrom<PredictionNoExtrap>(fSyst,
"pred_nxp_Nominal/noShift" + varname).
release();
99 fSyst, extrapStr +
"Lightlevel/noShift"+varname).
release();
101 fSyst,
"pred_nxp_Lightlevel/noShift"+varname).
release();
104 nomLLCore, nomLLNoExtrap,
true);
106 for(
const ISyst* syst: systs){
127 std::cout <<
"\tLooking at systName " << systName <<
", so pushing back nomLightLevel " <<
std::endl;
128 sp.
preds.push_back(nomLightLevel);
131 sp.
preds.push_back(nom);
138 PredictionNoExtrap* shNoExtrap = ana::LoadFrom<PredictionNoExtrap>(fSyst,
"pred_nxp_" + systName + sigmaStr +varname).
release();
166 const std::vector<const ISyst*>&
systs,
171 gROOT->SetMustClean(
false);
178 if (extrap ==
kNuMu) extrapStr +=
"xp_numu";
183 if (WhichQuant == -1) VarName =
"numu_pred_NumuEnergy";
185 std::cout <<
"\nLooking at VarName " << VarName <<
" --> Loading nominals now..." <<
std::endl;
187 TFile*
fin = TFile::Open(fname.c_str(),
"read");
190 std::string NomVar = extrapStr+
"Nominal/noShift/"+VarName;
194 std::string LNomVar = extrapStr+
"Lightlevel/noShift/"+VarName;
197 for(
const ISyst* syst: systs){
201 syst->
ShortName() ==
"RPAShapeRES2018Test" 221 if (systName ==
"Lightlevel" || systName ==
"Cherenkov") {
222 std::cout <<
"\tLooking at systName " << systName <<
", so pushing back nomLightLevel " <<
std::endl;
223 sp.
preds.push_back(nomLightLevel);
225 sp.
preds.push_back(nom);
232 auto shCore = ana::LoadFrom<PredictionExtrap> (
fin, extrapStr + systName + sigmaStr +VarName).
release();
233 sp.
preds.push_back(shCore);
264 const double kNormFHC = 0.0144;
265 const double kNormRHC = 0.0064;
282 const std::vector<const ISyst*>&
systs,
286 if(std::find(systs.begin(), systs.end(), syst) == systs.end())
return;
289 const int nBins = h->GetNbinsX();
302 for(
int binIdx = 0; binIdx < nBins+2; ++binIdx){
303 normsp.
fits[
coeff][binIdx].emplace_back(0, 0, frac, 1);
312 fPreds.emplace(syst, normsp);
318 dir = dir->GetDirectory(name.c_str());
321 TObjString*
tag = (TObjString*)dir->Get(
"type");
324 assert(tag->GetString() ==
"PredictionSystJoint2018");
330 const TObjString*
beam = (TObjString*)dir->Get(
"beam");
332 ret->fBeam = beam->GetString();
334 ret->fSplitBySign = ret->IsFHC();
350 TDirectory*
tmp = gDirectory;
352 dir = (TDirectory*)dir->GetDirectory(name.c_str());
355 TObjString(
"PredictionSystJoint2018").Write(
"type");
368 if(sigma == -2)
return "minusTwo";
369 if(sigma == -1)
return "minusOne";
370 if(sigma == 0)
return "";
371 if(sigma == +1)
return "plusOne";
372 if(sigma == +2)
return "plusTwo";
381 if(
fBeam ==
"fhc" )
return true;
382 if(
fBeam ==
"rhc")
return false;
384 std::cout <<
"PredictionSystJoint2018: Bad beam string: "
void AddNormSysts(const std::vector< const ISyst * > &systs)
Must set fBeam first.
Cuts and Vars for the 2020 FD DiF Study.
PredictionSystJoint2018()
std::string systName
What systematic we're interpolating.
void SaveTo(TDirectory *dir, const std::string &name) const override
TH1D * ToTH1(double exposure, Color_t col=kBlack, Style_t style=kSolid, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Histogram made from this Spectrum, scaled to some exposure.
virtual const std::string & ShortName() const final
The name printed out to the screen.
Loads shifted spectra from files.
General interface to oscillation calculators.
std::vector< std::vector< std::vector< Coeffs > > > fitsNubar
Will be filled if signs are separated, otherwise not.
std::vector< int > GetDummyShifts(const ISyst *s)
Encapsulate code to systematically shift a caf::SRProxy.
std::unique_ptr< IPrediction > fPredNom
The nominal prediction.
const DummyAnaSyst kAnaLightlevelSyst("Lightlevel","Lightlevel")
static std::unique_ptr< PredictionSystJoint2018 > LoadFrom(TDirectory *dir, const std::string &name)
virtual void SaveTo(TDirectory *dir, const std::string &name) const override
const DummyAnaSyst kAnaCherenkovSyst("Cherenkov","Cherenkov")
std::vector< double > shifts
Shift values sampled.
std::vector< IPrediction * > preds
double frac(double x)
Fractional part.
const Binning kNue2018Binning
std::unique_ptr< IPrediction > LoadFrom< IPrediction >(TDirectory *dir, const std::string &label)
double coeff(double W, int m, int l, bool real)
Oscillation probability calculators.
virtual _IOscCalc * Copy() const =0
virtual ~PredictionSystJoint2018()
Spectrum Predict(osc::IOscCalc *calc) const override
bool IsFHC() const
Interprets fBeam.
const DummyAnaSyst kAna2018NormRHC("NormRHC2018","RHC. Norm.")
REGISTER_LOADFROM("BENDecomp", IDecomp, BENDecomp)
assert(nhit_max >=nhit_nbins)
Standard interface to all prediction techniques.
std::string SigmaToString(int sigma) const
std::string to_string(ModuleType mt)
std::unordered_map< const ISyst *, ShiftedPreds > fPreds
osc::IOscCalc * fOscOrigin
The oscillation values we assume when evaluating the coefficients.
static void LoadFromBody(TDirectory *dir, PredictionInterp *ret, std::vector< const ISyst * > veto={})
void AddNormSyst(const ISyst *syst, const std::vector< const ISyst * > &systs, double frac)
const DummyAnaSyst kAna2018NormFHC("NormFHC2018","FHC. Norm.")
std::vector< std::vector< std::vector< Coeffs > > > fits
Indices: [type][histogram bin][shift bin].