Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RooProdGenContext.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooProdGenContext.h,v 1.15 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_PROD_GEN_CONTEXT
17 #define ROO_PROD_GEN_CONTEXT
18 
19 #include "TList.h"
20 #include "RooAbsGenContext.h"
21 #include "RooArgSet.h"
22 
23 class RooProdPdf;
24 class RooDataSet;
25 class RooRealIntegral;
26 class RooAcceptReject;
27 class TRandom;
28 class TIterator;
29 class RooSuperCategory ;
30 
31 class RooProdGenContext : public RooAbsGenContext {
32 public:
33  RooProdGenContext(const RooProdPdf &model, const RooArgSet &vars, const RooDataSet *prototype= 0,
34  const RooArgSet* auxProto=0, Bool_t _verbose= kFALSE);
35  virtual ~RooProdGenContext();
36 
37  virtual void setProtoDataOrder(Int_t* lut) ;
38  virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
39 
40  virtual void attach(const RooArgSet& params) ;
41 
42 protected:
43 
44  virtual void initGenerator(const RooArgSet &theEvent);
45  virtual void generateEvent(RooArgSet &theEvent, Int_t remaining);
46 
47  void updateCCDTable() ;
48 
49 
50  RooProdGenContext(const RooProdGenContext& other) ;
51 
52  RooArgSet _commonCats ; // Common category dependents
53  RooArgSet* _ccdCloneSet ;
54  RooSuperCategory* _ccdSuper ; // SuperCategory of Common category dependents
55  RooArgSet* _pdfCloneSet ;
56  RooAbsPdf* _pdfClone ;
57  RooRealIntegral* _pdfCcdInt ;
58  RooArgSet _uniObs ; // Observable to be generated with flat distribution
59  TIterator* _uniIter ; // Iterator over uniform observables
60  Bool_t _ccdRefresh ;
61  Double_t * _ccdTable ;
62  const RooProdPdf *_pdf ; // Original PDF
63  std::list<RooAbsGenContext*> _gcList ; // List of component generator contexts
64  RooArgSet _ownedMultiProds ; // Owned auxilary multi-term product PDFs
65 
66  ClassDef(RooProdGenContext,0) // Context for efficient generation of a a dataset from a RooProdPdf
67 };
68 
69 #endif