cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
RunParameters.h
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2013-2024 Laurent Forthomme
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#ifndef CepGen_Core_RunParameters_h
20
#define CepGen_Core_RunParameters_h
21
22
#include "
CepGen/Physics/Kinematics.h
"
23
24
namespace
cepgen
{
25
class
EventExporter;
26
class
EventModifier;
27
class
ParametersList;
28
namespace
proc {
29
class
Process;
30
}
31
namespace
utils {
32
class
Functional;
33
class
TimeKeeper;
34
}
// namespace utils
35
enum class
IntegratorType;
36
typedef
std::vector<std::unique_ptr<EventModifier> >
EventModifiersSequence
;
37
typedef
std::vector<std::unique_ptr<EventExporter> >
EventExportersSequence
;
38
typedef
std::vector<std::unique_ptr<utils::Functional> >
TamingFunctionsSequence
;
39
41
class
RunParameters
:
public
SteeredObject
<RunParameters> {
42
public
:
43
RunParameters
();
44
RunParameters
(
RunParameters
&);
45
RunParameters
(
const
RunParameters
&);
46
~RunParameters
();
// required for unique_ptr initialisation!
47
48
static
ParametersDescription
description
();
49
50
RunParameters
&
operator=
(
RunParameters
);
51
52
friend
std::ostream&
operator<<
(std::ostream&,
const
RunParameters
&);
53
54
void
setTimeKeeper
(
utils::TimeKeeper
*);
55
utils::TimeKeeper
*
timeKeeper
() {
return
tmr_.get(); }
56
const
utils::TimeKeeper
*
timeKeeper
()
const
{
return
tmr_.get(); }
57
58
void
initialiseModules
();
59
60
ParametersList
&
integrator
() {
return
integrator_; }
61
const
ParametersList
&
integrator
()
const
{
return
integrator_; }
62
63
//----- process to compute
64
65
bool
hasProcess
()
const
{
return
!(!process_); }
66
proc::Process
&
process
();
67
const
proc::Process
&
process
()
const
;
68
std::string
processName
()
const
;
69
void
clearProcess
();
70
void
setProcess
(std::unique_ptr<proc::Process>);
71
void
setProcess
(
proc::Process
*);
72
73
//----- events kinematics
74
76
const
Kinematics
&
kinematics
()
const
;
77
78
//----- events generation
79
81
class
Generation
:
public
SteeredObject
<Generation> {
82
public
:
84
explicit
Generation
(
const
ParametersList
& =
ParametersList
());
85
86
static
ParametersDescription
description
();
87
88
void
setTargetLuminosity
(
double
lumi_invpb) { target_lumi_ = lumi_invpb; }
89
double
targetLuminosity
()
const
{
return
target_lumi_; }
90
void
setMaxGen
(
size_t
max_gen) { max_gen_ = max_gen; }
91
size_t
maxGen
()
const
{
return
max_gen_; }
92
bool
enabled
()
const
{
return
max_gen_ > 0; }
93
void
setPrintEvery
(
size_t
print_every) { gen_print_every_ = print_every; }
94
size_t
printEvery
()
const
{
return
gen_print_every_; }
95
void
setSymmetrise
(
bool
sym) { symmetrise_ = sym; }
96
bool
symmetrise
()
const
{
return
symmetrise_; }
97
void
setNumThreads
(
size_t
nt) { num_threads_ = nt; }
98
size_t
numThreads
()
const
{
return
num_threads_; }
99
void
setNumPoints
(
size_t
np) { num_points_ = np; }
100
size_t
numPoints
()
const
{
return
num_points_; }
101
102
private
:
103
int
max_gen_, gen_print_every_;
104
double
target_lumi_;
105
bool
symmetrise_;
106
int
num_threads_, num_points_;
107
};
108
Generation
&
generation
() {
return
generation_; }
109
const
Generation
&
generation
()
const
{
return
generation_; }
110
111
//----- event modification (e.g. hadronisation, decay) algorithm
112
113
EventModifier
&
eventModifier
(
size_t
);
114
EventModifiersSequence
&
eventModifiersSequence
() {
return
evt_modifiers_; }
116
const
EventModifiersSequence
&
eventModifiersSequence
()
const
{
return
evt_modifiers_; }
117
void
clearEventModifiersSequence
();
118
void
addModifier
(std::unique_ptr<EventModifier>);
119
void
addModifier
(
EventModifier
*);
120
121
//----- event output algorithms
122
123
EventExporter
&
eventExporter
(
size_t
);
124
EventExportersSequence
&
eventExportersSequence
() {
return
evt_exporters_; }
125
const
EventExportersSequence
&
eventExportersSequence
()
const
{
return
evt_exporters_; }
126
void
clearEventExportersSequence
();
127
void
addEventExporter
(std::unique_ptr<EventExporter>);
128
void
addEventExporter
(
EventExporter
*);
129
130
//----- taming functions
131
133
const
TamingFunctionsSequence
&
tamingFunctions
()
const
{
return
taming_functions_; }
134
void
addTamingFunction
(std::unique_ptr<utils::Functional>);
135
136
//----- run operations
137
138
void
prepareRun
();
139
142
void
addGenerationTime
(
double
gen_time);
143
inline
double
totalGenerationTime
()
const
{
return
total_gen_time_; }
144
inline
unsigned
int
numGeneratedEvents
()
const
{
return
num_gen_events_; }
145
146
private
:
147
std::unique_ptr<proc::Process> process_;
148
EventModifiersSequence
evt_modifiers_;
149
EventExportersSequence
evt_exporters_;
150
TamingFunctionsSequence
taming_functions_;
151
double
total_gen_time_{0.};
152
unsigned
long
num_gen_events_{0ul};
153
ParametersList integrator_;
154
Generation generation_;
155
std::unique_ptr<utils::TimeKeeper> tmr_;
156
};
157
}
// namespace cepgen
158
159
#endif
Kinematics.h
cepgen::EventExporter
Output format handler for events export.
Definition
EventExporter.h:30
cepgen::EventModifier
Class template to interface (external/internal) events modification algorithms.
Definition
EventModifier.h:29
cepgen::Kinematics
List of kinematic constraints to apply on the process phase space.
Definition
Kinematics.h:27
cepgen::ParametersDescription
A description object for parameters collection.
Definition
ParametersDescription.h:26
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::RunParameters::Generation
Collection of events generation parameters.
Definition
RunParameters.h:81
cepgen::RunParameters::Generation::setSymmetrise
void setSymmetrise(bool sym)
Switch the symmetrisation of the z-axis for each event.
Definition
RunParameters.h:95
cepgen::RunParameters::Generation::numPoints
size_t numPoints() const
Number of points to "shoot" in each integration bin.
Definition
RunParameters.h:100
cepgen::RunParameters::Generation::numThreads
size_t numThreads() const
Number of threads to perform the events generation.
Definition
RunParameters.h:98
cepgen::RunParameters::Generation::setPrintEvery
void setPrintEvery(size_t print_every)
Set the events display frequency.
Definition
RunParameters.h:93
cepgen::RunParameters::Generation::printEvery
size_t printEvery() const
Frequency at which events are displayed to the user.
Definition
RunParameters.h:94
cepgen::RunParameters::Generation::setNumThreads
void setNumThreads(size_t nt)
Set the number of threads for the events generation.
Definition
RunParameters.h:97
cepgen::RunParameters::Generation::symmetrise
bool symmetrise() const
Symmetrise events wrt the -axis ?
Definition
RunParameters.h:96
cepgen::RunParameters::Generation::setTargetLuminosity
void setTargetLuminosity(double lumi_invpb)
Set target luminosity, in pb^-1.
Definition
RunParameters.h:88
cepgen::RunParameters::Generation::maxGen
size_t maxGen() const
Maximal number of events to generate.
Definition
RunParameters.h:91
cepgen::RunParameters::Generation::setNumPoints
void setNumPoints(size_t np)
Set the number of points to probe in each integration bin.
Definition
RunParameters.h:99
cepgen::RunParameters::Generation::setMaxGen
void setMaxGen(size_t max_gen)
Set the maximal number of events to generate.
Definition
RunParameters.h:90
cepgen::RunParameters::Generation::targetLuminosity
double targetLuminosity() const
Target luminosity to reach, in pb^-1.
Definition
RunParameters.h:89
cepgen::RunParameters::Generation::description
static ParametersDescription description()
Definition
RunParameters.cpp:287
cepgen::RunParameters::Generation::enabled
bool enabled() const
Are we generating events?
Definition
RunParameters.h:92
cepgen::RunParameters
List of parameters used to start and run the simulation job.
Definition
RunParameters.h:41
cepgen::RunParameters::kinematics
const Kinematics & kinematics() const
Events kinematics for phase space definition.
Definition
RunParameters.cpp:125
cepgen::RunParameters::eventModifiersSequence
const EventModifiersSequence & eventModifiersSequence() const
Definition
RunParameters.h:116
cepgen::RunParameters::initialiseModules
void initialiseModules()
Initialise the event handling modules for an event generation.
Definition
RunParameters.cpp:79
cepgen::RunParameters::process
proc::Process & process()
Process object for cross-section computation/events generation.
Definition
RunParameters.cpp:105
cepgen::RunParameters::timeKeeper
const utils::TimeKeeper * timeKeeper() const
Pointer to a timekeeper instance.
Definition
RunParameters.h:56
cepgen::RunParameters::eventExporter
EventExporter & eventExporter(size_t)
Output module.
Definition
RunParameters.cpp:141
cepgen::RunParameters::clearEventModifiersSequence
void clearEventModifiersSequence()
Remove all event modifiers from sequence.
Definition
RunParameters.cpp:133
cepgen::RunParameters::numGeneratedEvents
unsigned int numGeneratedEvents() const
Number of events generated in run.
Definition
RunParameters.h:144
cepgen::RunParameters::addModifier
void addModifier(std::unique_ptr< EventModifier >)
Add a new event modification algorithm to the sequence.
Definition
RunParameters.cpp:135
cepgen::RunParameters::eventModifier
EventModifier & eventModifier(size_t)
Event modification algorithm.
Definition
RunParameters.cpp:131
cepgen::RunParameters::eventExportersSequence
EventExportersSequence & eventExportersSequence()
List of output modules.
Definition
RunParameters.h:124
cepgen::RunParameters::operator<<
friend std::ostream & operator<<(std::ostream &, const RunParameters &)
User-readable dump of runtime parameters.
Definition
RunParameters.cpp:157
cepgen::RunParameters::timeKeeper
utils::TimeKeeper * timeKeeper()
Pointer to a timekeeper instance.
Definition
RunParameters.h:55
cepgen::RunParameters::operator=
RunParameters & operator=(RunParameters)
Assignment operator.
Definition
RunParameters.cpp:66
cepgen::RunParameters::tamingFunctions
const TamingFunctionsSequence & tamingFunctions() const
List of all taming functions definitions.
Definition
RunParameters.h:133
cepgen::RunParameters::prepareRun
void prepareRun()
Reset total generation time and number of events generated for this run, prepare kinematics.
Definition
RunParameters.cpp:88
cepgen::RunParameters::generation
const Generation & generation() const
Event generation parameters.
Definition
RunParameters.h:109
cepgen::RunParameters::clearEventExportersSequence
void clearEventExportersSequence()
Remove all output modules from sequence.
Definition
RunParameters.cpp:143
cepgen::RunParameters::setProcess
void setProcess(std::unique_ptr< proc::Process >)
Set a process configuration.
Definition
RunParameters.cpp:117
cepgen::RunParameters::processName
std::string processName() const
Name of the process considered.
Definition
RunParameters.cpp:109
cepgen::RunParameters::RunParameters
RunParameters()
Definition
RunParameters.cpp:40
cepgen::RunParameters::hasProcess
bool hasProcess() const
Is this parameters collection holding any physics process?
Definition
RunParameters.h:65
cepgen::RunParameters::addTamingFunction
void addTamingFunction(std::unique_ptr< utils::Functional >)
Set a new taming function definition.
Definition
RunParameters.cpp:153
cepgen::RunParameters::eventModifiersSequence
EventModifiersSequence & eventModifiersSequence()
List of event modification algos List of event modification algos.
Definition
RunParameters.h:114
cepgen::RunParameters::addGenerationTime
void addGenerationTime(double gen_time)
Add a new timing into the total generation time.
Definition
RunParameters.cpp:100
cepgen::RunParameters::clearProcess
void clearProcess()
Remove the process pointer.
Definition
RunParameters.cpp:115
cepgen::RunParameters::description
static ParametersDescription description()
Definition
RunParameters.cpp:268
cepgen::RunParameters::integrator
const ParametersList & integrator() const
Integrator specific user-defined parameters.
Definition
RunParameters.h:61
cepgen::RunParameters::integrator
ParametersList & integrator()
Integrator specific user-defined parameters.
Definition
RunParameters.h:60
cepgen::RunParameters::addEventExporter
void addEventExporter(std::unique_ptr< EventExporter >)
Set a new output module definition.
Definition
RunParameters.cpp:145
cepgen::RunParameters::setTimeKeeper
void setTimeKeeper(utils::TimeKeeper *)
Initialise the timekeeper instance.
Definition
RunParameters.cpp:98
cepgen::RunParameters::eventExportersSequence
const EventExportersSequence & eventExportersSequence() const
List of output modules.
Definition
RunParameters.h:125
cepgen::RunParameters::generation
Generation & generation()
Event generation parameters.
Definition
RunParameters.h:108
cepgen::RunParameters::totalGenerationTime
double totalGenerationTime() const
Total generation time in s for this run.
Definition
RunParameters.h:143
cepgen::RunParameters::~RunParameters
~RunParameters()
Definition
RunParameters.cpp:64
cepgen::SteeredObject
Base user-steerable object.
Definition
SteeredObject.h:41
cepgen::proc::Process
Class template to define any process to compute using this MC integrator/events generator.
Definition
Process.h:34
cepgen::utils::TimeKeeper
Collection of clocks to benchmark execution blocks.
Definition
TimeKeeper.h:35
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
cepgen::EventModifiersSequence
std::vector< std::unique_ptr< EventModifier > > EventModifiersSequence
Event modification algos ordered set.
Definition
RunParameters.h:36
cepgen::EventExportersSequence
std::vector< std::unique_ptr< EventExporter > > EventExportersSequence
Event export modules ordered set.
Definition
RunParameters.h:37
cepgen::TamingFunctionsSequence
std::vector< std::unique_ptr< utils::Functional > > TamingFunctionsSequence
Taming functions evaluators set.
Definition
RunParameters.h:38
CepGen
Core
RunParameters.h
Generated on Mon Jul 29 2024 for CepGen by
1.9.7