Logo ROOT   6.16/01
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
28#include <vector>
29
30namespace RooStats {
31
32class ToyMCStudy: public RooAbsStudy {
33
34 public:
35 // need to have constructor without arguments for proof
36 ToyMCStudy(const char *name = "ToyMCStudy", const char *title = "ToyMCStudy") :
37 RooAbsStudy(name, title),
38 fRandomSeed(0),
39 fToyMCSampler(NULL)
40 {
41 // In this case, this is the normal output. The SamplingDistribution
42 // instances are stored as detailed output.
44 }
45
46 RooAbsStudy* clone(const char* /*newname*/="") const { return new ToyMCStudy(*this) ; }
47
48 virtual ~ToyMCStudy() {}
49
50 // RooAbsStudy interfaces
51 virtual Bool_t initialize(void);
52 virtual Bool_t execute(void);
53 virtual Bool_t finalize(void);
54
56
58 void SetParamPoint(const RooArgSet& paramPoint) { fParamPoint.add(paramPoint); }
59
60 void SetRandomSeed(unsigned int seed) { fRandomSeed = seed; }
61
62 protected:
63
64 unsigned int fRandomSeed;
67
68 protected:
69 ClassDef(ToyMCStudy,2); // toy MC study for parallel processing
70
71};
72
73
74class ToyMCPayload : public TNamed {
75
76 public:
77
79 // proof constructor, do not use
80 fDataSet = NULL;
81 }
82
84 {
85 fDataSet = sd;
86 }
87
88 virtual ~ToyMCPayload() {
89 }
90
91
93 {
94 return fDataSet;
95 }
96
97 private:
99
100 protected:
102};
103
104
105}
106
107
108#endif
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:324
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:28
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
Definition: RooArgSet.h:88
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:31
RooDataSet * GetSamplingDistributions()
Definition: ToyMCStudy.h:92
RooDataSet * fDataSet
Definition: ToyMCStudy.h:98
virtual ~ToyMCPayload()
Definition: ToyMCStudy.h:88
ToyMCPayload(RooDataSet *sd)
Definition: ToyMCStudy.h:83
ToyMCSampler is an implementation of the TestStatSampler interface.
Definition: ToyMCSampler.h:71
ToyMCStudy is an implementation of RooAbsStudy for toy Monte Carlo sampling.
Definition: ToyMCStudy.h:32
void SetToyMCSampler(ToyMCSampler &t)
Definition: ToyMCStudy.h:57
unsigned int fRandomSeed
Definition: ToyMCStudy.h:64
virtual Bool_t finalize(void)
Definition: ToyMCStudy.cxx:90
RooAbsStudy * clone(const char *="") const
Definition: ToyMCStudy.h:46
ToyMCSampler * fToyMCSampler
Definition: ToyMCStudy.h:65
void SetParamPoint(const RooArgSet &paramPoint)
Definition: ToyMCStudy.h:58
RooArgSet fParamPoint
Definition: ToyMCStudy.h:66
virtual Bool_t initialize(void)
Definition: ToyMCStudy.cxx:43
void SetRandomSeed(unsigned int seed)
Definition: ToyMCStudy.h:60
RooDataSet * merge()
Definition: ToyMCStudy.cxx:101
virtual Bool_t execute(void)
Definition: ToyMCStudy.cxx:78
virtual ~ToyMCStudy()
Definition: ToyMCStudy.h:48
ToyMCStudy(const char *name="ToyMCStudy", const char *title="ToyMCStudy")
Definition: ToyMCStudy.h:36
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
@(#)root/roostats:$Id$ Author: George Lewis, Kyle Cranmer
Definition: Asimov.h:20