![]() |
MaCh3
2.4.2
Reference Guide
|
Base class for MCMC fitting algorithms. More...
#include <Fitters/MCMCBase.h>
Public Member Functions | |
| MCMCBase (Manager *const fitMan) | |
| Constructor. More... | |
| virtual | ~MCMCBase ()=default |
| Destructor. More... | |
| void | RunMCMC () override |
| Actual implementation of MCMC fitting algorithm. More... | |
| void | StartFromPreviousFit (const std::string &FitName) override |
| Allow to start from previous fit/chain. More... | |
| void | setChainLength (unsigned int L) |
| Set how long chain should be. More... | |
Public Member Functions inherited from FitterBase | |
| FitterBase (Manager *const fitMan) | |
| Constructor. More... | |
| virtual | ~FitterBase () |
| Destructor for the FitterBase class. More... | |
| void | AddSampleHandler (SampleHandlerBase *sample) |
| This function adds a sample PDF object to the analysis framework. The sample PDF object will be utilized in fitting procedures or likelihood scans. More... | |
| void | AddSystObj (ParameterHandlerBase *cov) |
| This function adds a Covariance object to the analysis framework. The Covariance object will be utilized in fitting procedures or likelihood scans. More... | |
| void | DragRace (const int NLaps=100) |
| Calculates the required time for each sample or covariance object in a drag race simulation. Inspired by Dan's feature. More... | |
| void | RunLLHScan () |
| Perform a 1D likelihood scan. More... | |
| void | RunLLHMap () |
| Perform a general multi-dimensional likelihood scan. More... | |
| void | GetStepScaleBasedOnLLHScan () |
| LLH scan is good first estimate of step scale. More... | |
| void | Run2DLLHScan () |
| Perform a 2D likelihood scan. More... | |
| void | RunSigmaVar () |
| Perform a 1D/2D sigma var for all samples. More... | |
| std::string | GetName () const |
| Get name of class. More... | |
Protected Member Functions | |
| void | DoMCMCStep () |
| The full StartStep->DoStep->EndStep chain. More... | |
| virtual void | ProposeStep ()=0 |
| Propose a step. More... | |
| void | PreStepProcess () |
| Actions before step proposal [start stopwatch]. More... | |
| void | PostStepProcess () |
| Actions after step proposal [end stopwatch, fill tree]. More... | |
| virtual void | DoStep ()=0 |
| The MCMC step proposal and acceptance. More... | |
| virtual double | AcceptanceProbability ()=0 |
| Step acceptance probability. More... | |
| bool | IsStepAccepted (const double acc_prob) |
| Is step accepted? More... | |
| void | AcceptStep () |
| Accept a step. More... | |
| void | AdaptiveStep () |
| Adaptive MCMC step. More... | |
| void | PrintProgress (const bool StepsPrint=true) |
| Print the progress. More... | |
Protected Member Functions inherited from FitterBase | |
| void | ProcessMCMC () |
| Process MCMC output. More... | |
| void | PrepareOutput () |
| Prepare the output file. More... | |
| void | SaveOutput () |
| Save output and close files. More... | |
| void | SanitiseInputs () |
| Remove obsolete memory and make other checks before fit starts. More... | |
| void | SaveSettings () |
| Save the settings that the MCMC was run with. More... | |
| bool | GetScanRange (std::map< std::string, std::vector< double >> &scanRanges) const |
| YSP: Set up a mapping to store parameters with user-specified ranges, suggested by D. Barrow. More... | |
| void | GetParameterScanRange (const ParameterHandlerBase *cov, const int i, double &CentralValue, double &lower, double &upper, const int n_points, const std::string &suffix="") const |
| Helper function to get parameter scan range, central value. More... | |
| bool | CheckSkipParameter (const std::vector< std::string > &SkipVector, const std::string &ParamName) const |
| KS: Check whether we want to skip parameter using skip vector. More... | |
| void | CustomRange (const std::string &ParName, const double sigma, double &ParamShiftValue) const |
| For comparison with other fitting frameworks (like P-Theta) we usually have to apply different parameter values then usual 1, 3 sigma. More... | |
Protected Attributes | |
| bool | out_of_bounds |
| Do we reject based on hitting boundaries in systs. More... | |
| bool | accept |
| Accept. More... | |
| unsigned int | chainLength |
| number of steps in chain More... | |
| bool | anneal |
| simulated annealing More... | |
| double | AnnealTemp |
| simulated annealing temperature More... | |
Protected Attributes inherited from FitterBase | |
| Manager * | fitMan |
| The manager for configuration handling. More... | |
| unsigned int | step |
| current state More... | |
| double | logLCurr |
| current likelihood More... | |
| double | logLProp |
| proposed likelihood More... | |
| double | accProb |
| current acceptance prob More... | |
| int | accCount |
| counts accepted steps More... | |
| unsigned int | stepStart |
| step start, by default 0 if we start from previous chain then it will be different More... | |
| std::vector< double > | sample_llh |
| store the llh breakdowns More... | |
| std::vector< double > | syst_llh |
| systematic llh breakdowns More... | |
| std::vector< SampleHandlerBase * > | samples |
| Sample holder. More... | |
| unsigned int | TotalNSamples |
| Total number of samples used, single SampleHandler can store more than one analysis sample! More... | |
| std::vector< ParameterHandlerBase * > | systematics |
| Systematic holder. More... | |
| std::unique_ptr< TStopwatch > | clock |
| tells global time how long fit took More... | |
| std::unique_ptr< TStopwatch > | stepClock |
| tells how long single step/fit iteration took More... | |
| double | stepTime |
| Time of single step. More... | |
| std::unique_ptr< TRandom3 > | random |
| Random number. More... | |
| TFile * | outputFile |
| Output. More... | |
| TDirectory * | CovFolder |
| Output cov folder. More... | |
| TDirectory * | SampleFolder |
| Output sample folder. More... | |
| TTree * | outTree |
| Output tree with posteriors. More... | |
| int | auto_save |
| auto save every N steps More... | |
| bool | fTestLikelihood |
| Necessary for some fitting algorithms like PSO. More... | |
| bool | FileSaved |
| Checks if file saved not repeat some operations. More... | |
| bool | SettingsSaved |
| Checks if setting saved not repeat some operations. More... | |
| bool | OutputPrepared |
| Checks if output prepared not repeat some operations. More... | |
| std::string | AlgorithmName |
| Name of fitting algorithm that is being used. More... | |
Base class for MCMC fitting algorithms.
Inherits from FitterBase and defines the interface for MCMC-based fitting, including chain management and step handling.
Definition at line 8 of file MCMCBase.h.
| MCMCBase::MCMCBase | ( | Manager *const | fitMan | ) |
Constructor.
| fitMan | A pointer to a manager object, which will handle all settings. |
Definition at line 6 of file MCMCBase.cpp.
|
virtualdefault |
Destructor.
|
protectedpure virtual |
Step acceptance probability.
Implemented in MR2T2, and DelayedMR2T2.
|
protected |
Accept a step.
Definition at line 206 of file MCMCBase.cpp.
|
inlineprotected |
|
inlineprotected |
The full StartStep->DoStep->EndStep chain.
Starts step timer, prints progress
Step proposal, acceptance etc
Tree filling etc.
Definition at line 80 of file MCMCBase.cpp.
|
protectedpure virtual |
The MCMC step proposal and acceptance.
Implemented in MR2T2, and DelayedMR2T2.
|
protected |
Is step accepted?
| acc_prob | used for telling whether step is accepted or not |
Definition at line 188 of file MCMCBase.cpp.
|
inlineprotected |
Actions after step proposal [end stopwatch, fill tree].
Definition at line 104 of file MCMCBase.cpp.
|
inlineprotected |
Actions before step proposal [start stopwatch].
Definition at line 91 of file MCMCBase.cpp.
|
inlineprotected |
Print the progress.
Definition at line 127 of file MCMCBase.cpp.
|
protectedpure virtual |
Propose a step.
Implemented in MR2T2.
|
overridevirtual |
Actual implementation of MCMC fitting algorithm.
Implements FitterBase.
Definition at line 32 of file MCMCBase.cpp.
|
inline |
Set how long chain should be.
| L | new chain length |
Definition at line 26 of file MCMCBase.h.
|
overridevirtual |
Allow to start from previous fit/chain.
| FitName | Name of previous chain |
Reimplemented from FitterBase.
Definition at line 149 of file MCMCBase.cpp.
|
protected |
Accept.
Definition at line 63 of file MCMCBase.h.
|
protected |
simulated annealing
Definition at line 69 of file MCMCBase.h.
|
protected |
simulated annealing temperature
Definition at line 71 of file MCMCBase.h.
|
protected |
number of steps in chain
Definition at line 66 of file MCMCBase.h.
|
protected |
Do we reject based on hitting boundaries in systs.
Definition at line 60 of file MCMCBase.h.