RooFoamGenerator.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooFoamGenerator.h 34064 2010-06-22 15:05:19Z wouter $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00015  *****************************************************************************/
00016 #ifndef ROO_FOAM_GENERATOR
00017 #define ROO_FOAM_GENERATOR
00018 
00019 #include "RooAbsNumGenerator.h"
00020 #include "RooPrintable.h"
00021 #include "RooArgSet.h"
00022 
00023 class RooAbsReal;
00024 class RooRealVar;
00025 class RooDataSet;
00026 
00027 class TFoam ;
00028 class RooTFoamBinding ;
00029 class RooNumGenFactory ;
00030 
00031 class RooFoamGenerator : public RooAbsNumGenerator {
00032 public:
00033   RooFoamGenerator() : _binding(0), _tfoam(0), _xmin(0), _range(0), _vec(0), _rvIter(0) {} ; 
00034   RooFoamGenerator(const RooAbsReal &func, const RooArgSet &genVars, const RooNumGenConfig& config, Bool_t verbose=kFALSE, const RooAbsReal* maxFuncVal=0);
00035   RooAbsNumGenerator* clone(const RooAbsReal& func, const RooArgSet& genVars, const RooArgSet& /*condVars*/, 
00036                             const RooNumGenConfig& config, Bool_t verbose=kFALSE, const RooAbsReal* maxFuncVal=0) const {
00037     return new RooFoamGenerator(func,genVars,config,verbose,maxFuncVal) ;
00038   }
00039   virtual ~RooFoamGenerator();
00040 
00041   const RooArgSet *generateEvent(UInt_t remaining, Double_t& resampleRatio);
00042   
00043   TFoam& engine() { return *_tfoam; }
00044 
00045   virtual Bool_t canSampleConditional() const { return kFALSE ; }
00046   virtual Bool_t canSampleCategories() const { return kFALSE ; }
00047  
00048 protected:
00049 
00050   friend class RooNumGenFactory ;
00051   static void registerSampler(RooNumGenFactory& fact) ; 
00052 
00053   RooTFoamBinding* _binding ; // Binding of RooAbsReal to TFoam function interface
00054   TFoam*           _tfoam ;   // Instance of TFOAM generator
00055   Double_t*        _xmin ;    // Lower bound of observables to be generated ;
00056   Double_t*        _range ;   // Range of observables to be generated ;
00057   Double_t*        _vec ;     // Transfer array for FOAM output
00058   TIterator*       _rvIter ;  // Iteratator over _realVars ;
00059 
00060 
00061   ClassDef(RooFoamGenerator,0) // Context for generating a dataset from a PDF using the TFoam class
00062 };
00063 
00064 #endif

Generated on Tue Jul 5 14:26:10 2011 for ROOT_528-00b_version by  doxygen 1.5.1