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

Vegas integration algorithm developed by P. Lepage, as documented in [18]. More...

+ Inheritance diagram for VegasIntegrator:
+ Collaboration diagram for VegasIntegrator:

Public Types

enum class  Mode { importance = 1 , importanceOnly = 0 , stratified = -1 }
 

Public Member Functions

 VegasIntegrator (const ParametersList &params)
 
Value integrate (Integrand &) override
 Perform the multidimensional Monte Carlo integration.
 
void setLimits (const std::vector< Limits > &) override
 Specify the variables limits on integration.
 
void checkLimits (const Integrand &)
 Ensure the integration bounds are properly set.
 
virtual double uniform (const Limits &={0., 1.}) const
 Generate a uniformly distributed (between 0 and 1) random number.
 
const std::string & name () const
 Module unique indexing name.
 
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 ()
 
static Value integrate (const std::function< double(const std::vector< double > &)> &, const ParametersList &, size_t)
 Perform an integration with a given functional and a given set of parameters.
 
static Value integrate (const std::function< double(const std::vector< double > &)> &, const ParametersList &, const std::vector< Limits > &)
 Perform an integration with a given functional and a given set of parameters.
 

Protected Member Functions

void setIntegrand (Integrand &)
 
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

std::function< double(double *, size_t, void *)> funct_
 A functor wrapping GSL's function footprint.
 
std::unique_ptr< gsl_monte_function > function_
 GSL structure storing the function to be integrated by this integrator instance (along with its parameters)
 
std::vector< double > xlow_
 
std::vector< double > xhigh_
 
const std::unique_ptr< utils::RandomGeneratorrnd_gen_
 
int verbosity_
 Integrator verbosity.
 
std::vector< Limitslimits_
 List of per-variable integration limits.
 
const std::string name_
 Module unique indexing name.
 
ParametersList params_
 Module parameters.
 

Friends

std::ostream & operator<< (std::ostream &os, const Mode &mode)
 

Detailed Description

Definition at line 30 of file VegasIntegrator.cpp.

Member Enumeration Documentation

◆ Mode

enum class Mode
strong
Enumerator
importance 
importanceOnly 
stratified 

Definition at line 56 of file VegasIntegrator.cpp.

Constructor & Destructor Documentation

◆ VegasIntegrator()

VegasIntegrator ( const ParametersList params)
explicit

Definition at line 32 of file VegasIntegrator.cpp.

Member Function Documentation

◆ checkLimits()

void checkLimits ( const Integrand integrand)
inherited

Definition at line 32 of file Integrator.cpp.

◆ description()

static ParametersDescription description ( )
static

Definition at line 40 of file VegasIntegrator.cpp.

◆ integrate() [1/3]

Value integrate ( const std::function< double(const std::vector< double > &)> &  func,
const ParametersList params,
const std::vector< Limits > &  limits 
)
staticinherited

Definition at line 68 of file Integrator.cpp.

◆ integrate() [2/3]

Value integrate ( const std::function< double(const std::vector< double > &)> &  func,
const ParametersList params,
size_t  num_vars 
)
staticinherited

Definition at line 62 of file Integrator.cpp.

◆ integrate() [3/3]

Value integrate ( Integrand result)
overridevirtual
Parameters
[out]resultintegral computed over the full phase space

Implements Integrator.

Definition at line 114 of file VegasIntegrator.cpp.

◆ name()

const std::string & name ( ) const
inherited

Definition at line 42 of file NamedModule.h.

◆ operator!=()

template<typename T >
bool operator!= ( const SteeredObject< T > &  oth) const
inherited

Definition at line 51 of file SteeredObject.h.

◆ operator==()

template<typename T >
bool operator== ( const SteeredObject< T > &  oth) const
inherited

Definition at line 49 of file SteeredObject.h.

◆ parameters()

template<typename T >
const ParametersList & parameters ( ) const
overridevirtualinherited

Reimplemented from Steerable.

Definition at line 54 of file SteeredObject.h.

◆ setDescribedParameters()

template<typename T >
void setDescribedParameters ( const ParametersList params_orig)
inherited

Definition at line 73 of file SteeredObject.h.

◆ setIntegrand()

void setIntegrand ( Integrand integrand)
protectedinherited

Definition at line 30 of file GSLIntegrator.cpp.

◆ setLimits()

void setLimits ( const std::vector< Limits > &  limits)
overridevirtualinherited

Reimplemented from Integrator.

Definition at line 44 of file GSLIntegrator.cpp.

◆ setParameters()

template<typename T >
virtual void setParameters ( const ParametersList params)
overridevirtualinherited

Reimplemented from Steerable.

Reimplemented in Initial, Remnants, CutsList, IncomingBeams, and Kinematics.

Definition at line 62 of file SteeredObject.h.

◆ 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.

◆ uniform()

double uniform ( const Limits lim = {0., 1.}) const
virtualinherited

Definition at line 54 of file Integrator.cpp.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const Mode mode 
)
friend

Definition at line 57 of file VegasIntegrator.cpp.

Member Data Documentation

◆ funct_

std::function<double(double*, size_t, void*)> funct_
protectedinherited

Definition at line 39 of file GSLIntegrator.h.

◆ function_

std::unique_ptr<gsl_monte_function> function_
protectedinherited

Definition at line 42 of file GSLIntegrator.h.

◆ limits_

std::vector<Limits> limits_
protectedinherited

Definition at line 58 of file Integrator.h.

◆ name_

const std::string name_
protectedinherited

Definition at line 45 of file NamedModule.h.

◆ params_

ParametersList params_
mutableprotectedinherited

Definition at line 50 of file Steerable.h.

◆ rnd_gen_

const std::unique_ptr<utils::RandomGenerator> rnd_gen_
protectedinherited

Definition at line 56 of file Integrator.h.

◆ verbosity_

int verbosity_
protectedinherited

Definition at line 57 of file Integrator.h.

◆ xhigh_

std::vector<double> xhigh_
protectedinherited

Definition at line 43 of file GSLIntegrator.h.

◆ xlow_

std::vector<double> xlow_
protectedinherited

Definition at line 43 of file GSLIntegrator.h.