Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ToyMCStudy.h
Go to the documentation of this file.
1// @(#)root/roostats:$Id$
2// Author: Sven Kreiss and Kyle Cranmer June 2010
3/*************************************************************************
4 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOSTATS_ToyMCStudy
12#define ROOSTATS_ToyMCStudy
13
14#include "Rtypes.h"
15
16#include "RooAbsStudy.h"
17
20
21#include "RooWorkspace.h"
22#include "RooArgSet.h"
23
24#include "RooDataSet.h"
25#include "RooLinkedList.h"
26#include "RooLinkedListIter.h"
27
28namespace RooStats {
29
30class ToyMCStudy: public RooAbsStudy {
31
32 public:
33 /// need to have constructor without arguments for proof
34 ToyMCStudy(const char *name = "ToyMCStudy", const char *title = "ToyMCStudy") :
35 RooAbsStudy(name, title),
36 fRandomSeed(0),
37 fToyMCSampler(nullptr)
38 {
39 // In this case, this is the normal output. The SamplingDistribution
40 // instances are stored as detailed output.
42 }
43
44 RooAbsStudy* clone(const char* /*newname*/="") const override { return new ToyMCStudy(*this) ; }
45
46 ~ToyMCStudy() override {}
47
48 // RooAbsStudy interfaces
49 bool initialize(void) override;
50 bool execute(void) override;
51 bool finalize(void) override;
52
54
56 void SetParamPoint(const RooArgSet& paramPoint) { fParamPoint.add(paramPoint); }
57
58 void SetRandomSeed(unsigned int seed) { fRandomSeed = seed; }
59
60 protected:
61
62 unsigned int fRandomSeed;
65
66 protected:
67 ClassDefOverride(ToyMCStudy,2); // toy MC study for parallel processing
68
69};
70
71
72class ToyMCPayload : public TNamed {
73
74 public:
75
77 // proof constructor, do not use
78 fDataSet = nullptr;
79 }
80
82 {
83 fDataSet = sd;
84 }
85
86 ~ToyMCPayload() override {
87 }
88
89
91 {
92 return fDataSet;
93 }
94
95 private:
97
98 protected:
100};
101
102
103}
104
105
106#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
char name[80]
Definition TGX11.cxx:110
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
RooAbsStudy is an abstract base class for RooStudyManager modules.
Definition RooAbsStudy.h:33
void storeDetailedOutput(bool flag)
Definition RooAbsStudy.h:47
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
RooDataSet is a container class to hold unbinned data.
Definition RooDataSet.h:57
RooDataSet * GetSamplingDistributions()
Definition ToyMCStudy.h:90
RooDataSet * fDataSet
Definition ToyMCStudy.h:96
ToyMCPayload(RooDataSet *sd)
Definition ToyMCStudy.h:81
~ToyMCPayload() override
Definition ToyMCStudy.h:86
ToyMCSampler is an implementation of the TestStatSampler interface.
ToyMCStudy is an implementation of RooAbsStudy for toy Monte Carlo sampling.
Definition ToyMCStudy.h:30
void SetToyMCSampler(ToyMCSampler &t)
Definition ToyMCStudy.h:55
unsigned int fRandomSeed
Definition ToyMCStudy.h:62
bool execute(void) override
bool finalize(void) override
ToyMCSampler * fToyMCSampler
Definition ToyMCStudy.h:63
void SetParamPoint(const RooArgSet &paramPoint)
Definition ToyMCStudy.h:56
RooArgSet fParamPoint
Definition ToyMCStudy.h:64
RooAbsStudy * clone(const char *="") const override
Definition ToyMCStudy.h:44
void SetRandomSeed(unsigned int seed)
Definition ToyMCStudy.h:58
RooDataSet * merge()
ToyMCStudy(const char *name="ToyMCStudy", const char *title="ToyMCStudy")
need to have constructor without arguments for proof
Definition ToyMCStudy.h:34
~ToyMCStudy() override
Definition ToyMCStudy.h:46
bool initialize(void) override
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Namespace for the RooStats classes.
Definition Asimov.h:19