cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
Generator.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
16
#ifndef CepGen_Generator_h
17
#define CepGen_Generator_h
18
19
#include <functional>
20
#include <memory>
21
22
#include "
CepGen/Utils/Value.h
"
23
25
namespace
cepgen
{
26
class
Event;
27
class
Integrator;
28
class
GeneratorWorker;
29
class
RunParameters;
30
namespace
proc {
31
class
Process;
32
}
33
34
static
std::vector<std::string>
loaded_libraries
;
35
static
std::vector<std::string>
invalid_libraries
;
36
static
std::vector<std::string>
search_paths
;
38
bool
callPath
(
const
std::string&,
bool
(*callback)(
const
std::string&));
39
bool
loadLibrary
(
const
std::string&,
bool
match =
false
);
42
void
initialise
(
bool
safe_mode =
false
);
43
void
printHeader
();
44
48
class
Generator
{
49
public
:
52
explicit
Generator
(
bool
safe_mode =
false
);
53
explicit
Generator
(
RunParameters
*);
54
~Generator
();
55
56
void
parseRunParameters
(
const
std::string&);
57
const
RunParameters
&
runParameters
()
const
;
58
RunParameters
&
runParameters
();
59
void
setRunParameters
(std::unique_ptr<RunParameters>&);
60
61
void
setIntegrator
(std::unique_ptr<Integrator>);
62
void
integrate
();
63
64
Value
computeXsection
();
68
[[deprecated(
"Please use the parameters-less version"
)]]
void
computeXsection
(
double
& cross_section,
double
& err);
69
double
crossSection
()
const
{
return
xsect_; }
70
double
crossSectionError
()
const
{
return
xsect_.
uncertainty
(); }
71
72
void
generate
(
size_t
num_events,
const
std::function<
void
(
const
Event
&,
size_t
)>&);
73
void
generate
(
size_t
num_events,
const
std::function<
void
(
const
proc::Process
&)>& =
nullptr
);
74
const
Event
&
next
();
75
79
double
computePoint
(
const
std::vector<double>& x);
80
81
private
:
82
void
initialise();
83
void
clearRun();
84
void
resetIntegrator();
85
86
std::unique_ptr<RunParameters> parameters_;
87
std::unique_ptr<GeneratorWorker> worker_;
88
std::unique_ptr<Integrator> integrator_;
89
bool
initialised_{
false
};
90
Value xsect_{-1., -1.};
91
};
92
}
// namespace cepgen
93
94
#endif
Value.h
cepgen::Event
Container for the information on the in- and outgoing particles' kinematics.
Definition
Event.h:28
cepgen::Generator
Core generator object allowing for process definition, cross section computation, and event generatio...
Definition
Generator.h:48
cepgen::Generator::generate
void generate(size_t num_events, const std::function< void(const Event &, size_t)> &)
Generate events.
Definition
Generator.cpp:235
cepgen::Generator::computePoint
double computePoint(const std::vector< double > &x)
Compute one single point from the total phase space.
Definition
Generator.cpp:90
cepgen::Generator::integrate
void integrate()
Integrate the functional over the phase space of interest.
Definition
Generator.cpp:145
cepgen::Generator::parseRunParameters
void parseRunParameters(const std::string &)
Read a steering card to populate the run parameters block.
Definition
Generator.cpp:72
cepgen::Generator::setIntegrator
void setIntegrator(std::unique_ptr< Integrator >)
Specify an integrator algorithm configuration.
Definition
Generator.cpp:135
cepgen::Generator::next
const Event & next()
Generate one single event.
Definition
Generator.cpp:191
cepgen::Generator::~Generator
~Generator()
Definition
Generator.cpp:52
cepgen::Generator::setRunParameters
void setRunParameters(std::unique_ptr< RunParameters > &)
Feed the generator with a RunParameters object.
Definition
Generator.cpp:88
cepgen::Generator::crossSectionError
double crossSectionError() const
Last error on the cross section computed.
Definition
Generator.h:70
cepgen::Generator::crossSection
double crossSection() const
Last cross section computed by the generator.
Definition
Generator.h:69
cepgen::Generator::runParameters
const RunParameters & runParameters() const
Pointer to the parameters block.
Definition
Generator.cpp:76
cepgen::Generator::computeXsection
Value computeXsection()
Compute the cross section and uncertainty, in pb, for the run parameters Compute the cross section fo...
Definition
Generator.cpp:110
cepgen::RunParameters
List of parameters used to start and run the simulation job.
Definition
RunParameters.h:41
cepgen::Value
A scalar value with its uncertainty.
Definition
Value.h:26
cepgen::Value::uncertainty
double uncertainty() const
Absolute uncertainty around the central value.
Definition
Value.h:35
cepgen::proc::Process
Class template to define any process to compute using this MC integrator/events generator.
Definition
Process.h:34
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
cepgen::invalid_libraries
static std::vector< std::string > invalid_libraries
Collection of libraries tested not to work with RTE.
Definition
Generator.h:35
cepgen::loadLibrary
bool loadLibrary(const std::string &path, bool match)
Import a shared library in RTE Launch the initialisation procedure.
Definition
GlobalFunctions.cpp:42
cepgen::printHeader
void printHeader()
Dump this program's header into the standard output stream.
Definition
GlobalFunctions.cpp:143
cepgen::initialise
void initialise(bool safe_mode)
Definition
GlobalFunctions.cpp:91
cepgen::search_paths
static std::vector< std::string > search_paths
Collection of search paths to build RTE Execute an action on a path if found in search paths collecti...
Definition
Generator.h:36
cepgen::loaded_libraries
static std::vector< std::string > loaded_libraries
Collection of libraries loaded in RTE.
Definition
Generator.h:34
cepgen::callPath
bool callPath(const std::string &local_path, bool(*callback)(const std::string &))
Definition
GlobalFunctions.cpp:77
CepGen
Generator.h
Generated on Mon Jul 29 2024 for CepGen by
1.9.7