a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
InputParser.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 INPUTPARSER_H
9 #define INPUTPARSER_H
10 
11 #include "ThObsFactory.h"
12 #include "ModelFactory.h"
13 #include "Observable.h"
14 #include "Observable2D.h"
17 #include "HiggsObservable.h"
18 #include "ThObservable.h"
19 #include "ModelParameter.h"
20 #include "StandardModel.h"
21 #include <iostream>
22 #include <fstream>
23 #include <istream>
24 #include <boost/ptr_container/ptr_vector.hpp>
25 #include <boost/tuple/tuple.hpp>
26 #include <boost/function.hpp>
27 #include <string>
28 
48 class InputParser {
49 public:
50 
55 
60  InputParser(const InputParser& orig);
61 
65  virtual ~InputParser();
66 
73 // CorrelatedGaussianObservables ParseCGO(boost::ptr_vector<Observable>& Observables, std::ifstream& ifile, boost::tokenizer<boost::char_separator<char> >::iterator& beg);
74 
96  std::string ReadParameters(const std::string filename_i,
97  const int rank,
98  std::vector<ModelParameter>& ModelPars,
99  boost::ptr_vector<Observable>& Observables,
100  std::vector<Observable2D>& Observables2D,
101  std::vector<CorrelatedGaussianObservables>& CGO,
102  std::vector<CorrelatedGaussianParameters>& CGP);
103 
110  {
111  return myModel;
112  }
113 
115  {
116  return myObsFactory;
117  }
118 
120  return myModelFactory;
121  }
122 
123  void addCustomObservableType(const std::string name, boost::function<Observable*() > funct);
124 
125  Observable * CreateObservableType(const std::string& name) const;
126 
127  void setModel(StandardModel* myModel_i){
128  myModel = myModel_i;
129  }
130 
131 private:
135  std::string modname;
136  bool modelset;
137  std::map <std::string, boost::tuple<bool, std::string, int> > checkDuplicateParameter;
138  std::string modeldefinedinfile;
139  //std::map<std::string, boost::function<InputParser*(ModelFactory&, ThObsFactory&) > > customParserMap;
140  std::map<std::string, boost::function<Observable* ()> > customObservableTypeMap;
141  //std::map<std::string, std::string> ObservableToParsermap;
142  int lineNo;
143  std::string filename;
144  int rank;
145  std::string filepath;
146  std::string line;
147  bool IsEOF;
148 };
149 
154 #endif /* INPUTPARSER_H */
ModelFactory
A class for.
Definition: ModelFactory.h:25
InputParser::rank
int rank
Definition: InputParser.h:144
InputParser::~InputParser
virtual ~InputParser()
The default destructor.
Definition: InputParser.cpp:27
InputParser::InputParser
InputParser(ModelFactory &ModF, ThObsFactory &ObsF)
Constructor.
Definition: InputParser.cpp:16
ThObservable.h
StandardModel.h
InputParser
A class for reading input parameters and output directives.
Definition: InputParser.h:48
InputParser::CreateObservableType
Observable * CreateObservableType(const std::string &name) const
Definition: InputParser.cpp:255
ModelParameter.h
InputParser::filename
std::string filename
Definition: InputParser.h:143
HiggsObservable.h
StandardModel
A model class for the Standard Model.
Definition: StandardModel.h:474
ModelFactory.h
InputParser::myModel
StandardModel * myModel
Pointer to an object of type StandardModel.
Definition: InputParser.h:132
myModel
My own Model.
Definition: Doxygen/examples-src/myModel/src/myModel.h:17
ThObsFactory.h
InputParser::ReadParameters
std::string ReadParameters(const std::string filename_i, const int rank, std::vector< ModelParameter > &ModelPars, boost::ptr_vector< Observable > &Observables, std::vector< Observable2D > &Observables2D, std::vector< CorrelatedGaussianObservables > &CGO, std::vector< CorrelatedGaussianParameters > &CGP)
The member that parses the Observable2D directives from SomeModel.conf file.
Definition: InputParser.cpp:35
InputParser::setModel
void setModel(StandardModel *myModel_i)
Definition: InputParser.h:127
ThObsFactory
A class for.
Definition: ThObsFactory.h:26
InputParser::customObservableTypeMap
std::map< std::string, boost::function< Observable *()> > customObservableTypeMap
Definition: InputParser.h:140
InputParser::myObsFactory
ThObsFactory & myObsFactory
Reference to an object of type ThObsFactory.
Definition: InputParser.h:134
InputParser::checkDuplicateParameter
std::map< std::string, boost::tuple< bool, std::string, int > > checkDuplicateParameter
Definition: InputParser.h:137
InputParser::getModel
StandardModel * getModel() const
A get method to access the pointer to the object of the StandardModel class.
Definition: InputParser.h:109
InputParser::myModelFactory
ModelFactory & myModelFactory
Pointer to an object of type ModelFactory.
Definition: InputParser.h:133
Observable.h
Observable
A class for observables.
Definition: Observable.h:28
InputParser::lineNo
int lineNo
Definition: InputParser.h:142
InputParser::line
std::string line
Definition: InputParser.h:146
Observable2D.h
InputParser::IsEOF
bool IsEOF
Definition: InputParser.h:147
InputParser::addCustomObservableType
void addCustomObservableType(const std::string name, boost::function< Observable *() > funct)
Definition: InputParser.cpp:250
InputParser::filepath
std::string filepath
Definition: InputParser.h:145
InputParser::modelset
bool modelset
Definition: InputParser.h:136
InputParser::getObsFactory
const ThObsFactory & getObsFactory() const
Definition: InputParser.h:114
InputParser::getModelFactory
ModelFactory & getModelFactory() const
Definition: InputParser.h:119
CorrelatedGaussianObservables.h
InputParser::modeldefinedinfile
std::string modeldefinedinfile
Definition: InputParser.h:138
InputParser::modname
std::string modname
A string to store the model name in.
Definition: InputParser.h:135
CorrelatedGaussianParameters.h