00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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 ) ;
00040 RooDataSet* finalizeRun() ;
00041
00042 Bool_t processBeforeGen(Int_t ) ;
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)
00095 } ;
00096
00097
00098 #endif
00099