/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id$
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/
#ifndef ROO_NUM_GEN_FACTORY
#define ROO_NUM_GEN_FACTORY

#include <map>
#include <string>
#include "TObject.h"
#include "RooLinkedList.h"
#include "RooAbsNumGenerator.h"
class RooNumGenConfig ;
class RooAbsReal ;

class RooNumGenFactory ;
typedef void (*RooNumGenInitializerFunc)(RooNumGenFactory&) ;

class RooNumGenFactory : public TObject {
public:

  static RooNumGenFactory& instance() ;
  virtual ~RooNumGenFactory();

  Bool_t storeProtoSampler(RooAbsNumGenerator* proto, const RooArgSet& defConfig) ;
  const RooAbsNumGenerator* getProtoSampler(const char* name) ;

  RooAbsNumGenerator* createSampler(RooAbsReal& func, const RooArgSet& genVars, const RooArgSet& condVars, 
				    const RooNumGenConfig& config, Bool_t verbose=kFALSE, RooAbsReal* maxFuncVal=0) ;

  static void cleanup() ;


protected:
	 
  friend class RooNumGenConfig ;

  std::map<std::string,RooAbsNumGenerator*> _map ;

  RooNumGenFactory(); 
  RooNumGenFactory(const RooNumGenFactory& other) ;

  static RooNumGenFactory* _instance ;


  ClassDef(RooNumGenFactory,1) // Numeric Generator factory
};

#endif


 RooNumGenFactory.h:1
 RooNumGenFactory.h:2
 RooNumGenFactory.h:3
 RooNumGenFactory.h:4
 RooNumGenFactory.h:5
 RooNumGenFactory.h:6
 RooNumGenFactory.h:7
 RooNumGenFactory.h:8
 RooNumGenFactory.h:9
 RooNumGenFactory.h:10
 RooNumGenFactory.h:11
 RooNumGenFactory.h:12
 RooNumGenFactory.h:13
 RooNumGenFactory.h:14
 RooNumGenFactory.h:15
 RooNumGenFactory.h:16
 RooNumGenFactory.h:17
 RooNumGenFactory.h:18
 RooNumGenFactory.h:19
 RooNumGenFactory.h:20
 RooNumGenFactory.h:21
 RooNumGenFactory.h:22
 RooNumGenFactory.h:23
 RooNumGenFactory.h:24
 RooNumGenFactory.h:25
 RooNumGenFactory.h:26
 RooNumGenFactory.h:27
 RooNumGenFactory.h:28
 RooNumGenFactory.h:29
 RooNumGenFactory.h:30
 RooNumGenFactory.h:31
 RooNumGenFactory.h:32
 RooNumGenFactory.h:33
 RooNumGenFactory.h:34
 RooNumGenFactory.h:35
 RooNumGenFactory.h:36
 RooNumGenFactory.h:37
 RooNumGenFactory.h:38
 RooNumGenFactory.h:39
 RooNumGenFactory.h:40
 RooNumGenFactory.h:41
 RooNumGenFactory.h:42
 RooNumGenFactory.h:43
 RooNumGenFactory.h:44
 RooNumGenFactory.h:45
 RooNumGenFactory.h:46
 RooNumGenFactory.h:47
 RooNumGenFactory.h:48
 RooNumGenFactory.h:49
 RooNumGenFactory.h:50
 RooNumGenFactory.h:51
 RooNumGenFactory.h:52
 RooNumGenFactory.h:53
 RooNumGenFactory.h:54
 RooNumGenFactory.h:55
 RooNumGenFactory.h:56
 RooNumGenFactory.h:57
 RooNumGenFactory.h:58
 RooNumGenFactory.h:59
 RooNumGenFactory.h:60
 RooNumGenFactory.h:61
 RooNumGenFactory.h:62