00001 // @(#)root/roostats:$Id: ToyMCStudy.h 36602 2010-11-11 16:52:13Z moneta $ 00002 // Author: Sven Kreiss and Kyle Cranmer June 2010 00003 /************************************************************************* 00004 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * 00005 * All rights reserved. * 00006 * * 00007 * For the licensing terms see $ROOTSYS/LICENSE. * 00008 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00009 *************************************************************************/ 00010 00011 #ifndef ROOSTATS_ToyMCStudy 00012 #define ROOSTATS_ToyMCStudy 00013 00014 //_________________________________________________ 00015 /* 00016 BEGIN_HTML 00017 <p> 00018 ToyMCStudy is an implementation of RooAbsStudy for toy Monte Carlo sampling. 00019 This class is automatically used by ToyMCSampler when given a ProofConfig. 00020 This is also its intended use case. 00021 </p> 00022 END_HTML 00023 */ 00024 // 00025 00026 #ifndef ROOT_Rtypes 00027 #include "Rtypes.h" 00028 #endif 00029 00030 #include "RooAbsStudy.h" 00031 00032 #include "RooStats/ToyMCSampler.h" 00033 #include "RooStats/SamplingDistribution.h" 00034 00035 #include "RooWorkspace.h" 00036 #include "RooArgSet.h" 00037 00038 #include "RooDataSet.h" 00039 #include "RooLinkedList.h" 00040 #include "RooLinkedListIter.h" 00041 00042 namespace RooStats { 00043 00044 class ToyMCStudy: public RooAbsStudy { 00045 00046 public: 00047 // need to have constructor without arguments for proof 00048 ToyMCStudy(const char *name = "ToyMCStudy", const char *title = "ToyMCStudy") : 00049 RooAbsStudy(name, title), 00050 00051 fToyMCSampler(NULL) 00052 { 00053 // In this case, this is the normal output. The SamplingDistribution 00054 // instances are stored as detailed output. 00055 storeDetailedOutput(kTRUE); 00056 } 00057 00058 virtual ~ToyMCStudy() { 00059 } 00060 00061 // RooAbsStudy interfaces 00062 virtual Bool_t initialize(void); 00063 virtual Bool_t execute(void); 00064 virtual Bool_t finalize(void); 00065 00066 Bool_t merge(SamplingDistribution& result); 00067 00068 void SetToyMCSampler(ToyMCSampler& t) { fToyMCSampler = &t; } 00069 void SetParamPointOfInterest(const RooArgSet& poi) { fParamPointOfInterest.add(poi); } 00070 00071 protected: 00072 00073 ToyMCSampler *fToyMCSampler; 00074 RooArgSet fParamPointOfInterest; 00075 00076 protected: 00077 ClassDef(ToyMCStudy,1) // toy MC study for parallel processing 00078 }; 00079 } 00080 00081 00082 #endif