Logo ROOT   6.14/05
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 
18 #include "RooStats/ToyMCSampler.h"
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 
30 namespace RooStats {
31 
32 class 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 
55  RooDataSet* merge();
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 
74 class 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
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:86
ToyMCStudy(const char *name="ToyMCStudy", const char *title="ToyMCStudy")
Definition: ToyMCStudy.h:36
unsigned int fRandomSeed
Definition: ToyMCStudy.h:64
RooDataSet * merge()
Definition: ToyMCStudy.cxx:101
ToyMCPayload(RooDataSet *sd)
Definition: ToyMCStudy.h:83
RooDataSet * GetSamplingDistributions()
Definition: ToyMCStudy.h:92
bool Bool_t
Definition: RtypesCore.h:59
virtual Bool_t finalize(void)
Definition: ToyMCStudy.cxx:90
RooDataSet * fDataSet
Definition: ToyMCStudy.h:98
virtual Bool_t initialize(void)
Definition: ToyMCStudy.cxx:43
void SetRandomSeed(unsigned int seed)
Definition: ToyMCStudy.h:60
RooArgSet fParamPoint
Definition: ToyMCStudy.h:66
void SetParamPoint(const RooArgSet &paramPoint)
Definition: ToyMCStudy.h:58
ToyMCStudy is an implementation of RooAbsStudy for toy Monte Carlo sampling.
Definition: ToyMCStudy.h:32
#define ClassDef(name, id)
Definition: Rtypes.h:320
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
RooAbsStudy * clone(const char *="") const
Definition: ToyMCStudy.h:46
RooAbsStudy is an abstract base class for RooStudyManager modules.
Definition: RooAbsStudy.h:33
ToyMCSampler is an implementation of the TestStatSampler interface.
Definition: ToyMCSampler.h:71
virtual ~ToyMCPayload()
Definition: ToyMCStudy.h:88
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:29
ToyMCSampler * fToyMCSampler
Definition: ToyMCStudy.h:65
Namespace for the RooStats classes.
Definition: Asimov.h:20
void SetToyMCSampler(ToyMCSampler &t)
Definition: ToyMCStudy.h:57
virtual Bool_t execute(void)
Definition: ToyMCStudy.cxx:78
virtual ~ToyMCStudy()
Definition: ToyMCStudy.h:48
const Bool_t kTRUE
Definition: RtypesCore.h:87
void storeDetailedOutput(Bool_t flag)
Definition: RooAbsStudy.h:47
char name[80]
Definition: TGX11.cxx:109