57 std::unique_ptr<TH1D>
MakePredictive(
const std::vector<std::unique_ptr<TH1D>>& Toys,
58 const std::string& Sample_Name,
59 const std::string& suffix,
60 const bool DebugHistograms);
63 std::vector<std::unique_ptr<TH2D>>
ProduceSpectra(
const std::vector<std::vector<std::unique_ptr<TH1D>>>& Toys,
64 const std::string suffix);
69 const std::vector<TDirectory*>& SampleDir);
76 double GetLLH(
const std::unique_ptr<TH1D>& DatHist,
77 const std::unique_ptr<TH1D>& MCHist,
78 const std::unique_ptr<TH1D>& W2Hist,
82 void MakeChi2Plots(
const std::vector<std::vector<double>>& Chi2_x,
83 const std::string& Chi2_x_title,
84 const std::vector<std::vector<double>>& Chi2_y,
85 const std::string& Chi2_y_title,
86 const std::vector<TDirectory*>& SampleDir,
87 const std::string Title);
Base class for implementing fitting algorithms.
std::string GetName() const
Get name of class.
manager * fitMan
The manager.
Custom exception class for MaCh3 errors.
Class responsible for handling of systematic error parameters with different types defined in the con...
Implementation of Prior/Posterior Predictive and Bayesian p-Value calculations following the approach...
void SetParamters()
This set some params to prior value this way you can evaluate errors from subset of errors.
std::vector< double > PenaltyTerm
Penalty term values for each toy by default 0.
std::vector< std::string > SampleNames
Name of a single sample.
std::vector< std::unique_ptr< TH1D > > MC_Nom_Hist
Vector of MC histograms.
virtual ~PredictiveThrower()
Destructor.
bool FullLLH
KS: Use Full LLH or only sample contribution based on discussion with Asher we almost always only wan...
std::unique_ptr< TH1D > MakePredictive(const std::vector< std::unique_ptr< TH1D >> &Toys, const std::string &Sample_Name, const std::string &suffix, const bool DebugHistograms)
Produce posterior predictive distribution.
void RunPredictiveAnalysis()
Main routine responsible for producing posterior predictive distributions and $p$-value.
bool LoadToys()
Load existing toys.
PredictiveThrower(manager *const fitMan)
Constructor.
std::vector< std::vector< std::unique_ptr< TH1D > > > W2_Hist_Toy
std::unordered_set< int > ParameterOnlyToVary
KS: Index of parameters groups that will be varied.
bool Is_PriorPredictive
Whether it is Prior or Posterior predictive.
std::vector< std::string > ParameterGroupsNotVaried
KS: Names of parameter groups that will not be varied.
std::vector< std::unique_ptr< TH1D > > W2_Nom_Hist
Vector of W2 histograms.
int NModelParams
KS: Count total number of model parameters which can be used for stuff like BIC.
void RunMCMC() override
This is not used in this class.
int Ntoys
Number of toys we are generating analysing.
void SetupToyGeneration()
Setup useful variables etc before stating toy generation.
void MakeChi2Plots(const std::vector< std::vector< double >> &Chi2_x, const std::string &Chi2_x_title, const std::vector< std::vector< double >> &Chi2_y, const std::string &Chi2_y_title, const std::vector< TDirectory * > &SampleDir, const std::string Title)
Produce Chi2 plot for a single sample based on which $p$-value is calculated.
std::vector< int > SampleObjectMap
Maps if sample with given SampleHandler, useful if we have more than one sample in single object.
void SetupSampleInformation()
Setup sample information.
void PosteriorPredictivepValue(const std::vector< std::unique_ptr< TH1D >> &PostPred_mc, const std::vector< TDirectory * > &SampleDir)
Calculate Posterior Predictive $p$-value.
int TotalNumberOfSamples
Number of toys we are generating analysing.
void ProduceToys()
Produce toys by throwing from MCMC.
std::vector< std::unique_ptr< TH2D > > ProduceSpectra(const std::vector< std::vector< std::unique_ptr< TH1D >>> &Toys, const std::string suffix)
Produce Violin style spectra.
ParameterHandlerGeneric * ModelSystematic
Pointer to El Generico.
std::vector< double > ReweightWeight
Reweighting factors applied for each toy, by default 1.
double GetLLH(const std::unique_ptr< TH1D > &DatHist, const std::unique_ptr< TH1D > &MCHist, const std::unique_ptr< TH1D > &W2Hist, SampleHandlerBase *SampleHandler)
Helper functions to calculate likelihoods using TH1D.
std::vector< std::unique_ptr< TH1D > > Data_Hist
Vector of Data histograms.
std::vector< std::vector< std::unique_ptr< TH1D > > > MC_Hist_Toy
Class responsible for handling implementation of samples used in analysis, reweighting and returning ...
The manager class is responsible for managing configurations and settings.