00001 // -*- C++ -*- 00002 // 00003 // HelicityVertex.h is a part of ThePEG - Toolkit for HEP Event Generation 00004 // Copyright (C) 2003-2007 Peter Richardson, Leif Lonnblad 00005 // 00006 // ThePEG is licenced under version 2 of the GPL, see COPYING for details. 00007 // Please respect the MCnet academic guidelines, see GUIDELINES for details. 00008 // 00009 #ifndef ThePEG_HelicityVertex_H 00010 #define ThePEG_HelicityVertex_H 00011 // This is the declaration of the HelicityVertex class. 00012 00013 #include "ThePEG/EventRecord/EventConfig.h" 00014 #include "ThePEG/Utilities/ClassDescription.h" 00015 #include "RhoDMatrix.h" 00016 #include "ThePEG/EventRecord/EventInfoBase.h" 00017 #include "ThePEG/Utilities/Rebinder.h" 00018 #include "ThePEG/EventRecord/SpinBase.h" 00019 #include "ThePEG/Helicity/HelicityDefinitions.h" 00020 #include "HelicityVertex.fh" 00021 00022 // #include "HelicityVertex.xh" 00023 00024 namespace ThePEG { 00025 namespace Helicity { 00026 00046 class HelicityVertex: public EventInfoBase { 00047 00048 public: 00049 00053 friend ostream & operator<<(ostream & os, const HelicityVertex & vert); 00054 00055 public: 00056 00058 typedef vector<tcSpinPtr> SpinVector; 00059 00060 public: 00061 00065 static void Init(); 00066 00073 virtual void rebind(const EventTranslationMap & trans); 00074 00075 public: 00076 00082 const SpinVector & incoming() const {return _incoming;} 00083 00087 const SpinVector & outgoing() const {return _outgoing;} 00088 00094 void addIncoming(tcSpinPtr spin, int & loc) { 00095 _incoming.push_back(spin); 00096 loc=_incoming.size()-1; 00097 } 00098 00104 void addOutgoing(tcSpinPtr spin, int & loc) { 00105 _outgoing.push_back(spin); 00106 loc=_outgoing.size()-1; 00107 } 00108 00112 void resetIncoming(tcSpinPtr spin, int loc) { 00113 assert( loc < int(_incoming.size()) && loc >= 0 ); 00114 _incoming[loc]=spin; 00115 } 00116 00120 void resetOutgoing(tcSpinPtr spin, int loc) { 00121 assert( loc < int(_outgoing.size()) && loc >= 0 ); 00122 _outgoing[loc]=spin; 00123 } 00125 00126 public: 00127 00134 virtual RhoDMatrix getRhoMatrix(int loc,bool recursive) const = 0; 00135 00139 virtual RhoDMatrix getDMatrix(int loc) const = 0; 00141 00142 private: 00143 00147 static AbstractNoPIOClassDescription<HelicityVertex> initHelicityVertex; 00148 00152 HelicityVertex & operator=(const HelicityVertex &); 00153 00154 private: 00155 00159 SpinVector _incoming; 00160 00164 SpinVector _outgoing; 00165 00166 }; 00167 00171 inline ostream & operator<<(ostream & os, const HelicityVertex & vert) { 00172 os << "the incoming particles at the vertex are" << endl; 00173 for(unsigned int ix=0;ix<vert._incoming.size();++ix) { 00174 os << "the " << ix << " th incoming particle " << vert._incoming[ix] << "\n"; 00175 } 00176 os << "the outgoing particles at the vertex are" << endl; 00177 for(unsigned int ix=0;ix<vert._outgoing.size();++ix) { 00178 os << "the " << ix << " th outgoing particle " << vert._outgoing[ix] << "\n"; 00179 } 00180 return os; 00181 } 00182 00183 } 00184 } 00185 00186 00187 namespace ThePEG { 00188 00195 template <> 00196 struct BaseClassTrait<ThePEG::Helicity::HelicityVertex,1> 00197 : public ClassTraitsType { 00199 typedef EventInfoBase NthBase; 00200 }; 00201 00206 template <> 00207 struct ClassTraits<ThePEG::Helicity::HelicityVertex> 00208 : public ClassTraitsBase<ThePEG::Helicity::HelicityVertex> { 00212 static string className() { return "ThePEG::Helicity::HelicityVertex"; } 00213 }; 00214 00217 } 00218 00219 #endif /* ThePEG_HelicityVertex_H */