Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooBinnedGenContext.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id$
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_BINNED_GEN_CONTEXT
17#define ROO_BINNED_GEN_CONTEXT
18
19#include "RooAbsGenContext.h"
20#include "RooArgSet.h"
21
22
23class RooDataSet;
24class RooDataHist;
25
27public:
28 RooBinnedGenContext(const RooAbsPdf &model, const RooArgSet &vars, const RooDataSet *prototype= nullptr,
29 const RooArgSet* auxProto=nullptr, bool _verbose= false);
31
32 RooDataSet* generate(double nEvents=0.0, bool skipInit=false, bool extendedMode=false) override ;
33
34 void setProtoDataOrder(Int_t*) override {}
35
36 void attach(const RooArgSet& params) override ;
37
38 void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override ;
39
40 void setExpectedData(bool) override ;
41
42protected:
43
44 void initGenerator(const RooArgSet &theEvent) override;
45 void generateEvent(RooArgSet &theEvent, Int_t remaining) override;
46
48
49 std::unique_ptr<RooArgSet> _vars;
50 RooArgSet _pdfSet ; ///< Set owned all nodes of internal clone of p.d.f
51 RooAbsPdf *_pdf ; ///< Pointer to cloned p.d.f
52 std::unique_ptr<RooDataHist> _hist ; ///< Histogram
53 bool _expectedData ; ///< Asimov?
54
55 ClassDefOverride(RooBinnedGenContext,0) // Specialized context for generating a dataset from a binned pdf
56};
57
58#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
static void indent(ostringstream &buf, int indent_level)
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:55
RooBinnedGenContext is an efficient implementation of the generator context specific for binned pdfs.
RooAbsPdf * _pdf
Pointer to cloned p.d.f.
~RooBinnedGenContext() override
void generateEvent(RooArgSet &theEvent, Int_t remaining) override
this method is not implemented for this context
void setProtoDataOrder(Int_t *) override
Set the traversal order of prototype data to that in the lookup tables passed as argument.
RooBinnedGenContext(const RooBinnedGenContext &other)
std::unique_ptr< RooDataHist > _hist
Histogram.
void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override
Print the details of the context.
RooArgSet _pdfSet
Set owned all nodes of internal clone of p.d.f.
void setExpectedData(bool) override
std::unique_ptr< RooArgSet > _vars
void initGenerator(const RooArgSet &theEvent) override
One-time initialization of generator contex.
RooDataSet * generate(double nEvents=0.0, bool skipInit=false, bool extendedMode=false) override
Generate the specified number of events with nEvents>0 and and return a dataset containing the genera...
void attach(const RooArgSet &params) override
Attach given set of variables to internal p.d.f. clone.
The RooDataHist is a container class to hold N-dimensional binned data.
Definition RooDataHist.h:39
RooDataSet is a container class to hold unbinned data.
Definition RooDataSet.h:57
Basic string class.
Definition TString.h:139