AmpGen 2.1
Loading...
Searching...
No Matches
Lineshapes.h
Go to the documentation of this file.
1#ifndef AMPGEN_LINESHAPES_H
2#define AMPGEN_LINESHAPES_H
3
4#include <map>
5#include <string>
6#include <utility>
7#include <vector>
8
9#include "AmpGen/Expression.h"
10#include "AmpGen/Factory.h"
11#include "AmpGen/MsgService.h"
12#include "AmpGen/Tensor.h"
13#include "AmpGen/Particle.h"
14
42
43#define DECLARE_LINESHAPE( X ) \
44 class X : public AmpGen::Lineshape::Base { \
45 static std::string _id; \
46 public: \
47 X(){ DEBUG("Constructing lineshape") ;} \
48 AmpGen::Expression get(const AmpGen::Expression& s, const AmpGen::Expression& s1, \
49 const AmpGen::Expression& s2, const std::string& particleName, \
50 const unsigned int& L, const std::string& lineshapeModifier, \
51 AmpGen::DebugSymbols* dbexpressions = 0) const override; \
52 AmpGen::Expression get(const AmpGen::Particle& p, \
53 const std::string& lineshapeModifier, \
54 AmpGen::DebugSymbols* dbexpressions = nullptr ) const override; \
55 }
56
57#define DEFINE_LINESHAPE( X ) \
58 REGISTER_WITH_KEY( Lineshape::Base, Lineshape::X, #X, std::string ); \
59 AmpGen::Expression Lineshape::X::get( const AmpGen::Particle& p, \
60 const std::string& lineshapeModifier, \
61 AmpGen::DebugSymbols* dbexpressions ) const { return \
62 get(p.massSq(), p.daughter(0)->massSq(), p.daughter(1)->massSq(), \
63 p.name(), p.L(), lineshapeModifier, dbexpressions) ;} \
64 AmpGen::Expression Lineshape::X::get( const AmpGen::Expression& s, const AmpGen::Expression& s1, \
65 const AmpGen::Expression& s2, const std::string& particleName, \
66 const unsigned int& L, const std::string& lineshapeModifier, \
67 AmpGen::DebugSymbols* dbexpressions ) const
68
69#define DEFINE_GENERIC_SHAPE( X ) \
70 REGISTER_WITH_KEY( Lineshape::Base, Lineshape::X, #X, std::string ); \
71 AmpGen::Expression Lineshape::X::get( const AmpGen::Expression& s, const AmpGen::Expression& s1, \
72 const AmpGen::Expression& s2, const std::string& particleName, \
73 const unsigned int& L, const std::string& lineshapeModifier, \
74 AmpGen::DebugSymbols* dbexpressions ) const { return 0;} \
75 AmpGen::Expression Lineshape::X::get( const AmpGen::Particle& p, \
76 const std::string& lineshapeModifier, \
77 AmpGen::DebugSymbols* dbexpressions ) const
78
79namespace AmpGen
80{
81 class Particle; // forward definitions
82
86
87 namespace Lineshape
88 {
89 class Base {
90 public:
91 virtual ~Base() = default;
92 virtual Expression get( const Expression& s, const Expression& s1, const Expression& s2,
93 const std::string& particleName, const unsigned& L,
94 const std::string& lineshapeModifier, DebugSymbols* dbexpressions = nullptr ) const = 0;
95 virtual Expression get( const AmpGen::Particle& p,
96 const std::string& lineshapeModifier,
97 AmpGen::DebugSymbols* dbexpressions = nullptr ) const = 0;
98 Base* create() { return this; }
99 };
100
101 class Factory : public AmpGen::Factory<Lineshape::Base>
102 {
103 public:
104 static Expression get(const std::string& lineshape, const Expression& s, const Expression& s1,
105 const Expression& s2, const std::string& particleName, const unsigned& L,
106 std::vector<std::pair<std::string, Expression>>* dbexpressions = nullptr );
107 static Expression get(const std::string& lineshape,
108 const Particle& p,
109 AmpGen::DebugSymbols* dbexpressions );
110 static bool isLineshape( const std::string& lineshape );
111 };
112
114
139
154
165
190
275
300
303
305
321
326
331
336
339
345
364
372
377
390
402
404 } // namespace Lineshape
405
406 Expression Q2( const Expression& Msq, const Expression& M1sq, const Expression& M2sq );
407
409 std::vector<std::pair<std::string, Expression>>* dbexpressions = nullptr );
410 Expression BlattWeisskopf_Norm( const Expression& z, const Expression& z0, unsigned int L );
411
412 Expression BL( const Expression& s, const Expression& s0, const Expression& s1, const Expression& s2,
413 const Expression& radius, const unsigned int& L );
414
415 Expression BlattWeisskopf( const Expression& z, unsigned int L );
416
417 Expression pol( const AmpGen::Expression& X, const std::vector<Expression>& p );
418
419 std::vector<Expression> parameterVector(const std::string& name, const size_t& nParam);
420
421 Expression width( const Expression& s, const Expression& s1, const Expression& s2, const Expression& mass,
422 const Expression& width, const Expression& radius, unsigned int L,
423 DebugSymbols* dbexpressions = nullptr );
424} // namespace AmpGen
425#endif
#define DECLARE_LINESHAPE(X)
Definition Lineshapes.h:43
Wrapper class for shared_ptrs to virtual expressions for use in conjunction with operators to build e...
Definition Expression.h:135
Static factory to construct classes from a hierarchy based on a key (normally std::string)
Definition Factory.h:22
virtual ~Base()=default
virtual Expression get(const Expression &s, const Expression &s1, const Expression &s2, const std::string &particleName, const unsigned &L, const std::string &lineshapeModifier, DebugSymbols *dbexpressions=nullptr) const =0
virtual Expression get(const AmpGen::Particle &p, const std::string &lineshapeModifier, AmpGen::DebugSymbols *dbexpressions=nullptr) const =0
static Expression get(const std::string &lineshape, const Particle &p, AmpGen::DebugSymbols *dbexpressions)
static Expression get(const std::string &lineshape, const Expression &s, const Expression &s1, const Expression &s2, const std::string &particleName, const unsigned &L, std::vector< std::pair< std::string, Expression > > *dbexpressions=nullptr)
static bool isLineshape(const std::string &lineshape)
Describes a particle, its decay process and subsequent decay products, which are also Particles.
Definition Particle.h:103
Expression Q2(const Expression &Msq, const Expression &M1sq, const Expression &M2sq)
Expression kFactor(const Expression &mass, const Expression &width, std::vector< std::pair< std::string, Expression > > *dbexpressions=nullptr)
Expression BL(const Expression &s, const Expression &s0, const Expression &s1, const Expression &s2, const Expression &radius, const unsigned int &L)
Expression width(const Expression &s, const Expression &s1, const Expression &s2, const Expression &mass, const Expression &width, const Expression &radius, unsigned int L, DebugSymbols *dbexpressions=nullptr)
Expression BlattWeisskopf(const Expression &z, unsigned int L)
std::vector< DebugSymbol > DebugSymbols
Definition Expression.h:111
Expression pol(const AmpGen::Expression &X, const std::vector< Expression > &p)
Expression BlattWeisskopf_Norm(const Expression &z, const Expression &z0, unsigned int L)
std::vector< Expression > parameterVector(const std::string &name, const size_t &nParam)