ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooGenContext.h,v 1.19 2007/05/11 09:11:30 verkerke Exp $
 * 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_GEN_CONTEXT
#define ROO_GEN_CONTEXT

#include "RooAbsGenContext.h"
#include "RooArgSet.h"

class RooAbsPdf;
class RooDataSet;
class RooRealIntegral;
class RooAcceptReject;
class TRandom;
class RooRealVar ;
class RooAbsNumGenerator ;

class RooGenContext : public RooAbsGenContext {
public:
  RooGenContext(const RooAbsPdf &model, const RooArgSet &vars, const RooDataSet *prototype= 0,
		const RooArgSet* auxProto=0, Bool_t verbose=kFALSE, const RooArgSet* forceDirect=0);
  virtual ~RooGenContext();

  virtual void printMultiline(ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;

  virtual void attach(const RooArgSet& params) ;

protected:

  virtual void initGenerator(const RooArgSet &theEvent);
  virtual void generateEvent(RooArgSet &theEvent, Int_t remaining);

  RooArgSet *_cloneSet;   // Clone of all nodes of input p.d.f
  RooAbsPdf *_pdfClone;   // Clone of input p.d.f
  RooArgSet _directVars,_uniformVars,_otherVars; // List of observables generated internally, randomly, and by accept/reject sampling
  Int_t _code;                        // Internal generation code
  Double_t _maxProb, _area, _norm;    // Maximum probability, p.d.f area and normalization
  RooRealIntegral *_acceptRejectFunc; // Projection function to be passed to accept/reject sampler
  RooAbsNumGenerator *_generator;     // MC sampling generation engine
  RooRealVar *_maxVar ;               // Variable holding maximum value of p.d.f
  TIterator *_uniIter ;               // Iterator over uniform observables
  Int_t _updateFMaxPerEvent ;         // If true, maximum p.d.f value needs to be recalculated for each event

  ClassDef(RooGenContext,0) // Universal context for generating toy MC data from any p.d.f
};

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