Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PurePhaseSpaceDefs.hh
Go to the documentation of this file.
1 ///
2 /// @file PurePhaseSpaceDefs.hh
3 /// @brief Container class for pure phase space vertices definitions
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_PUREPHASEPACEDEFS_HH
13 #define HAMMER_PUREPHASEPACEDEFS_HH
14 
15 #include <complex>
16 #include <map>
17 #include <set>
18 #include <string>
19 #include <utility>
20 #include <vector>
21 #include <type_traits>
22 
23 #include <boost/variant.hpp>
24 
25 #include "Hammer/IndexTypes.hh"
27 #include "Hammer/Tools/Logging.hh"
28 #include "Hammer/Tools/Pdg.fhh"
29 
30 #include "yaml-cpp/yaml.h"
31 
32 namespace Hammer {
33 
34  class Log;
35 
36  /// @brief Hammer settings manager class
37  ///
38  /// Stores Hammer options, provides facilities for saving and reading option files,
39  /// provides option query interface. It also provide a repository of other run-wide
40  /// information, such as the bibliography associated to the specific run, the list
41  /// of files being processed
42  ///
43  /// @ingroup Handlers
45 
46  public:
47  /// @name Constructors
48  //@{
49 
50  /// default constructor
52  }
53 
54  PurePhaseSpaceDefs(const PurePhaseSpaceDefs& other) = delete;
55  PurePhaseSpaceDefs& operator=(const PurePhaseSpaceDefs& other) = delete;
56  PurePhaseSpaceDefs(PurePhaseSpaceDefs&& other) = default;
58 
59  virtual ~PurePhaseSpaceDefs() noexcept = default;
60 
61  //@}
62 
63  protected:
64  /// @brief logging facility
65  /// @return stream to be used for logging
66  Log& getLog() const;
67 
68  public:
69  void write(flatbuffers::FlatBufferBuilder* msgwriter,
70  std::vector<flatbuffers::Offset<Serial::FBPurePS>>* msgs) const;
71 
72  bool read(const Serial::FBHeader* msgreader, bool merge);
73 
74  public:
75  /// @brief
76  /// @param[in] decays
77  /// @param[in] what
78  void addPurePhaseSpaceVertices(const std::set<VertexName>& decays, WTerm what);
79 
80  void addPurePhaseSpaceVertex(const VertexName& decay, WTerm what);
81 
83 
84  /// @brief
85  /// @param[in] parent
86  /// @param[in] daughters
87  /// @return
88  virtual NumDenPair<bool> isPurePhaseSpace(PdgId parent, const std::vector<PdgId>& daughters) const;
89 
90 
91  private:
92 
94 
95 
96  public:
97 
98  void init();
99 
100  private:
101  friend struct YAML::convert<::Hammer::PurePhaseSpaceDefs>;
102 
103  private:
104 
105  NumDenPair<std::vector<std::string>> _purePhaseSpaceVerticesNames;
106 
107  /// @brief Pure PS vertices
108  /// @details A pair of the {set of the vertex (parent + daughter) HashIds for vertices set to PS in numerator,
109  /// set of the vertex (parent + daughter) HashIds for vertices set to PS in denominator}
111 
112  };
113 
114  YAML::Emitter& operator<<(YAML::Emitter& out, const PurePhaseSpaceDefs& s);
115 
116 } // namespace Hammer
117 
118 namespace YAML {
119 
120  template <>
121  struct convert<::Hammer::PurePhaseSpaceDefs> {
122 
123  static Node encode(const ::Hammer::PurePhaseSpaceDefs& value);
124 
125  static bool decode(const Node& node, ::Hammer::PurePhaseSpaceDefs& value);
126  };
127 
128 } // namespace YAML
129 
130 
131 #endif
std::string VertexName
Definition: IndexTypes.hh:46
Forward declaration of serialization related typedefs and includes.
Hammer settings manager class.
Hammer data types declarations.
NumDenPair< VertexUIDSet > purePhaseSpaceVertices() const
NumDenPair< std::vector< std::string > > _purePhaseSpaceVerticesNames
Log & getLog() const
logging facility
void addPurePhaseSpaceVertices(const std::set< VertexName > &decays, WTerm what)
PurePhaseSpaceDefs & operator=(const PurePhaseSpaceDefs &other)=delete
Message logging routines.
bool read(const Serial::FBHeader *msgreader, bool merge)
PurePhaseSpaceDefs()
default constructor
std::set< VertexUID > VertexUIDSet
Definition: IndexTypes.hh:43
Pdg forward declarations.
Logging class.
Definition: Logging.hh:33
virtual NumDenPair< bool > isPurePhaseSpace(PdgId parent, const std::vector< PdgId > &daughters) const
void clearPurePhaseSpaceVertices(WTerm what)
void write(flatbuffers::FlatBufferBuilder *msgwriter, std::vector< flatbuffers::Offset< Serial::FBPurePS >> *msgs) const
size_t HashId
Definition: IndexTypes.hh:31
Main class.
Definition: Hammer.hh:45
void addPurePhaseSpaceVertex(const VertexName &decay, WTerm what)
virtual ~PurePhaseSpaceDefs() noexcept=default
int PdgId
Definition: Pdg.fhh:17
NumDenPair< std::set< HashId > > _purePhaseSpaceVertices
Pure PS vertices.