Logo ROOT  
Reference Guide
RooAcceptReject.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooAcceptReject.h,v 1.16 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_ACCEPT_REJECT
17 #define ROO_ACCEPT_REJECT
18 
19 #include "RooAbsNumGenerator.h"
20 #include "RooPrintable.h"
21 #include "RooArgSet.h"
22 
23 class RooAbsReal;
24 class RooRealVar;
25 class RooDataSet;
26 class RooRealBinding;
27 class RooNumGenFactory ;
28 
30 public:
32  // coverity[UNINIT_CTOR]
33  } ;
34  RooAcceptReject(const RooAbsReal &func, const RooArgSet &genVars, const RooNumGenConfig& config, Bool_t verbose=kFALSE, const RooAbsReal* maxFuncVal=0);
35  RooAbsNumGenerator* clone(const RooAbsReal& func, const RooArgSet& genVars, const RooArgSet& /*condVars*/,
36  const RooNumGenConfig& config, Bool_t verbose=kFALSE, const RooAbsReal* maxFuncVal=0) const {
37  return new RooAcceptReject(func,genVars,config,verbose,maxFuncVal) ;
38  }
39  virtual ~RooAcceptReject();
40 
41  const RooArgSet *generateEvent(UInt_t remaining, Double_t& resampleRatio);
43 
44 
45  // Advertisement of capabilities
46  virtual Bool_t canSampleConditional() const { return kTRUE ; }
47  virtual Bool_t canSampleCategories() const { return kTRUE ; }
48 
49 
50 protected:
51 
52  friend class RooNumGenFactory ;
53  static void registerSampler(RooNumGenFactory& fact) ;
54 
55  void addEventToCache();
57 
58  Double_t _maxFuncVal, _funcSum; // Maximum function value found, and sum of all samples made
59  UInt_t _realSampleDim,_catSampleMult;// Number of real and discrete dimensions to be samplesd
60  UInt_t _minTrials; // Minimum number of max.finding trials, total number of samples
61  UInt_t _totalEvents; // Total number of function samples
62  UInt_t _eventsUsed; // Accepted number of function samples
63  TIterator *_nextCatVar; // Iterator of categories to be generated
64  TIterator *_nextRealVar; // Iterator over variables to be generated
65 
66  UInt_t _minTrialsArray[4]; // Minimum number of trials samples for 1,2,3 dimensional problems
67 
68  ClassDef(RooAcceptReject,0) // Context for generating a dataset from a PDF
69 };
70 
71 #endif
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooAcceptReject::canSampleCategories
virtual Bool_t canSampleCategories() const
Definition: RooAcceptReject.h:47
RooAcceptReject::generateEvent
const RooArgSet * generateEvent(UInt_t remaining, Double_t &resampleRatio)
Return a pointer to a generated event.
Definition: RooAcceptReject.cxx:178
RooArgSet.h
RooAcceptReject::_nextCatVar
TIterator * _nextCatVar
Definition: RooAcceptReject.h:63
RooAcceptReject::registerSampler
static void registerSampler(RooNumGenFactory &fact)
Register RooIntegrator1D, is parameters and capabilities with RooNumIntFactory.
Definition: RooAcceptReject.cxx:61
RooPrintable.h
RooAcceptReject::_eventsUsed
UInt_t _eventsUsed
Definition: RooAcceptReject.h:62
RooAbsReal
Definition: RooAbsReal.h:61
RooNumGenFactory
Definition: RooNumGenFactory.h:30
bool
TIterator
Definition: TIterator.h:30
RooAcceptReject::_totalEvents
UInt_t _totalEvents
Definition: RooAcceptReject.h:61
RooAcceptReject::_maxFuncVal
Double_t _maxFuncVal
Definition: RooAcceptReject.h:58
RooAcceptReject::getFuncMax
Double_t getFuncMax()
Definition: RooAcceptReject.cxx:329
RooRealBinding
Definition: RooRealBinding.h:26
RooAcceptReject::~RooAcceptReject
virtual ~RooAcceptReject()
Destructor.
Definition: RooAcceptReject.cxx:165
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooAbsNumGenerator
Definition: RooAbsNumGenerator.h:30
RooAcceptReject
Definition: RooAcceptReject.h:29
RooAcceptReject::canSampleConditional
virtual Bool_t canSampleConditional() const
Definition: RooAcceptReject.h:46
RooAcceptReject::clone
RooAbsNumGenerator * clone(const RooAbsReal &func, const RooArgSet &genVars, const RooArgSet &, const RooNumGenConfig &config, Bool_t verbose=kFALSE, const RooAbsReal *maxFuncVal=0) const
Definition: RooAcceptReject.h:35
unsigned int
RooAcceptReject::_funcSum
Double_t _funcSum
Definition: RooAcceptReject.h:58
Double_t
double Double_t
Definition: RtypesCore.h:59
RooNumGenConfig
Definition: RooNumGenConfig.h:25
RooAcceptReject::_minTrialsArray
UInt_t _minTrialsArray[4]
Definition: RooAcceptReject.h:66
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooAcceptReject::_minTrials
UInt_t _minTrials
Definition: RooAcceptReject.h:60
RooDataSet
Definition: RooDataSet.h:33
RooAcceptReject::RooAcceptReject
RooAcceptReject()
Definition: RooAcceptReject.h:31
RooAcceptReject::_realSampleDim
UInt_t _realSampleDim
Definition: RooAcceptReject.h:59
RooRealVar
Definition: RooRealVar.h:36
RooAcceptReject::addEventToCache
void addEventToCache()
Add a trial event to our cache and update our estimates of the function maximum value and integral.
Definition: RooAcceptReject.cxx:297
RooAcceptReject::_catSampleMult
UInt_t _catSampleMult
Definition: RooAcceptReject.h:59
RooAcceptReject::nextAcceptedEvent
const RooArgSet * nextAcceptedEvent()
Scan through events in the cache which have not been used yet, looking for the first accepted one whi...
Definition: RooAcceptReject.cxx:268
RooArgSet
Definition: RooArgSet.h:28
RooAcceptReject::_nextRealVar
TIterator * _nextRealVar
Definition: RooAcceptReject.h:64
RooAbsNumGenerator.h