* Main occurence of the Monte-Carlo integrator@cite PeterLepage1978192 developed by G.P. Lepage in 1978
* @brief Vegas Monte-Carlo integrator instance
*/
class Vegas {
public:
/**
* Constructs the class by booking the memory and structures for the Vegas integrator. This code is based on the Vegas Monte Carlo integration algorithm developed by P. Lepage, as documented in @cite PeterLepage1978192
* @param[in] dim_ The number of dimensions on which the function will be integrated
* @param[in] f_ The function one is required to integrate
* @param[inout] inParam_ A list of parameters to define the phase space on which this integration is performed (embedded in an Parameters object)
*/
Vegas(const int dim_,double f_(double*,size_t,void*),Parameters* inParam_);
/**
* @brief Class destructor
*/
~Vegas();
/**
- * Vegas algorithm to perform the (_dim)-dimensional Monte Carlo integration of a given function as described in @cite PeterLepage1978192
+ * Vegas algorithm to perform the n-dimensional Monte Carlo integration of a given function as described in @cite PeterLepage1978192
* @author Primary author : G.P. Lepage
- * @author This C++ implementation : L. Forthomme
- * @date Sep 1976
- * @date Reviewed in Apr 1978
- * @date FTN5 version 21 Aug 1984
- * @date This C++ implementation is from 12 Dec 2013
+ * @author This C++ implementation : GSL
* @param[out] result_ The cross section as integrated by Vegas for the given phase space restrictions
* @param[out] abserr_ The error associated to the computed cross section
* @return 0 if the integration was performed successfully
*/
int Integrate(double* result_,double* abserr_);
/**
- * First stage of the integration process : Initialization of cumulative variables (no grid so far)
- * @param ncalls_ Number of function calls to be performed
- * @return 0, if this part, along with parts 2 and 3 were performed successfully
- */
- int Vegas1(int ncalls_=-1);
- /**
- * Second stage of the integration process : Grid initialization
- * @param ncalls_ Number of function calls to be performed
- * @return 0, if this part, along with part 3 were performed successfully
- */
- int Vegas2(int ncalls_=-1);
- /**
- * Third stage of the integration process : Main loop
- * @return 0, if this part was performed successfully
- */
- int Vegas3();
- /**
* Launches the Vegas generation of events according to the provided input
* parameters.
* @brief Launches the generation of events
*/
void Generate();
/**
* Generates one event according to the grid parameters set in Vegas::SetGen
* @brief Generates one single event according to the method defined in the Fortran 77 version of LPAIR
* @return A boolean stating if the generation was successful (in term of the computed weight for the phase space point)
*/
bool GenerateOneEvent();
private:
/**
* Transforms the function to integrate into a numerically stable function where poles are tamed.
* @param[in] x_ The @a _ndim -dimensional point at which the stabilised function is to be evaluated
* @param[in] ip_ The physics parameters to apply to the function to evaluate
* @param[in] storedbg_ A debugging flag to set whether or not the internal variables of this method need to be stored for further processing
* @return Tamed function value at this point @a x_