ROOT  6.06/09
Reference Guide
RooSimGenContext.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooSimGenContext.h,v 1.12 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_SIM_GEN_CONTEXT
17 #define ROO_SIM_GEN_CONTEXT
18 
19 #include "TList.h"
20 #include "RooAbsGenContext.h"
21 #include "RooArgSet.h"
22 #include <vector>
23 
24 class RooSimultaneous;
25 class RooDataSet;
27 
29 public:
30  RooSimGenContext(const RooSimultaneous &model, const RooArgSet &vars, const RooDataSet *prototype= 0,
31  const RooArgSet* auxProto=0, Bool_t _verbose= kFALSE);
32  virtual ~RooSimGenContext();
33  virtual void setProtoDataOrder(Int_t* lut) ;
34 
35  virtual void attach(const RooArgSet& params) ;
36 
37  virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
38 
39 
40 protected:
41 
42  virtual void initGenerator(const RooArgSet &theEvent);
43  virtual void generateEvent(RooArgSet &theEvent, Int_t remaining);
44 
45  RooDataSet* createDataSet(const char* name, const char* title, const RooArgSet& obs) ;
46  void updateFractions() ;
47 
48  RooSimGenContext(const RooSimGenContext& other) ;
49 
50  RooAbsCategoryLValue* _idxCat ; // Clone of index category
51  RooArgSet* _idxCatSet ; // Owner of index category components
52  const RooDataSet *_prototype; // Prototype data set
53  const RooSimultaneous *_pdf ; // Original PDF
54  std::vector<RooAbsGenContext*> _gcList ; // List of component generator contexts
55  std::vector<int> _gcIndex ; // Index value corresponding to component
56  Bool_t _haveIdxProto ; // Flag set if generation of index is requested
57  TString _idxCatName ; // Name of index category
58  Int_t _numPdf ; // Number of generated PDFs
59  Double_t* _fracThresh ; //[_numPdf] Fraction threshold array
60  RooDataSet* _protoData ; //! Prototype dataset
61 
62  RooArgSet _allVarsPdf ; // All pdf variables
63  TIterator* _proxyIter ; // Iterator over pdf proxies
64 
65  ClassDef(RooSimGenContext,0) // Context for efficiently generating a dataset from a RooSimultaneous PDF
66 };
67 
68 #endif
TIterator * _proxyIter
const RooDataSet * _prototype
virtual ~RooSimGenContext()
Destructor. Delete all owned subgenerator contexts.
RooDataSet * createDataSet(const char *name, const char *title, const RooArgSet &obs)
Create an empty dataset to hold the events that will be generated.
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
RooArgSet _allVarsPdf
Prototype dataset.
Iterator abstract base class.
Definition: TIterator.h:32
void updateFractions()
No action needed if we have a proto index.
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining)
Generate event appropriate for current index state.
RooArgSet * _idxCatSet
RooSimGenContext(const RooSimultaneous &model, const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t _verbose=kFALSE)
Constructor of specialized generator context for RooSimultaneous p.d.f.s.
virtual void attach(const RooArgSet &params)
Attach the index category clone to the given event buffer.
std::vector< int > _gcIndex
bool verbose
virtual void initGenerator(const RooArgSet &theEvent)
Perform one-time initialization of generator context.
static void indent(ostringstream &buf, int indent_level)
Double_t * _fracThresh
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Detailed printing interface.
double Double_t
Definition: RtypesCore.h:55
const RooSimultaneous * _pdf
#define name(a, b)
Definition: linkTestLib0.cpp:5
std::vector< RooAbsGenContext * > _gcList
RooAbsCategoryLValue * _idxCat
RooDataSet * _protoData
virtual void setProtoDataOrder(Int_t *lut)
Set the traversal order of the prototype data to that in the given lookup table.