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 
23 class RooSimultaneous;
24 class RooDataSet;
26 
28 public:
29  RooSimGenContext(const RooSimultaneous &model, const RooArgSet &vars, const RooDataSet *prototype= 0,
30  const RooArgSet* auxProto=0, Bool_t _verbose= kFALSE);
31  virtual ~RooSimGenContext();
32  virtual void setProtoDataOrder(Int_t* lut) ;
33 
34  virtual void attach(const RooArgSet& params) ;
35 
36  virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
37 
38 
39 protected:
40 
41  virtual void initGenerator(const RooArgSet &theEvent);
42  virtual void generateEvent(RooArgSet &theEvent, Int_t remaining);
43 
44  RooDataSet* createDataSet(const char* name, const char* title, const RooArgSet& obs) ;
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_t _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_t* _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  ClassDef(RooSimGenContext,0) // Context for efficiently generating a dataset from a RooSimultaneous PDF
65 };
66 
67 #endif
RooSimGenContext::_idxCatSet
RooArgSet * _idxCatSet
Definition: RooSimGenContext.h:50
RooSimGenContext::attach
virtual void attach(const RooArgSet &params)
Attach the index category clone to the given event buffer.
Definition: RooSimGenContext.cxx:185
RooSimGenContext::_pdf
const RooSimultaneous * _pdf
Definition: RooSimGenContext.h:52
RooArgSet.h
RooSimGenContext::_gcList
std::vector< RooAbsGenContext * > _gcList
Definition: RooSimGenContext.h:53
RooSimGenContext::_fracThresh
Double_t * _fracThresh
Definition: RooSimGenContext.h:58
RooAbsGenContext.h
RooSimGenContext::RooSimGenContext
RooSimGenContext(const RooSimGenContext &other)
RooSimGenContext::printMultiline
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Detailed printing interface.
Definition: RooSimGenContext.cxx:346
RooSimGenContext::setProtoDataOrder
virtual void setProtoDataOrder(Int_t *lut)
Set the traversal order of the prototype data to that in the given lookup table.
Definition: RooSimGenContext.cxx:333
RooSimGenContext::_protoData
RooDataSet * _protoData
Definition: RooSimGenContext.h:59
indent
static void indent(ostringstream &buf, int indent_level)
Definition: TClingCallFunc.cxx:87
RooSimGenContext::_idxCatName
TString _idxCatName
Definition: RooSimGenContext.h:56
TString
Basic string class.
Definition: TString.h:136
RooSimGenContext
RooSimGenContext is an efficient implementation of the generator context specific for RooSimultaneous...
Definition: RooSimGenContext.h:27
bool
TIterator
Iterator abstract base class.
Definition: TIterator.h:30
RooSimGenContext::_idxCat
RooAbsCategoryLValue * _idxCat
Definition: RooSimGenContext.h:49
RooSimGenContext::createDataSet
RooDataSet * createDataSet(const char *name, const char *title, const RooArgSet &obs)
Create an empty dataset to hold the events that will be generated.
Definition: RooSimGenContext.cxx:225
RooAbsGenContext::_verbose
Bool_t _verbose
Definition: RooAbsGenContext.h:80
RooSimGenContext::_numPdf
Int_t _numPdf
Definition: RooSimGenContext.h:57
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
RooAbsGenContext
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
Definition: RooAbsGenContext.h:26
RooSimGenContext::_proxyIter
TIterator * _proxyIter
Definition: RooSimGenContext.h:62
RooSimGenContext::generateEvent
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining)
Generate event appropriate for current index state.
Definition: RooSimGenContext.cxx:261
RooSimGenContext::_prototype
const RooDataSet * _prototype
Definition: RooSimGenContext.h:51
RooSimGenContext::~RooSimGenContext
virtual ~RooSimGenContext()
Destructor. Delete all owned subgenerator contexts.
Definition: RooSimGenContext.cxx:169
Double_t
double Double_t
Definition: RtypesCore.h:59
RooSimGenContext::updateFractions
void updateFractions()
No action needed if we have a proto index.
Definition: RooSimGenContext.cxx:301
RooSimGenContext::RooSimGenContext
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.
Definition: RooSimGenContext.cxx:61
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooDataSet
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:33
make_cnn_model.model
model
Definition: make_cnn_model.py:6
RooSimGenContext::_gcIndex
std::vector< int > _gcIndex
Definition: RooSimGenContext.h:54
RooSimGenContext::_haveIdxProto
Bool_t _haveIdxProto
Definition: RooSimGenContext.h:55
RooSimultaneous
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
Definition: RooSimultaneous.h:37
RooAbsCategoryLValue
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
Definition: RooAbsCategoryLValue.h:25
RooSimGenContext::_allVarsPdf
RooArgSet _allVarsPdf
Prototype dataset.
Definition: RooSimGenContext.h:61
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:33
RooSimGenContext::initGenerator
virtual void initGenerator(const RooArgSet &theEvent)
Perform one-time initialization of generator context.
Definition: RooSimGenContext.cxx:202
int