BinnedLkhdExperiment.cxx
Go to the documentation of this file.
1 #include "TH1D.h"
2 
8 
10 
11 #include "Utilities/func/Stan.h"
12 
13 namespace ana
14 {
16  : fMC(MC), fData(data)
17  {}
18 
20  const SystShifts &syst) const
21  {
22  auto pred = syst.IsNominal()
23  ? fMC->Predict(osc).ToBins(fData.POT())
24  : fMC->PredictSyst(osc, syst).ToBins(fData.POT());
25  TH1D* hdata = fData.ToTH1(fData.POT());
26 
27  using ana::LogLikelihood; // note: this LogLikelihood() is in StanUtils.h
28  auto ll = LogLikelihood(pred, hdata) / -2.; // LogLikelihood(), confusingly, returns chi2=-2*LL
29 
30  HistCache::Delete(hdata);
31 
32  return ll;
33  }
34 
35 }
Oscillation analysis framework, runs over CAF files outside of ART.
bool IsNominal() const
Definition: SystShifts.h:43
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.
Definition: Spectrum.cxx:553
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
stan::math::var LogLikelihood(osc::_IOscCalculatorAdjustable< stan::math::var > *osc, const SystShifts &syst) const override
stan::math::var LogLikelihood(const std::vector< stan::math::var > &exp, const TH1 *obs)
Variant that handles the prediction in the form of Stan vars.
Definition: StanUtils.cxx:11
BinnedLkhdExperiment(const IPrediction *MC, const Spectrum &data)
virtual Spectrum Predict(osc::IOscCalculator *calc) const =0
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:37
virtual Spectrum PredictSyst(osc::IOscCalculator *calc, const SystShifts &syst) const
Definition: IPrediction.cxx:98
const XML_Char const XML_Char * data
Definition: expat.h:268
General interface to any calculator that lets you set the parameters.
static void Delete(TH1D *&h)
Definition: HistCache.cxx:215
double POT() const
Definition: Spectrum.h:263
Oscillation probability calculators.
Definition: Calcs.h:5
string syst
Definition: plotSysts.py:176
Standard interface to all prediction techniques.
Definition: IPrediction.h:57