RooRandomizeParamMCSModule.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooRandomizeParamMCSModule.h,v 1.2 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 
00017 #ifndef ROO_RANDOMIZE_PARAM_MCS_MODULE
00018 #define ROO_RANDOMIZE_PARAM_MCS_MODULE
00019 
00020 #include "RooAbsMCStudyModule.h"
00021 #include "RooRealVar.h"
00022 #include <list>
00023 
00024 class RooRandomizeParamMCSModule : public RooAbsMCStudyModule {
00025 public:
00026 
00027   RooRandomizeParamMCSModule() ;
00028   RooRandomizeParamMCSModule(const RooRandomizeParamMCSModule& other) ;
00029   virtual ~RooRandomizeParamMCSModule() ;
00030 
00031   void sampleUniform(RooRealVar& param, Double_t lo, Double_t hi) ;
00032   void sampleGaussian(RooRealVar& param, Double_t mean, Double_t sigma) ;
00033 
00034   void sampleSumUniform(const RooArgSet& paramSet, Double_t lo, Double_t hi) ;
00035   void sampleSumGauss(const RooArgSet& paramSet, Double_t lo, Double_t hi) ;
00036 
00037   Bool_t initializeInstance() ; 
00038 
00039   Bool_t initializeRun(Int_t /*numSamples*/) ; 
00040   RooDataSet* finalizeRun() ;
00041 
00042   Bool_t processBeforeGen(Int_t /*sampleNum*/) ; 
00043         
00044 private:
00045 
00046   struct UniParam {
00047      UniParam() {}
00048      UniParam(RooRealVar* p, Double_t lo, Double_t hi) : _param(p), _lo(lo), _hi(hi) {}
00049      bool operator==(const UniParam& other) { return (_param==other._param) ; }
00050      bool operator<(const UniParam& other) { return (_lo<other._lo) ; }
00051      RooRealVar* _param ;
00052      Double_t _lo ;
00053      Double_t _hi ;
00054   } ;
00055 
00056   struct UniParamSet {
00057      UniParamSet() {}
00058      UniParamSet(const RooArgSet& pset, Double_t lo, Double_t hi) : _pset(pset), _lo(lo), _hi(hi) {}
00059      bool operator==(const UniParamSet& other) { return (_lo==other._lo) ; }
00060      bool operator<(const UniParamSet& other) { return (_lo<other._lo) ; }
00061      RooArgSet _pset ;
00062      Double_t _lo ;
00063      Double_t _hi ;
00064   } ;
00065 
00066   struct GausParam {
00067      GausParam() {}
00068      GausParam(RooRealVar* p, Double_t mean, Double_t sigma) : _param(p), _mean(mean), _sigma(sigma) {}
00069      bool operator==(const GausParam& other) { return (_param==other._param) ; }
00070      bool operator<(const GausParam& other) { return (_mean<other._mean) ; }
00071      RooRealVar* _param ;
00072      Double_t _mean ;
00073      Double_t _sigma ;
00074   } ;
00075 
00076   struct GausParamSet {
00077      GausParamSet() {}
00078      GausParamSet(const RooArgSet& pset, Double_t mean, Double_t sigma) : _pset(pset), _mean(mean), _sigma(sigma) {}
00079      bool operator==(const GausParamSet& other) { return (_mean==other._mean) ; }
00080      bool operator<(const GausParamSet& other) { return (_mean<other._mean) ; }
00081      RooArgSet _pset ;
00082      Double_t _mean ;
00083      Double_t _sigma ;
00084   } ;
00085 
00086   std::list<UniParam>     _unifParams ; //!
00087   std::list<UniParamSet>  _unifParamSets ; //!
00088   std::list<GausParam>    _gausParams ; //!
00089   std::list<GausParamSet> _gausParamSets ; //!
00090 
00091   RooArgSet _genParSet ;
00092   RooDataSet* _data ;
00093 
00094   ClassDef(RooRandomizeParamMCSModule,0) // MCStudy module to vary one or more input parameters during fit/generation cycle
00095 } ;
00096 
00097 
00098 #endif
00099 

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