Logo ROOT  
Reference Guide
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(NULL)
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 { return new ToyMCStudy(*this) ; }
45
46 virtual ~ToyMCStudy() {}
47
48 // RooAbsStudy interfaces
49 virtual Bool_t initialize(void);
50 virtual Bool_t execute(void);
51 virtual Bool_t finalize(void);
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 ClassDef(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 = NULL;
79 }
80
82 {
83 fDataSet = sd;
84 }
85
86 virtual ~ToyMCPayload() {
87 }
88
89
91 {
92 return fDataSet;
93 }
94
95 private:
97
98 protected:
100};
101
102
103}
104
105
106#endif
bool Bool_t
Definition: RtypesCore.h:63
const Bool_t kTRUE
Definition: RtypesCore.h:100
#define ClassDef(name, id)
Definition: Rtypes.h:325
char name[80]
Definition: TGX11.cxx:110
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooAbsStudy is an abstract base class for RooStudyManager modules.
Definition: RooAbsStudy.h:33
void storeDetailedOutput(Bool_t flag)
Definition: RooAbsStudy.h:47
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:35
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:36
RooDataSet * GetSamplingDistributions()
Definition: ToyMCStudy.h:90
RooDataSet * fDataSet
Definition: ToyMCStudy.h:96
virtual ~ToyMCPayload()
Definition: ToyMCStudy.h:86
ToyMCPayload(RooDataSet *sd)
Definition: ToyMCStudy.h:81
ToyMCSampler is an implementation of the TestStatSampler interface.
Definition: ToyMCSampler.h:67
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
virtual Bool_t finalize(void)
Definition: ToyMCStudy.cxx:90
RooAbsStudy * clone(const char *="") const
Definition: ToyMCStudy.h:44
ToyMCSampler * fToyMCSampler
Definition: ToyMCStudy.h:63
void SetParamPoint(const RooArgSet &paramPoint)
Definition: ToyMCStudy.h:56
RooArgSet fParamPoint
Definition: ToyMCStudy.h:64
virtual Bool_t initialize(void)
Definition: ToyMCStudy.cxx:43
void SetRandomSeed(unsigned int seed)
Definition: ToyMCStudy.h:58
RooDataSet * merge()
Definition: ToyMCStudy.cxx:101
virtual Bool_t execute(void)
Definition: ToyMCStudy.cxx:78
virtual ~ToyMCStudy()
Definition: ToyMCStudy.h:46
ToyMCStudy(const char *name="ToyMCStudy", const char *title="ToyMCStudy")
Definition: ToyMCStudy.h:34
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