thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
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 
13 #include "ThePEG/Config/ThePEG.h"
14 #include "ThePEG/Repository/EventGenerator.h"
15 
16 namespace ThePEG {
17 
35 class Main: public Base {
36 
37 public:
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 
73 public:
74 
78  static void Init() {}
79 
80 private:
81 
86 
90  static long theN;
91 
95  static vector<string> theArguments;
96 
97 private:
98 
103 
107  Main & operator=(const Main &) = delete;
108 
109 };
110 
111 }
112 
113 
114 namespace ThePEG {
115 
120 template <>
121 struct BaseClassTrait<Main,1>: public ClassTraitsType {
123  typedef int NthBase;
124 };
125 
128 template <>
129 struct ClassTraits<Main>: public ClassTraitsBase<Main> {
131  static string className() { return "ThePEG::Main"; }
132 
133 };
134 
137 }
138 
139 #endif /* THEPEG_Main_H */
static long N()
Get the number of events requested.
Definition: Main.h:57
Define the base class from which all (polymorphic) classes in ThePEG are derived. ...
Definition: ThePEG.h:54
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
static long theN
The number of events requested.
Definition: Main.h:90
static void N(long n)
Set the number of events requested.
Definition: Main.h:52
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
static const vector< string > & arguments()
Get the command-line arguments.
Definition: Main.h:71
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
This is the main config header file for ThePEG.
This is a base class for classes implementing a main steering routine for running an EventGenerator...
Definition: Main.h:35
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 void arguments(const vector< string > &args)
Set the command-line arguments.
Definition: Main.h:63
A concreate implementation of ClassDescriptionBase describing an abstract class without persistent da...
static EGPtr theEventGenerator
The global event generator.
Definition: Main.h:85
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
static void Init()
Standard Init function used to initialize the interfaces.
Definition: Main.h:78
static tEGPtr eventGenerator()
Get the global event generator.
Definition: Main.h:47
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
static vector< string > theArguments
The command-line arguments.
Definition: Main.h:95
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52
static void eventGenerator(tEGPtr eg)
Set the global event generator.
Definition: Main.h:42