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
38{
43 namespace Vertex
44 {
51 struct Base {
52
62 const AmpGen::Tensor& Q,
63 const AmpGen::Tensor& V1,
64 const AmpGen::Tensor& V2,
65 AmpGen::DebugSymbols* db = nullptr ) = 0;
66
67 virtual ~Base() = default;
68 Base* create() { return this; }
69 };
70
73
77
81
85
89
93
97
101
105
109
113
115
122
127
133
138
145
148
151
154
156
162
167
174
177
180
183
185
191
198
203
204 class Factory : public AmpGen::Factory<Vertex::Base>
205 {
206 public:
207 static Tensor getSpinFactor( const Tensor& P, const Tensor& Q, const Tensor& V1, const Tensor& V2,
208 const std::string& name, DebugSymbols* db = nullptr );
209 static Tensor getSpinFactorNBody( const std::vector<std::pair<Tensor, Tensor>>& tensors, const unsigned int& mL,
210 DebugSymbols* db = nullptr );
211 static bool isVertex( const std::string& hash );
212 };
213 } // namespace Vertex
214
222 Tensor Orbital_PWave(const Tensor& p, const Tensor& q);
223
230 Tensor Orbital_DWave(const Tensor& p, const Tensor& q);
231
238
246
256
259 Tensor Bar( const Tensor& P );
260 Tensor slash( const Tensor& P );
261} // namespace AmpGen
262#endif
Static factory to construct classes from a hierarchy based on a key (normally std::string)
Definition Factory.h:22
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:44
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:51
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:68