thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
VertexBase.h
1// -*- C++ -*-
2//
3// VertexBase.h is a part of ThePEG - Toolkit for HEP Event Generation
4// Copyright (C) 2003-2019 Peter Richardson, Leif Lonnblad
5//
6// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8//
9#ifndef ThePEG_VertexBase_H
10#define ThePEG_VertexBase_H
11//
12// This is the declaration of the VertexBase class.
13
14#include <ThePEG/Interface/Interfaced.h>
15#include <ThePEG/PDT/ParticleData.h>
17#include <ThePEG/Repository/EventGenerator.h>
18#include "ThePEG/StandardModel/StandardModelBase.h"
19#include "VertexBase.fh"
20#include <array>
21
22
23namespace ThePEG {
24namespace Helicity {
25
30namespace VertexType {
31 typedef unsigned T;
35 const T UNDEFINED = 0;
36}
37
41namespace ColourStructure {
42 typedef unsigned T;
43 const T UNDEFINED = 0;
44 const T SINGLET = 1;
45 const T SU3TFUND = 2;
46 const T SU3F = 3;
47 const T SU3T6 = 4;
48 const T SU3K6 = 5;
49 const T EPS = 6;
50 const T DELTA = 7;
51 const T SU3FF = 8;
52 const T SU3TTFUNDS = 9;
53 const T SU3TTFUNDD = 10;
54 const T SU3TT6 = 11;
55 const T SU3I12I34 = 12;
56 const T SU3I14I23 = 13;
57 const T SU3T21T43 = 14;
58 const T SU3T23T41 = 15;
59}
60
64namespace CouplingType {
65 typedef unsigned T;
66 const T UNDEFINED = 0;
67 const T QED = 1;
68 const T QCD = 2;
69}
83class VertexBase : public Interfaced {
87friend ostream & operator<<(ostream &, const VertexBase &);
88
89public:
90
98 VertexBase(VertexType::T name, bool kine=false);
100
101public:
102
110
116 void persistentInput(PersistentIStream & is, int version);
118
122 static void Init();
123
124public:
125
133 unsigned int size() const { return _particles.size(); }
134
135public:
140 bool isIncoming(tPDPtr p) const {
141 return _inpart.find(p) != _inpart.end();
142 }
143
148 bool isOutgoing(tPDPtr p) const {
149 return _outpart.find(p) != _outpart.end();
150 }
151
155 const set<tPDPtr> & incoming() const { return _inpart; }
156
160 const set<tPDPtr> & outgoing() const { return _outpart; }
161
165 Complex norm() const { return _norm; }
166
172 vector<long> search(unsigned int ilist,long id) const;
173
179 vector<tPDPtr> search(unsigned int ilist,tcPDPtr id) const;
180
188 bool allowed(long id1, long id2, long id3, long id4 = 0) const;
189
193 VertexType::T getName() const { return _theName; }
194
198 unsigned int getNpoint() const { return _npoint; }
199
203 int orderInGem() const { return couplingOrders_.at(CouplingType::QED); }
204
208 int orderInGs() const { return couplingOrders_.at(CouplingType::QCD); }
209
213 int orderInCoupling(CouplingType::T cType) const {
214 if(couplingOrders_.find(cType) !=couplingOrders_.end())
215 return couplingOrders_.at(cType);
216 else
217 return 0;
218 }
219
224 int output(0);
225 for(auto & p : couplingOrders_)
226 output += p.second;
227 return output;
228 }
229
233 ColourStructure::T colourStructure() const {return colourStructure_;}
235
236public:
237
245 double strongCoupling(Energy2 q2) const {
246 if(_coupopt==0) {
247 double val = 4.0*Constants::pi*generator()->standardModel()->alphaS(q2);
248 assert(val>=0.);
249 return sqrt(val);
250 }
251 else if(_coupopt==1)
252 return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaS());
253 else
254 return _gs;
255 }
256
261 if(_coupopt==0)
262 return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaEMME(q2));
263 else if(_coupopt==1)
264 return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaEMMZ());
265 else
266 return _ee;
267 }
268
272 double weakCoupling(Energy2 q2) const {
273 if( _coupopt == 0 )
274 return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaEMME(q2)/
275 generator()->standardModel()->sin2ThetaW());
276 else if( _coupopt == 1 )
277 return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaEMMZ()/
278 generator()->standardModel()->sin2ThetaW());
279 else
280 return _ee/_sw;
281 }
282
283 double sin2ThetaW() const {
284 if( _coupopt == 0 || _coupopt == 1)
285 return generator()->standardModel()->sin2ThetaW();
286 else
287 return sqr(_sw);
288 }
290
291public:
292
306 virtual void setCoupling(Energy2 q2,tcPDPtr part1,
307 tcPDPtr part2,tcPDPtr part3)=0;
308
319 virtual void setCoupling(Energy2 q2,tcPDPtr part1,tcPDPtr part2,tcPDPtr part3,
320 tcPDPtr part4)=0;
322
323protected:
324
332 virtual void doinit();
333
343 virtual void rebind(const TranslationMap & trans);
344
352
353protected:
362 void addToList(const vector<long> & ids);
363
372 void addToList(long ida, long idb, long idc, long idd = 0);
374
375protected:
384 void norm(const Complex & coup) { _norm = coup; }
385
394 virtual Complex propagator(int iopt, Energy2 q2,tcPDPtr part,
395 complex<Energy> mass=-GeV,
396 complex<Energy> width=-GeV);
397
407 complex<Energy> mass=-GeV,
408 complex<Energy> width=-GeV) {
409 return _norm*propagator(iopt,q2,part,mass,width);
410 }
412
413public:
416
420 bool kinematics() const { return _calckinematics; }
421
425 void kinematics(bool kine ) { _calckinematics=kine; }
426
431 const Lorentz5Momentum & p1,
432 const Lorentz5Momentum & p2) {
433 _kine[0][0]=p0*p0;
434 _kine[1][1]=p1*p1;
435 _kine[2][2]=p2*p2;
436 _kine[0][1]=p0*p1;_kine[1][0]=_kine[0][1];
437 _kine[0][2]=p0*p2;_kine[2][0]=_kine[0][2];
438 _kine[1][2]=p1*p2;_kine[2][1]=_kine[1][2];
439 }
440
445 const Lorentz5Momentum & p1,
446 const Lorentz5Momentum & p2,
447 const Lorentz5Momentum & p3) {
448 _kine[0][0]=p0*p0;
449 _kine[1][1]=p1*p1;
450 _kine[2][2]=p2*p2;
451 _kine[3][3]=p3*p3;
452 _kine[0][1]=p0*p1;_kine[1][0]=_kine[0][1];
453 _kine[0][2]=p0*p2;_kine[2][0]=_kine[0][2];
454 _kine[0][3]=p0*p3;_kine[3][0]=_kine[0][3];
455 _kine[1][2]=p1*p2;_kine[2][1]=_kine[1][2];
456 _kine[1][3]=p1*p3;_kine[3][1]=_kine[1][3];
457 _kine[2][3]=p2*p3;_kine[3][2]=_kine[2][3];
458 }
459
463 void calculateKinematics(const vector<Lorentz5Momentum> & p) {
464 for(size_t ix=0;ix<p.size();++ix) {
465 for(size_t iy=0;iy<=ix;++ix) {
466 _kine[ix][iy]=p[ix]*p[iy];
467 _kine[iy][ix]=_kine[ix][iy];
468 }
469 }
470 }
471
475 Energy2 invariant(unsigned int ix ,unsigned int iy) const {
476 assert ( ix < _npoint && iy < _npoint );
477 return _kine[ix][iy];
478 }
480
481protected:
482
487 void orderInGem(int order) { couplingOrders_[CouplingType::QED] = order; }
488
493 void orderInGs (int order) { couplingOrders_[CouplingType::QCD] = order; }
494
498 void orderInCoupling(CouplingType::T cType, int order) {
499 couplingOrders_[cType] = order;
500 }
501
505 void colourStructure(ColourStructure::T structure) {
506 colourStructure_ = structure;
507 }
508
509private:
510
514 VertexBase & operator=(const VertexBase &) = delete;
515
516private:
517
525 vector<vector<PDPtr> > _particles;
526
530 unsigned int _npoint;
531
535 set<tPDPtr> _inpart;
536
540 set<tPDPtr> _outpart;
542
547
552
556 std::array<std::array<Energy2,5>,5> _kine;
557
561 VertexType::T _theName;
562
566 ColourStructure::T colourStructure_;
567
571 map<CouplingType::T,int> couplingOrders_;
572
576 unsigned int _coupopt;
577
581 double _gs;
582
586 double _ee;
587
591 double _sw;
592};
593
597ostream & operator<<(ostream &, const VertexBase &);
598
599}
600}
601
602#endif /* ThePEG_VertexBase_H */
This file contains enumerations used by LorentzSpinor and LorentzSpinorBar classes.
The VertexBase class is the base class for all helicity amplitude vertices.
Definition: VertexBase.h:83
const set< tPDPtr > & incoming() const
Get the list of incoming particles.
Definition: VertexBase.h:155
const set< tPDPtr > & outgoing() const
Get the list of outgoing particles.
Definition: VertexBase.h:160
int orderInCoupling(CouplingType::T cType) const
Get the order in a specific coupling.
Definition: VertexBase.h:213
vector< tPDPtr > search(unsigned int ilist, tcPDPtr id) const
Function to search the list.
ColourStructure::T colourStructure() const
Get the colour structure.
Definition: VertexBase.h:233
bool isIncoming(tPDPtr p) const
Is a particle allowed as an incoming particle?
Definition: VertexBase.h:140
set< tPDPtr > _inpart
ParticleData pointers for the allowed incoming particles.
Definition: VertexBase.h:535
double weakCoupling(Energy2 q2) const
Weak coupling.
Definition: VertexBase.h:272
vector< vector< PDPtr > > _particles
Storage of the particles.
Definition: VertexBase.h:525
int orderInGem() const
Get the order in .
Definition: VertexBase.h:203
VertexType::T _theName
Name of vertex.
Definition: VertexBase.h:561
Complex norm() const
Get the coupling.
Definition: VertexBase.h:165
VertexBase(VertexType::T name, bool kine=false)
Constructor for -point vertices.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
void addToList(const vector< long > &ids)
Members to set-up the particles.
map< CouplingType::T, int > couplingOrders_
The order of the vertex in specific couplings.
Definition: VertexBase.h:571
VertexBase & operator=(const VertexBase &)=delete
Private and non-existent assignment operator.
void colourStructure(ColourStructure::T structure)
Set the colour structure.
Definition: VertexBase.h:505
Energy2 invariant(unsigned int ix, unsigned int iy) const
Get one of the kinematic invariants.
Definition: VertexBase.h:475
friend ostream & operator<<(ostream &, const VertexBase &)
The output operator is a friend to avoid the data being public.
Complex normPropagator(int iopt, Energy2 q2, tcPDPtr part, complex< Energy > mass=-GeV, complex< Energy > width=-GeV)
Calculate propagator multiplied by coupling.
Definition: VertexBase.h:406
int orderInGs() const
Get the order in .
Definition: VertexBase.h:208
virtual void setCoupling(Energy2 q2, tcPDPtr part1, tcPDPtr part2, tcPDPtr part3, tcPDPtr part4)=0
Calculate the couplings for a four point interaction.
bool allowed(long id1, long id2, long id3, long id4=0) const
Is a given combination allowed.
std::array< std::array< Energy2, 5 >, 5 > _kine
Kinematica quantities needed for loop vertices.
Definition: VertexBase.h:556
VertexType::T getName() const
Get name of Vertex.
Definition: VertexBase.h:193
void calculateKinematics(const Lorentz5Momentum &p0, const Lorentz5Momentum &p1, const Lorentz5Momentum &p2, const Lorentz5Momentum &p3)
Calculate the kinematics for a 4-point vertex.
Definition: VertexBase.h:444
double strongCoupling(Energy2 q2) const
Strong coupling.
Definition: VertexBase.h:245
void orderInCoupling(CouplingType::T cType, int order)
Set the order in a specifc type of coupling.
Definition: VertexBase.h:498
int orderInAllCouplings() const
Get the total order of the vertex.
Definition: VertexBase.h:223
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
void calculateKinematics(const vector< Lorentz5Momentum > &p)
Calculate the kinematics for a n-point vertex.
Definition: VertexBase.h:463
virtual void setCoupling(Energy2 q2, tcPDPtr part1, tcPDPtr part2, tcPDPtr part3)=0
Set coupling methods.
void calculateKinematics(const Lorentz5Momentum &p0, const Lorentz5Momentum &p1, const Lorentz5Momentum &p2)
Calculate the kinematics for a 3-point vertex.
Definition: VertexBase.h:430
static void Init()
Standard Init function used to initialize the interfaces.
double _gs
Fixed value of strong coupling to use.
Definition: VertexBase.h:581
Complex _norm
The overall coupling.
Definition: VertexBase.h:546
void orderInGem(int order)
Set the order in .
Definition: VertexBase.h:487
void norm(const Complex &coup)
Members for the amplitude calculations.
Definition: VertexBase.h:384
unsigned int getNpoint() const
Get number of lines on Vertex.
Definition: VertexBase.h:198
void addToList(long ida, long idb, long idc, long idd=0)
Set up the lists of outer particles for the three-/four-point vertex.
virtual IVector getReferences()
Return a vector of all pointers to Interfaced objects used in this object.
double electroMagneticCoupling(Energy2 q2) const
Electromagnetic coupling.
Definition: VertexBase.h:260
virtual void rebind(const TranslationMap &trans)
Rebind pointer to other Interfaced objects.
unsigned int _coupopt
option for the coupling
Definition: VertexBase.h:576
bool kinematics() const
Whether or not to calculate the kinematics invariants.
Definition: VertexBase.h:420
unsigned int size() const
Access to the particle information.
Definition: VertexBase.h:133
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
double _ee
Fixed value of the electromagentic coupling to use.
Definition: VertexBase.h:586
virtual Complex propagator(int iopt, Energy2 q2, tcPDPtr part, complex< Energy > mass=-GeV, complex< Energy > width=-GeV)
Calculate the propagator for a diagram.
void orderInGs(int order)
Set the order in .
Definition: VertexBase.h:493
void kinematics(bool kine)
Set whether or not to calculate the kinematics invariants.
Definition: VertexBase.h:425
set< tPDPtr > _outpart
ParticleData pointers for the allowed outgoing particles.
Definition: VertexBase.h:540
vector< long > search(unsigned int ilist, long id) const
Function to search the list.
ColourStructure::T colourStructure_
Colour structure of the vertex.
Definition: VertexBase.h:566
bool _calckinematics
Whether or not to calculate the kinematic invariants for the vertex.
Definition: VertexBase.h:551
bool isOutgoing(tPDPtr p) const
Is a particle allowed as an outgoing particle?
Definition: VertexBase.h:148
unsigned int _npoint
Number of particles at the vertex.
Definition: VertexBase.h:530
double _sw
Fixed value of to use.
Definition: VertexBase.h:591
string name() const
Returns the name of this object, without the path.
The Interfaced class is derived from the InterfacedBase class adding a couple of things particular to...
Definition: Interfaced.h:38
tEGPtr generator() const
Return a pointer to the EventGenerator controlling the run.
Definition: Interfaced.h:99
PersistentIStream is used to read persistent objects from a stream where they were previously written...
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
Rebinder is a class associating pairs of pointers to objects.
Definition: Rebinder.h:27
constexpr double pi
Good old .
Definition: Constants.h:54
const T UNDEFINED
Undefined Enum for the Lorentz structures.
Definition: VertexBase.h:35
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
std::complex< double > Complex
ThePEG code should use Complex for all complex scalars.
Definition: Complex.h:23
vector< T > & operator<<(vector< T > &tv, const U &u)
Overload the left shift operator for vector to push_back objects to a vector.
Definition: Containers.h:179
constexpr auto sqr(const T &x) -> decltype(x *x)
The square function should really have been included in the standard C++ library.
Definition: ThePEG.h:117
vector< IBPtr > IVector
A vector of pointers to InterfacedBase objects.
Definition: Containers.h:67