Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
25public:
26
30
31 void sampleUniform(RooRealVar& param, double lo, double hi) ;
32 void sampleGaussian(RooRealVar& param, double mean, double sigma) ;
33
34 void sampleSumUniform(const RooArgSet& paramSet, double lo, double hi) ;
35 void sampleSumGauss(const RooArgSet& paramSet, double lo, double hi) ;
36
37 bool initializeInstance() override ;
38
39 bool initializeRun(Int_t /*numSamples*/) override ;
40 RooDataSet* finalizeRun() override ;
41
42 bool processBeforeGen(Int_t /*sampleNum*/) override ;
43
44private:
45
46 struct UniParam {
48 UniParam(RooRealVar* p, double lo, double 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 _lo ;
53 double _hi ;
54 } ;
55
56 struct UniParamSet {
58 UniParamSet(const RooArgSet& pset, double lo, double 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) ; }
62 double _lo ;
63 double _hi ;
64 } ;
65
66 struct GausParam {
68 GausParam(RooRealVar* p, double mean, double 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) ; }
72 double _mean ;
73 double _sigma ;
74 } ;
75
76 struct GausParamSet {
78 GausParamSet(const RooArgSet& pset, double mean, double 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) ; }
82 double _mean ;
83 double _sigma ;
84 } ;
85
86 std::list<UniParam> _unifParams ; ///<!
87 std::list<UniParamSet> _unifParamSets ; ///<!
88 std::list<GausParam> _gausParams ; ///<!
89 std::list<GausParamSet> _gausParamSets ; ///<!
90
92 std::unique_ptr<RooDataSet> _data ;
93
94 ClassDefOverride(RooRandomizeParamMCSModule,0) // MCStudy module to vary one or more input parameters during fit/generation cycle
95} ;
96
97
98#endif
99
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
winID h TVirtualViewer3D TVirtualGLPainter p
#define hi
Base class for add-on modules to RooMCStudy that can perform additional calculations on each generate...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Container class to hold unbinned data.
Definition RooDataSet.h:34
Add-on module to RooMCStudy that allows you to randomize input generation parameters.
void sampleSumGauss(const RooArgSet &paramSet, double lo, double hi)
Request gaussian smearing of sum of parameters in paramSet uniform smearing with mean 'mean' and widt...
std::unique_ptr< RooDataSet > _data
bool initializeRun(Int_t) override
Initialize module at beginning of RooCMStudy run.
void sampleSumUniform(const RooArgSet &paramSet, double lo, double hi)
Request uniform smearing of sum of parameters in paramSet uniform smearing in range [lo,...
std::list< UniParamSet > _unifParamSets
!
void sampleGaussian(RooRealVar &param, double mean, double sigma)
Request Gaussian smearing of param in with mean 'mean' and width 'sigma' in RooMCStudy generation cyc...
bool processBeforeGen(Int_t) override
Apply all smearings to generator parameters.
~RooRandomizeParamMCSModule() override
RooDataSet * finalizeRun() override
Return auxiliary data of this module so that it is merged with RooMCStudy::fitParDataSet()
bool initializeInstance() override
Initialize module after attachment to RooMCStudy object.
void sampleUniform(RooRealVar &param, double lo, double hi)
Request uniform smearing of param in range [lo,hi] in RooMCStudy generation cycle.
std::list< GausParamSet > _gausParamSets
!
Variable that can be changed from the outside.
Definition RooRealVar.h:37
const Double_t sigma
GausParamSet(const RooArgSet &pset, double mean, double sigma)
GausParam(RooRealVar *p, double mean, double sigma)
UniParamSet(const RooArgSet &pset, double lo, double hi)
UniParam(RooRealVar *p, double lo, double hi)