ThePEG  1.8.0
VertexBase.h
1 // -*- C++ -*-
2 //
3 // VertexBase.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 2003-2011 Peter Richardson, Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 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>
16 #include <ThePEG/Helicity/HelicityDefinitions.h>
17 #include <ThePEG/Repository/EventGenerator.h>
18 #include "ThePEG/StandardModel/StandardModelBase.h"
19 #include "VertexBase.fh"
20 
21 namespace ThePEG {
22 namespace Helicity {
23 
28 namespace VertexType {
29  typedef unsigned T;
33  const T UNDEFINED = 0;
34 }
35 
49 class VertexBase : public Interfaced {
53 friend ostream & operator<<(ostream &, const VertexBase &);
54 
55 public:
56 
64  VertexBase(VertexType::T name, bool kine=false);
66 
67 public:
68 
75  void persistentOutput(PersistentOStream & os) const;
76 
82  void persistentInput(PersistentIStream & is, int version);
84 
88  static void Init();
89 
90 public:
91 
99  unsigned int size() const { return _particles.size(); }
100 
101 public:
106  bool isIncoming(tPDPtr p) const {
107  return _inpart.find(p) != _inpart.end();
108  }
109 
114  bool isOutgoing(tPDPtr p) const {
115  return _outpart.find(p) != _outpart.end();
116  }
117 
121  const set<tPDPtr> & incoming() const { return _inpart; }
122 
126  const set<tPDPtr> & outgoing() const { return _outpart; }
127 
131  Complex norm() const { return _norm; }
132 
138  vector<long> search(unsigned int ilist,long id) const;
139 
145  vector<tPDPtr> search(unsigned int ilist,tcPDPtr id) const;
146 
154  bool allowed(long id1, long id2, long id3, long id4 = 0) const;
155 
159  VertexType::T getName() const { return _theName; }
160 
164  unsigned int getNpoint() const { return _npoint; }
165 
169  unsigned int orderInGem() const { return _ordergEM; }
170 
174  unsigned int orderInGs() const { return _ordergS; }
176 
177 public:
178 
186  double strongCoupling(Energy2 q2) const {
187  if(_coupopt==0) {
188  double val = 4.0*Constants::pi*generator()->standardModel()->alphaS(q2);
189  assert(val>=0.);
190  return sqrt(val);
191  }
192  else if(_coupopt==1)
193  return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaS());
194  else
195  return _gs;
196  }
197 
201  double electroMagneticCoupling(Energy2 q2) const {
202  if(_coupopt==0)
203  return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaEMME(q2));
204  else if(_coupopt==1)
205  return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaEMMZ());
206  else
207  return _ee;
208  }
209 
213  double weakCoupling(Energy2 q2) const {
214  if( _coupopt == 0 )
215  return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaEMME(q2)/
216  generator()->standardModel()->sin2ThetaW());
217  else if( _coupopt == 1 )
218  return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaEMMZ()/
219  generator()->standardModel()->sin2ThetaW());
220  else
221  return _ee/_sw;
222  }
223 
224  double sin2ThetaW() const {
225  if( _coupopt == 0 || _coupopt == 1)
226  return generator()->standardModel()->sin2ThetaW();
227  else
228  return sqr(_sw);
229  }
231 
232 protected:
233 
241  virtual void doinit();
242 
252  virtual void rebind(const TranslationMap & trans);
253 
259  virtual IVector getReferences();
261 
262 protected:
271  void addToList(const vector<long> & ids);
272 
281  void addToList(long ida, long idb, long idc, long idd = 0);
283 
284 protected:
293  void norm(const Complex & coup) { _norm = coup; }
294 
303  virtual Complex propagator(int iopt, Energy2 q2,tcPDPtr part,
304  complex<Energy> mass=-GeV,
305  complex<Energy> width=-GeV);
306 
315  Complex normPropagator(int iopt, Energy2 q2,tcPDPtr part,
316  complex<Energy> mass=-GeV,
317  complex<Energy> width=-GeV) {
318  return _norm*propagator(iopt,q2,part,mass,width);
319  }
321 
322 public:
325 
329  bool kinematics() const { return _calckinematics; }
330 
334  void kinematics(bool kine ) { _calckinematics=kine; }
335 
340  const Lorentz5Momentum & p1,
341  const Lorentz5Momentum & p2) {
342  _kine[0][0]=p0*p0;
343  _kine[1][1]=p1*p1;
344  _kine[2][2]=p2*p2;
345  _kine[0][1]=p0*p1;_kine[1][0]=_kine[0][1];
346  _kine[0][2]=p0*p2;_kine[2][0]=_kine[0][2];
347  _kine[1][2]=p1*p2;_kine[2][1]=_kine[1][2];
348  }
349 
354  const Lorentz5Momentum & p1,
355  const Lorentz5Momentum & p2,
356  const Lorentz5Momentum & p3) {
357  _kine[0][0]=p0*p0;
358  _kine[1][1]=p1*p1;
359  _kine[2][2]=p2*p2;
360  _kine[3][3]=p3*p3;
361  _kine[0][1]=p0*p1;_kine[1][0]=_kine[0][1];
362  _kine[0][2]=p0*p2;_kine[2][0]=_kine[0][2];
363  _kine[0][3]=p0*p3;_kine[3][0]=_kine[0][3];
364  _kine[1][2]=p1*p2;_kine[2][1]=_kine[1][2];
365  _kine[1][3]=p1*p3;_kine[3][1]=_kine[1][3];
366  _kine[2][3]=p2*p3;_kine[3][2]=_kine[2][3];
367  }
368 
372  void calculateKinematics(const vector<Lorentz5Momentum> & p) {
373  unsigned int ix,iy;
374  for(ix=0;ix<p.size();++ix) {
375  for(iy=0;iy<=ix;++ix) {
376  _kine[ix][iy]=p[ix]*p[iy];
377  _kine[iy][ix]=_kine[ix][iy];
378  }
379  }
380  }
381 
385  Energy2 invariant(unsigned int ix ,unsigned int iy) const {
386  assert ( ix < _npoint && iy < _npoint );
387  return _kine[ix][iy];
388  }
390 
391 protected:
392 
397  void orderInGem(unsigned int order) { _ordergEM = order; }
398 
403  void orderInGs(unsigned int order) { _ordergS = order; }
404 
405 private:
406 
411 
415  VertexBase & operator=(const VertexBase &);
416 
417 private:
418 
426  vector<vector<PDPtr> > _particles;
427 
431  unsigned int _npoint;
432 
436  set<tPDPtr> _inpart;
437 
441  set<tPDPtr> _outpart;
443 
448 
453 
457  vector<vector<Energy2> > _kine;
458 
462  VertexType::T _theName;
463 
467  unsigned int _ordergEM;
468 
472  unsigned int _ordergS;
473 
477  unsigned int _coupopt;
478 
482  double _gs;
483 
487  double _ee;
488 
492  double _sw;
493 };
494 
498 ostream & operator<<(ostream &, const VertexBase &);
499 
500 }
501 }
502 
503 
504 namespace ThePEG {
505 
512 template <>
515  typedef Interfaced NthBase;
516 };
517 
522 template <>
524  : public ClassTraitsBase<ThePEG::Helicity::VertexBase> {
528  static string className() { return "ThePEG::VertexBase"; }
529 };
530 
533 }
534 
535 #endif /* ThePEG_VertexBase_H */
VertexType::T _theName
Name of vertex.
Definition: VertexBase.h:462
PersistentIStream is used to read persistent objects from a stream where they were previously written...
unsigned int size() const
Access to the particle information.
Definition: VertexBase.h:99
std::complex< double > Complex
ThePEG code should use Complex for all complex scalars.
Definition: Complex.h:23
double _sw
Fixed value of to use.
Definition: VertexBase.h:492
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
A concreate implementation of ClassDescriptionBase describing an abstract class with persistent data...
bool isIncoming(tPDPtr p) const
Is a particle allowed as an incoming particle?
Definition: VertexBase.h:106
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:681
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:509
unsigned int orderInGs() const
Get the order in .
Definition: VertexBase.h:174
vector< vector< PDPtr > > _particles
Storage of the particles.
Definition: VertexBase.h:426
Rebinder is a class associating pairs of pointers to objects.
Definition: Rebinder.h:27
set< tPDPtr > _outpart
ParticleData pointers for the allowed outgoing particles.
Definition: VertexBase.h:441
static AbstractClassDescription< ThePEG::Helicity::VertexBase > initVertexBase
Describe a concrete class with persistent data.
Definition: VertexBase.h:410
void orderInGs(unsigned int order)
Set the order in .
Definition: VertexBase.h:403
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
unsigned int _coupopt
option for the coupling
Definition: VertexBase.h:477
double strongCoupling(Energy2 q2) const
Strong coupling.
Definition: VertexBase.h:186
set< tPDPtr > _inpart
ParticleData pointers for the allowed incoming particles.
Definition: VertexBase.h:436
Complex _norm
The overall coupling.
Definition: VertexBase.h:447
bool isOutgoing(tPDPtr p) const
Is a particle allowed as an outgoing particle?
Definition: VertexBase.h:114
double _ee
Fixed value of the electromagentic coupling to use.
Definition: VertexBase.h:487
The VertexBase class is the base class for all helicity amplitude vertices.
Definition: VertexBase.h:49
Energy2 invariant(unsigned int ix, unsigned int iy) const
Get one of the kinematic invariants.
Definition: VertexBase.h:385
double _gs
Fixed value of strong coupling to use.
Definition: VertexBase.h:482
unsigned int _ordergS
Order of vertex in .
Definition: VertexBase.h:472
unsigned int _ordergEM
Order of vertex in .
Definition: VertexBase.h:467
bool _calckinematics
Whether or not to calculate the kinematic invariants for the vertex.
Definition: VertexBase.h:452
const T UNDEFINED
Undefined Enum for the Lorentz structures.
Definition: VertexBase.h:33
ostream & operator<<(ostream &, const VertexBase &)
Output the information on the vertex.
Complex norm() const
Get the coupling.
Definition: VertexBase.h:131
double electroMagneticCoupling(Energy2 q2) const
Electromagnetic coupling.
Definition: VertexBase.h:201
bool kinematics() const
Whether or not to calculate the kinematics invariants.
Definition: VertexBase.h:329
void orderInGem(unsigned int order)
Set the order in .
Definition: VertexBase.h:397
void calculateKinematics(const vector< Lorentz5Momentum > &p)
Calculate the kinematics for a n-point vertex.
Definition: VertexBase.h:372
The Interfaced class is derived from the InterfacedBase class adding a couple of things particular to...
Definition: Interfaced.h:38
double weakCoupling(Energy2 q2) const
Weak coupling.
Definition: VertexBase.h:213
const double pi
Good old .
Definition: Constants.h:54
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:353
unsigned int _npoint
Number of particles at the vertex.
Definition: VertexBase.h:431
vector< vector< Energy2 > > _kine
Kinematica quantities needed for loop vertices.
Definition: VertexBase.h:457
void kinematics(bool kine)
Set whether or not to calculate the kinematics invariants.
Definition: VertexBase.h:334
void calculateKinematics(const Lorentz5Momentum &p0, const Lorentz5Momentum &p1, const Lorentz5Momentum &p2)
Calculate the kinematics for a 3-point vertex.
Definition: VertexBase.h:339
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
VertexType::T getName() const
Get name of Vertex.
Definition: VertexBase.h:159
void norm(const Complex &coup)
Members for the amplitude calculations.
Definition: VertexBase.h:293
unsigned int getNpoint() const
Get number of lines on Vertex.
Definition: VertexBase.h:164
vector< IBPtr > IVector
A vector of pointers to InterfacedBase objects.
Definition: Containers.h:67
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
Complex normPropagator(int iopt, Energy2 q2, tcPDPtr part, complex< Energy > mass=-GeV, complex< Energy > width=-GeV)
Calculate propagator multiplied by coupling.
Definition: VertexBase.h:315
const set< tPDPtr > & incoming() const
Get the list of incoming particles.
Definition: VertexBase.h:121
unsigned int orderInGem() const
Get the order in .
Definition: VertexBase.h:169
const set< tPDPtr > & outgoing() const
Get the list of outgoing particles.
Definition: VertexBase.h:126
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52