Logo ROOT  
Reference Guide
RooGenContext.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooGenContext.h,v 1.19 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_GEN_CONTEXT
17 #define ROO_GEN_CONTEXT
18 
19 #include "RooAbsGenContext.h"
20 #include "RooArgSet.h"
21 
22 class RooAbsPdf;
23 class RooDataSet;
24 class RooRealIntegral;
25 class RooAcceptReject;
26 class TRandom;
27 class RooRealVar ;
28 class RooAbsNumGenerator ;
29 
31 public:
32  RooGenContext(const RooAbsPdf &model, const RooArgSet &vars, const RooDataSet *prototype= 0,
33  const RooArgSet* auxProto=0, Bool_t verbose=kFALSE, const RooArgSet* forceDirect=0);
34  virtual ~RooGenContext();
35 
36  virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
37 
38  virtual void attach(const RooArgSet& params) ;
39 
40 protected:
41 
42  virtual void initGenerator(const RooArgSet &theEvent);
43  virtual void generateEvent(RooArgSet &theEvent, Int_t remaining);
44 
45  RooArgSet *_cloneSet; // Clone of all nodes of input p.d.f
46  RooAbsPdf *_pdfClone; // Clone of input p.d.f
47  RooArgSet _directVars,_uniformVars,_otherVars; // List of observables generated internally, randomly, and by accept/reject sampling
48  Int_t _code; // Internal generation code
49  Double_t _maxProb{0.}, _area{0.}, _norm{0.}; // Maximum probability, p.d.f area and normalization
50  RooRealIntegral *_acceptRejectFunc; // Projection function to be passed to accept/reject sampler
51  RooAbsNumGenerator *_generator; // MC sampling generation engine
52  RooRealVar *_maxVar ; // Variable holding maximum value of p.d.f
53  TIterator *_uniIter ; // Iterator over uniform observables
54  Int_t _updateFMaxPerEvent ; // If true, maximum p.d.f value needs to be recalculated for each event
55 
56  ClassDef(RooGenContext,0) // Universal context for generating toy MC data from any p.d.f
57 };
58 
59 #endif
RooGenContext::initGenerator
virtual void initGenerator(const RooArgSet &theEvent)
Perform one-time initialization of the generator context.
Definition: RooGenContext.cxx:352
RooGenContext::_maxVar
RooRealVar * _maxVar
Definition: RooGenContext.h:52
RooArgSet.h
RooGenContext::_pdfClone
RooAbsPdf * _pdfClone
Definition: RooGenContext.h:46
RooGenContext
Definition: RooGenContext.h:30
RooGenContext::attach
virtual void attach(const RooArgSet &params)
Attach the cloned model to the event buffer we will be filling.
Definition: RooGenContext.cxx:333
RooAbsGenContext.h
indent
static void indent(ostringstream &buf, int indent_level)
Definition: TClingCallFunc.cxx:87
RooGenContext::_cloneSet
RooArgSet * _cloneSet
Definition: RooGenContext.h:45
TString
Definition: TString.h:136
RooGenContext::_area
Double_t _area
Definition: RooGenContext.h:49
RooGenContext::generateEvent
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining)
Generate one event.
Definition: RooGenContext.cxx:382
bool
TIterator
Definition: TIterator.h:30
RooRealIntegral
Definition: RooRealIntegral.h:34
TRandom
Definition: TRandom.h:27
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooAbsNumGenerator
Definition: RooAbsNumGenerator.h:30
RooAcceptReject
Definition: RooAcceptReject.h:29
RooAbsGenContext
Definition: RooAbsGenContext.h:26
RooGenContext::_uniIter
TIterator * _uniIter
Definition: RooGenContext.h:53
Double_t
double Double_t
Definition: RtypesCore.h:59
RooGenContext::_maxProb
Double_t _maxProb
Definition: RooGenContext.h:49
RooGenContext::_otherVars
RooArgSet _otherVars
Definition: RooGenContext.h:47
RooGenContext::_updateFMaxPerEvent
Int_t _updateFMaxPerEvent
Definition: RooGenContext.h:54
RooGenContext::_generator
RooAbsNumGenerator * _generator
Definition: RooGenContext.h:51
RooGenContext::_uniformVars
RooArgSet _uniformVars
Definition: RooGenContext.h:47
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooGenContext::_directVars
RooArgSet _directVars
Definition: RooGenContext.h:47
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooGenContext::_code
Int_t _code
Definition: RooGenContext.h:48
RooDataSet
Definition: RooDataSet.h:33
make_cnn_model.model
model
Definition: make_cnn_model.py:6
RooAbsPdf
Definition: RooAbsPdf.h:40
RooRealVar
Definition: RooRealVar.h:36
RooGenContext::_acceptRejectFunc
RooRealIntegral * _acceptRejectFunc
Definition: RooGenContext.h:50
RooGenContext::~RooGenContext
virtual ~RooGenContext()
Destructor.
Definition: RooGenContext.cxx:316
RooGenContext::RooGenContext
RooGenContext(const RooAbsPdf &model, const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE, const RooArgSet *forceDirect=0)
Initialize a new context for generating events with the specified variables, using the specified PDF ...
Definition: RooGenContext.cxx:69
RooGenContext::_norm
Double_t _norm
Definition: RooGenContext.h:49
RooGenContext::printMultiline
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Printing interface.
Definition: RooGenContext.cxx:438
RooArgSet
Definition: RooArgSet.h:28
int