thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
Main.h
1// -*- C++ -*-
2//
3// Main.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_Main_H
10#define THEPEG_Main_H
11// This is the declaration of the Main class.
12
14#include "ThePEG/Repository/EventGenerator.h"
15
16namespace ThePEG {
17
35class Main: public Base {
36
37public:
38
42 static void eventGenerator(tEGPtr eg) { theEventGenerator = eg; }
43
48
52 static void N(long n) { theN = n; }
53
57 static long N() { return theN; }
58
59
63 static void arguments(const vector<string> & args)
64 {
65 theArguments = args;
66 }
67
71 static const vector<string> & arguments() { return theArguments; }
72
73public:
74
78 static void Init() {}
79
80private:
81
86
90 static long theN;
91
95 static vector<string> theArguments;
96
97private:
98
103
107 Main & operator=(const Main &) = delete;
108
109};
110
111}
112
113
114namespace ThePEG {
115
120template <>
121struct BaseClassTrait<Main,1>: public ClassTraitsType {
123 typedef int NthBase;
124};
125
128template <>
129struct ClassTraits<Main>: public ClassTraitsBase<Main> {
131 static string className() { return "ThePEG::Main"; }
132
133};
134
137}
138
139#endif /* THEPEG_Main_H */
This is the main config header file for ThePEG.
A concreate implementation of ClassDescriptionBase describing an abstract class without persistent da...
This is a base class for classes implementing a main steering routine for running an EventGenerator,...
Definition: Main.h:35
static void N(long n)
Set the number of events requested.
Definition: Main.h:52
static void Init()
Standard Init function used to initialize the interfaces.
Definition: Main.h:78
static EGPtr theEventGenerator
The global event generator.
Definition: Main.h:85
static AbstractNoPIOClassDescription< Main > initMain
Describe an abstract base class without persistent data.
Definition: Main.h:102
Main & operator=(const Main &)=delete
Private and non-existent assignment operator.
static const vector< string > & arguments()
Get the command-line arguments.
Definition: Main.h:71
static void arguments(const vector< string > &args)
Set the command-line arguments.
Definition: Main.h:63
static long theN
The number of events requested.
Definition: Main.h:90
static long N()
Get the number of events requested.
Definition: Main.h:57
static tEGPtr eventGenerator()
Get the global event generator.
Definition: Main.h:47
static void eventGenerator(tEGPtr eg)
Set the global event generator.
Definition: Main.h:42
static vector< string > theArguments
The command-line arguments.
Definition: Main.h:95
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
Define the base class from which all (polymorphic) classes in ThePEG are derived.
Definition: ThePEG.h:54
static string className()
Return the name of class T.
Definition: ClassTraits.h:66