Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DictionaryManager.hh
Go to the documentation of this file.
1 ///
2 /// @file DictionaryManager.hh
3 /// @brief Global container class for amplitudes, rates, FFs, data
4 ///
5 
6 //**** This file is a part of the HAMMER library
7 //**** Copyright (C) 2016 - 2020 The HAMMER Collaboration
8 //**** HAMMER is licensed under version 3 of the GPL; see COPYING for details
9 //**** Please note the MCnet academic guidelines; see GUIDELINES for details
10 
11 // -*- C++ -*-
12 #ifndef HAMMER_DICTIONARY_MANAGER
13 #define HAMMER_DICTIONARY_MANAGER
14 
15 #include <vector>
16 #include <memory>
17 
18 #include "Hammer/IndexTypes.hh"
19 #include "Hammer/Tools/Pdg.fhh"
22 
23 namespace YAML {
24 
25  class Node;
26 
27 } // namespace YAML
28 
29 namespace Hammer {
30 
31  // class RunDefinitions;
32  class ProvidersRepo;
33  class ExternalData;
34  class ProcRates;
35  class ProcessDefinitions;
36  class SchemeDefinitions;
37  class PurePhaseSpaceDefs;
38  class Log;
39 
40  /// @brief Main class
41  ///
42  /// Contains ...
43  ///
44  /// @ingroup Core
46 
47  public:
48 
50 
51  DictionaryManager(const DictionaryManager& other) = delete;
52  DictionaryManager& operator=(const DictionaryManager& other) = delete;
53  DictionaryManager(DictionaryManager&& other) = delete;
55 
56  virtual ~DictionaryManager() noexcept;
57 
58  public:
59 
60  void init();
61 
62  virtual const ProvidersRepo& providers() const;
63 
64  virtual const ExternalData& externalData() const;
65  virtual ExternalData& externalData();
66 
67  virtual const ProcRates& rates() const;
68  virtual ProcRates& rates();
69 
70  virtual const ProcessDefinitions& processDefs() const;
72 
73  virtual const PurePhaseSpaceDefs& purePSDefs() const;
74  virtual PurePhaseSpaceDefs& purePSDefs();
75 
76  virtual const SchemeDefinitions& schemeDefs() const;
77  virtual SchemeDefinitions& schemeDefs();
78 
79  virtual void setSettingsHandler(SettingsHandler& sh);
80 
81  public:
82  void write(flatbuffers::FlatBufferBuilder* msgwriter) const;
83 
84  bool read(const Serial::FBHeader* msgreader, bool merge);
85 
86  public:
87  /// @brief read Hammer settings from a file
88  /// @param[in] fileName the file name
89  void readDecays(const std::string& fileName);
90 
91  /// @brief read Hammer settings from a string
92  /// @param[in] yamlData the decay options
93  void parseDecays(const std::string& yamlData);
94 
95  /// @brief write current Hammer settings to a file
96  /// @param[in] fileName the file name
97  void saveDecays(const std::string& fileName);
98 
99  private:
100  /// @brief
101  /// @param[in] input
102  void processDecays(const YAML::Node& input);
103 
104  private:
105  /// @brief purely virtual function for a class to define new settings
106  virtual void defineSettings();
107 
108  Log& getLog() const;
109 
110  private:
111  std::unique_ptr<SchemeDefinitions> _schemeDefs;
112  std::unique_ptr<ProvidersRepo> _providers;
113  std::unique_ptr<ExternalData> _external;
114  std::unique_ptr<ProcRates> _rates;
115  std::unique_ptr<PurePhaseSpaceDefs> _purePSDefs;
116  std::unique_ptr<ProcessDefinitions> _procDefs;
117  };
118 
119 } // namespace Hammer
120 
121 #endif
virtual const PurePhaseSpaceDefs & purePSDefs() const
Decay process class.
Definition: ProcRates.hh:34
std::unique_ptr< ProcRates > _rates
Forward declaration of serialization related typedefs and includes.
void readDecays(const std::string &fileName)
read Hammer settings from a file
Hammer settings manager class.
Hammer data types declarations.
std::unique_ptr< PurePhaseSpaceDefs > _purePSDefs
void processDecays(const YAML::Node &input)
DictionaryManager & operator=(const DictionaryManager &other)=delete
bool read(const Serial::FBHeader *msgreader, bool merge)
virtual const ProvidersRepo & providers() const
std::unique_ptr< ExternalData > _external
virtual void defineSettings()
purely virtual function for a class to define new settings
Base class to access the settings repository.
Pdg forward declarations.
Logging class.
Definition: Logging.hh:33
virtual const ExternalData & externalData() const
void saveDecays(const std::string &fileName)
write current Hammer settings to a file
Hammer settings manager class.
void write(flatbuffers::FlatBufferBuilder *msgwriter) const
Base class for accessing Hammer settings repository.
virtual const ProcRates & rates() const
std::unique_ptr< ProvidersRepo > _providers
Hammer settings manager class.
virtual void setSettingsHandler(SettingsHandler &sh)
set link to settings repository handler.
std::unique_ptr< SchemeDefinitions > _schemeDefs
virtual const SchemeDefinitions & schemeDefs() const
virtual ~DictionaryManager() noexcept
Hammer settings manager class.
std::unique_ptr< ProcessDefinitions > _procDefs
virtual const ProcessDefinitions & processDefs() const
void parseDecays(const std::string &yamlData)
read Hammer settings from a string