79 std::vector<std::unique_ptr<TH1>>
MakePredictive(
const std::vector<std::vector<std::unique_ptr<TH1>>>& Toys,
80 const std::vector<TDirectory*>& Director,
81 const std::string& suffix,
82 const bool DebugHistograms);
86 const std::vector<std::vector<std::unique_ptr<TH1>>>& Toys,
87 const std::vector<TDirectory*>& Director,
88 const std::string suffix);
92 const std::vector<TDirectory*>& SampleDir);
99 double GetLLH(
const std::unique_ptr<TH1>& DatHist,
100 const std::unique_ptr<TH1>& MCHist,
101 const std::unique_ptr<TH1>& W2Hist,
105 void MakeChi2Plots(
const std::vector<std::vector<double>>& Chi2_x,
106 const std::string& Chi2_x_title,
107 const std::vector<std::vector<double>>& Chi2_y,
108 const std::string& Chi2_y_title,
109 const std::vector<TDirectory*>& SampleDir,
110 const std::string Title);
KS: Class handling binning for multiple samples.
Base class for implementing fitting algorithms.
std::string GetName() const
Get name of class.
Manager * fitMan
The manager for configuration handling.
Custom exception class used throughout MaCh3.
The manager class is responsible for managing configurations and settings.
Base class responsible for handling of systematic error parameters. Capable of using PCA or using ada...
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.
virtual ~PredictiveThrower()
Destructor.
std::vector< std::vector< std::unique_ptr< TH2D > > > ProduceSpectra(const std::vector< std::vector< std::unique_ptr< TH1 >>> &Toys, const std::vector< TDirectory * > &Director, const std::string suffix)
Produce Violin style spectra.
bool FullLLH
KS: Use Full LLH or only sample contribution based on discussion with Asher we almost always only wan...
void RunPredictiveAnalysis()
Main routine responsible for producing posterior predictive distributions and $p$-value.
bool LoadToys()
Load existing toys.
void PosteriorPredictivepValue(const std::vector< std::unique_ptr< TH1 >> &PostPred_mc, const std::vector< TDirectory * > &SampleDir)
Calculate Posterior Predictive $p$-value.
std::vector< std::unique_ptr< TH1 > > MakePredictive(const std::vector< std::vector< std::unique_ptr< TH1 >>> &Toys, const std::vector< TDirectory * > &Director, const std::string &suffix, const bool DebugHistograms)
Produce posterior predictive distribution.
std::vector< std::string > GetStoredFancyName(ParameterHandlerBase *Systematics) const
Get Fancy parameters stored in mcmc chains for passed ParameterHandler.
std::vector< std::unique_ptr< TH1 > > W2_Nom_Hist
Vector of W2 histograms.
std::unordered_set< int > ParameterOnlyToVary
KS: Index of parameters that will be varied.
std::vector< std::vector< std::unique_ptr< TH1 > > > W2_Hist_Toy
double GetLLH(const std::unique_ptr< TH1 > &DatHist, const std::unique_ptr< TH1 > &MCHist, const std::unique_ptr< TH1 > &W2Hist, const SampleHandlerBase *SampleHandler)
Helper functions to calculate likelihoods using TH1.
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.
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.
void SetupSampleInformation()
Setup sample information.
std::vector< std::unique_ptr< TH1 > > MC_Nom_Hist
Vector of MC histograms.
int TotalNumberOfSamples
Number of toys we are generating analysing.
void ProduceToys()
Produce toys by throwing from MCMC.
void StudyBetaParameters(TDirectory *PredictiveDir)
Evaluate prior/post predictive distribution for beta parameters (used for evaluating impact MC statis...
std::vector< std::unique_ptr< TH1 > > Data_Hist
Vector of Data histograms.
ParameterHandlerGeneric * ModelSystematic
Pointer to El Generico.
std::vector< double > ReweightWeight
Reweighting factors applied for each toy, by default 1.
PredictiveThrower(Manager *const fitMan)
Constructor.
std::vector< std::vector< std::unique_ptr< TH1 > > > MC_Hist_Toy
std::vector< PredictiveSample > SampleInfo
Handy struct for all sample info.
Class responsible for handling implementation of samples used in analysis, reweighting and returning ...
Class responsible for handling implementation of samples used in analysis, reweighting and returning ...
KS: Summary of sample info to be used by.
int LocalId
Local SampleId in SampleHandler.
int Dimenstion
Sample Dimension.
const SampleHandlerFD * SamHandler
Pointer to SampleHandler.
const BinningHandler * Binning
Pointer to binning handler.