AmpGen 2.1
Loading...
Searching...
No Matches
Vertex.h
Go to the documentation of this file.
1#ifndef AMPGEN_IVERTEX_H
2#define AMPGEN_IVERTEX_H
3
4#include <map>
5#include <utility>
6#include <vector>
7#include <string>
8
9#include "AmpGen/Expression.h"
10#include "AmpGen/Factory.h"
11#include "AmpGen/Particle.h"
12#include "AmpGen/Tensor.h"
13#include "AmpGen/MsgService.h"
14
22
26#define DECLARE_VERTEX(NAME) \
27 struct NAME : public Base { \
28 NAME() { DEBUG("Constructing vertex"); } \
29 virtual Tensor operator()(const Tensor &P, const Tensor &Q, const Tensor &V1, const Tensor &V2, DebugSymbols *db = 0) override; \
30 static std::string _id; \
31 }
32
33#define DEFINE_VERTEX(VERTEX) \
34 REGISTER_WITH_KEY(Vertex::Base, Vertex::VERTEX, #VERTEX, std::string); \
35 Tensor Vertex::VERTEX::operator()(const Tensor &P, const Tensor &Q, const Tensor &V1, const Tensor &V2, DebugSymbols *db)
36
37namespace AmpGen {
42 namespace Vertex {
49 struct Base {
58 virtual AmpGen::Tensor
59 operator()(const AmpGen::Tensor &P, const AmpGen::Tensor &Q, const AmpGen::Tensor &V1, const AmpGen::Tensor &V2, AmpGen::DebugSymbols *db = nullptr)
60 = 0;
61
62 virtual ~Base() = default;
63 Base *create() { return this; }
64 };
65
68
72
76
80
84
88
92
96
100
104
108
110
117
122
128
133
140
143
146
149
151
157
162
169
172
175
178
180
186
193
198
199 class Factory : public AmpGen::Factory<Vertex::Base> {
200 public:
201 static Tensor getSpinFactor(const Tensor &P, const Tensor &Q, const Tensor &V1, const Tensor &V2, const std::string &name, DebugSymbols *db = nullptr);
202 static Tensor getSpinFactorNBody(const std::vector<std::pair<Tensor, Tensor>> &tensors, const unsigned int &mL, DebugSymbols *db = nullptr);
203 static bool isVertex(const std::string &hash);
204 };
205 } // namespace Vertex
206
214 Tensor Orbital_PWave(const Tensor &p, const Tensor &q);
215
222 Tensor Orbital_DWave(const Tensor &p, const Tensor &q);
223
230
238
248
251 Tensor Bar(const Tensor &P);
252 Tensor slash(const Tensor &P);
253} // namespace AmpGen
254#endif
Static factory to construct classes from a hierarchy based on a key (normally std::string).
Definition Factory.h:18
static Tensor getSpinFactor(const Tensor &P, const Tensor &Q, const Tensor &V1, const Tensor &V2, const std::string &name, DebugSymbols *db=nullptr)
static Tensor getSpinFactorNBody(const std::vector< std::pair< Tensor, Tensor > > &tensors, const unsigned int &mL, DebugSymbols *db=nullptr)
static bool isVertex(const std::string &hash)
Tensor Spin2Projector(const Tensor &p)
Helper function that computes the projection operator onto a spin one state.
Tensor Orbital_DWave(const Tensor &p, const Tensor &q)
Helper function that computes the orbital momentum operator.
#define DECLARE_VERTEX(NAME)
Macro to declare a vertex.
Definition Vertex.h:26
Tensor Orbital_PWave(const Tensor &p, const Tensor &q)
Helper function that computes the orbital momentum operator.
Tensor Spin1Projector(const Tensor &p)
Helper function that computes the projection operator onto a spin one state.
Tensor Spin1hProjector(const Tensor &B)
Helper function that projects a spinor.
Namespace that contains the base class for vertices, Vertex::Base, as well as the implementations of ...
Definition Vertex.h:42
Tensor Spin3hProjector(const Tensor &A)
Tensor Spin3hbProjector(const Tensor &A)
Tensor Spin1hbProjector(const Tensor &B)
Tensor slash(const Tensor &P)
Tensor Gamma4Vec()
std::vector< DebugSymbol > DebugSymbols
Definition Expression.h:111
Tensor Bar(const Tensor &P)
Tensor gamma_twiddle(const Tensor &P)
Base class for all spin vertices.
Definition Vertex.h:49
virtual ~Base()=default
virtual AmpGen::Tensor operator()(const AmpGen::Tensor &P, const AmpGen::Tensor &Q, const AmpGen::Tensor &V1, const AmpGen::Tensor &V2, AmpGen::DebugSymbols *db=nullptr)=0
Calculate the generalised current for this decay process, as a function of:
Base * create()
Definition Vertex.h:63