18class TGraphAsymmErrors;
44 void DragRace(
const int NLaps = 100);
66 virtual inline std::string
GetName()
const {
return "FitterBase";};
85 bool GetScaneRange(std::map<std::string, std::vector<double>>& scanRanges);
88 bool CheckSkipParameter(
const std::vector<std::string>& SkipVector,
const std::string& ParamName)
const;
155 std::ofstream debugFile;
Base class for implementing fitting algorithms.
void RunLLHScan()
Perform a 1D likelihood scan.
void AddSystObj(ParameterHandlerBase *cov)
This function adds a Covariance object to the analysis framework. The Covariance object will be utili...
void AddSampleHandler(SampleHandlerBase *sample)
This function adds a sample PDF object to the analysis framework. The sample PDF object will be utili...
std::unique_ptr< TRandom3 > random
Random number.
std::vector< SampleHandlerBase * > samples
Sample holder.
int stepStart
step start if restarting
double logLProp
proposed likelihood
bool CheckSkipParameter(const std::vector< std::string > &SkipVector, const std::string &ParamName) const
KS: Check whether we want to skip parameter using skip vector.
void ProcessMCMC()
Process MCMC output.
int accCount
counts accepted steps
virtual std::string GetName() const
Get name of class.
bool OutputPrepared
Checks if output prepared not repeat some operations.
void SaveOutput()
Save output and close files.
TFile * outputFile
Output.
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.
bool SettingsSaved
Checks if setting saved not repeat some operations.
virtual void RunMCMC()=0
The specific fitting algorithm implemented in this function depends on the derived class....
double accProb
current acceptance prob
void GetStepScaleBasedOnLLHScan()
LLH scan is good first estimate of step scale.
virtual void StartFromPreviousFit(const std::string &FitName)
Allow to start from previous fit/chain.
bool FileSaved
Checks if file saved not repeat some operations.
std::vector< double > sample_llh
store the llh breakdowns
void RunSigmaVar()
Perform a 2D and 1D sigma var for all samples.
double stepTime
Time of single step.
std::unique_ptr< TStopwatch > clock
tells global time how long fit took
std::unique_ptr< TStopwatch > stepClock
tells how long single step/fit iteration took
TDirectory * CovFolder
Output cov folder.
TDirectory * SampleFolder
Output sample folder.
void DragRace(const int NLaps=100)
Calculates the required time for each sample or covariance object in a drag race simulation....
void Run2DLLHScan()
Perform a 2D likelihood scan.
unsigned int TotalNSamples
Total number of samples used.
double logLCurr
current likelihood
std::vector< double > syst_llh
systematic llh breakdowns
int auto_save
auto save every N steps
bool fTestLikelihood
Necessary for some fitting algorithms like PSO.
virtual ~FitterBase()
Destructor for the FitterBase class.
TTree * outTree
Output tree with posteriors.
void SanitiseInputs()
Remove obsolete memory and make other checks before fit starts.
bool GetScaneRange(std::map< std::string, std::vector< double > > &scanRanges)
YSP: Set up a mapping to store parameters with user-specified ranges, suggested by D....
std::vector< ParameterHandlerBase * > systematics
Systematic holder.
Base class responsible for handling of systematic error parameters. Capable of using PCA or using ada...
Class responsible for handling implementation of samples used in analysis, reweighting and returning ...
The manager class is responsible for managing configurations and settings.