Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooEffGenContext.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooEffGenContext.h,v 1.2 2007/05/11 09:11:30 verkerke Exp $
5 * Authors: *
6 * GR, Gerhard Raven, NIKHEF/VU, Gerhard.Raven@nikhf.nl *
7 * *
8 * Copyright (c) 2005, NIKHEF. All rights reserved. *
9 * *
10 * Redistribution and use in source and binary forms, *
11 * with or without modification, are permitted according to the terms *
12 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
13 *****************************************************************************/
14#ifndef ROO_EFF_GEN_CONTEXT
15#define ROO_EFF_GEN_CONTEXT
16
17#include "RooAbsGenContext.h"
18class RooAbsPdf;
19class RooArgSet;
20class RooDataSet;
21class RooAbsReal;
22
24public:
25 RooEffGenContext(const RooAbsPdf &model, const RooAbsPdf &pdf, const RooAbsReal &eff, const RooArgSet &vars,
26 const RooDataSet *prototype = nullptr, const RooArgSet *auxProto = nullptr, bool verbose = false,
27 const RooArgSet *forceDirect = nullptr);
28
29 void printMultiline(std::ostream &os, Int_t content, bool verbose = false, TString indent = "") const override;
30
31protected:
32 void initGenerator(const RooArgSet &theEvent) override;
33 void generateEvent(RooArgSet &theEvent, Int_t remaining) override;
34
35private:
36 inline void initializeEff(RooAbsReal const &eff)
37 {
38 _eff = dynamic_cast<RooAbsReal *>(_cloneSet.find(eff.GetName()));
39 }
40
41 RooArgSet _cloneSet; ///< Internal clone of p.d.f.
42 RooAbsReal *_eff; ///< Pointer to efficiency function
43 std::unique_ptr<RooAbsGenContext> _generator; ///< Generator context for p.d.f
44 RooArgSet _vars; ///< Vars to generate
45 double _maxEff; ///< Maximum of efficiency in vars
46
47 ClassDefOverride(RooEffGenContext, 0); // Context for generating a dataset from a PDF
48};
49#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
static void indent(ostringstream &buf, int indent_level)
RooAbsArg * find(const char *name) const
Find object with given name in list.
Abstract base class for generator contexts of RooAbsPdf objects.
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
Container class to hold unbinned data.
Definition RooDataSet.h:57
Specialized generator context for p.d.fs represented by class RooEffProd, which are p....
void generateEvent(RooArgSet &theEvent, Int_t remaining) override
Generate one event.
void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override
Detailed printing interface.
std::unique_ptr< RooAbsGenContext > _generator
Generator context for p.d.f.
RooArgSet _cloneSet
Internal clone of p.d.f.
void initializeEff(RooAbsReal const &eff)
void initGenerator(const RooArgSet &theEvent) override
One-time initialization of generator.
RooArgSet _vars
Vars to generate.
double _maxEff
Maximum of efficiency in vars.
RooAbsReal * _eff
Pointer to efficiency function.
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
Basic string class.
Definition TString.h:139