Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ProcResults.hh
Go to the documentation of this file.
1 ///
2 /// @file ProcResults.hh
3 /// @brief Container for process-related results of weight calculation
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_PROCESSRESULTS_HH
13 #define HAMMER_PROCESSRESULTS_HH
14 
15 #include <utility>
16 #include <vector>
17 #include <string>
18 
19 #include "Hammer/IndexTypes.hh"
20 #include "Hammer/Math/Tensor.hh"
23 
24 namespace Hammer {
25 
26  class Log;
27 
28  /// @brief Decay process class
29  ///
30  /// Contains the amplitudes, weights and info associated to a decay, ...
31  ///
32  /// @ingroup Core
33  class ProcResults : public SettingsConsumer {
34 
35  public:
36  ProcResults();
37 
38  ProcResults(const Serial::FBProcData* msgreader);
39 
40  ProcResults(const ProcResults& other) = delete;
41  ProcResults& operator=(const ProcResults& other) = delete;
42  ProcResults(ProcResults&& other) = delete;
43  ProcResults& operator=(ProcResults&& other) = delete;
44 
45  ~ProcResults() noexcept = default;
46 
47  public:
48 
49  /// @brief
50  /// @param[in] what
51  /// @return
52  const Tensor& processAmplitude(WTerm what = WTerm::NUMERATOR) const;
53 
54  /// @brief
55  /// @param[in] what
56  /// @return
58 
59  /// @brief
60  /// @param[in] what
61  /// @return
63 
64  /// @brief
65  /// @param[in] what
66  /// @return
68 
69  std::vector<std::reference_wrapper<const Tensor>> processFormFactors(const std::string& schemeName) const;
70 
71  std::vector<std::reference_wrapper<Tensor>> processFormFactors(const std::string& schemeName);
72 
73  void appendFormFactor(const std::string& schemeName, const Tensor& formfact);
74 
75  void appendFormFactor(const std::string& schemeName, Tensor&& formfact);
76 
77  void clearFormFactors();
78 
79  bool haveFormFactors() const;
80 
81  /// @brief
82  /// @param[in] schemeName
83  /// @return
84  const Tensor& processWeight(const std::string& schemeName) const;
85 
86  /// @brief
87  /// @param[in] schemeName
88  /// @return
89  Tensor& processWeight(const std::string& schemeName);
90 
91  void setProcessWeight(const std::string& schemeName, const Tensor& weight);
92 
93  void setProcessWeight(const std::string& schemeName, Tensor&& weight);
94 
95  void clearWeights();
96 
97  bool haveWeights() const;
98 
99  std::vector<std::string> availableSchemes() const;
100 
101  public:
102 
103  /// @brief
104  /// @param[in] msgwriter
105  /// @param[in] msg
106  void write(flatbuffers::FlatBufferBuilder* msgwriter, flatbuffers::Offset<Serial::FBProcData>* msg) const;
107 
108  /// @brief
109  /// @param[in] msgreader
110  /// @param[in] merge
111  bool read(const Serial::FBProcData* msgreader, bool merge);
112 
113  protected:
114  /// @brief purely virtual function for a class to define new settings
115  virtual void defineSettings();
116 
117  /// @brief logging facility
118  /// @return stream to be used for logging
119  Log& getLog() const;
120 
121  private:
122 
123 
128 
129  };
130 
131 } // namespace Hammer
132 
133 #endif
Forward declaration of serialization related typedefs and includes.
Hammer data types declarations.
~ProcResults() noexcept=default
const Tensor & processAmplitude(WTerm what=WTerm::NUMERATOR) const
Definition: ProcResults.cc:35
NumDenPair< Tensor > _processSquaredAmplitude
Definition: ProcResults.hh:125
Decay process class.
Definition: ProcResults.hh:33
NumDenPair< Tensor > _processAmplitude
Definition: ProcResults.hh:126
void write(flatbuffers::FlatBufferBuilder *msgwriter, flatbuffers::Offset< Serial::FBProcData > *msg) const
Definition: ProcResults.cc:126
Log & getLog() const
logging facility
Definition: ProcResults.cc:249
Base class to access the settings repository.
bool haveWeights() const
Definition: ProcResults.cc:114
std::vector< std::string > availableSchemes() const
Definition: ProcResults.cc:87
Logging class.
Definition: Logging.hh:33
const Tensor & processWeight(const std::string &schemeName) const
Definition: ProcResults.cc:94
bool read(const Serial::FBProcData *msgreader, bool merge)
Definition: ProcResults.cc:192
const Tensor & processAmplitudeSquared(WTerm what=WTerm::NUMERATOR) const
Definition: ProcResults.cc:43
Multidimensional tensor class with complex numbers as elements.
Definition: Tensor.hh:33
Base class for accessing Hammer settings repository.
std::vector< std::reference_wrapper< const Tensor > > processFormFactors(const std::string &schemeName) const
Definition: ProcResults.cc:51
SchemeDict< Tensor > _processWeights
Definition: ProcResults.hh:124
virtual void defineSettings()
purely virtual function for a class to define new settings
Definition: ProcResults.cc:119
std::map< SchemeName, T > SchemeDict
Definition: IndexTypes.hh:64
void appendFormFactor(const std::string &schemeName, const Tensor &formfact)
Definition: ProcResults.cc:71
SchemeDict< std::vector< Tensor > > _processFormFactors
Definition: ProcResults.hh:127
bool haveFormFactors() const
Definition: ProcResults.cc:83
void setProcessWeight(const std::string &schemeName, const Tensor &weight)
Definition: ProcResults.cc:102
ProcResults & operator=(const ProcResults &other)=delete
Hammer tensor class.