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
49public:
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
131private:
135 std::string modname;
137 std::map <std::string, boost::tuple<bool, std::string, int> > checkDuplicateParameter;
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;
143 std::string filename;
144 int rank;
145 std::string filepath;
146 std::string line;
147 bool IsEOF;
148};
149
154#endif /* INPUTPARSER_H */
A class for reading input parameters and output directives.
Definition: InputParser.h:48
const ThObsFactory & getObsFactory() const
Definition: InputParser.h:114
std::string modname
A string to store the model name in.
Definition: InputParser.h:135
std::map< std::string, boost::function< Observable *()> > customObservableTypeMap
Definition: InputParser.h:140
ThObsFactory & myObsFactory
Reference to an object of type ThObsFactory.
Definition: InputParser.h:134
InputParser(ModelFactory &ModF, ThObsFactory &ObsF)
Constructor.
Definition: InputParser.cpp:16
Observable * CreateObservableType(const std::string &name) const
std::string filename
Definition: InputParser.h:143
StandardModel * myModel
Pointer to an object of type StandardModel.
Definition: InputParser.h:132
std::string modeldefinedinfile
Definition: InputParser.h:138
void setModel(StandardModel *myModel_i)
Definition: InputParser.h:127
virtual ~InputParser()
The default destructor.
Definition: InputParser.cpp:27
std::string line
Definition: InputParser.h:146
void addCustomObservableType(const std::string name, boost::function< Observable *() > funct)
std::map< std::string, boost::tuple< bool, std::string, int > > checkDuplicateParameter
Definition: InputParser.h:137
ModelFactory & myModelFactory
Pointer to an object of type ModelFactory.
Definition: InputParser.h:133
std::string filepath
Definition: InputParser.h:145
StandardModel * getModel() const
A get method to access the pointer to the object of the StandardModel class.
Definition: InputParser.h:109
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
ModelFactory & getModelFactory() const
Definition: InputParser.h:119
A class for.
Definition: ModelFactory.h:25
A class for observables.
Definition: Observable.h:28
A model class for the Standard Model.
A class for.
Definition: ThObsFactory.h:26