Logo ROOT  
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 "RooAbsGenContext.h"
20#include "RooArgSet.h"
21#include <vector>
22
23class RooSimultaneous;
24class RooDataSet;
26
28public:
29 RooSimGenContext(const RooSimultaneous &model, const RooArgSet &vars, const RooDataSet *prototype= 0,
30 const RooArgSet* auxProto=0, bool _verbose= false);
31 ~RooSimGenContext() override;
32 void setProtoDataOrder(Int_t* lut) override ;
33
34 void attach(const RooArgSet& params) override ;
35
36 void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override ;
37
38
39protected:
40
41 void initGenerator(const RooArgSet &theEvent) override;
42 void generateEvent(RooArgSet &theEvent, Int_t remaining) override;
43
44 RooDataSet* createDataSet(const char* name, const char* title, const RooArgSet& obs) override ;
45 void updateFractions() ;
46
48
49 RooAbsCategoryLValue* _idxCat{nullptr}; ///< Clone of index category
50 RooArgSet* _idxCatSet{nullptr}; ///< Owner of index category components
51 const RooDataSet *_prototype{nullptr}; ///< Prototype data set
52 const RooSimultaneous *_pdf{nullptr}; ///< Original PDF
53 std::vector<RooAbsGenContext*> _gcList ; ///< List of component generator contexts
54 std::vector<int> _gcIndex ; ///< Index value corresponding to component
55 bool _haveIdxProto{false}; ///< Flag set if generation of index is requested
56 TString _idxCatName{}; ///< Name of index category
57 Int_t _numPdf{0}; ///< Number of generated PDFs
58 double* _fracThresh{nullptr}; ///<[_numPdf] Fraction threshold array
59 RooDataSet* _protoData{nullptr}; ///<! Prototype dataset
60
61 RooArgSet _allVarsPdf{}; ///< All pdf variables
62 TIterator* _proxyIter{nullptr}; ///< Iterator over pdf proxies
63
64 ClassDefOverride(RooSimGenContext,0) // Context for efficiently generating a dataset from a RooSimultaneous PDF
65};
66
67#endif
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
static void indent(ostringstream &buf, int indent_level)
char name[80]
Definition: TGX11.cxx:110
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
bool _verbose
Verbose messaging?
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:57
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:55
RooSimGenContext is an efficient implementation of the generator context specific for RooSimultaneous...
RooAbsCategoryLValue * _idxCat
Clone of index category.
void initGenerator(const RooArgSet &theEvent) override
Perform one-time initialization of generator context.
void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override
Detailed printing interface.
RooSimGenContext(const RooSimultaneous &model, const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, bool _verbose=false)
Constructor of specialized generator context for RooSimultaneous p.d.f.s.
RooArgSet _allVarsPdf
All pdf variables.
double * _fracThresh
[_numPdf] Fraction threshold array
RooArgSet * _idxCatSet
Owner of index category components.
void setProtoDataOrder(Int_t *lut) override
Set the traversal order of the prototype data to that in the given lookup table.
void updateFractions()
No action needed if we have a proto index.
RooDataSet * _protoData
! Prototype dataset
const RooDataSet * _prototype
Prototype data set.
RooSimGenContext(const RooSimGenContext &other)
const RooSimultaneous * _pdf
Original PDF.
RooDataSet * createDataSet(const char *name, const char *title, const RooArgSet &obs) override
Create an empty dataset to hold the events that will be generated.
TString _idxCatName
Name of index category.
std::vector< RooAbsGenContext * > _gcList
List of component generator contexts.
void generateEvent(RooArgSet &theEvent, Int_t remaining) override
Generate event appropriate for current index state.
Int_t _numPdf
Number of generated PDFs.
std::vector< int > _gcIndex
Index value corresponding to component.
void attach(const RooArgSet &params) override
Attach the index category clone to the given event buffer.
~RooSimGenContext() override
Destructor. Delete all owned subgenerator contexts.
bool _haveIdxProto
Flag set if generation of index is requested.
TIterator * _proxyIter
Iterator over pdf proxies.
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
Iterator abstract base class.
Definition: TIterator.h:30
Basic string class.
Definition: TString.h:136