Logo ROOT  
Reference Guide
RooAddGenContext.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooAddGenContext.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_ADD_GEN_CONTEXT
17 #define ROO_ADD_GEN_CONTEXT
18 
19 #include "RooAbsGenContext.h"
20 #include "RooArgSet.h"
21 #include <vector>
22 #include "RooAddPdf.h"
23 #include "RooAddModel.h"
24 
25 class RooAddPdf;
26 class RooAddModel;
27 class RooDataSet;
28 class RooRealIntegral;
29 class RooAcceptReject;
30 class TRandom;
31 
33 public:
34  RooAddGenContext(const RooAddPdf &model, const RooArgSet &vars, const RooDataSet *prototype= 0,
35  const RooArgSet* auxProto=0, Bool_t _verbose= kFALSE);
36  RooAddGenContext(const RooAddModel &model, const RooArgSet &vars, const RooDataSet *prototype= 0,
37  const RooArgSet* auxProto=0, Bool_t _verbose= kFALSE);
38  virtual ~RooAddGenContext();
39 
40  virtual void setProtoDataOrder(Int_t* lut) ;
41 
42  virtual void attach(const RooArgSet& params) ;
43 
44  virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
45 
46 protected:
47 
48  virtual void initGenerator(const RooArgSet &theEvent);
49  virtual void generateEvent(RooArgSet &theEvent, Int_t remaining);
50  void updateThresholds() ;
51 
53 
54  const RooArgSet* _vars ;
55  RooArgSet* _pdfSet ; // Set owned all nodes of internal clone of p.d.f
56  RooAbsPdf *_pdf ; // Pointer to cloned p.d.f
57  std::vector<RooAbsGenContext*> _gcList ; // List of component generator contexts
58  Int_t _nComp ; // Number of PDF components
59  Double_t* _coefThresh ; //[_nComp] Array of coefficient thresholds
60  Bool_t _isModel ; // Are we generating from a RooAddPdf or a RooAddModel
61  RooAddModel::CacheElem* _mcache ; //! RooAddModel cache element
62  RooAddPdf::CacheElem* _pcache ; //! RooAddPdf cache element
63 
64  ClassDef(RooAddGenContext,0) // Specialized context for generating a dataset from a RooAddPdf
65 };
66 
67 #endif
RooAddGenContext::_vars
const RooArgSet * _vars
Definition: RooAddGenContext.h:54
RooAddGenContext::_isModel
Bool_t _isModel
Definition: RooAddGenContext.h:60
RooAddModel.h
RooAddPdf
RooAddPdf is an efficient implementation of a sum of PDFs of the form.
Definition: RooAddPdf.h:32
RooAddGenContext::initGenerator
virtual void initGenerator(const RooArgSet &theEvent)
One-time initialization of generator contex.
Definition: RooAddGenContext.cxx:173
RooArgSet.h
RooAddGenContext::_mcache
RooAddModel::CacheElem * _mcache
Definition: RooAddGenContext.h:61
RooAddGenContext::RooAddGenContext
RooAddGenContext(const RooAddGenContext &other)
RooAddGenContext::printMultiline
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Print the details of the context.
Definition: RooAddGenContext.cxx:264
RooAbsGenContext.h
indent
static void indent(ostringstream &buf, int indent_level)
Definition: TClingCallFunc.cxx:87
RooAddPdf.h
RooAddGenContext::_gcList
std::vector< RooAbsGenContext * > _gcList
Definition: RooAddGenContext.h:57
RooAddPdf::CacheElem
Transient cache with transformed values of coefficients.
Definition: RooAddPdf.h:108
RooAddGenContext::_nComp
Int_t _nComp
Definition: RooAddGenContext.h:58
TString
Basic string class.
Definition: TString.h:136
bool
RooRealIntegral
RooRealIntegral performs hybrid numerical/analytical integrals of RooAbsReal objects.
Definition: RooRealIntegral.h:34
RooAddGenContext::_pdfSet
RooArgSet * _pdfSet
Definition: RooAddGenContext.h:55
TRandom
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
RooAddGenContext::generateEvent
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining)
Randomly choose one of the component contexts to generate this event, with a probability proportional...
Definition: RooAddGenContext.cxx:196
RooAbsGenContext::_verbose
Bool_t _verbose
Definition: RooAbsGenContext.h:80
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooAddGenContext::_pcache
RooAddPdf::CacheElem * _pcache
RooAddModel cache element.
Definition: RooAddGenContext.h:62
RooAddGenContext::attach
virtual void attach(const RooArgSet &params)
Attach given set of variables to internal p.d.f. clone.
Definition: RooAddGenContext.cxx:156
RooAcceptReject
Class RooAcceptReject is a generic toy monte carlo generator implement the accept/reject sampling tec...
Definition: RooAcceptReject.h:29
RooAbsGenContext
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
Definition: RooAbsGenContext.h:26
RooAddGenContext::_pdf
RooAbsPdf * _pdf
Definition: RooAddGenContext.h:56
RooAddGenContext
RooAddGenContext is an efficient implementation of the generator context specific for RooAddPdf PDFs.
Definition: RooAddGenContext.h:32
RooAddGenContext::setProtoDataOrder
virtual void setProtoDataOrder(Int_t *lut)
Forward the setProtoDataOrder call to the component generator contexts.
Definition: RooAddGenContext.cxx:251
RooAddModel::CacheElem
Transiet cache with transformed values of coefficients.
Definition: RooAddModel.h:102
RooAddGenContext::~RooAddGenContext
virtual ~RooAddGenContext()
Destructor. Delete all owned subgenerator contexts.
Definition: RooAddGenContext.cxx:141
Double_t
double Double_t
Definition: RtypesCore.h:59
RooAddModel
RooAddModel is an efficient implementation of a sum of PDFs of the form.
Definition: RooAddModel.h:28
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
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
RooAddGenContext::updateThresholds
void updateThresholds()
Update the cumulative threshold table from the current coefficient values.
Definition: RooAddGenContext.cxx:215
RooAbsPdf
Definition: RooAbsPdf.h:43
RooAddGenContext::RooAddGenContext
RooAddGenContext(const RooAddPdf &model, const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t _verbose=kFALSE)
Constructor.
Definition: RooAddGenContext.cxx:52
RooAddGenContext::_coefThresh
Double_t * _coefThresh
Definition: RooAddGenContext.h:59
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:29
int