Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ProcManager.hh
Go to the documentation of this file.
1 ///
2 /// @file ProcManager.hh
3 /// @brief Container class for all process related data structures
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_PROCESSMANAGER_HH
13 #define HAMMER_PROCESSMANAGER_HH
14 
15 #include <map>
16 #include <string>
17 #include <vector>
18 
19 #include "Hammer/IndexTypes.hh"
20 #include "Hammer/Math/Tensor.hh"
23 #include "Hammer/ProcGraph.hh"
25 #include "Hammer/ProcResults.hh"
26 #include "Hammer/Process.hh"
27 
28 namespace Hammer {
29 
30  class Log;
31  class DictionaryManager;
32  class ProcGraph;
33  class ProcRequirements;
34  class ProcResults;
35  class Process;
36 
37  /// @brief Decay process class
38  ///
39  /// Contains the amplitudes, weights and info associated to a decay, ...
40  ///
41  /// @ingroup Core
42  class ProcManager : public SettingsConsumer {
43 
44  public:
45  ProcManager();
46 
47  ProcManager(const Process& inputs);
48 
49  ProcManager(const Serial::FBProcess* msgreader);
50 
51  ProcManager(const ProcManager& other) = delete;
52  ProcManager& operator=(const ProcManager& other) = delete;
53  ProcManager(ProcManager&& other);
54  ProcManager& operator=(ProcManager&& other) = delete;
55 
56  ~ProcManager() noexcept = default;
57 
58  public:
59  /// @brief
60  /// @param[in] dictionaries
61  virtual void initialize(DictionaryManager* dictionaries);
62 
63  virtual void setSettingsHandler(SettingsHandler& sh);
64  virtual void setSettingsHandler(const SettingsConsumer& sh);
65 
66  /// @brief
67  void calc();
68 
69  const ProcResults& results() const;
70 
71  const Process& inputs() const;
72 
73  // NumDenPair<double> getPSRates() const;
74 
75  protected:
76 
77  /// @brief
78  /// @param[in] parent
79  void calcRates(const ParticleIndex& parent) const;
80 
81  /// @brief
82  /// @param[in] parent
83  Tensor calcPSTensor(const ParticleIndex& parent) const;
84 
85  /// @brief
86  /// @param[in] parent
87  /// @param[in] ffmaps
88  /// @param[in] schemeName
89  Tensor calcRateTensor(const ParticleIndex& parent, const ProcIdDict<FFIndex>& ffmaps, const std::string& schemeName) const;
90 
91  public:
92 
93  /// @brief
94  /// @param[in] msgwriter
95  /// @param[in] msg
96  void write(flatbuffers::FlatBufferBuilder* msgwriter, flatbuffers::Offset<Serial::FBProcess>* msg) const;
97 
98  /// @brief
99  /// @param[in] msgreader
100  /// @param[in] merge
101  bool read(const Serial::FBProcess* msgreader, bool merge);
102 
103  protected:
104 
105  /// @brief purely virtual function for a class to define new settings
106  virtual void defineSettings();
107 
108  /// @brief logging facility
109  /// @return stream to be used for logging
110  Log& getLog() const;
111 
112  void setDictionary(DictionaryManager* dict);
113 
114  private:
115 
116  std::unique_ptr<Process> _inputs;
117  std::unique_ptr<ProcGraph> _graph;
118  std::unique_ptr<ProcRequirements> _reqs;
119  std::unique_ptr<ProcResults> _results;
121 // NumDenPair<double> _processPhaseSpaceRates;
122 
124 
125  };
126 
127 } // namespace Hammer
128 
129 #endif
virtual void defineSettings()
purely virtual function for a class to define new settings
Definition: ProcManager.cc:254
DictionaryManager * _dictionaries
Definition: ProcManager.hh:123
Forward declaration of serialization related typedefs and includes.
SchemeDict< Tensor > * _processRates
Definition: ProcManager.hh:120
Hammer data types declarations.
~ProcManager() noexcept=default
Tensor calcPSTensor(const ParticleIndex &parent) const
Definition: ProcManager.cc:289
virtual void initialize(DictionaryManager *dictionaries)
Definition: ProcManager.cc:78
void write(flatbuffers::FlatBufferBuilder *msgwriter, flatbuffers::Offset< Serial::FBProcess > *msg) const
Definition: ProcManager.cc:263
void calcRates(const ParticleIndex &parent) const
Definition: ProcManager.cc:338
Decay process class.
Definition: Process.hh:34
Container class for required ingredients for the process weight calculation.
ProcManager & operator=(const ProcManager &other)=delete
std::unique_ptr< ProcResults > _results
Definition: ProcManager.hh:119
Decay process class.
Definition: ProcResults.hh:33
std::unique_ptr< ProcRequirements > _reqs
Definition: ProcManager.hh:118
Container class for process tree structure and its amplitudes associations.
virtual void setSettingsHandler(SettingsHandler &sh)
set link to settings repository handler.
Definition: ProcManager.cc:64
Base class to access the settings repository.
std::unique_ptr< Process > _inputs
Definition: ProcManager.hh:116
Tensor calcRateTensor(const ParticleIndex &parent, const ProcIdDict< FFIndex > &ffmaps, const std::string &schemeName) const
Definition: ProcManager.cc:305
Decay process class.
Definition: ProcManager.hh:42
void setDictionary(DictionaryManager *dict)
Definition: ProcManager.cc:74
Hammer process class.
Logging class.
Definition: Logging.hh:33
const Process & inputs() const
Definition: ProcManager.cc:250
Log & getLog() const
logging facility
Definition: ProcManager.cc:387
Container for process-related results of weight calculation.
Multidimensional tensor class with complex numbers as elements.
Definition: Tensor.hh:33
Base class for accessing Hammer settings repository.
std::unique_ptr< ProcGraph > _graph
Definition: ProcManager.hh:117
const ProcResults & results() const
Definition: ProcManager.cc:246
std::map< ProcessUID, T > ProcIdDict
Definition: IndexTypes.hh:51
bool read(const Serial::FBProcess *msgreader, bool merge)
Definition: ProcManager.cc:275
Hammer settings manager class.
size_t ParticleIndex
Definition: IndexTypes.hh:27
std::map< SchemeName, T > SchemeDict
Definition: IndexTypes.hh:64
Hammer tensor class.