ModelConfig.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #include <boost/property_tree/ptree.hpp>
7 namespace pt = boost::property_tree;
8 
9 
10 const std::string CONFIG_NAME = "config.json";
11 const std::string MODEL_NAME = "model.pb";
12 
13 
15 {
18 };
19 
21 {
23  std::vector<std::string> varNames;
24 };
25 
27 {
28 private:
30  bool loaded;
31 
32  void parseConfig(const std::string &fname);
33 
34  static InputConfig parseInput(
35  pt::ptree &tree, const InputConfigKeys &keys
36  );
37 
38  std::vector<InputConfigKeys> scalarInputKeys;
39  std::vector<InputConfigKeys> vectorInputKeys;
40  std::vector<std::string> outputKeys;
41 
42 public:
44  const std::string &savedir,
45  const std::vector<InputConfigKeys> &scalarInputKeys,
46  const std::vector<InputConfigKeys> &vectorInputKeys,
47  const std::vector<std::string> &outputKeys
48  );
49 
50  void load();
51  bool isLoaded() const;
52 
53  std::string getConfigPath() const;
54  std::string getModelPath() const;
55  std::string getSavedir() const;
56 
57  std::vector<InputConfig> scalarInputs;
58  std::vector<InputConfig> vectorInputs;
59  std::vector<std::string> outputNodes;
60 };
61 
keys
Reco plots.
Definition: caf_analysis.py:46
std::vector< std::string > outputKeys
Definition: ModelConfig.h:40
std::vector< InputConfigKeys > scalarInputKeys
Definition: ModelConfig.h:38
std::string nodeName
Definition: ModelConfig.h:16
std::vector< std::string > outputNodes
Definition: ModelConfig.h:59
std::vector< InputConfigKeys > vectorInputKeys
Definition: ModelConfig.h:39
void load(std::string lib)
Definition: load_libs.C:3
std::string varNames
Definition: ModelConfig.h:17
std::string savedir
Definition: ModelConfig.h:29
std::vector< InputConfig > vectorInputs
Definition: ModelConfig.h:58
std::string nodeName
Definition: ModelConfig.h:22
std::vector< InputConfig > scalarInputs
Definition: ModelConfig.h:57
const std::string CONFIG_NAME
Definition: ModelConfig.h:10
const std::string MODEL_NAME
Definition: ModelConfig.h:11
std::vector< std::string > varNames
Definition: ModelConfig.h:23
enum BeamMode string