Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooFoamGenerator.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id$
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_FOAM_GENERATOR
17#define ROO_FOAM_GENERATOR
18
19#include "RooAbsNumGenerator.h"
20#include "RooPrintable.h"
21#include "RooArgSet.h"
22
23#include <TFoamIntegrand.h>
24#include <TFoam.h>
25
26class RooAbsReal;
27class RooRealVar;
28class RooDataSet;
29
30class RooNumGenFactory ;
31
33public:
34 RooFoamGenerator() = default;
35 RooFoamGenerator(const RooAbsReal &func, const RooArgSet &genVars, const RooNumGenConfig& config, bool verbose=false, const RooAbsReal* maxFuncVal=nullptr);
36 RooAbsNumGenerator* clone(const RooAbsReal& func, const RooArgSet& genVars, const RooArgSet& /*condVars*/,
37 const RooNumGenConfig& config, bool verbose=false, const RooAbsReal* maxFuncVal=nullptr) const override {
38 return new RooFoamGenerator(func,genVars,config,verbose,maxFuncVal) ;
39 }
40
41 const RooArgSet *generateEvent(UInt_t remaining, double& resampleRatio) override;
42
43 TFoam& engine() { return *_tfoam; }
44
45 bool canSampleConditional() const override { return false ; }
46 bool canSampleCategories() const override { return false ; }
47
48 std::string const& generatorName() const override;
49
50protected:
51
52 friend class RooNumGenFactory ;
53 static void registerSampler(RooNumGenFactory& fact) ;
54
55 std::unique_ptr<TFoamIntegrand> _binding; ///< Binding of RooAbsReal to TFoam function interface
56 std::unique_ptr<TFoam> _tfoam; ///< Instance of TFOAM generator
57 std::vector<double> _xmin ; ///< Lower bound of observables to be generated ;
58 std::vector<double> _range; ///< Range of observables to be generated ;
59 std::vector<double> _vec; ///< Transfer array for FOAM output
60};
61
62#endif
Abstract base class for MC event generator implementations like RooAcceptReject and RooFoam.
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
Container class to hold unbinned data.
Definition RooDataSet.h:57
Generic Monte Carlo toy generator that implement the TFOAM sampling technique on any positively value...
bool canSampleConditional() const override
const RooArgSet * generateEvent(UInt_t remaining, double &resampleRatio) override
are we actually generating anything? (the cache always contains at least our function value)
std::vector< double > _xmin
Lower bound of observables to be generated ;.
RooAbsNumGenerator * clone(const RooAbsReal &func, const RooArgSet &genVars, const RooArgSet &, const RooNumGenConfig &config, bool verbose=false, const RooAbsReal *maxFuncVal=nullptr) const override
RooFoamGenerator()=default
std::vector< double > _range
Range of observables to be generated ;.
std::unique_ptr< TFoam > _tfoam
Instance of TFOAM generator.
bool canSampleCategories() const override
std::unique_ptr< TFoamIntegrand > _binding
Binding of RooAbsReal to TFoam function interface.
std::string const & generatorName() const override
Return unique name of generator implementation.
std::vector< double > _vec
Transfer array for FOAM output.
static void registerSampler(RooNumGenFactory &fact)
Register RooIntegrator1D, is parameters and capabilities with RooNumIntFactory.
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.
Variable that can be changed from the outside.
Definition RooRealVar.h:37
TFoam is the main class of the multi-dimensional general purpose Monte Carlo event generator (integra...
Definition TFoam.h:21