cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.3
A generic central exclusive processes event generator
Loading...
Searching...
No Matches

Event generator worker instance. More...

#include <CepGen/Core/GeneratorWorker.h>

+ Inheritance diagram for GeneratorWorker:
+ Collaboration diagram for GeneratorWorker:

Public Member Functions

 GeneratorWorker (const ParametersList &)
 Book memory slots and structures for the generator.
 
virtual ~GeneratorWorker ()
 
void setRunParameters (const RunParameters *)
 Specify the runtime parameters.
 
void setIntegrator (const Integrator *integ)
 Specify the integrator instance handled by the mother generator.
 
void generate (size_t num_events, const std::function< void(const proc::Process &)> &)
 Launch the event generation.
 
ProcessIntegrandintegrand ()
 Function evaluator.
 
virtual void initialise ()=0
 Initialise the generation parameters.
 
virtual bool next ()=0
 Generate a single event.
 
bool operator== (const SteeredObject &oth) const
 Equality operator.
 
bool operator!= (const SteeredObject &oth) const
 Inequality operator.
 
const ParametersListparameters () const override
 Module user-defined parameters.
 
virtual void setParameters (const ParametersList &params) override
 Set module parameters.
 
void setDescribedParameters (const ParametersList &params_orig)
 Set (documented) module parameters.
 

Static Public Member Functions

static ParametersDescription description ()
 

Protected Member Functions

bool storeEvent ()
 Store the event in the output file.
 
template<typename T >
steer (const std::string &key) const
 Retrieve a parameters as previously steered.
 
template<typename T , typename U >
U steerAs (const std::string &key) const
 Retrieve a recasted parameters as previously steered.
 
std::string steerName () const
 Retrieve module name from parameters.
 
std::string steerPath (const std::string &key) const
 Retrieve a path from common search paths.
 

Protected Attributes

const Integratorintegrator_ {nullptr}
 Pointer to the mother-handled integrator instance.
 
const RunParametersparams_ {nullptr}
 Steering parameters for the event generation.
 
std::unique_ptr< ProcessIntegrandintegrand_
 Local event weight evaluator.
 
std::function< void(const proc::Process &)> callback_proc_ {nullptr}
 Callback function for each new event.
 

Detailed Description

Definition at line 32 of file GeneratorWorker.h.

Constructor & Destructor Documentation

◆ GeneratorWorker()

GeneratorWorker ( const ParametersList params)
explicit

Definition at line 31 of file GeneratorWorker.cpp.

◆ ~GeneratorWorker()

~GeneratorWorker ( )
virtual

Definition at line 40 of file GeneratorWorker.cpp.

Member Function Documentation

◆ description()

ParametersDescription description ( )
static

Definition at line 76 of file GeneratorWorker.cpp.

◆ generate()

void generate ( size_t  num_events,
const std::function< void(const proc::Process &)> &  callback 
)
Parameters
[in]num_eventsNumber of events to generate
[in]callbackThe callback function applied on every event generated

Definition at line 50 of file GeneratorWorker.cpp.

◆ initialise()

virtual void initialise ( )
pure virtual

◆ integrand()

ProcessIntegrand & integrand ( )

Definition at line 47 of file GeneratorWorker.h.

◆ next()

virtual bool next ( )
pure virtual

◆ operator!=()

bool operator!= ( const SteeredObject< GeneratorWorker > &  oth) const
inherited

Definition at line 51 of file SteeredObject.h.

◆ operator==()

bool operator== ( const SteeredObject< GeneratorWorker > &  oth) const
inherited

Definition at line 49 of file SteeredObject.h.

◆ parameters()

const ParametersList & parameters ( ) const
overridevirtualinherited

Reimplemented from Steerable.

Definition at line 54 of file SteeredObject.h.

◆ setDescribedParameters()

void setDescribedParameters ( const ParametersList params_orig)
inherited

Definition at line 73 of file SteeredObject.h.

◆ setIntegrator()

void setIntegrator ( const Integrator integ)

Definition at line 44 of file GeneratorWorker.cpp.

◆ setParameters()

virtual void setParameters ( const ParametersList params)
overridevirtualinherited

Reimplemented from Steerable.

Definition at line 62 of file SteeredObject.h.

◆ setRunParameters()

void setRunParameters ( const RunParameters params)

Definition at line 33 of file GeneratorWorker.cpp.

◆ steer()

template<typename T >
T steer ( const std::string &  key) const
protectedinherited

Definition at line 39 of file Steerable.h.

◆ steerAs()

template<typename T , typename U >
U steerAs ( const std::string &  key) const
protectedinherited

Definition at line 44 of file Steerable.h.

◆ steerName()

std::string steerName ( ) const
protectedinherited

Definition at line 48 of file Steerable.h.

◆ steerPath()

std::string steerPath ( const std::string &  key) const
protectedinherited

Definition at line 30 of file Steerable.cpp.

◆ storeEvent()

bool storeEvent ( )
protected
Returns
A boolean stating whether or not the event was successfully saved

Definition at line 58 of file GeneratorWorker.cpp.

Member Data Documentation

◆ callback_proc_

std::function<void(const proc::Process&)> callback_proc_ {nullptr}
protected

Definition at line 62 of file GeneratorWorker.h.

◆ integrand_

std::unique_ptr<ProcessIntegrand> integrand_
protected

Definition at line 61 of file GeneratorWorker.h.

◆ integrator_

const Integrator* integrator_ {nullptr}
protected

Definition at line 58 of file GeneratorWorker.h.

◆ params_

const RunParameters* params_ {nullptr}
protected

Definition at line 59 of file GeneratorWorker.h.