Configuration.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 #pragma once
20 
21 #include <memory>
22 #include <string>
23 #include <vector>
24 
25 #include <momemta/impl/InputTag_fwd.h>
26 
28 class ParameterSet;
29 struct ExecutionPath;
30 
37  public:
43  struct ModuleDecl {
44  std::string name;
45  std::string type;
46  std::shared_ptr<ParameterSet> parameters;
48 
49  ModuleDecl() = default;
50  ModuleDecl(const ModuleDecl&);
51  ModuleDecl(const ModuleDecl&&);
52  ModuleDecl& operator=(ModuleDecl);
53  };
54 
56  const std::vector<ModuleDecl>& getModules() const;
58  const ParameterSet& getCubaConfiguration() const;
60  const ParameterSet& getGlobalParameters() const;
62  std::vector<InputTag> getIntegrands() const;
64  std::vector<std::string> getInputs() const;
65 
67  std::vector<std::shared_ptr<ExecutionPath>> getPaths() const;
68 
70  size_t getNDimensions() const;
71 
78 
83 
84  Configuration& operator=(Configuration);
85 
86  private:
87  friend class ConfigurationReader;
88  Configuration(): n_dimensions(0) {};
89 
91  Configuration freeze() const;
92 
93  std::vector<ModuleDecl> modules;
94  std::shared_ptr<ParameterSet> global_parameters;
95  std::shared_ptr<ParameterSet> cuba_configuration;
96  std::vector<InputTag> integrands;
97  std::vector<std::shared_ptr<ExecutionPath>> paths;
98  std::vector<std::string> inputs;
99  std::size_t n_dimensions;
100 };
size_t getNDimensions() const
std::string name
Name of the module (user-defined from the configuration file)
Definition: Configuration.h:44
A lua configuration file parser.
Configuration freeze() const
Freeze the configuration.
const ParameterSet & getGlobalParameters() const
std::shared_ptr< ParameterSet > parameters
Module&#39;s parameters, as parsed from the configuration file.
Definition: Configuration.h:47
std::vector< std::shared_ptr< ExecutionPath > > getPaths() const
const ParameterSet & getCubaConfiguration() const
std::vector< InputTag > getIntegrands() const
std::vector< std::string > getInputs() const
A class encapsulating a lua table.
Definition: ParameterSet.h:82
A frozen snapshot of the configuration file.
Definition: Configuration.h:36
A module declaration, defined from the configuration file.
Definition: Configuration.h:43
const std::vector< ModuleDecl > & getModules() const