109 cov->PrintNominalCurrProp();
114 debugFile <<
"\n-------------------------------------------------------" << std::endl;
127 TFile *infile =
new TFile(FitName.c_str(),
"READ");
128 TTree *posts = infile->Get<TTree>(
"posteriors");
129 unsigned int step_val = 0;
131 posts->SetBranchAddress(
"step", &step_val);
132 posts->GetEntry(posts->GetEntries() - 1);
136 for (
unsigned int i = 0; i <
systematics.size(); ++i)
153 if (syst->GetDoAdaption()){
154 syst->UpdateAdaptiveCovariance();
163 const double fRandom =
random->Rndm();
166 debugFile <<
" logLProp: " <<
logLProp <<
" logLCurr: " <<
logLCurr <<
" acc_prob: " << acc_prob <<
" fRandom: " << fRandom << std::endl;
169 if (fRandom > acc_prob)
MaCh3Plotting::PlottingManager * man
Base class for implementing fitting algorithms.
std::unique_ptr< TRandom3 > random
Random number.
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.
virtual void StartFromPreviousFit(const std::string &FitName)
Allow to start from previous fit/chain.
double stepTime
Time of single step.
unsigned int stepStart
step start, by default 0 if we start from previous chain then it will be different
std::unique_ptr< TStopwatch > stepClock
tells how long single step/fit iteration took
double logLCurr
current likelihood
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.
void RunMCMC() override
Actual implementation of MCMC fitting algorithm.
bool anneal
simulated annealing
unsigned int chainLength
number of steps in chain
void AcceptStep()
Accept a step.
double AnnealTemp
simulated annealing temperature
void StartFromPreviousFit(const std::string &FitName) override
Allow to start from previous fit/chain.
void PrintProgress()
Print the progress.
bool out_of_bounds
Do we reject based on hitting boundaries in systs.
bool IsStepAccepted(const double acc_prob)
Is step accepted?
void DoMCMCStep()
The full StartStep->DoStep->EndStep chain.
void PreStepProcess()
Actions before step proposal [start stopwatch].
MCMCBase(manager *const fitMan)
Constructor.
virtual void ProposeStep()=0
Propose a step.
virtual void DoStep()=0
The MCMC step proposal and acceptance.
void PostStepProcess()
Actions after step proposal [end stopwatch, fill tree].
void AdaptiveStep()
Adaptive MCMC step.
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.