a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
GenerateEvent.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 HEPfit Collaboration
3  *
4  *
5  * For the licensing terms see doc/COPYING.
6  */
7 
8 #ifndef GENERATEEVENT_H
9 #define GENERATEEVENT_H
10 
11 #include "InputParser.h"
12 #include "Observable.h"
13 #include "Observable2D.h"
15 #include "ModelParameter.h"
16 #include "Model.h"
17 #include "boost/shared_ptr.hpp"
18 #include "boost/make_shared.hpp"
19 #include <TF1.h>
20 #ifdef _MPI
21 #include <mpi.h>
22 #endif
23 
42 public:
58  GenerateEvent(ModelFactory& ModelF, ThObsFactory& ThObsF,
59  const std::string& ModelConf_i,
60  const std::string& OutDirName_i,
61  const std::string& JobTag_i
62  /*const bool noMC_i*/);
63 
67  virtual ~GenerateEvent();
68 
87  void generate(int unsigned nIteration_i, int seed = 0, bool weight_i = false);
88 
89  void addCustomObservableType(const std::string name, boost::function<Observable*() > funct);
90 
91 private:
100 
106  void generateRandomEvent(int iterationNo);
107 
108  void createDirectories();
109 
110  void initModel();
111 
112  void setDParsFromParameters(const std::vector<double>& parameters, std::map<std::string,double>& DPars_i);
113 
115  std::map<std::string, double> DPars;
116  std::map<std::string, TF1*> DDist;
117  std::map<std::string, boost::shared_ptr<std::ofstream> > ObsOut;
118  std::map<std::string, boost::shared_ptr<std::ofstream> > CGOOut;
119  std::map<std::string, boost::shared_ptr<std::ofstream> > ParsOut;
121  std::vector<ModelParameter> ModPars;
122  std::vector<ModelParameter> ModParsVar;
123  boost::ptr_vector<Observable> Obs;
124  std::vector<Observable2D> Obs2D;
125  std::vector<CorrelatedGaussianObservables> CGO;
126  std::vector<CorrelatedGaussianParameters> CGP;
127  std::string ModelConf;
128  std::string OutDirName;
129  std::string OldOutDirName;
130  std::string ObsDirName;
131  std::string CGODirName;
132  std::string SMDebugDirName;
133  std::string SUSYDebugDirName;
134  std::string ParsDirName;
135  std::string JobTag;
136  //bool noMC;///< Flag to initiate noMC mode.
137  bool outputTerm;
138  int rank;
139  int procnum;
140 #ifdef _MPI
141  int nameLen;
142  char processorName[MPI_MAX_PROCESSOR_NAME];
143 #endif
144  std::ofstream summary;
148  double *sendbuff;
149  double *sendbuff_w;
150  double **buff;
151  double **buff_w;
153  int **buff_int;
154  std::string ModelName;
155  bool weight;
156 };
157 
158 #endif /* GENERATEEVENT_H */
159 
ModelFactory
A class for.
Definition: ModelFactory.h:25
GenerateEvent::GenerateEvent
GenerateEvent(ModelFactory &ModelF, ThObsFactory &ThObsF, const std::string &ModelConf_i, const std::string &OutDirName_i, const std::string &JobTag_i)
Constructor.
Definition: GenerateEvent.cpp:13
GenerateEvent::CGODirName
std::string CGODirName
String for the name of the Correlated Gaussian Observables output directory.
Definition: GenerateEvent.h:131
GenerateEvent::buff_int
int ** buff_int
Definition: GenerateEvent.h:153
GenerateEvent::Obs2D
std::vector< Observable2D > Obs2D
Vector for the Observables2D defined in SomeModel.conf.
Definition: GenerateEvent.h:124
GenerateEvent::CGO
std::vector< CorrelatedGaussianObservables > CGO
vector for the Correlated Gaussian Observables defined in SomeModel.conf.
Definition: GenerateEvent.h:125
InputParser.h
GenerateEvent::initModel
void initModel()
Definition: GenerateEvent.cpp:329
GenerateEvent::ObsDirName
std::string ObsDirName
String for the name of the observables output directory.
Definition: GenerateEvent.h:130
GenerateEvent::DPars
std::map< std::string, double > DPars
Map of parameters to be passed to Model().
Definition: GenerateEvent.h:115
GenerateEvent::weight
bool weight
Definition: GenerateEvent.h:155
GenerateEvent
A class for generating events.
Definition: GenerateEvent.h:41
GenerateEvent::outputTerm
bool outputTerm
Flag to specify output stream storage.
Definition: GenerateEvent.h:137
GenerateEvent::nIteration
int nIteration
Definition: GenerateEvent.h:145
GenerateEvent::sendbuff
double * sendbuff
Definition: GenerateEvent.h:148
GenerateEvent::addCustomObservableType
void addCustomObservableType(const std::string name, boost::function< Observable *() > funct)
Definition: GenerateEvent.cpp:505
GenerateEvent::Mod
StandardModel * Mod
Name of the model as defined in SomeModel.conf.
Definition: GenerateEvent.h:120
GenerateEvent::buffersize
int buffersize
Definition: GenerateEvent.h:147
GenerateEvent::OldOutDirName
std::string OldOutDirName
String for the name of the backup output directory.
Definition: GenerateEvent.h:129
InputParser
A class for reading input parameters and output directives.
Definition: InputParser.h:48
GenerateEvent::processorName
char processorName[MPI_MAX_PROCESSOR_NAME]
Definition: GenerateEvent.h:142
GenerateEvent::ModelConf
std::string ModelConf
String for the name of the SomeModel.conf file.
Definition: GenerateEvent.h:127
ModelParameter.h
GenerateEvent::ModParsVar
std::vector< ModelParameter > ModParsVar
Vector for the model parameters varied in SomeModel.conf.
Definition: GenerateEvent.h:122
GenerateEvent::rank
int rank
Definition: GenerateEvent.h:138
StandardModel
A model class for the Standard Model.
Definition: StandardModel.h:477
GenerateEvent::JobTag
std::string JobTag
String for the optional JobTag argument to be passes to the executable.
Definition: GenerateEvent.h:135
GenerateEvent::CGP
std::vector< CorrelatedGaussianParameters > CGP
vector for the Correlated Gaussian Parameters defined in SomeModel.conf.
Definition: GenerateEvent.h:126
GenerateEvent::ParsOut
std::map< std::string, boost::shared_ptr< std::ofstream > > ParsOut
Map of output stream for parameters.
Definition: GenerateEvent.h:119
ThObsFactory
A class for.
Definition: ThObsFactory.h:26
GenerateEvent::Obs
boost::ptr_vector< Observable > Obs
Vector for the observables defined in SomeModel.conf.
Definition: GenerateEvent.h:123
GenerateEvent::defineParameterDistributions
void defineParameterDistributions()
The parameter distributions as specified in SomeModel.conf is defined here.
Definition: GenerateEvent.cpp:391
GenerateEvent::buff
double ** buff
Definition: GenerateEvent.h:150
Observable.h
Model.h
GenerateEvent::SUSYDebugDirName
std::string SUSYDebugDirName
String for the name of the Correlated Gaussian Observables output directory.
Definition: GenerateEvent.h:133
GenerateEvent::generate
void generate(int unsigned nIteration_i, int seed=0, bool weight_i=false)
The method used to generate events and format output.
Definition: GenerateEvent.cpp:52
Observable
A class for observables.
Definition: Observable.h:28
GenerateEvent::positionID
int positionID
Definition: GenerateEvent.h:146
GenerateEvent::myInputParser
InputParser myInputParser
An oject of the InputParser() class.
Definition: GenerateEvent.h:114
GenerateEvent::SMDebugDirName
std::string SMDebugDirName
String for the name of the observables output directory.
Definition: GenerateEvent.h:132
GenerateEvent::sendbuff_w
double * sendbuff_w
Definition: GenerateEvent.h:149
GenerateEvent::CGOOut
std::map< std::string, boost::shared_ptr< std::ofstream > > CGOOut
Map of output stream for corellated Gaussian observables.
Definition: GenerateEvent.h:118
GenerateEvent::OutDirName
std::string OutDirName
String for the name of the output directory.
Definition: GenerateEvent.h:128
GenerateEvent::ObsOut
std::map< std::string, boost::shared_ptr< std::ofstream > > ObsOut
Map of output stream for observables.
Definition: GenerateEvent.h:117
Observable2D.h
GenerateEvent::nameLen
int nameLen
Definition: GenerateEvent.h:141
GenerateEvent::procnum
int procnum
Definition: GenerateEvent.h:139
GenerateEvent::sendbuff_int
int * sendbuff_int
Definition: GenerateEvent.h:152
GenerateEvent::buff_w
double ** buff_w
Definition: GenerateEvent.h:151
GenerateEvent::createDirectories
void createDirectories()
Definition: GenerateEvent.cpp:270
GenerateEvent::DDist
std::map< std::string, TF1 * > DDist
Map of parameter distributions.
Definition: GenerateEvent.h:116
GenerateEvent::generateRandomEvent
void generateRandomEvent(int iterationNo)
This member generates random numbers for the parameters being varied in the model....
Definition: GenerateEvent.cpp:433
GenerateEvent::ModPars
std::vector< ModelParameter > ModPars
Vector for the model parameters defined in SomeModel.conf.
Definition: GenerateEvent.h:121
GenerateEvent::~GenerateEvent
virtual ~GenerateEvent()
The default destructor.
Definition: GenerateEvent.cpp:45
GenerateEvent::ParsDirName
std::string ParsDirName
String for the name of the parameters output directory.
Definition: GenerateEvent.h:134
GenerateEvent::ModelName
std::string ModelName
Definition: GenerateEvent.h:154
CorrelatedGaussianObservables.h
GenerateEvent::summary
std::ofstream summary
Definition: GenerateEvent.h:144
GenerateEvent::setDParsFromParameters
void setDParsFromParameters(const std::vector< double > &parameters, std::map< std::string, double > &DPars_i)
Definition: GenerateEvent.cpp:469