00001 // -*- C++ -*- 00002 // 00003 // Strategy.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_Strategy_H 00010 #define ThePEG_Strategy_H 00011 // This is the declaration of the Strategy class. 00012 00013 #include "ThePEG/Config/ThePEG.h" 00014 #include "Strategy.fh" 00015 #include "ThePEG/Interface/Interfaced.h" 00016 00017 namespace ThePEG { 00018 00041 class Strategy: public Interfaced { 00042 00043 public: 00044 00050 const ParticleMap & particles() const { return theParticles; } 00051 00059 string localParticlesDir() const; 00060 00069 const vector<string> & defaultParticlesDirs() const { 00070 return theDefaultParticlesDirs; 00071 } 00072 00076 const vector<IPtr> & defaultObjects() const { return theDefaultObjects; } 00078 00083 virtual const string versionstring() const { return ""; } 00084 00085 public: 00086 00093 void persistentOutput(PersistentOStream & os) const; 00094 00100 void persistentInput(PersistentIStream & is, int version); 00102 00106 static void Init(); 00107 00108 protected: 00109 00116 virtual IBPtr clone() const; 00117 00122 virtual IBPtr fullclone() const; 00124 00125 private: 00126 00130 ParticleMap & particles() { return theParticles; } 00131 00132 private: 00133 00137 ParticleMap theParticles; 00138 00146 string theLocalParticlesDir; 00147 00151 vector<IPtr> theDefaultObjects; 00152 00162 vector<string> theDefaultParticlesDirs; 00163 00164 private: 00165 00169 void setLocalParticles(PDPtr pd, int); 00170 00174 void insLocalParticles(PDPtr pd, int); 00175 00179 void delLocalParticles(int place); 00180 00184 vector<PDPtr> getLocalParticles() const; 00185 00189 void setLocalParticlesDir(string); 00190 00194 void setDefaultParticlesDirs(string,int); 00195 00199 void insDefaultParticlesDirs(string,int); 00200 00204 static bool checkDir(string); 00205 00206 private: 00207 00211 static ClassDescription<Strategy> initStrategy; 00212 00216 Strategy & operator=(const Strategy &); 00217 00218 }; 00219 00224 template <> 00225 struct BaseClassTrait<Strategy,1>: public ClassTraitsType { 00227 typedef Interfaced NthBase; 00228 }; 00229 00232 template <> 00233 struct ClassTraits<Strategy>: public ClassTraitsBase<Strategy> { 00235 static string className() { return "ThePEG::Strategy"; } 00236 }; 00237 00240 } 00241 00242 #endif /* ThePEG_Strategy_H */