Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooMCIntegrator.h
Go to the documentation of this file.
1/// \cond ROOFIT_INTERNAL
2
3/*****************************************************************************
4 * Project: RooFit *
5 * Package: RooFitCore *
6 * File: $Id: RooMCIntegrator.h,v 1.15 2007/05/11 09:11:30 verkerke Exp $
7 * Authors: *
8 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
9 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
10 * *
11 * Copyright (c) 2000-2005, Regents of the University of California *
12 * and Stanford University. All rights reserved. *
13 * *
14 * Redistribution and use in source and binary forms, *
15 * with or without modification, are permitted according to the terms *
16 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
17 *****************************************************************************/
18#ifndef ROO_MC_INTEGRATOR
19#define ROO_MC_INTEGRATOR
20
21#include "RooAbsIntegrator.h"
22#include "RooGrid.h"
23#include "RooNumIntConfig.h"
24#include "TStopwatch.h"
25
26class RooMCIntegrator : public RooAbsIntegrator {
27public:
28 // Constructors, assignment etc
30 enum GeneratorType { QuasiRandom, PseudoRandom };
32 bool verbose = false);
33 RooMCIntegrator(const RooAbsFunc &function, const RooNumIntConfig &config);
34
35 bool checkLimits() const override;
36 double integral(const double *yvec = nullptr) override;
37
38 enum Stage { AllStages, ReuseGrid, RefineGrid };
39 double vegas(Stage stage, UInt_t calls, UInt_t iterations, double *absError = nullptr);
40
41 double getAlpha() const { return _alpha; }
42 void setAlpha(double alpha) { _alpha = alpha; }
43
44 GeneratorType getGenType() const { return _genType; }
46
47 const RooGrid &grid() const { return _grid; }
48
49protected:
50 friend class RooNumIntFactory;
51 static void registerIntegrator(RooNumIntFactory &fact);
52
53 mutable RooGrid _grid; // Sampling grid definition
54
55 // control variables
56 bool _verbose; ///< Verbosity control
57 double _alpha; ///< Grid stiffness parameter
58 Int_t _mode; ///< Sampling mode
59 GeneratorType _genType; ///< Generator type
60 Int_t _nRefineIter; ///< Number of refinement iterations
61 Int_t _nRefinePerDim; ///< Number of refinement samplings (per dim)
62 Int_t _nIntegratePerDim; ///< Number of integration samplings (per dim)
63
64 TStopwatch _timer; ///< Timer
65
66 double _jac, _wtd_int_sum, _sum_wgts, _chi_sum, _chisq, _result,
67 _sigma; ///< Scratch variables preserved between calls to vegas1/2/2
68 UInt_t _it_start, _it_num, _samples, _calls_per_box; ///< Scratch variables preserved between calls to vegas1/2/2
69};
70
71#endif
72
73/// \endcond
int Int_t
Definition RtypesCore.h:45
unsigned int UInt_t
Definition RtypesCore.h:46
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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.
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