/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooConvGenContext.h,v 1.12 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_CONV_GEN_CONTEXT
#define ROO_CONV_GEN_CONTEXT

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

class RooAbsAnaConvPdf;
class RooDataSet;
class RooRealIntegral;
class RooAcceptReject;
class TRandom;
class TIterator;
class RooRealVar ;
class RooNumConvPdf ;
class RooFFTConvPdf ;

class RooConvGenContext : public RooAbsGenContext {
public:
  RooConvGenContext(const RooFFTConvPdf &model, const RooArgSet &vars, const RooDataSet *prototype= 0,
		    const RooArgSet* auxProto=0, Bool_t _verbose= kFALSE);
  RooConvGenContext(const RooNumConvPdf &model, const RooArgSet &vars, const RooDataSet *prototype= 0,
		    const RooArgSet* auxProto=0, Bool_t _verbose= kFALSE);
  RooConvGenContext(const RooAbsAnaConvPdf &model, const RooArgSet &vars, const RooDataSet *prototype= 0,
		    const RooArgSet* auxProto=0, Bool_t _verbose= kFALSE);
  virtual ~RooConvGenContext();

  virtual void setProtoDataOrder(Int_t* lut) ;

  virtual void attach(const RooArgSet& params) ;

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


protected:

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

  RooConvGenContext(const RooConvGenContext& other) ;

  RooAbsGenContext* _pdfGen ;   // Physics model generator context
  RooAbsGenContext* _modelGen ; // Resolution model generator context
  TString _convVarName ;        // Name of convolution variable
  RooArgSet* _pdfVarsOwned ;    // Owning version of pdfVars ;
  RooArgSet* _modelVarsOwned ;  // Owning version of modelVars ;
  RooArgSet* _pdfVars ;         // Holder of PDF x truth event
  RooArgSet* _modelVars ;       // Holder of resModel event
  RooArgSet* _pdfCloneSet ;     // Owner of PDF clone
  RooArgSet* _modelCloneSet ;   // Owner of resModel clone
  RooRealVar* _cvModel ;         // Convolution variable in resModel event
  RooRealVar* _cvPdf ;           // Convolution variable in PDFxTruth event
  RooRealVar* _cvOut ;           // Convolution variable in output event

  ClassDef(RooConvGenContext,0) // Context for generating a dataset from a PDF
};

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