Logo ROOT   6.16/01
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
25class RooAddPdf;
26class RooAddModel;
27class RooDataSet;
28class RooRealIntegral;
29class RooAcceptReject;
30class TRandom;
31class TIterator;
32
34public:
35 RooAddGenContext(const RooAddPdf &model, const RooArgSet &vars, const RooDataSet *prototype= 0,
36 const RooArgSet* auxProto=0, Bool_t _verbose= kFALSE);
37 RooAddGenContext(const RooAddModel &model, const RooArgSet &vars, const RooDataSet *prototype= 0,
38 const RooArgSet* auxProto=0, Bool_t _verbose= kFALSE);
39 virtual ~RooAddGenContext();
40
41 virtual void setProtoDataOrder(Int_t* lut) ;
42
43 virtual void attach(const RooArgSet& params) ;
44
45 virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
46
47protected:
48
49 virtual void initGenerator(const RooArgSet &theEvent);
50 virtual void generateEvent(RooArgSet &theEvent, Int_t remaining);
51 void updateThresholds() ;
52
54
55 const RooArgSet* _vars ;
56 RooArgSet* _pdfSet ; // Set owned all nodes of internal clone of p.d.f
57 RooAbsPdf *_pdf ; // Pointer to cloned p.d.f
58 std::vector<RooAbsGenContext*> _gcList ; // List of component generator contexts
59 Int_t _nComp ; // Number of PDF components
60 Double_t* _coefThresh ; //[_nComp] Array of coefficient thresholds
61 Bool_t _isModel ; // Are we generating from a RooAddPdf or a RooAddModel
62 RooAddModel::CacheElem* _mcache ; //! RooAddModel cache element
63 RooAddPdf::CacheElem* _pcache ; //! RooAddPdf cache element
64
65 ClassDef(RooAddGenContext,0) // Specialized context for generating a dataset from a RooAddPdf
66};
67
68#endif
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:324
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
Class RooAcceptReject is a generic toy monte carlo generator implement the accept/reject sampling tec...
RooAddGenContext is an efficient implementation of the generator context specific for RooAddPdf PDFs.
RooAddGenContext(const RooAddPdf &model, const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t _verbose=kFALSE)
Constructor.
virtual void initGenerator(const RooArgSet &theEvent)
One-time initialization of generator contex.
virtual ~RooAddGenContext()
Destructor. Delete all owned subgenerator contexts.
virtual void setProtoDataOrder(Int_t *lut)
Forward the setProtoDataOrder call to the component generator contexts.
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining)
Randomly choose one of the component contexts to generate this event, with a probability proportional...
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Print the details of the context.
void updateThresholds()
Update the cumulative threshold table from the current coefficient values.
std::vector< RooAbsGenContext * > _gcList
RooArgSet * _pdfSet
virtual void attach(const RooArgSet &params)
Attach given set of variables to internal p.d.f. clone.
RooAddGenContext(const RooAddGenContext &other)
RooAddModel::CacheElem * _mcache
Double_t * _coefThresh
RooAddPdf::CacheElem * _pcache
RooAddModel cache element.
const RooArgSet * _vars
Transiet cache with transformed values of coefficients.
Definition: RooAddModel.h:102
Transiet cache with transformed values of coefficients.
Definition: RooAddPdf.h:106
RooAddPdf is an efficient implementation of a sum of PDFs of the form.
Definition: RooAddPdf.h:29
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:31
RooRealIntegral performs hybrid numerical/analytical integrals of RooAbsReal objects.
Iterator abstract base class.
Definition: TIterator.h:30
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
Basic string class.
Definition: TString.h:131