00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ThePEG_VertexBase_H
00010 #define ThePEG_VertexBase_H
00011
00012
00013
00014 #include <ThePEG/Interface/Interfaced.h>
00015 #include <ThePEG/PDT/ParticleData.h>
00016 #include <ThePEG/Helicity/HelicityDefinitions.h>
00017 #include <ThePEG/Repository/EventGenerator.h>
00018 #include "ThePEG/StandardModel/StandardModelBase.h"
00019 #include "VertexBase.fh"
00020
00021 namespace ThePEG {
00022 namespace Helicity {
00023
00028 namespace VertexType {
00029 typedef unsigned T;
00030 const T UNDEFINED = 0;
00031 }
00032
00046 class VertexBase : public Interfaced {
00050 friend ostream & operator<<(ostream &, const VertexBase &);
00051
00052 public:
00053
00061 VertexBase(VertexType::T name, bool kine=false);
00063
00064 public:
00065
00072 void persistentOutput(PersistentOStream & os) const;
00073
00079 void persistentInput(PersistentIStream & is, int version);
00081
00085 static void Init();
00086
00087 public:
00088
00096 unsigned int size() const { return _particles.size(); }
00097
00098 public:
00103 bool isIncoming(tPDPtr p) const {
00104 return _inpart.find(p) != _inpart.end();
00105 }
00106
00111 bool isOutgoing(tPDPtr p) const {
00112 return _outpart.find(p) != _outpart.end();
00113 }
00114
00118 const set<tPDPtr> & incoming() const { return _inpart; }
00119
00123 const set<tPDPtr> & outgoing() const { return _outpart; }
00124
00128 Complex norm() const { return _norm; }
00129
00135 vector<long> search(unsigned int ilist,long id) const;
00136
00142 vector<tPDPtr> search(unsigned int ilist,tcPDPtr id) const;
00143
00151 bool allowed(long id1, long id2, long id3, long id4 = 0) const;
00152
00156 VertexType::T getName() const { return _theName; }
00157
00161 unsigned int getNpoint() const { return _npoint; }
00162
00166 unsigned int orderInGem() const { return _ordergEM; }
00167
00171 unsigned int orderInGs() const { return _ordergS; }
00173
00174 protected:
00175
00183 double strongCoupling(Energy2 q2) const {
00184 if(_coupopt==0)
00185 return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaS(q2));
00186 else if(_coupopt==1)
00187 return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaS());
00188 else
00189 return _gs;
00190 }
00191
00195 double electroMagneticCoupling(Energy2 q2) const {
00196 if(_coupopt==0)
00197 return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaEM(q2));
00198 else if(_coupopt==1)
00199 return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaEM());
00200 else
00201 return _ee;
00202 }
00203
00207 double weakCoupling(Energy2 q2) const {
00208 if( _coupopt == 0 )
00209 return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaEM(q2)/
00210 generator()->standardModel()->sin2ThetaW());
00211 else if( _coupopt == 1 )
00212 return sqrt(4.0*Constants::pi*generator()->standardModel()->alphaEM()/
00213 generator()->standardModel()->sin2ThetaW());
00214 else
00215 return _ee/_sw;
00216 }
00217
00218 double sin2ThetaW() const {
00219 if( _coupopt == 0 || _coupopt == 1)
00220 return generator()->standardModel()->sin2ThetaW();
00221 else
00222 return sqr(_sw);
00223 }
00225
00226 protected:
00227
00235 virtual void doinit();
00236
00246 virtual void rebind(const TranslationMap & trans);
00247
00253 virtual IVector getReferences();
00255
00256 protected:
00268 void addToList(const vector<long> & ids);
00269
00278 void addToList(long ida, long idb, long idc, long idd = 0);
00280
00281 protected:
00290 void norm(const Complex & coup) { _norm = coup; }
00291
00300 virtual Complex propagator(int iopt, Energy2 q2,tcPDPtr part,
00301 Energy mass=-GeV, Energy width=-GeV);
00302
00311 Complex normPropagator(int iopt, Energy2 q2,tcPDPtr part,
00312 Energy mass=-GeV, Energy width=-GeV) {
00313 return _norm*propagator(iopt,q2,part,mass,width);
00314 }
00316
00317 public:
00320
00324 bool kinematics() const { return _calckinematics; }
00325
00329 void kinematics(bool kine ) { _calckinematics=kine; }
00330
00334 void calculateKinematics(const Lorentz5Momentum & p0,
00335 const Lorentz5Momentum & p2,
00336 const Lorentz5Momentum & p1) {
00337 _kine[0][0]=p0*p0;
00338 _kine[1][1]=p1*p1;
00339 _kine[2][2]=p2*p2;
00340 _kine[0][1]=p0*p1;_kine[1][0]=_kine[0][1];
00341 _kine[0][2]=p0*p2;_kine[2][0]=_kine[0][2];
00342 _kine[1][2]=p1*p2;_kine[2][1]=_kine[1][2];
00343 }
00344
00348 void calculateKinematics(const Lorentz5Momentum & p0,
00349 const Lorentz5Momentum & p1,
00350 const Lorentz5Momentum & p2,
00351 const Lorentz5Momentum & p3) {
00352 _kine[0][0]=p0*p0;
00353 _kine[1][1]=p1*p1;
00354 _kine[2][2]=p2*p2;
00355 _kine[3][3]=p3*p3;
00356 _kine[0][1]=p0*p1;_kine[1][0]=_kine[0][1];
00357 _kine[0][2]=p0*p2;_kine[2][0]=_kine[0][2];
00358 _kine[0][3]=p0*p3;_kine[3][0]=_kine[0][3];
00359 _kine[1][2]=p1*p2;_kine[2][1]=_kine[1][2];
00360 _kine[1][3]=p1*p3;_kine[3][1]=_kine[1][3];
00361 _kine[2][3]=p2*p3;_kine[3][2]=_kine[2][3];
00362 }
00363
00367 void calculateKinematics(const vector<Lorentz5Momentum> & p) {
00368 unsigned int ix,iy;
00369 for(ix=0;ix<p.size();++ix) {
00370 for(iy=0;iy<=ix;++ix) {
00371 _kine[ix][iy]=p[ix]*p[iy];
00372 _kine[iy][ix]=_kine[ix][iy];
00373 }
00374 }
00375 }
00376
00380 Energy2 invariant(unsigned int ix ,unsigned int iy) const {
00381 assert ( ix < _npoint && iy < _npoint );
00382 return _kine[ix][iy];
00383 }
00385
00386 protected:
00387
00392 void orderInGem(unsigned int order) { _ordergEM = order; }
00393
00398 void orderInGs(unsigned int order) { _ordergS = order; }
00399
00400 private:
00401
00405 static AbstractClassDescription<ThePEG::Helicity::VertexBase> initVertexBase;
00406
00410 VertexBase & operator=(const VertexBase &);
00411
00412 private:
00413
00421 vector<vector<PDPtr> > _particles;
00422
00426 unsigned int _npoint;
00427
00431 set<tPDPtr> _inpart;
00432
00436 set<tPDPtr> _outpart;
00438
00442 Complex _norm;
00443
00447 bool _calckinematics;
00448
00452 vector<vector<Energy2> > _kine;
00453
00457 VertexType::T _theName;
00458
00462 unsigned int _ordergEM;
00463
00467 unsigned int _ordergS;
00468
00472 unsigned int _coupopt;
00473
00477 double _gs;
00478
00482 double _ee;
00483
00487 double _sw;
00488 };
00489
00493 ostream & operator<<(ostream &, const VertexBase &);
00494
00495 }
00496 }
00497
00498
00499 namespace ThePEG {
00500
00507 template <>
00508 struct BaseClassTrait<ThePEG::Helicity::VertexBase,1> {
00510 typedef Interfaced NthBase;
00511 };
00512
00517 template <>
00518 struct ClassTraits<ThePEG::Helicity::VertexBase>
00519 : public ClassTraitsBase<ThePEG::Helicity::VertexBase> {
00523 static string className() { return "ThePEG::VertexBase"; }
00524 };
00525
00528 }
00529
00530 #endif