A class for Monte Carlo. More...
#include <MonteCarlo.h>
A class for Monte Carlo.
This class is responsible for the MCMC runs using the MCMCEngine class together with input parameters from the InputParser class. The Monte Carlo mode is the default run mode if the –noMC flag is not specified. The settings for the Monte Carlo run can be fixed in in the format specified in the MonteCarlo.conf file, the name of this configuration file should be specified as the second argument to the executable.
Definition at line 35 of file MonteCarlo.h.
Public Member Functions | |
| void | addCustomObservableType (const std::string name, boost::function< Observable *() > funct) |
| std::map< std::string, BCH1D * > | getHistograms1D () const |
| std::map< std::string, BCH2D * > | getHistograms2D () const |
| MonteCarlo (ModelFactory &ModelF, ThObsFactory &ThObsF, const std::string &ModelConf_i, const std::string &MonteCarloConf_i, const std::string &OutFile_i, const std::string &JobTag_i) | |
| Constructor. More... | |
| void | Run (const int rank) |
| This member is responsible for setting the Monte Carlo run parameters and conducting the Monte Carlo run including initiating all output generation. More... | |
| void | TestRun (int rank) |
| The default destructor. More... | |
Private Member Functions | |
| void | ReadPreRunData (std::string file) |
Private Attributes | |
| bool | CalculateNormalization |
| < Flag for calculating the evidence. More... | |
| std::vector< CorrelatedGaussianObservables > | CGO |
| Vector for the Correlated Gaussian Observables defined in SomeModel.conf. More... | |
| std::vector< CorrelatedGaussianParameters > | CGP |
| Vector for the Correlated Gaussian Parameters defined in SomeModel.conf. More... | |
| bool | checkrun |
| A check to make sure TestRun()and Run() are not called consecutively. More... | |
| bool | FindModeWithMinuit |
| Flag for using Minuit libraries. More... | |
| std::string | JobTag |
| String for the optional JobTag argument to be passes to the executable. More... | |
| MonteCarloEngine | MCEngine |
| An object of the MonteCarloEngine class. More... | |
| std::string | MCMCConf |
| String for the name of the MonteCarlo.conf file. More... | |
| std::string | ModelConf |
| String for the name of the SomeModel.conf file. More... | |
| std::string | ModelName |
| The name of the model. More... | |
| std::vector< ModelParameter > | ModPars |
| Vector for the model parameters defined in SomeModel.conf. More... | |
| InputParser | myInputParser |
| An object of the InputParser class. More... | |
| double | normalization |
| A variable to store the evidence of a model. More... | |
| boost::ptr_vector< Observable > | Obs |
| Vector for the observables defined in SomeModel.conf. More... | |
| std::vector< Observable2D > | Obs2D |
| Vector for the Observables2D defined in SomeModel.conf. More... | |
| std::string | ObsDirName |
| String for the output directory name. More... | |
| std::string | OutFile |
| String for the name of the output root file without the .root extension. More... | |
| bool | PrintAllMarginalized |
| Flag for printing all Marginalized distributions to be passed on to the BAT routines. More... | |
| bool | PrintCorrelationMatrix |
| Flag for printing the correlation matrix. More... | |
| bool | PrintKnowledgeUpdatePlots |
| Flag for printing plots to compare prior vs. posterior knowledge of parameters. More... | |
| bool | PrintParameterPlot |
| Flag for printing the overview parameter plots. More... | |
| bool | WritePreRunData |
| Flag for printing the overview parameter plots. More... | |
| MonteCarlo::MonteCarlo | ( | ModelFactory & | ModelF, |
| ThObsFactory & | ThObsF, | ||
| const std::string & | ModelConf_i, | ||
| const std::string & | MonteCarloConf_i, | ||
| const std::string & | OutFile_i, | ||
| const std::string & | JobTag_i | ||
| ) |
Constructor.
The default constructor sets the names of the configuration files and the names of the output root file and specific output directory if a job ID is specified as an argument to the executable. The constructor also sets the default values of some flags related to the Monte Carlo run. The boolean flags (FindModeWithMinuit, PrintAllMarginalized, PrintCorrelationMatrix, PrintKnowledgeUpdatePlots, PrintParameterPlot) attain their run time values after the MonteCarlo.conf file is parsed by MonteCarlo::Run().
| [in] | ModelF | |
| [in] | ThObsF | |
| [in] | ModelConf_i | the name of the input configuration file for the model name, the model parameters and observables to be calculated (Observables, Observables2D, Model Parameters vs. Observables and Correlated Gaussian Observables) |
| [in] | MonteCarloConf_i | the name of the Monte Carlo configuration file that specifies the parameters of the Monte Carlo run like no. of chains, no. of pre run iterations etc. |
| [in] | OutFile_i | the name of the root output file to be given without the .root extention |
| [in] | JobTag_i | optional job tag that might be specified |
Definition at line 26 of file MonteCarlo.cpp.
| void MonteCarlo::addCustomObservableType | ( | const std::string | name, |
| boost::function< Observable *() > | funct | ||
| ) |
Definition at line 489 of file MonteCarlo.cpp.
|
inline |
Definition at line 142 of file MonteCarlo.h.
|
inline |
Definition at line 147 of file MonteCarlo.h.
|
private |
Definition at line 456 of file MonteCarlo.cpp.
| void MonteCarlo::Run | ( | const int | rank | ) |
This member is responsible for setting the Monte Carlo run parameters and conducting the Monte Carlo run including initiating all output generation.
The algorithm implemented by this member is as follows:
The details for BCSummaryTool, BCLog, BCAux and BCModelOutput can be found in the BAT website. These are used mainly to generate logs and output.
The details of the object MCEngine of type MonteCarloEngine which overloads the BCEngineMCMC class can be found in our documentation of the former class.
| [in] | rank | = MPI::COMM_WORLD.Get_rank(), specifies the rank of the process. This carries a non zero value only when the executable is compiled with the parallelized version of BAT and run as parallel processes with MPI. |
Definition at line 108 of file MonteCarlo.cpp.
| void MonteCarlo::TestRun | ( | int | rank | ) |
The default destructor.
This member is used for test runa to generate a single event
The values of the parameters that are used to generate the single event is the average value passed from the SomeModel.conf file.
The algorithm implemented by this member is as follows:
| [in] | rank | = MPI::COMM_WORLD.Get_rank(), specifies the rank of the process. This carries a non zero value only when the executable is compiled with the parallelized version of BAT and run as parallel processes with MPI. |
Definition at line 52 of file MonteCarlo.cpp.
|
private |
< Flag for calculating the evidence.
Definition at line 169 of file MonteCarlo.h.
|
private |
Vector for the Correlated Gaussian Observables defined in SomeModel.conf.
Definition at line 161 of file MonteCarlo.h.
|
private |
Vector for the Correlated Gaussian Parameters defined in SomeModel.conf.
Definition at line 162 of file MonteCarlo.h.
|
private |
A check to make sure TestRun()and Run() are not called consecutively.
Definition at line 175 of file MonteCarlo.h.
|
private |
Flag for using Minuit libraries.
Definition at line 168 of file MonteCarlo.h.
|
private |
String for the optional JobTag argument to be passes to the executable.
Definition at line 166 of file MonteCarlo.h.
|
private |
An object of the MonteCarloEngine class.
Definition at line 157 of file MonteCarlo.h.
|
private |
String for the name of the MonteCarlo.conf file.
Definition at line 164 of file MonteCarlo.h.
|
private |
String for the name of the SomeModel.conf file.
Definition at line 163 of file MonteCarlo.h.
|
private |
The name of the model.
Definition at line 155 of file MonteCarlo.h.
|
private |
Vector for the model parameters defined in SomeModel.conf.
Definition at line 158 of file MonteCarlo.h.
|
private |
An object of the InputParser class.
Definition at line 156 of file MonteCarlo.h.
|
private |
A variable to store the evidence of a model.
Definition at line 176 of file MonteCarlo.h.
|
private |
Vector for the observables defined in SomeModel.conf.
Definition at line 159 of file MonteCarlo.h.
|
private |
Vector for the Observables2D defined in SomeModel.conf.
Definition at line 160 of file MonteCarlo.h.
|
private |
String for the output directory name.
Definition at line 167 of file MonteCarlo.h.
|
private |
String for the name of the output root file without the .root extension.
Definition at line 165 of file MonteCarlo.h.
|
private |
Flag for printing all Marginalized distributions to be passed on to the BAT routines.
Definition at line 170 of file MonteCarlo.h.
|
private |
Flag for printing the correlation matrix.
Definition at line 171 of file MonteCarlo.h.
|
private |
Flag for printing plots to compare prior vs. posterior knowledge of parameters.
Definition at line 172 of file MonteCarlo.h.
|
private |
Flag for printing the overview parameter plots.
Definition at line 173 of file MonteCarlo.h.
|
private |
Flag for printing the overview parameter plots.
Definition at line 174 of file MonteCarlo.h.