SLHAReader.h
1 #ifndef READ_SLHA_H
2 #define READ_SLHA_H
3 
4 #include <map>
5 #include <sstream>
6 #include <string>
7 #include <vector>
8 
9 namespace SLHA {
10 
11 class Block {
12  public:
13  Block(const std::string& name = "");
14  virtual ~Block() {}
15 
16  void set_entry(const std::vector<int>& indices, double value);
17  double get_entry(const std::vector<int>& indices, double def_val = 0) const;
18  void set_name(const std::string& name);
19  std::string get_name() const;
20  int get_indices() const;
21 
22  private:
23  std::string _name;
24  std::map<std::vector<int>, double> _entries;
25  unsigned int _indices;
26 };
27 
28 class Reader {
29  public:
30  Reader(const std::string& file_name = "");
31 
32  void read_slha_file(const std::string& file_name);
33  double get_block_entry(const std::string& block_name, const std::vector<int>& indices,
34  double def_val = 0) const;
35  double get_block_entry(const std::string& block_name, int index, double def_val = 0) const;
36  void set_block_entry(const std::string& block_name, const std::vector<int>& indices, double value);
37  void set_block_entry(const std::string& block_name, int index, double value);
38 
39  private:
40  std::map<std::string, Block> _blocks;
41 };
42 }
43 
44 #endif