thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
Strategy.h
1// -*- C++ -*-
2//
3// Strategy.h is a part of ThePEG - Toolkit for HEP Event Generation
4// Copyright (C) 1999-2019 Leif Lonnblad
5//
6// ThePEG is licenced under version 3 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
14#include "Strategy.fh"
15#include "ThePEG/Interface/Interfaced.h"
16
17namespace ThePEG {
18
41class Strategy: public Interfaced {
42
43public:
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
85public:
86
94
100 void persistentInput(PersistentIStream & is, int version);
102
106 static void Init();
107
108protected:
109
116 virtual IBPtr clone() const;
117
122 virtual IBPtr fullclone() const;
124
125private:
126
130 ParticleMap & particles() { return theParticles; }
131
132private:
133
137 ParticleMap theParticles;
138
147
151 vector<IPtr> theDefaultObjects;
152
163
164private:
165
170
175
179 void delLocalParticles(int place);
180
184 vector<PDPtr> getLocalParticles() const;
185
190
194 void setDefaultParticlesDirs(string,int);
195
199 void insDefaultParticlesDirs(string,int);
200
204 static bool checkDir(string);
205
206private:
207
212
216 Strategy & operator=(const Strategy &) = delete;
217
218};
219
224template <>
225struct BaseClassTrait<Strategy,1>: public ClassTraitsType {
227 typedef Interfaced NthBase;
228};
229
232template <>
233struct ClassTraits<Strategy>: public ClassTraitsBase<Strategy> {
235 static string className() { return "ThePEG::Strategy"; }
236};
237
240}
241
242#endif /* ThePEG_Strategy_H */
This is the main config header file for ThePEG.
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data.
The Interfaced class is derived from the InterfacedBase class adding a couple of things particular to...
Definition: Interfaced.h:38
PersistentIStream is used to read persistent objects from a stream where they were previously written...
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
The Strategy class represents a general strategy to be assigned to an EventGenerator.
Definition: Strategy.h:41
vector< string > theDefaultParticlesDirs
By default all particles in the Repository are included in a run, although only one particle per PDG ...
Definition: Strategy.h:162
void setLocalParticlesDir(string)
Utility function used by the interface.
ParticleMap & particles()
Return the map of local particles.
Definition: Strategy.h:130
void insLocalParticles(PDPtr pd, int)
Utility function used by the interface.
virtual const string versionstring() const
Return a freeform version string.
Definition: Strategy.h:83
const vector< IPtr > & defaultObjects() const
Return the vector of default objects.
Definition: Strategy.h:76
void setDefaultParticlesDirs(string, int)
Utility function used by the interface.
const ParticleMap & particles() const
Return the map of local particles indexed by their PDG id number.
Definition: Strategy.h:50
string localParticlesDir() const
A directory in the repository which will be scanned for particles which will be included as default p...
static bool checkDir(string)
Utility function used by the interface.
Strategy & operator=(const Strategy &)=delete
Private and non-existent assignment operator.
vector< IPtr > theDefaultObjects
A vector of default objects.
Definition: Strategy.h:151
vector< PDPtr > getLocalParticles() const
Utility function used by the interface.
ParticleMap theParticles
the map of default particles.
Definition: Strategy.h:137
void setLocalParticles(PDPtr pd, int)
Utility function used by the interface.
static ClassDescription< Strategy > initStrategy
Describe a concrete class with persistent data.
Definition: Strategy.h:211
const vector< string > & defaultParticlesDirs() const
By default all particles in the Repository are included in a run, although only one particle per PDG ...
Definition: Strategy.h:69
static void Init()
Standard Init function used to initialize the interface.
string theLocalParticlesDir
A directory in the repository which will be scanned for particles which will be included as default p...
Definition: Strategy.h:146
void delLocalParticles(int place)
Utility function used by the interface.
virtual IBPtr clone() const
Make a simple clone of this object.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
void insDefaultParticlesDirs(string, int)
Utility function used by the interface.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
static string className()
Return the name of class T.
Definition: ClassTraits.h:66
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30