MonteCarlo.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 HEPfit Collaboration
3  * All rights reserved.
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 #include <BAT/BCH1D.h>
14 #include <BAT/BCH2D.h>
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;
175  bool checkrun;
176  double normalization;
177 
178  void ReadPreRunData (std::string file);
179 };
180 
185 #endif /* MONTECARLO_H */
bool checkrun
A check to make sure TestRun()and Run() are not called consecutively.
Definition: MonteCarlo.h:175
std::map< std::string, BCH1D * > getHistograms1D() const
Definition: MonteCarlo.h:142
double normalization
A variable to store the evidence of a model.
Definition: MonteCarlo.h:176
std::string ObsDirName
String for the output directory name.
Definition: MonteCarlo.h:167
A class for.
Definition: ModelFactory.h:25
void addCustomObservableType(const std::string name, boost::function< Observable *() > funct)
Definition: MonteCarlo.cpp:489
A class for.
Definition: ThObsFactory.h:26
bool CalculateNormalization
< Flag for calculating the evidence.
Definition: MonteCarlo.h:169
void ReadPreRunData(std::string file)
Definition: MonteCarlo.cpp:456
bool PrintParameterPlot
Flag for printing the overview parameter plots.
Definition: MonteCarlo.h:173
MonteCarloEngine MCEngine
An object of the MonteCarloEngine class.
Definition: MonteCarlo.h:157
std::string OutFile
String for the name of the output root file without the .root extension.
Definition: MonteCarlo.h:165
bool PrintAllMarginalized
Flag for printing all Marginalized distributions to be passed on to the BAT routines.
Definition: MonteCarlo.h:170
void Run(const int rank)
This member is responsible for setting the Monte Carlo run parameters and conducting the Monte Carlo ...
Definition: MonteCarlo.cpp:108
std::map< std::string, BCH1D * > getHistograms1D() const
bool WritePreRunData
Flag for printing the overview parameter plots.
Definition: MonteCarlo.h:174
std::vector< CorrelatedGaussianParameters > CGP
Vector for the Correlated Gaussian Parameters defined in SomeModel.conf.
Definition: MonteCarlo.h:162
A class for observables.
Definition: Observable.h:28
A class for reading input parameters and output directives.
Definition: InputParser.h:49
std::map< std::string, BCH2D * > getHistograms2D() const
std::vector< ModelParameter > ModPars
Vector for the model parameters defined in SomeModel.conf.
Definition: MonteCarlo.h:158
bool PrintKnowledgeUpdatePlots
Flag for printing plots to compare prior vs. posterior knowledge of parameters.
Definition: MonteCarlo.h:172
void TestRun(int rank)
The default destructor.
Definition: MonteCarlo.cpp:52
std::map< std::string, BCH2D * > getHistograms2D() const
Definition: MonteCarlo.h:147
bool PrintCorrelationMatrix
Flag for printing the correlation matrix.
Definition: MonteCarlo.h:171
An engine class for Monte Carlo.
std::string ModelName
The name of the model.
Definition: MonteCarlo.h:155
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
std::vector< Observable2D > Obs2D
Vector for the Observables2D defined in SomeModel.conf.
Definition: MonteCarlo.h:160
boost::ptr_vector< Observable > Obs
Vector for the observables defined in SomeModel.conf.
Definition: MonteCarlo.h:159
A class for Monte Carlo.
Definition: MonteCarlo.h:35
std::vector< CorrelatedGaussianObservables > CGO
Vector for the Correlated Gaussian Observables defined in SomeModel.conf.
Definition: MonteCarlo.h:161
InputParser myInputParser
An object of the InputParser class.
Definition: MonteCarlo.h:156
bool FindModeWithMinuit
Flag for using Minuit libraries.
Definition: MonteCarlo.h:168
std::string MCMCConf
String for the name of the MonteCarlo.conf file.
Definition: MonteCarlo.h:164
std::string JobTag
String for the optional JobTag argument to be passes to the executable.
Definition: MonteCarlo.h:166
std::string ModelConf
String for the name of the SomeModel.conf file.
Definition: MonteCarlo.h:163