Public Member Functions | |
MichelDecomp (SpectrumLoaderBase &NDMCloader, SpectrumLoaderBase &NDdataloader, const HistAxis &axis, const Cut &cut, const IDecomp *nNueEstimate, const SystShifts &shiftMC=kNoShift, const SystShifts &shiftData=kNoShift, const Var &wei=kUnweighted) | |
MichelDecomp (SpectrumLoaderBase &NDMCloader, SpectrumLoaderBase &NDdataloader, std::string label, const Binning &bins, const Var &var, const Cut &cut, const IDecomp *nNueEstimate, const SystShifts &shiftMC=kNoShift, const SystShifts &shiftData=kNoShift, const Var &wei=kUnweighted) | |
MichelDecomp (Loaders &loaders, const HistAxis &axis, const Cut &cut, const IDecomp *nNueEstimate, const SystShifts &shiftMC=kNoShift, const SystShifts &shiftData=kNoShift, const Var &wei=kUnweighted) | |
~MichelDecomp () | |
virtual Spectrum | NCTotalComponent () const override |
virtual Spectrum | NCComponent () const override |
virtual Spectrum | NCAntiComponent () const override |
virtual Spectrum | NumuComponent () const override |
virtual Spectrum | AntiNumuComponent () const override |
virtual Spectrum | NueComponent () const override |
virtual Spectrum | AntiNueComponent () const override |
virtual Spectrum | Data_Component () const override |
virtual Spectrum | MCTotal () const |
Spectrum | MC_NCTotalComponent () const override |
Spectrum | MC_NCComponent () const override |
Spectrum | MC_NCAntiComponent () const override |
Spectrum | MC_NumuComponent () const override |
Spectrum | MC_AntiNumuComponent () const override |
Spectrum | MC_NueComponent () const override |
Spectrum | MC_AntiNueComponent () const override |
virtual Spectrum | MC_MCTotal () const |
void | SavePlots (TDirectory *dir) const |
virtual void | SaveTo (TDirectory *dir, const std::string &name) const override |
const IDecomp * | GetNueEstimateDecomp () const |
Static Public Member Functions | |
static std::unique_ptr< MichelDecomp > | LoadFrom (TDirectory *dir, const std::string &name) |
Protected Member Functions | |
MichelDecomp (Spectrum nc, Spectrum antinc, Spectrum numu, Spectrum antinumu, Spectrum nue, Spectrum antinue, Spectrum data, ReweightableSpectrum michelnc, ReweightableSpectrum michelnumu, ReweightableSpectrum michelnue, ReweightableSpectrum micheldata, const IDecomp *nueestimate) | |
void | Decompose () const |
Calls ComputeScaleFactor for every process / E Bin, saves scale factors. More... | |
void | SplitByProp (MDCMPHelper hSums, std::vector< double > &numuScales, std::vector< double > &ncScales, std::vector< double > &nueScales) const |
void | SplitByNue (MDCMPHelper hSums, std::vector< double > &numuScales, std::vector< double > &ncScales, std::vector< double > &nueScales) const |
void | SplitByMichels (int EIdx, MDCMPHelper hSums, std::vector< double > &numuScales, std::vector< double > &ncScales, std::vector< double > &nueScales) const |
double | GetNueScale (int EIdx) const |
Nue scale from input decomp. More... | |
double | GetNumuScale (int EIdx) const |
Numu scale from input decomp. More... | |
double | GetNCScale (int EIdx) const |
NC scale from input decomp. More... | |
double | GetNumuMCContent (int EIdx) const |
Getting numu relative MC content. More... | |
double | GetNCMCContent (int EIdx) const |
double | ComputeScaleFactor (int EIdx, MDCMPHelper hSums) const |
Starting code to run through decomp algebra //////////////////////////////////////////////////////////////////////// Compute scale factors. More... | |
double | CalculateMCMean (double h, double Numu, double NC, double Nue, MDCMPHelper hSums) const |
Calculates the expected MC events, for a given scale factor. More... | |
double | MDCMPLogLikelihood (double h, int EIdx, MDCMPHelper hSums) const |
Calculates the LL for a given scale, based on the data. More... | |
double | ComputeMaxScale (MDCMPHelper hSums) const |
double | GetSum (ReweightableSpectrum spect, int EIdx) const |
Sums given spectrum over NME bins, for a given E Bin. More... | |
double | GetTemplateContent (ReweightableSpectrum spect, int EIdx, int mIdx) const |
Gets bin content in template histogram, for a given E / NME bin. More... | |
virtual Spectrum | MCToDCMPComp (std::vector< double >, Spectrum) const |
Ending code to run through decomp algebra. More... | |
void | SaveCompPlots (TDirectory *dir, std::string comp, Spectrum dcmp, Spectrum mc) const |
void | SaveTempPlots (TDirectory *dir) const |
Definition at line 44 of file MichelDecomp.h.
ana::MichelDecomp::MichelDecomp | ( | SpectrumLoaderBase & | NDMCloader, |
SpectrumLoaderBase & | NDdataloader, | ||
const HistAxis & | axis, | ||
const Cut & | cut, | ||
const IDecomp * | nNueEstimate, | ||
const SystShifts & | shiftMC = kNoShift , |
||
const SystShifts & | shiftData = kNoShift , |
||
const Var & | wei = kUnweighted |
||
) |
Definition at line 40 of file MichelDecomp.cxx.
Referenced by LoadFrom().
ana::MichelDecomp::MichelDecomp | ( | SpectrumLoaderBase & | NDMCloader, |
SpectrumLoaderBase & | NDdataloader, | ||
std::string | label, | ||
const Binning & | bins, | ||
const Var & | var, | ||
const Cut & | cut, | ||
const IDecomp * | nNueEstimate, | ||
const SystShifts & | shiftMC = kNoShift , |
||
const SystShifts & | shiftData = kNoShift , |
||
const Var & | wei = kUnweighted |
||
) |
Definition at line 74 of file MichelDecomp.cxx.
ana::MichelDecomp::MichelDecomp | ( | Loaders & | loaders, |
const HistAxis & | axis, | ||
const Cut & | cut, | ||
const IDecomp * | nNueEstimate, | ||
const SystShifts & | shiftMC = kNoShift , |
||
const SystShifts & | shiftData = kNoShift , |
||
const Var & | wei = kUnweighted |
||
) |
Definition at line 89 of file MichelDecomp.cxx.
ana::MichelDecomp::~MichelDecomp | ( | ) |
|
inlineprotected |
Definition at line 110 of file MichelDecomp.h.
References make_syst_table_plots::h, mc, ana::NC, ana::MDCMPFitResults::ncScales, ana::MDCMPFitResults::nueScales, ana::MDCMPFitResults::numuScales, and string.
|
overridevirtual |
Implements ana::IDecomp.
Definition at line 426 of file MichelDecomp.cxx.
References Decompose(), fAntiNue, fFitResult, isDecomposed, MCToDCMPComp(), and ana::MDCMPFitResults::nueScales.
Referenced by MakeResultPlot(), MichelDecompTest(), NDHists(), nue_decomp_scales(), nue_decomp_scales_for_make_decomp(), and SavePlots().
|
overridevirtual |
Implements ana::IDecomp.
Definition at line 440 of file MichelDecomp.cxx.
References Decompose(), fAntiNumu, fFitResult, isDecomposed, MCToDCMPComp(), and ana::MDCMPFitResults::numuScales.
Referenced by MakeResultPlot(), MichelDecompTest(), NDHists(), nue_decomp_scales(), nue_decomp_scales_for_make_decomp(), and SavePlots().
|
protected |
Calculates the expected MC events, for a given scale factor.
Definition at line 280 of file MichelDecomp.cxx.
References ana::assert(), ana::MDCMPHelper::fNueScale, ana::MDCMPHelper::fSumData, ana::MDCMPHelper::fSumNC, ana::MDCMPHelper::fSumNue, ana::MDCMPHelper::fSumNumu, extractScale::mean, and ana::NC.
Referenced by MDCMPLogLikelihood().
|
protected |
Definition at line 272 of file MichelDecomp.cxx.
References ana::assert(), ana::MDCMPHelper::fNueScale, ana::MDCMPHelper::fSumData, ana::MDCMPHelper::fSumNue, and ana::MDCMPHelper::fSumNumu.
Referenced by ComputeScaleFactor().
|
protected |
Starting code to run through decomp algebra //////////////////////////////////////////////////////////////////////// Compute scale factors.
Definition at line 249 of file MichelDecomp.cxx.
References ComputeMaxScale(), dx, MDCMPLogLikelihood(), and scale.
Referenced by SplitByMichels().
|
overridevirtual |
Reimplemented from ana::IDecomp.
Definition at line 502 of file MichelDecomp.cxx.
References fData.
Referenced by nue_decomp_scales_for_make_decomp(), PlotNueDecompFourBins(), TableNueNDComponents(), and TableNueNDDataMC().
|
protected |
Calls ComputeScaleFactor for every process / E Bin, saves scale factors.
Definition at line 107 of file MichelDecomp.cxx.
References fFitResult, fMichelData, fMichelNC, fMichelNue, fMichelNumu, ana::MDCMPHelper::fNCScale, ana::MDCMPHelper::fNueScale, fNumu, ana::MDCMPHelper::fNumuScale, ana::MDCMPHelper::fSumData, ana::MDCMPHelper::fSumNC, ana::MDCMPHelper::fSumNue, ana::MDCMPHelper::fSumNumu, GetNCMCContent(), GetNCScale(), GetNueScale(), GetNumuMCContent(), GetNumuScale(), GetSum(), isDecomposed, ana::MDCMPFitResults::ncScales, ana::MDCMPFitResults::nueScales, ana::MDCMPFitResults::numuScales, SplitByMichels(), SplitByNue(), and ana::Spectrum::ToTH1().
Referenced by AntiNueComponent(), AntiNumuComponent(), NCAntiComponent(), NCComponent(), NCTotalComponent(), NueComponent(), and NumuComponent().
|
protected |
Definition at line 236 of file MichelDecomp.cxx.
References fAntiNC, fAntiNue, fAntiNumu, fNC, fNue, fNumu, nc, and ana::Ratio::ToTH1().
Referenced by Decompose().
|
protected |
NC scale from input decomp.
Definition at line 217 of file MichelDecomp.cxx.
References fAntiNC, fNC, fNueEstimate, nc, ana::IDecomp::NCTotalComponent(), scale, and ana::Ratio::ToTH1().
Referenced by Decompose().
|
inline |
Definition at line 108 of file MichelDecomp.h.
|
protected |
Nue scale from input decomp.
Definition at line 195 of file MichelDecomp.cxx.
References ana::IDecomp::AntiNueComponent(), fAntiNue, fNue, fNueEstimate, ana::nue, ana::IDecomp::NueComponent(), scale, and ana::Ratio::ToTH1().
Referenced by Decompose().
|
protected |
Getting numu relative MC content.
Definition at line 227 of file MichelDecomp.cxx.
References fAntiNC, fAntiNue, fAntiNumu, fNC, fNue, fNumu, and ana::Ratio::ToTH1().
Referenced by Decompose().
|
protected |
Numu scale from input decomp.
Definition at line 206 of file MichelDecomp.cxx.
References ana::IDecomp::AntiNumuComponent(), fAntiNumu, fNueEstimate, fNumu, ana::IDecomp::NumuComponent(), scale, and ana::Ratio::ToTH1().
Referenced by Decompose().
|
protected |
Sums given spectrum over NME bins, for a given E Bin.
Definition at line 322 of file MichelDecomp.cxx.
References fData, analysePickle::hist, ana::Spectrum::POT(), sum, and ana::ReweightableSpectrum::ToTH2().
Referenced by Decompose().
|
protected |
Gets bin content in template histogram, for a given E / NME bin.
Definition at line 330 of file MichelDecomp.cxx.
References fData, analysePickle::hist, ana::Spectrum::POT(), and ana::ReweightableSpectrum::ToTH2().
Referenced by MDCMPLogLikelihood().
|
static |
Definition at line 534 of file MichelDecomp.cxx.
References ana::assert(), dir, fOwnNueEstimate, ana::LoadFrom< IDecomp >(), MichelDecomp(), nc, ana::nue, runNovaSAM::release, and runNovaSAM::ret.
Referenced by draw_decomp_plots(), nue_decomp_scales(), and plot_nominal_spectra().
|
overridevirtual |
Reimplemented from ana::IDecomp.
Definition at line 472 of file MichelDecomp.cxx.
References fAntiNue.
Referenced by GetNueNDComponentsMC(), MakeResultPlot(), NDHists(), and nue_decomp_scales_for_make_decomp().
|
overridevirtual |
Reimplemented from ana::IDecomp.
Definition at line 482 of file MichelDecomp.cxx.
References fAntiNumu.
Referenced by GetNueNDComponentsMC(), MakeResultPlot(), NDHists(), and nue_decomp_scales_for_make_decomp().
|
inlinevirtual |
Definition at line 100 of file MichelDecomp.h.
References dir, ana::LoadFrom(), ana::SaveTo(), and string.
|
overridevirtual |
Reimplemented from ana::IDecomp.
Definition at line 497 of file MichelDecomp.cxx.
References fAntiNC.
|
overridevirtual |
Reimplemented from ana::IDecomp.
Definition at line 492 of file MichelDecomp.cxx.
References fNC.
Referenced by nue_decomp_scales_for_make_decomp().
|
overridevirtual |
Reimplemented from ana::IDecomp.
Definition at line 487 of file MichelDecomp.cxx.
Referenced by GetNueNDComponentsMC(), MakeResultPlot(), and NDHists().
|
overridevirtual |
Reimplemented from ana::IDecomp.
Definition at line 467 of file MichelDecomp.cxx.
References fNue.
Referenced by GetNueNDComponentsMC(), MakeResultPlot(), NDHists(), and nue_decomp_scales_for_make_decomp().
|
overridevirtual |
Reimplemented from ana::IDecomp.
Definition at line 477 of file MichelDecomp.cxx.
References fNumu.
Referenced by GetNueNDComponentsMC(), MakeResultPlot(), NDHists(), and nue_decomp_scales_for_make_decomp().
|
protectedvirtual |
Ending code to run through decomp algebra.
Definition at line 343 of file MichelDecomp.cxx.
References fData, fMichelData, ana::ReweightableSpectrum::GetBinnings(), ana::Spectrum::GetEigen(), ana::ReweightableSpectrum::GetLabels(), ana::Spectrum::Livetime(), and ana::Spectrum::POT().
Referenced by AntiNueComponent(), AntiNumuComponent(), NCAntiComponent(), NCComponent(), NueComponent(), and NumuComponent().
|
inlinevirtual |
Definition at line 89 of file MichelDecomp.h.
|
protected |
Calculates the LL for a given scale, based on the data.
Definition at line 295 of file MichelDecomp.cxx.
References CalculateMCMean(), e, fMichelData, fMichelNC, fMichelNue, fMichelNumu, GetTemplateContent(), extractScale::mean, ana::NC, and ana::ReweightableSpectrum::ToTH2().
Referenced by ComputeScaleFactor().
|
overridevirtual |
Implements ana::IDecomp.
Definition at line 459 of file MichelDecomp.cxx.
References Decompose(), fAntiNC, fFitResult, isDecomposed, MCToDCMPComp(), and ana::MDCMPFitResults::ncScales.
Referenced by NCTotalComponent(), and SavePlots().
|
overridevirtual |
Implements ana::IDecomp.
Definition at line 453 of file MichelDecomp.cxx.
References Decompose(), fFitResult, fNC, isDecomposed, MCToDCMPComp(), and ana::MDCMPFitResults::ncScales.
Referenced by NCTotalComponent(), nue_decomp_scales(), nue_decomp_scales_for_make_decomp(), and SavePlots().
|
overridevirtual |
Reimplemented from ana::IDecomp.
Definition at line 447 of file MichelDecomp.cxx.
References Decompose(), isDecomposed, NCAntiComponent(), and NCComponent().
Referenced by MakeResultPlot(), MichelDecompTest(), and NDHists().
|
overridevirtual |
Implements ana::IDecomp.
Definition at line 419 of file MichelDecomp.cxx.
References Decompose(), fFitResult, fNue, isDecomposed, MCToDCMPComp(), and ana::MDCMPFitResults::nueScales.
Referenced by draw_decomp_plots(), MakeResultPlot(), MichelDecompTest(), NDHists(), nue_decomp_scales(), nue_decomp_scales_for_make_decomp(), and SavePlots().
|
overridevirtual |
Implements ana::IDecomp.
Definition at line 433 of file MichelDecomp.cxx.
References Decompose(), fFitResult, fNumu, isDecomposed, MCToDCMPComp(), and ana::MDCMPFitResults::numuScales.
Referenced by MakeResultPlot(), MichelDecompTest(), NDHists(), nue_decomp_scales(), nue_decomp_scales_for_make_decomp(), SavePlots(), and test_micheldecomp().
|
protected |
Definition at line 358 of file MichelDecomp.cxx.
References fData, plot_xsec_1d::hmc, pot, ana::Spectrum::POT(), and ana::Spectrum::ToTH1().
Referenced by SavePlots().
void ana::MichelDecomp::SavePlots | ( | TDirectory * | dir | ) | const |
Definition at line 395 of file MichelDecomp.cxx.
References AntiNueComponent(), AntiNumuComponent(), fAntiNC, fAntiNue, fAntiNumu, fNC, fNue, fNumu, NCAntiComponent(), NCComponent(), NueComponent(), NumuComponent(), SaveCompPlots(), SaveTempPlots(), and tmp.
Referenced by make_files_for_decomp_plots().
|
protected |
Definition at line 376 of file MichelDecomp.cxx.
References fData, fMichelData, fMichelNC, fMichelNue, fMichelNumu, pot, ana::Spectrum::POT(), ana::ReweightableSpectrum::ToTH2(), and ana::ToTH2().
Referenced by SavePlots().
|
overridevirtual |
Implements ana::IDecomp.
Definition at line 507 of file MichelDecomp.cxx.
References dir, fAntiNC, fAntiNue, fAntiNumu, fData, fMichelData, fMichelNC, fMichelNue, fMichelNumu, fNC, fNue, fNueEstimate, fNumu, ana::IDecomp::SaveTo(), ana::ReweightableSpectrum::SaveTo(), ana::Spectrum::SaveTo(), and tmp.
Referenced by make_files_for_decomp_plots(), and nue_decomp_scales().
|
protected |
Definition at line 150 of file MichelDecomp.cxx.
References ComputeScaleFactor(), ana::MDCMPHelper::fNueScale, ana::MDCMPHelper::fSumData, ana::MDCMPHelper::fSumNC, ana::MDCMPHelper::fSumNue, and ana::MDCMPHelper::fSumNumu.
Referenced by Decompose().
|
protected |
Definition at line 184 of file MichelDecomp.cxx.
References ana::MDCMPHelper::fNCScale, ana::MDCMPHelper::fNueScale, and ana::MDCMPHelper::fNumuScale.
Referenced by Decompose().
|
protected |
Definition at line 165 of file MichelDecomp.cxx.
References ana::MDCMPHelper::fSumData, ana::MDCMPHelper::fSumNC, ana::MDCMPHelper::fSumNue, and ana::MDCMPHelper::fSumNumu.
|
protected |
Definition at line 184 of file MichelDecomp.h.
Referenced by GetNCMCContent(), GetNCScale(), GetNumuMCContent(), MC_NCAntiComponent(), MC_NCTotalComponent(), NCAntiComponent(), SavePlots(), and SaveTo().
|
protected |
Definition at line 188 of file MichelDecomp.h.
Referenced by AntiNueComponent(), GetNCMCContent(), GetNueScale(), GetNumuMCContent(), MC_AntiNueComponent(), SavePlots(), and SaveTo().
|
protected |
Definition at line 186 of file MichelDecomp.h.
Referenced by AntiNumuComponent(), GetNCMCContent(), GetNumuMCContent(), GetNumuScale(), MC_AntiNumuComponent(), SavePlots(), and SaveTo().
|
protected |
Definition at line 189 of file MichelDecomp.h.
Referenced by Data_Component(), GetSum(), GetTemplateContent(), MCToDCMPComp(), SaveCompPlots(), SaveTempPlots(), and SaveTo().
|
mutableprotected |
Definition at line 199 of file MichelDecomp.h.
Referenced by AntiNueComponent(), AntiNumuComponent(), Decompose(), NCAntiComponent(), NCComponent(), NueComponent(), and NumuComponent().
|
protected |
Definition at line 193 of file MichelDecomp.h.
Referenced by Decompose(), MCToDCMPComp(), MDCMPLogLikelihood(), SaveTempPlots(), and SaveTo().
|
protected |
Definition at line 190 of file MichelDecomp.h.
Referenced by Decompose(), MDCMPLogLikelihood(), SaveTempPlots(), and SaveTo().
|
protected |
Definition at line 192 of file MichelDecomp.h.
Referenced by Decompose(), MDCMPLogLikelihood(), SaveTempPlots(), and SaveTo().
|
protected |
Definition at line 191 of file MichelDecomp.h.
Referenced by Decompose(), MDCMPLogLikelihood(), SaveTempPlots(), and SaveTo().
|
protected |
Definition at line 183 of file MichelDecomp.h.
Referenced by GetNCMCContent(), GetNCScale(), GetNumuMCContent(), MC_NCComponent(), MC_NCTotalComponent(), NCComponent(), SavePlots(), and SaveTo().
|
protected |
Definition at line 187 of file MichelDecomp.h.
Referenced by GetNCMCContent(), GetNueScale(), GetNumuMCContent(), MC_NueComponent(), NueComponent(), SavePlots(), and SaveTo().
|
protected |
Definition at line 195 of file MichelDecomp.h.
Referenced by GetNCScale(), GetNueScale(), GetNumuScale(), SaveTo(), and ~MichelDecomp().
|
protected |
Definition at line 185 of file MichelDecomp.h.
Referenced by Decompose(), GetNCMCContent(), GetNumuMCContent(), GetNumuScale(), MC_NumuComponent(), NumuComponent(), SavePlots(), and SaveTo().
|
protected |
Definition at line 196 of file MichelDecomp.h.
Referenced by LoadFrom(), and ~MichelDecomp().
|
mutableprotected |
Definition at line 198 of file MichelDecomp.h.
Referenced by AntiNueComponent(), AntiNumuComponent(), Decompose(), NCAntiComponent(), NCComponent(), NCTotalComponent(), NueComponent(), and NumuComponent().