a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
MonteCarlo.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 HEPfit Collaboration
3  *
4  *
5  * For the licensing terms see doc/COPYING.
6  */
7 
8 #ifndef MONTECARLO_H
9 #define MONTECARLO_H
10 
11 #include "InputParser.h"
12 #include "MonteCarloEngine.h"
13 
14 #define NBINSMODELPARS 100
15 
35 class MonteCarlo {
36 public:
58  MonteCarlo(ModelFactory& ModelF, ThObsFactory& ThObsF,
59  const std::string& ModelConf_i,
60  const std::string& MonteCarloConf_i,
61  const std::string& OutFile_i,
62  const std::string& JobTag_i);
63 
67  virtual ~MonteCarlo();
68 
94  void TestRun(int rank);
95 
140  void Run(const int rank);
141 
142  std::map<std::string, BCH1D> getHistograms1D() const
143  {
144  return MCEngine.getHistograms1D();
145  }
146 
147  std::map<std::string, BCH2D> getHistograms2D() const
148  {
149  return MCEngine.getHistograms2D();
150  }
151 
152  void addCustomObservableType(const std::string name, boost::function<Observable*() > funct);
153 
154 private:
155  std::string ModelName;
158  std::vector<ModelParameter> ModPars;
159  boost::ptr_vector<Observable> Obs;
160  std::vector<Observable2D> Obs2D;
161  std::vector<CorrelatedGaussianObservables> CGO;
162  std::vector<CorrelatedGaussianParameters> CGP;
163  std::string ModelConf;
164  std::string MCMCConf;
165  std::string OutFile;
166  std::string JobTag;
167  std::string ObsDirName;
178  bool checkrun;
179  bool writechains;
180 
181  void ParseMCMCConfig(std::string file);
182  void ReadPreRunData(std::string file);
183 };
184 
189 #endif /* MONTECARLO_H */
MonteCarlo::TestRun
void TestRun(int rank)
This member is used for test runa to generate a single event.
Definition: MonteCarlo.cpp:59
ModelFactory
A class for.
Definition: ModelFactory.h:25
MonteCarlo::checkrun
bool checkrun
A check to make sure TestRun()and Run() are not called consecutively.
Definition: MonteCarlo.h:178
MonteCarlo::ObsDirName
std::string ObsDirName
String for the output directory name.
Definition: MonteCarlo.h:167
MonteCarlo::addCustomObservableType
void addCustomObservableType(const std::string name, boost::function< Observable *() > funct)
Definition: MonteCarlo.cpp:734
InputParser.h
MonteCarlo::CalculateNormalization
std::string CalculateNormalization
< Flag for calculating the evidence.
Definition: MonteCarlo.h:170
MonteCarlo::getHistograms2D
std::map< std::string, BCH2D > getHistograms2D() const
Definition: MonteCarlo.h:147
MonteCarlo::RunMinuitOnly
bool RunMinuitOnly
Flag for running Minuit only.
Definition: MonteCarlo.h:169
MonteCarlo::myInputParser
InputParser myInputParser
An object of the InputParser class.
Definition: MonteCarlo.h:156
MonteCarlo::JobTag
std::string JobTag
String for the optional JobTag argument to be passes to the executable.
Definition: MonteCarlo.h:166
MonteCarlo::PrintAllMarginalized
bool PrintAllMarginalized
Flag for printing all Marginalized distributions to be passed on to the BAT routines.
Definition: MonteCarlo.h:172
InputParser
A class for reading input parameters and output directives.
Definition: InputParser.h:48
MonteCarlo::NIterationNormalizationMC
int NIterationNormalizationMC
< Number of iterations for MC integral done to compute normalization of a model
Definition: MonteCarlo.h:171
MonteCarloEngine.h
MonteCarlo::Obs2D
std::vector< Observable2D > Obs2D
Vector for the Observables2D defined in SomeModel.conf.
Definition: MonteCarlo.h:160
ThObsFactory
A class for.
Definition: ThObsFactory.h:26
MonteCarlo::CGP
std::vector< CorrelatedGaussianParameters > CGP
Vector for the Correlated Gaussian Parameters defined in SomeModel.conf.
Definition: MonteCarlo.h:162
MonteCarlo::PrintTrianglePlot
bool PrintTrianglePlot
Flag for printing the triangle plot.
Definition: MonteCarlo.h:176
MonteCarlo::OutFile
std::string OutFile
String for the name of the output root file without the .root extension.
Definition: MonteCarlo.h:165
MonteCarlo::writechains
bool writechains
Flag for writing the chains of paramters and observables during the MCMC run.
Definition: MonteCarlo.h:179
MonteCarlo::ParseMCMCConfig
void ParseMCMCConfig(std::string file)
Definition: MonteCarlo.cpp:478
MonteCarlo::PrintCorrelationMatrix
bool PrintCorrelationMatrix
Flag for printing the correlation matrix.
Definition: MonteCarlo.h:173
MonteCarlo::Obs
boost::ptr_vector< Observable > Obs
Vector for the observables defined in SomeModel.conf.
Definition: MonteCarlo.h:159
MonteCarlo::Run
void Run(const int rank)
This member is responsible for setting the Monte Carlo run parameters and conducting the Monte Carlo ...
Definition: MonteCarlo.cpp:128
MonteCarlo::ModPars
std::vector< ModelParameter > ModPars
Vector for the model parameters defined in SomeModel.conf.
Definition: MonteCarlo.h:158
MonteCarlo::WritePreRunData
bool WritePreRunData
Flag for printing the overview parameter plots.
Definition: MonteCarlo.h:177
Observable
A class for observables.
Definition: Observable.h:28
MonteCarlo::~MonteCarlo
virtual ~MonteCarlo()
The default destructor.
Definition: MonteCarlo.cpp:53
MonteCarlo::ReadPreRunData
void ReadPreRunData(std::string file)
Definition: MonteCarlo.cpp:701
MonteCarlo::CGO
std::vector< CorrelatedGaussianObservables > CGO
Vector for the Correlated Gaussian Observables defined in SomeModel.conf.
Definition: MonteCarlo.h:161
MonteCarlo::MCEngine
MonteCarloEngine MCEngine
An object of the MonteCarloEngine class.
Definition: MonteCarlo.h:157
MonteCarlo::PrintKnowledgeUpdatePlots
bool PrintKnowledgeUpdatePlots
Flag for printing plots to compare prior vs. posterior knowledge of parameters.
Definition: MonteCarlo.h:174
MonteCarloEngine::getHistograms2D
std::map< std::string, BCH2D > getHistograms2D() const
A get method to access the map of 2D histograms.
Definition: MonteCarloEngine.h:251
MonteCarlo::PrintParameterPlot
bool PrintParameterPlot
Flag for printing the overview parameter plots.
Definition: MonteCarlo.h:175
MonteCarlo::FindModeWithMinuit
bool FindModeWithMinuit
Flag for using Minuit libraries.
Definition: MonteCarlo.h:168
MonteCarloEngine::getHistograms1D
std::map< std::string, BCH1D > getHistograms1D() const
A get method to access the map of 1D histograms.
Definition: MonteCarloEngine.h:242
MonteCarlo::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.
Definition: MonteCarlo.cpp:26
MonteCarlo::ModelConf
std::string ModelConf
String for the name of the SomeModel.conf file.
Definition: MonteCarlo.h:163
MonteCarloEngine
An engine class for Monte Carlo.
Definition: MonteCarloEngine.h:42
MonteCarlo
A class for Monte Carlo.
Definition: MonteCarlo.h:35
MonteCarlo::MCMCConf
std::string MCMCConf
String for the name of the MonteCarlo.conf file.
Definition: MonteCarlo.h:164
MonteCarlo::ModelName
std::string ModelName
The name of the model.
Definition: MonteCarlo.h:155
MonteCarlo::getHistograms1D
std::map< std::string, BCH1D > getHistograms1D() const
Definition: MonteCarlo.h:142