Logo ROOT   6.12/07
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) ; }
54  } ;
55 
56  struct 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 
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...
RooAbsMCStudyModule is a base class for add-on modules to RooMCStudy that can perform additional calc...
Bool_t initializeInstance()
Initialize module after attachment to RooMCStudy object.
void sampleGaussian(RooRealVar &param, Double_t mean, Double_t sigma)
Request Gaussian smearing of param in with mean &#39;mean&#39; and width &#39;sigma&#39; in RooMCStudy generation cyc...
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
GausParamSet(const RooArgSet &pset, Double_t mean, Double_t sigma)
Bool_t initializeRun(Int_t)
Initialize module at beginning of RooCMStudy run.
#define ClassDef(name, id)
Definition: Rtypes.h:320
Bool_t processBeforeGen(Int_t)
Apply all smearings to generator parameters.
const Double_t sigma
std::list< UniParamSet > _unifParamSets
RooRealVar represents a fundamental (non-derived) real valued object.
Definition: RooRealVar.h:36
std::list< GausParamSet > _gausParamSets
GausParam(RooRealVar *p, Double_t mean, Double_t sigma)
virtual ~RooRandomizeParamMCSModule()
Destructor.
RooRandomizeParamMCSModule is an add-on modules to RooMCStudy that allows you to randomize input gene...
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:29
RooDataSet * finalizeRun()
Return auxiliary data of this module so that it is merged with RooMCStudy::fitParDataSet() ...
void sampleUniform(RooRealVar &param, Double_t lo, Double_t hi)
Request uniform smearing of param in range [lo,hi] in RooMCStudy generation cycle.
UniParam(RooRealVar *p, Double_t lo, Double_t hi)
double Double_t
Definition: RtypesCore.h:55
UniParamSet(const RooArgSet &pset, Double_t lo, Double_t hi)
float type_of_call hi(const int &, const int &)
void sampleSumGauss(const RooArgSet &paramSet, Double_t lo, Double_t hi)
Request gaussian smearing of sum of parameters in paramSet uniform smearing with mean &#39;mean&#39; and widt...