45 const double fRandom =
random->Rndm();
56 if (debug) debugFile <<
" logLProp: " <<
logLProp <<
" logLCurr: " <<
logLCurr <<
" accProb: " <<
accProb <<
" fRandom: " << fRandom << std::endl;
125 if(syst->GetDoAdaption()){
126 syst->GetAdaptiveHandler()->SaveAdaptiveToFile(syst->GetAdaptiveHandler()->GetOutFileName(), syst->GetName(),
true);
155 if (debug) debugFile <<
"LLH after " <<
systematics[s]->GetName() <<
" " << llh << std::endl;
164 if (debug) debugFile <<
"Rejecting based on boundary" << std::endl;
174 for (
size_t i = 0; i <
samples.size(); ++i)
180 for (
size_t i = 0; i <
samples.size(); ++i) {
185 if (debug) debugFile <<
"LLH after sample " << i <<
" " << llh << std::endl;
191 for (
size_t i = 0; i <
samples.size(); ++i) {
195 if (debug) debugFile <<
"LLH after REJECT sample " << i <<
" " << llh << std::endl;
212 cov->PrintNominalCurrProp();
216 debugFile <<
"\n-------------------------------------------------------" << std::endl;
229 TFile *infile =
new TFile(FitName.c_str(),
"READ");
230 TTree *posts = infile->Get<TTree>(
"posteriors");
233 posts->SetBranchAddress(
"step",&step_val);
234 posts->GetEntry(posts->GetEntries()-1);
238 for(
unsigned int i = 0; i <
systematics.size(); ++i){
MaCh3Plotting::PlottingManager * man
Base class for implementing fitting algorithms.
std::unique_ptr< TRandom3 > random
Random number.
std::vector< SampleHandlerBase * > samples
Sample holder.
int stepStart
step start if restarting
double logLProp
proposed likelihood
void ProcessMCMC()
Process MCMC output.
int accCount
counts accepted steps
void SaveOutput()
Save output and close files.
void SaveSettings()
Save the settings that the MCMC was run with.
manager * fitMan
The manager.
unsigned int step
current state
void PrepareOutput()
Prepare the output file.
double accProb
current acceptance prob
virtual void StartFromPreviousFit(const std::string &FitName)
Allow to start from previous fit/chain.
std::vector< double > sample_llh
store the llh breakdowns
double stepTime
Time of single step.
std::unique_ptr< TStopwatch > stepClock
tells how long single step/fit iteration took
double logLCurr
current likelihood
std::vector< double > syst_llh
systematic llh breakdowns
int auto_save
auto save every N steps
TTree * outTree
Output tree with posteriors.
void SanitiseInputs()
Remove obsolete memory and make other checks before fit starts.
std::vector< ParameterHandlerBase * > systematics
Systematic holder.
Base class responsible for handling of systematic error parameters. Capable of using PCA or using ada...
The manager class is responsible for managing configurations and settings.
YAML::Node const & raw()
Return config.
void RunMCMC() override
Actual implementation of MCMC fitting algorithm.
unsigned int chainLength
number of steps in chain
double AnnealTemp
simulated annealing temperature
bool anneal
simulated annealing
bool reject
Do we reject based on hitting boundaries in systs.
mcmc(manager *const fitMan)
Constructor.
virtual ~mcmc()
Destructor.
void CheckStep()
Do we accept the step.
void ProposeStep()
Propose a step.
void StartFromPreviousFit(const std::string &FitName) override
Allow to start from previous fit/chain.
void PrintProgress()
Print the progress.
static constexpr const double _LARGE_LOGL_
Large Likelihood is used it parameter go out of physical boundary, this indicates in MCMC that such s...