Logo ROOT  
Reference Guide
RooRandomizeParamMCSModule.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooRandomizeParamMCSModule.h,v 1.2 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 
17 #ifndef ROO_RANDOMIZE_PARAM_MCS_MODULE
18 #define ROO_RANDOMIZE_PARAM_MCS_MODULE
19 
20 #include "RooAbsMCStudyModule.h"
21 #include "RooRealVar.h"
22 #include <list>
23 
25 public:
26 
29  virtual ~RooRandomizeParamMCSModule() ;
30 
31  void sampleUniform(RooRealVar& param, Double_t lo, Double_t hi) ;
32  void sampleGaussian(RooRealVar& param, Double_t mean, Double_t sigma) ;
33 
34  void sampleSumUniform(const RooArgSet& paramSet, Double_t lo, Double_t hi) ;
35  void sampleSumGauss(const RooArgSet& paramSet, Double_t lo, Double_t hi) ;
36 
38 
39  Bool_t initializeRun(Int_t /*numSamples*/) ;
41 
42  Bool_t processBeforeGen(Int_t /*sampleNum*/) ;
43 
44 private:
45 
46  struct UniParam {
47  UniParam() {}
48  UniParam(RooRealVar* p, Double_t lo, Double_t hi) : _param(p), _lo(lo), _hi(hi) {}
49  bool operator==(const UniParam& other) { return (_param==other._param) ; }
50  bool operator<(const UniParam& other) { return (_lo<other._lo) ; }
52  Double_t _lo ;
53  Double_t _hi ;
54  } ;
55 
56  struct UniParamSet {
57  UniParamSet() {}
58  UniParamSet(const RooArgSet& pset, Double_t lo, Double_t hi) : _pset(pset), _lo(lo), _hi(hi) {}
59  bool operator==(const UniParamSet& other) { return (_lo==other._lo) ; }
60  bool operator<(const UniParamSet& other) { return (_lo<other._lo) ; }
64  } ;
65 
66  struct GausParam {
67  GausParam() {}
68  GausParam(RooRealVar* p, Double_t mean, Double_t sigma) : _param(p), _mean(mean), _sigma(sigma) {}
69  bool operator==(const GausParam& other) { return (_param==other._param) ; }
70  bool operator<(const GausParam& other) { return (_mean<other._mean) ; }
74  } ;
75 
76  struct GausParamSet {
78  GausParamSet(const RooArgSet& pset, Double_t mean, Double_t sigma) : _pset(pset), _mean(mean), _sigma(sigma) {}
79  bool operator==(const GausParamSet& other) { return (_mean==other._mean) ; }
80  bool operator<(const GausParamSet& other) { return (_mean<other._mean) ; }
84  } ;
85 
86  std::list<UniParam> _unifParams ; //!
87  std::list<UniParamSet> _unifParamSets ; //!
88  std::list<GausParam> _gausParams ; //!
89  std::list<GausParamSet> _gausParamSets ; //!
90 
93 
94  ClassDef(RooRandomizeParamMCSModule,0) // MCStudy module to vary one or more input parameters during fit/generation cycle
95 } ;
96 
97 
98 #endif
99 
RooRandomizeParamMCSModule::GausParamSet
Definition: RooRandomizeParamMCSModule.h:90
RooRandomizeParamMCSModule::UniParam::operator==
bool operator==(const UniParam &other)
Definition: RooRandomizeParamMCSModule.h:63
RooRandomizeParamMCSModule::UniParamSet::operator==
bool operator==(const UniParamSet &other)
Definition: RooRandomizeParamMCSModule.h:73
RooRandomizeParamMCSModule::GausParam::operator<
bool operator<(const GausParam &other)
Definition: RooRandomizeParamMCSModule.h:84
RooRandomizeParamMCSModule::UniParamSet::operator<
bool operator<(const UniParamSet &other)
Definition: RooRandomizeParamMCSModule.h:74
RooRandomizeParamMCSModule::UniParamSet::_hi
Double_t _hi
Definition: RooRandomizeParamMCSModule.h:77
RooRandomizeParamMCSModule::UniParamSet::UniParamSet
UniParamSet()
Definition: RooRandomizeParamMCSModule.h:71
RooRandomizeParamMCSModule::GausParam::operator==
bool operator==(const GausParam &other)
Definition: RooRandomizeParamMCSModule.h:83
RooRandomizeParamMCSModule::GausParam::_sigma
Double_t _sigma
Definition: RooRandomizeParamMCSModule.h:87
RooRandomizeParamMCSModule::_gausParamSets
std::list< GausParamSet > _gausParamSets
Definition: RooRandomizeParamMCSModule.h:103
RooRandomizeParamMCSModule::GausParam::_param
RooRealVar * _param
Definition: RooRandomizeParamMCSModule.h:85
RooRandomizeParamMCSModule::_genParSet
RooArgSet _genParSet
Definition: RooRandomizeParamMCSModule.h:105
RooRandomizeParamMCSModule::processBeforeGen
Bool_t processBeforeGen(Int_t)
Apply all smearings to generator parameters.
Definition: RooRandomizeParamMCSModule.cxx:371
RooRandomizeParamMCSModule::_unifParams
std::list< UniParam > _unifParams
Definition: RooRandomizeParamMCSModule.h:100
RooRandomizeParamMCSModule::UniParam::_param
RooRealVar * _param
Definition: RooRandomizeParamMCSModule.h:65
RooRandomizeParamMCSModule::initializeRun
Bool_t initializeRun(Int_t)
Initialize module at beginning of RooCMStudy run.
Definition: RooRandomizeParamMCSModule.cxx:359
RooRandomizeParamMCSModule::initializeInstance
Bool_t initializeInstance()
Initialize module after attachment to RooMCStudy object.
Definition: RooRandomizeParamMCSModule.cxx:243
RooRandomizeParamMCSModule::sampleUniform
void sampleUniform(RooRealVar &param, Double_t lo, Double_t hi)
Request uniform smearing of param in range [lo,hi] in RooMCStudy generation cycle.
Definition: RooRandomizeParamMCSModule.cxx:94
RooRandomizeParamMCSModule::RooRandomizeParamMCSModule
RooRandomizeParamMCSModule()
Constructor.
Definition: RooRandomizeParamMCSModule.cxx:58
bool
RooRandomizeParamMCSModule::GausParam
Definition: RooRandomizeParamMCSModule.h:80
RooAbsMCStudyModule.h
hi
float type_of_call hi(const int &, const int &)
RooRandomizeParamMCSModule::~RooRandomizeParamMCSModule
virtual ~RooRandomizeParamMCSModule()
Destructor.
Definition: RooRandomizeParamMCSModule.cxx:81
RooRandomizeParamMCSModule::_unifParamSets
std::list< UniParamSet > _unifParamSets
Definition: RooRandomizeParamMCSModule.h:101
RooRandomizeParamMCSModule::GausParamSet::operator==
bool operator==(const GausParamSet &other)
Definition: RooRandomizeParamMCSModule.h:93
RooAbsMCStudyModule
Definition: RooAbsMCStudyModule.h:30
RooRandomizeParamMCSModule::GausParamSet::GausParamSet
GausParamSet()
Definition: RooRandomizeParamMCSModule.h:91
RooRandomizeParamMCSModule::GausParam::GausParam
GausParam()
Definition: RooRandomizeParamMCSModule.h:81
RooRandomizeParamMCSModule::finalizeRun
RooDataSet * finalizeRun()
Return auxiliary data of this module so that it is merged with RooMCStudy::fitParDataSet()
Definition: RooRandomizeParamMCSModule.cxx:459
RooRandomizeParamMCSModule::sampleSumGauss
void sampleSumGauss(const RooArgSet &paramSet, Double_t lo, Double_t hi)
Request gaussian smearing of sum of parameters in paramSet uniform smearing with mean 'mean' and widt...
Definition: RooRandomizeParamMCSModule.cxx:195
RooRandomizeParamMCSModule::sampleGaussian
void sampleGaussian(RooRealVar &param, Double_t mean, Double_t sigma)
Request Gaussian smearing of param in with mean 'mean' and width 'sigma' in RooMCStudy generation cyc...
Definition: RooRandomizeParamMCSModule.cxx:115
RooRandomizeParamMCSModule::GausParamSet::_pset
RooArgSet _pset
Definition: RooRandomizeParamMCSModule.h:95
RooRealVar.h
RooRandomizeParamMCSModule::GausParam::_mean
Double_t _mean
Definition: RooRandomizeParamMCSModule.h:86
RooRandomizeParamMCSModule::UniParam
Definition: RooRandomizeParamMCSModule.h:60
RooRandomizeParamMCSModule::UniParamSet
Definition: RooRandomizeParamMCSModule.h:70
sigma
const Double_t sigma
Definition: h1analysisProxy.h:11
RooRandomizeParamMCSModule
Definition: RooRandomizeParamMCSModule.h:24
RooRandomizeParamMCSModule::UniParam::_hi
Double_t _hi
Definition: RooRandomizeParamMCSModule.h:67
RooRandomizeParamMCSModule::UniParam::_lo
Double_t _lo
Definition: RooRandomizeParamMCSModule.h:66
Double_t
double Double_t
Definition: RtypesCore.h:59
RooRandomizeParamMCSModule::UniParamSet::_lo
Double_t _lo
Definition: RooRandomizeParamMCSModule.h:76
RooRandomizeParamMCSModule::GausParamSet::operator<
bool operator<(const GausParamSet &other)
Definition: RooRandomizeParamMCSModule.h:94
RooRandomizeParamMCSModule::GausParamSet::_mean
Double_t _mean
Definition: RooRandomizeParamMCSModule.h:96
RooRandomizeParamMCSModule::sampleSumUniform
void sampleSumUniform(const RooArgSet &paramSet, Double_t lo, Double_t hi)
Request uniform smearing of sum of parameters in paramSet uniform smearing in range [lo,...
Definition: RooRandomizeParamMCSModule.cxx:140
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooRandomizeParamMCSModule::_gausParams
std::list< GausParam > _gausParams
Definition: RooRandomizeParamMCSModule.h:102
RooRandomizeParamMCSModule::UniParamSet::_pset
RooArgSet _pset
Definition: RooRandomizeParamMCSModule.h:75
RooDataSet
Definition: RooDataSet.h:33
RooRandomizeParamMCSModule::GausParamSet::_sigma
Double_t _sigma
Definition: RooRandomizeParamMCSModule.h:97
RooRandomizeParamMCSModule::UniParam::operator<
bool operator<(const UniParam &other)
Definition: RooRandomizeParamMCSModule.h:64
RooRealVar
Definition: RooRealVar.h:35
RooRandomizeParamMCSModule::_data
RooDataSet * _data
Definition: RooRandomizeParamMCSModule.h:106
RooArgSet
Definition: RooArgSet.h:28
int
RooRandomizeParamMCSModule::UniParam::UniParam
UniParam()
Definition: RooRandomizeParamMCSModule.h:61