Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooMCIntegrator.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooMCIntegrator.h,v 1.15 2007/05/11 09:11:30 verkerke Exp $
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef ROO_MC_INTEGRATOR
17#define ROO_MC_INTEGRATOR
18
19#include "RooAbsIntegrator.h"
20#include "RooGrid.h"
21#include "RooNumIntConfig.h"
22#include "TStopwatch.h"
23
25public:
26 // Constructors, assignment etc
30 bool verbose = false);
31 RooMCIntegrator(const RooAbsFunc &function, const RooNumIntConfig &config);
32
33 bool checkLimits() const override;
34 double integral(const double *yvec = nullptr) override;
35
37 double vegas(Stage stage, UInt_t calls, UInt_t iterations, double *absError = nullptr);
38
39 double getAlpha() const { return _alpha; }
40 void setAlpha(double alpha) { _alpha = alpha; }
41
42 GeneratorType getGenType() const { return _genType; }
44
45 const RooGrid &grid() const { return _grid; }
46
47protected:
48 friend class RooNumIntFactory;
49 static void registerIntegrator(RooNumIntFactory &fact);
50
51 mutable RooGrid _grid; // Sampling grid definition
52
53 // control variables
54 bool _verbose; ///< Verbosity control
55 double _alpha; ///< Grid stiffness parameter
56 Int_t _mode; ///< Sampling mode
57 GeneratorType _genType; ///< Generator type
58 Int_t _nRefineIter; ///< Number of refinement iterations
59 Int_t _nRefinePerDim; ///< Number of refinement samplings (per dim)
60 Int_t _nIntegratePerDim; ///< Number of integration samplings (per dim)
61
62 TStopwatch _timer; ///< Timer
63
65 _sigma; ///< Scratch variables preserved between calls to vegas1/2/2
66 UInt_t _it_start, _it_num, _samples, _calls_per_box; ///< Scratch variables preserved between calls to vegas1/2/2
67};
68
69#endif
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition RooAbsFunc.h:27
Abstract interface for integrators of real-valued functions that implement the RooAbsFunc interface.
Implements an adaptive multi-dimensional Monte Carlo numerical integration, following the VEGAS algor...
GeneratorType _genType
Generator type.
static void registerIntegrator(RooNumIntFactory &fact)
This function registers class RooMCIntegrator, its configuration options and its capabilities with Ro...
TStopwatch _timer
Timer.
Int_t _nIntegratePerDim
Number of integration samplings (per dim)
const RooGrid & grid() const
bool checkLimits() const override
Check if we can integrate over the current domain.
double _sigma
Scratch variables preserved between calls to vegas1/2/2.
GeneratorType getGenType() const
double vegas(Stage stage, UInt_t calls, UInt_t iterations, double *absError=nullptr)
Perform one step of Monte Carlo integration using the specified number of iterations with (approximat...
void setGenType(GeneratorType type)
bool _verbose
Verbosity control.
double getAlpha() const
Int_t _mode
Sampling mode.
Int_t _nRefinePerDim
Number of refinement samplings (per dim)
double _alpha
Grid stiffness parameter.
void setAlpha(double alpha)
UInt_t _calls_per_box
Scratch variables preserved between calls to vegas1/2/2.
Int_t _nRefineIter
Number of refinement iterations.
double integral(const double *yvec=nullptr) override
Evaluate the integral using a fixed number of calls to evaluate the integrand equal to about 10k per ...
Holds the configuration parameters of the various numeric integrators used by RooRealIntegral.
Factory to instantiate numeric integrators from a given function binding and a given configuration.
Stopwatch class.
Definition TStopwatch.h:28