00001 // -*- C++ -*- 00002 // 00003 // DiagramBase.h is a part of ThePEG - Toolkit for HEP Event Generation 00004 // Copyright (C) 1999-2007 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_DiagramBase_H 00010 #define ThePEG_DiagramBase_H 00011 // This is the declaration of the DiagramBase class. 00012 00013 #include "ThePEG/Config/ThePEG.h" 00014 #include "ThePEG/PDT/ParticleData.h" 00015 #include "ThePEG/MatrixElement/ColourLines.h" 00016 #include "ThePEG/Handlers/StandardXComb.fh" 00017 #include "DiagramBase.fh" 00018 #include "DiagramBase.xh" 00019 00020 namespace ThePEG { 00021 00041 class DiagramBase: public Base { 00042 00043 public: 00044 00050 DiagramBase() : theNIncoming(-1), theId(0) {} 00051 00055 virtual ~DiagramBase(); 00057 00058 public: 00059 00069 virtual tPVector construct(SubProPtr sb, const StandardXComb &, 00070 const ColourLines &) const = 0; 00072 00079 int nIncoming() const { return theNIncoming; } 00080 00085 const cPDVector & partons() const { return thePartons; } 00086 00090 int id() const { return theId; } 00091 00096 string getTag() const; 00098 00099 protected: 00100 00113 void partons(int ninc, const cPDVector & parts, int newId) { 00114 theNIncoming = ninc; 00115 thePartons = parts; 00116 theId = newId; 00117 } 00118 00123 bool done() const { return nIncoming() >= 0; } 00124 00125 public: 00126 00133 void persistentOutput(PersistentOStream & os) const; 00134 00140 void persistentInput(PersistentIStream & is, int version); 00142 00146 static void Init(); 00147 00148 private: 00149 00153 int theNIncoming; 00154 00159 cPDVector thePartons; 00160 00164 int theId; 00165 00166 private: 00167 00171 static AbstractClassDescription<DiagramBase> initDiagramBase; 00172 00176 DiagramBase & operator=(const DiagramBase &); 00177 00178 }; 00179 00180 } 00181 00182 00183 namespace ThePEG { 00184 00191 template <> 00192 struct BaseClassTrait<DiagramBase,1>: public ClassTraitsType { 00194 typedef Base NthBase; 00195 }; 00196 00201 template <> 00202 struct ClassTraits<DiagramBase>: public ClassTraitsBase<DiagramBase> { 00204 static string className() { return "ThePEG::DiagramBase"; } 00205 }; 00206 00209 } 00210 00211 #endif /* ThePEG_DiagramBase_H */