RooGenContext.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooGenContext.h,v 1.19 2007/05/11 09:11:30 verkerke Exp $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00015  *****************************************************************************/
00016 #ifndef ROO_GEN_CONTEXT
00017 #define ROO_GEN_CONTEXT
00018 
00019 #include "RooAbsGenContext.h"
00020 #include "RooArgSet.h"
00021 
00022 class RooAbsPdf;
00023 class RooDataSet;
00024 class RooRealIntegral;
00025 class RooAcceptReject;
00026 class TRandom;
00027 class RooRealVar ;
00028 class RooAbsNumGenerator ;
00029 
00030 class RooGenContext : public RooAbsGenContext {
00031 public:
00032   RooGenContext(const RooAbsPdf &model, const RooArgSet &vars, const RooDataSet *prototype= 0,
00033                 const RooArgSet* auxProto=0, Bool_t verbose=kFALSE, const RooArgSet* forceDirect=0);
00034   virtual ~RooGenContext();
00035 
00036   virtual void printMultiline(ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
00037 
00038   virtual void attach(const RooArgSet& params) ;
00039 
00040 protected:
00041 
00042   virtual void initGenerator(const RooArgSet &theEvent);
00043   virtual void generateEvent(RooArgSet &theEvent, Int_t remaining);
00044 
00045   RooArgSet *_cloneSet;   // Clone of all nodes of input p.d.f
00046   RooAbsPdf *_pdfClone;   // Clone of input p.d.f
00047   RooArgSet _directVars,_uniformVars,_otherVars; // List of observables generated internally, randomly, and by accept/reject sampling
00048   Int_t _code;                        // Internal generation code
00049   Double_t _maxProb, _area, _norm;    // Maximum probability, p.d.f area and normalization
00050   RooRealIntegral *_acceptRejectFunc; // Projection function to be passed to accept/reject sampler
00051   RooAbsNumGenerator *_generator;     // MC sampling generation engine
00052   RooRealVar *_maxVar ;               // Variable holding maximum value of p.d.f
00053   TIterator *_uniIter ;               // Iterator over uniform observables
00054   Int_t _updateFMaxPerEvent ;         // If true, maximum p.d.f value needs to be recalculated for each event
00055 
00056   ClassDef(RooGenContext,0) // Universal context for generating toy MC data from any p.d.f
00057 };
00058 
00059 #endif

Generated on Tue Jul 5 14:26:11 2011 for ROOT_528-00b_version by  doxygen 1.5.1