thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
Repository
Repository.h
1
// -*- C++ -*-
2
//
3
// Repository.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_Repository_H
10
#define ThePEG_Repository_H
11
// This is the declaration of the Repository class.
12
13
#include "
ThePEG/Config/ThePEG.h
"
14
#include "BaseRepository.h"
15
#include "EventGenerator.h"
16
#include "ThePEG/PDT/ParticleData.h"
17
#include "ThePEG/PDT/MatcherBase.h"
18
19
namespace
ThePEG
{
20
45
class
Repository
:
public
BaseRepository
{
46
47
public
:
48
50
typedef
map<string,EGPtr>
GeneratorMap
;
51
52
public
:
53
59
Repository
();
60
65
~Repository
();
66
67
public
:
68
76
static
void
Register
(
IBPtr
);
77
83
static
void
Register
(
IBPtr
,
string
newName);
85
94
static
void
defaultParticle
(
tPDPtr
);
95
100
static
PDPtr
defaultParticle
(
PID
id
);
101
109
static
tPDPtr
findParticle
(
string
name);
110
114
static
const
ParticleDataSet &
allParticles
() {
return
particles
(); }
115
119
static
const
MatcherSet &
allMatchers
() {
return
matchers
(); }
120
124
static
tPMPtr
findMatcher
(
string
name);
125
131
static
string
copyParticle
(
tPDPtr
,
string
);
133
140
static
EGPtr
makeRun
(
tEGPtr
eg,
string
name);
141
146
static
void
saveRun
(
string
EGname,
string
name,
string
filename);
148
156
static
string
load
(
string
filename);
157
161
static
void
save
(
string
filename);
162
166
static
void
save
() {
save
(
currentFileName
()); }
167
171
static
void
stats
(ostream &);
173
179
static
void
help
(
string
command, ostream & os);
180
185
static
void
remove
(
tIBPtr
);
186
193
static
string
remove
(
const
ObjectSet & rmset);
194
203
static
void
read
(istream & is, ostream & os,
string
prompt =
""
);
204
216
static
string
read
(
string
filename, ostream & os);
217
224
static
string
exec
(
string
cmd, ostream &);
225
235
static
string
modifyEventGenerator
(
EventGenerator
& eg,
string
filename,
236
ostream & os,
bool
initOnly =
false
);
237
242
static
void
resetEventGenerator
(
EventGenerator
& eg);
244
248
static
string
version
();
249
253
static
string
banner
();
254
255
private
:
256
260
static
void
registerParticle
(
tPDPtr
);
261
265
static
void
registerMatcher
(
tPMPtr
);
266
270
static
void
execAndCheckReply
(
string
, ostream &);
271
272
protected
:
273
280
static
ParticleMap &
defaultParticles
();
281
285
static
ParticleDataSet &
particles
();
286
290
static
MatcherSet &
matchers
();
291
295
static
GeneratorMap
&
generators
();
296
300
static
string
&
currentFileName
();
301
302
public
:
303
308
static
int
&
exitOnError
();
309
316
static
void
cleanup
();
318
319
private
:
320
325
Repository
(
const
Repository
&);
326
331
Repository
&
operator=
(
const
Repository
&) =
delete
;
332
336
static
int
ninstances
;
337
338
339
};
340
341
}
342
343
#endif
/* ThePEG_Repository_H */
ThePEG.h
This is the main config header file for ThePEG.
ThePEG::BaseRepository
BaseRepository is a purely static class which keeps a set of InterfacedBase objects indexed by their ...
Definition:
BaseRepository.h:45
ThePEG::EventGenerator
The EventGenerator class manages a whole event generator run.
Definition:
EventGenerator.h:68
ThePEG::PID
PID is a helper class implementing the type of PDG particle ids.
Definition:
PID.h:23
ThePEG::Pointer::RCPtr
RCPtr is a reference counted (smart) pointer.
Definition:
RCPtr.h:60
ThePEG::Pointer::TransientRCPtr
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition:
RCPtr.h:519
ThePEG::Repository
Repository inherits from the BaseRepository class.
Definition:
Repository.h:45
ThePEG::Repository::allParticles
static const ParticleDataSet & allParticles()
Return the set of all particles in the repository.
Definition:
Repository.h:114
ThePEG::Repository::load
static string load(string filename)
Load a whole repository from the given file.
ThePEG::Repository::registerMatcher
static void registerMatcher(tPMPtr)
Used by Register.
ThePEG::Repository::banner
static string banner()
Return a string with a ThePEG banner.
ThePEG::Repository::modifyEventGenerator
static string modifyEventGenerator(EventGenerator &eg, string filename, ostream &os, bool initOnly=false)
Insert the given EventGenerator and its dependent Interfaced objects into the repository and read com...
ThePEG::Repository::findParticle
static tPDPtr findParticle(string name)
Get a pointer to a particle based on the given path or name.
ThePEG::Repository::matchers
static MatcherSet & matchers()
The set of all matchers.
ThePEG::Repository::registerParticle
static void registerParticle(tPDPtr)
Used by Register.
ThePEG::Repository::read
static string read(string filename, ostream &os)
Read commands from a file and send them one by one to exec().
ThePEG::Repository::GeneratorMap
map< string, EGPtr > GeneratorMap
A map of EventGenerator objects indexed by their run name.
Definition:
Repository.h:50
ThePEG::Repository::saveRun
static void saveRun(string EGname, string name, string filename)
Isolate an event generatorn, named EGname, set its run name and save it to a file named filename.
ThePEG::Repository::stats
static void stats(ostream &)
Write some statistics about the repository to the standard output.
ThePEG::Repository::Repository
Repository()
The default constructor is the only one that should be used.
ThePEG::Repository::save
static void save()
Save the repository to the default file.
Definition:
Repository.h:166
ThePEG::Repository::defaultParticle
static void defaultParticle(tPDPtr)
Add a particle to the list of default ones.
ThePEG::Repository::allMatchers
static const MatcherSet & allMatchers()
Return the set of all matchers in the repository.
Definition:
Repository.h:119
ThePEG::Repository::cleanup
static void cleanup()
Call this function to clean up the repository at the end of your program if you are using the static ...
ThePEG::Repository::remove
static void remove(tIBPtr)
Remove the given object from the repository.
ThePEG::Repository::exitOnError
static int & exitOnError()
If non-zero the setup program will exit with this error code as soon as an error is encountered.
ThePEG::Repository::save
static void save(string filename)
Save the repository to the given file.
ThePEG::Repository::Register
static void Register(IBPtr)
Register an object with BaseRepository::Register() and add it to the list of particles or matchers if...
ThePEG::Repository::defaultParticle
static PDPtr defaultParticle(PID id)
Get a pointer to the default particle of the given type or generic name.
ThePEG::Repository::operator=
Repository & operator=(const Repository &)=delete
It makes no sense to copy a Repository, so this assignment is not implemented.
ThePEG::Repository::copyParticle
static string copyParticle(tPDPtr, string)
Special function for copying particles.
ThePEG::Repository::findMatcher
static tPMPtr findMatcher(string name)
Find a matcher with a given generic name.
ThePEG::Repository::makeRun
static EGPtr makeRun(tEGPtr eg, string name)
Isolate an event generator, eg, and save it to disk in a file named name (with .run appended.
ThePEG::Repository::exec
static string exec(string cmd, ostream &)
Interpret the command in cmd and return possible messages.
ThePEG::Repository::~Repository
~Repository()
The destructor will do some clean-up when the last Repository is deleted.
ThePEG::Repository::remove
static string remove(const ObjectSet &rmset)
Remove objects.
ThePEG::Repository::ninstances
static int ninstances
Count the number of repositorys instantiated.
Definition:
Repository.h:336
ThePEG::Repository::defaultParticles
static ParticleMap & defaultParticles()
The set of default particles.
ThePEG::Repository::help
static void help(string command, ostream &os)
Print out a help message.
ThePEG::Repository::resetEventGenerator
static void resetEventGenerator(EventGenerator &eg)
Reset the given EventGenerator; equivalent to modifyEventGenerator without reading an input file.
ThePEG::Repository::generators
static GeneratorMap & generators()
All isolated generators mapped to their run name.
ThePEG::Repository::currentFileName
static string & currentFileName()
The default file name used by save().
ThePEG::Repository::Repository
Repository(const Repository &)
It makes no sense to copy a Repository, so this constructor is not implemented.
ThePEG::Repository::execAndCheckReply
static void execAndCheckReply(string, ostream &)
Used by read()
ThePEG::Repository::version
static string version()
Return the version number of ThePEG.
ThePEG::Repository::particles
static ParticleDataSet & particles()
The set of all particles.
ThePEG::Repository::read
static void read(istream &is, ostream &os, string prompt="")
Read commands from a stream and send them one by one to exec().
ThePEG::Repository::Register
static void Register(IBPtr, string newName)
Register an object with BaseRepository::Register() and add it to the list of particles or matchers if...
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
Generated on Thu Jun 20 2024 14:47:00 for ThePEG by
1.9.6