cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
GeneratorWorker.h
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2020-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_GeneratorWorker_h
20
#define CepGen_Core_GeneratorWorker_h
21
22
#include "
CepGen/Event/Event.h
"
23
24
namespace
cepgen
{
25
class
Integrator;
26
class
RunParameters;
27
class
ProcessIntegrand;
28
namespace
proc {
29
class
Process
;
30
}
32
class
GeneratorWorker
:
public
SteeredObject
<GeneratorWorker> {
33
public
:
34
explicit
GeneratorWorker
(
const
ParametersList
&);
35
virtual
~GeneratorWorker
();
36
37
static
ParametersDescription
description
();
38
39
void
setRunParameters
(
const
RunParameters
*);
40
void
setIntegrator
(
const
Integrator
* integ);
41
45
void
generate
(
size_t
num_events,
const
std::function<
void
(
const
proc::Process
&)>&);
46
47
inline
ProcessIntegrand
&
integrand
() {
return
*
integrand_
; }
48
49
virtual
void
initialise
() = 0;
50
virtual
bool
next
() = 0;
51
52
protected
:
55
bool
storeEvent
();
56
57
// NOT owned
58
const
Integrator
*
integrator_
{
nullptr
};
59
const
RunParameters
*
params_
{
nullptr
};
60
61
std::unique_ptr<ProcessIntegrand>
integrand_
;
62
std::function<void(
const
proc::Process
&)>
callback_proc_
{
nullptr
};
63
};
64
}
// namespace cepgen
65
66
#endif
Event.h
cepgen::GeneratorWorker
Event generator worker instance.
Definition
GeneratorWorker.h:32
cepgen::GeneratorWorker::integrand_
std::unique_ptr< ProcessIntegrand > integrand_
Local event weight evaluator.
Definition
GeneratorWorker.h:61
cepgen::GeneratorWorker::callback_proc_
std::function< void(const proc::Process &)> callback_proc_
Callback function for each new event.
Definition
GeneratorWorker.h:62
cepgen::GeneratorWorker::integrand
ProcessIntegrand & integrand()
Function evaluator.
Definition
GeneratorWorker.h:47
cepgen::GeneratorWorker::params_
const RunParameters * params_
Steering parameters for the event generation.
Definition
GeneratorWorker.h:59
cepgen::GeneratorWorker::next
virtual bool next()=0
Generate a single event.
cepgen::GeneratorWorker::setIntegrator
void setIntegrator(const Integrator *integ)
Specify the integrator instance handled by the mother generator.
Definition
GeneratorWorker.cpp:44
cepgen::GeneratorWorker::generate
void generate(size_t num_events, const std::function< void(const proc::Process &)> &)
Launch the event generation.
Definition
GeneratorWorker.cpp:50
cepgen::GeneratorWorker::storeEvent
bool storeEvent()
Store the event in the output file.
Definition
GeneratorWorker.cpp:58
cepgen::GeneratorWorker::description
static ParametersDescription description()
Definition
GeneratorWorker.cpp:76
cepgen::GeneratorWorker::integrator_
const Integrator * integrator_
Pointer to the mother-handled integrator instance.
Definition
GeneratorWorker.h:58
cepgen::GeneratorWorker::initialise
virtual void initialise()=0
Initialise the generation parameters.
cepgen::GeneratorWorker::~GeneratorWorker
virtual ~GeneratorWorker()
Definition
GeneratorWorker.cpp:40
cepgen::GeneratorWorker::setRunParameters
void setRunParameters(const RunParameters *)
Specify the runtime parameters.
Definition
GeneratorWorker.cpp:33
cepgen::Integrator
Monte-Carlo integration algorithm.
Definition
Integrator.h:28
cepgen::ParametersDescription
A description object for parameters collection.
Definition
ParametersDescription.h:26
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::ProcessIntegrand
Wrapper to the function to be integrated.
Definition
ProcessIntegrand.h:36
cepgen::RunParameters
List of parameters used to start and run the simulation job.
Definition
RunParameters.h:41
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
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
CepGen
Core
GeneratorWorker.h
Generated on Mon Jul 29 2024 for CepGen by
1.9.7