ThePEG  1.8.0
Strategy.h
1 // -*- C++ -*-
2 //
3 // Strategy.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 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_Strategy_H
10 #define ThePEG_Strategy_H
11 // This is the declaration of the Strategy class.
12 
13 #include "ThePEG/Config/ThePEG.h"
14 #include "Strategy.fh"
15 #include "ThePEG/Interface/Interfaced.h"
16 
17 namespace ThePEG {
18 
41 class Strategy: public Interfaced {
42 
43 public:
44 
50  const ParticleMap & particles() const { return theParticles; }
51 
59  string localParticlesDir() const;
60 
69  const vector<string> & defaultParticlesDirs() const {
71  }
72 
76  const vector<IPtr> & defaultObjects() const { return theDefaultObjects; }
78 
83  virtual const string versionstring() const { return ""; }
84 
85 public:
86 
93  void persistentOutput(PersistentOStream & os) const;
94 
100  void persistentInput(PersistentIStream & is, int version);
102 
106  static void Init();
107 
108 protected:
109 
116  virtual IBPtr clone() const;
117 
122  virtual IBPtr fullclone() const;
124 
125 private:
126 
130  ParticleMap & particles() { return theParticles; }
131 
132 private:
133 
137  ParticleMap theParticles;
138 
147 
151  vector<IPtr> theDefaultObjects;
152 
162  vector<string> theDefaultParticlesDirs;
163 
164 private:
165 
169  void setLocalParticles(PDPtr pd, int);
170 
174  void insLocalParticles(PDPtr pd, int);
175 
179  void delLocalParticles(int place);
180 
184  vector<PDPtr> getLocalParticles() const;
185 
189  void setLocalParticlesDir(string);
190 
194  void setDefaultParticlesDirs(string,int);
195 
199  void insDefaultParticlesDirs(string,int);
200 
204  static bool checkDir(string);
205 
206 private:
207 
212 
216  Strategy & operator=(const Strategy &);
217 
218 };
219 
224 template <>
225 struct BaseClassTrait<Strategy,1>: public ClassTraitsType {
227  typedef Interfaced NthBase;
228 };
229 
232 template <>
233 struct ClassTraits<Strategy>: public ClassTraitsBase<Strategy> {
235  static string className() { return "ThePEG::Strategy"; }
236 };
237 
240 }
241 
242 #endif /* ThePEG_Strategy_H */