Compare a single data spectrum to the MC + cosmics expectation. More...
Public Member Functions | |
SingleSampleExperiment (const IPrediction *pred, const Spectrum &data, const Spectrum &cosmic, double cosmicScaleError=0) | |
SingleSampleExperiment (const IPrediction *pred, const Spectrum &data, const TH1D *cosmic, double cosmicScaleError=0, double fromlivetime=1., double topotlivetime=1.) | |
Fallback to manual cosmic scaling. More... | |
SingleSampleExperiment (const IPrediction *pred, const Spectrum &data) | |
In MC studies you might not want to bother with cosmics. More... | |
virtual | ~SingleSampleExperiment () |
virtual double | ChiSq (osc::IOscCalculatorAdjustable *osc, const SystShifts &syst=SystShifts::Nominal()) const override |
virtual void | Derivative (osc::IOscCalculator *calc, const SystShifts &shift, std::unordered_map< const ISyst *, double > &dch) const override |
virtual void | SaveTo (TDirectory *dir) const override |
SingleSampleExperiment (const SingleSampleExperiment &)=delete | |
SingleSampleExperiment & | operator= (const SingleSampleExperiment &)=delete |
SingleSampleExperiment (SingleSampleExperiment &&s) | |
Static Public Member Functions | |
static std::unique_ptr< SingleSampleExperiment > | LoadFrom (TDirectory *dir) |
Protected Member Functions | |
TH1D * | PredHistIncCosmics (osc::IOscCalculator *calc, const SystShifts &syst) const |
Protected Attributes | |
const IPrediction * | fMC |
Spectrum | fData |
TH1D * | fCosmic |
double | fCosmicScaleError |
Compare a single data spectrum to the MC + cosmics expectation.
Definition at line 21 of file SingleSampleExperiment.h.
ana::SingleSampleExperiment::SingleSampleExperiment | ( | const IPrediction * | pred, |
const Spectrum & | data, | ||
const Spectrum & | cosmic, | ||
double | cosmicScaleError = 0 |
||
) |
pred | Source of oscillated MC beam predictions |
data | Data spectrum to compare to |
cosmic | Cosmic ray background component |
cosmicScaleError | fractional uncertainty on cosmic normalization |
Definition at line 18 of file SingleSampleExperiment.cxx.
ana::SingleSampleExperiment::SingleSampleExperiment | ( | const IPrediction * | pred, |
const Spectrum & | data, | ||
const TH1D * | cosmic, | ||
double | cosmicScaleError = 0 , |
||
double | fromlivetime = 1. , |
||
double | topotlivetime = 1. |
||
) |
Fallback to manual cosmic scaling.
cosmic must be already scaled so that its bin contents can be directly summed onto data. If you're using the out-of-time part of the beam spill, the easiest thing to do is to pass kTimingSidebandWeight as the weight argument when you fill it.
Definition at line 29 of file SingleSampleExperiment.cxx.
References om::cout, allTimeWatchdog::endl, and fCosmic.
|
inline |
In MC studies you might not want to bother with cosmics.
Definition at line 47 of file SingleSampleExperiment.h.
References calc, dir, ana::LoadFrom(), ana::SystShifts::Nominal(), ana::ISyst::operator=(), ana::SaveTo(), plotSysts::shift, and plotSysts::syst.
|
virtual |
Definition at line 61 of file SingleSampleExperiment.cxx.
References ana::HistCache::Delete(), fCosmic, and PredHistIncCosmics().
|
delete |
|
inline |
Definition at line 70 of file SingleSampleExperiment.h.
References plotSysts::syst.
|
overridevirtual |
Implements ana::IChiSqExperiment.
Reimplemented in ana::BigChi2SingleSampleExperiment, and ana::CovMxExperiment.
Definition at line 92 of file SingleSampleExperiment.cxx.
References ana::HistCache::Delete(), Derivative(), fData, chisquared::hpred, ana::LogLikelihood(), ana::Spectrum::POT(), PredHistIncCosmics(), and ana::Spectrum::ToTH1().
Referenced by ana::BigChi2SingleSampleExperiment::ChiSq().
|
overridevirtual |
Reimplemented from ana::IChiSqExperiment.
Definition at line 108 of file SingleSampleExperiment.cxx.
References ana::HistCache::Delete(), ana::IPrediction::Derivative(), fCosmic, fCosmicScaleError, fData, fMC, chisquared::hpred, MECModelEnuComparisons::i, it, ana::LogLikelihoodDerivative(), pot, ana::Spectrum::POT(), PredHistIncCosmics(), and ana::Spectrum::ToTH1().
Referenced by ChiSq().
|
static |
Definition at line 160 of file SingleSampleExperiment.cxx.
References ana::Spectrum::LoadFrom(), ana::LoadFrom< IPrediction >(), mc, runNovaSAM::release, and runNovaSAM::ret.
Referenced by getHists_FNEX(), and ana::LoadFrom< IChiSqExperiment >().
|
delete |
|
protected |
Definition at line 68 of file SingleSampleExperiment.cxx.
References fCosmic, fCosmicScaleError, fData, fMC, ana::SystShifts::GetShift(), chisquared::hpred, ana::Spectrum::POT(), plot_validation_datamc::pred, ana::IPrediction::PredictSyst(), scale, ana::SystShifts::SetShift(), plotSysts::syst, and ana::Spectrum::ToTH1().
Referenced by ChiSq(), Derivative(), and ~SingleSampleExperiment().
|
overridevirtual |
Reimplemented from ana::IChiSqExperiment.
Definition at line 144 of file SingleSampleExperiment.cxx.
References dir, fCosmic, fData, fMC, ana::IPrediction::SaveTo(), ana::Spectrum::SaveTo(), and tmp.
Referenced by joint_fit_make_experiments().
|
protected |
Definition at line 84 of file SingleSampleExperiment.h.
Referenced by ana::CovMxExperiment::ChiSq(), Derivative(), PredHistIncCosmics(), SaveTo(), SingleSampleExperiment(), and ~SingleSampleExperiment().
|
protected |
Definition at line 86 of file SingleSampleExperiment.h.
Referenced by ana::CovMxExperiment::ChiSq(), Derivative(), and PredHistIncCosmics().
|
protected |
Definition at line 83 of file SingleSampleExperiment.h.
Referenced by ChiSq(), ana::CovMxExperiment::ChiSq(), Derivative(), PredHistIncCosmics(), and SaveTo().
|
protected |
Definition at line 82 of file SingleSampleExperiment.h.
Referenced by ana::CovMxExperiment::ChiSq(), Derivative(), PredHistIncCosmics(), and SaveTo().