ConfigurationReader.h
1 /*
2  * MoMEMta: a modular implementation of the Matrix Element Method
3  * Copyright (C) 2016 Universite catholique de Louvain (UCL), Belgium
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 
20 #pragma once
21 
22 #include <memory>
23 #include <string>
24 #include <vector>
25 
26 #include <momemta/Configuration.h>
27 #include <momemta/ILuaCallback.h>
28 
29 class ParameterSet;
30 struct ExecutionPath;
31 struct lua_State;
32 
46  public:
47  ConfigurationReader(const std::string&);
48  ConfigurationReader(const std::string&, const ParameterSet&);
49 
50  virtual void onModuleDeclared(const std::string& type, const std::string& name) override;
51  virtual void onIntegrandDeclared(const InputTag& tag) override;
52  virtual void onNewPath(const ExecutionPath& path) override;
53  virtual void addIntegrationDimension() override;
54  virtual void onNewInputDeclared(const std::string& name) override;
55 
56  ParameterSet& getGlobalParameters();
57  ParameterSet& getCubaConfiguration();
58 
64  Configuration freeze() const;
65 
66  private:
67  friend class Configuration;
68 
69  Configuration configuration;
70 
71  std::shared_ptr<lua_State> lua_state;
72 };
Notification callback used for communication between the lua file and MoMEMta.
Definition: ILuaCallback.h:30
virtual void onNewPath(const ExecutionPath &path) override
A new path is declared in the configuration file.
A lua configuration file parser.
Configuration freeze() const
Freeze the configuration.
virtual void onModuleDeclared(const std::string &type, const std::string &name) override
A module is declared in the configuration file.
virtual void addIntegrationDimension() override
A new integration dimension is requested in the configuration file.
An identifier of a module&#39;s output.
Definition: InputTag_fwd.h:37
A class encapsulating a lua table.
Definition: ParameterSet.h:82
A frozen snapshot of the configuration file.
Definition: Configuration.h:36
virtual void onNewInputDeclared(const std::string &name) override
The configuration file declared a new input.
virtual void onIntegrandDeclared(const InputTag &tag) override
The integrand was defined in the configuration file.