00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ROO_ABS_TEST_STATISTIC
00017 #define ROO_ABS_TEST_STATISTIC
00018
00019 #include "Riosfwd.h"
00020 #include "RooAbsReal.h"
00021 #include "RooSetProxy.h"
00022 #include "RooRealProxy.h"
00023 #include <string>
00024
00025 class RooArgSet ;
00026 class RooAbsData ;
00027 class RooAbsReal ;
00028 class RooSimultaneous ;
00029 class RooRealMPFE ;
00030
00031 class RooAbsTestStatistic ;
00032 typedef RooAbsTestStatistic* pRooAbsTestStatistic ;
00033 typedef RooAbsData* pRooAbsData ;
00034 typedef RooRealMPFE* pRooRealMPFE ;
00035
00036 class RooAbsTestStatistic : public RooAbsReal {
00037 public:
00038
00039
00040 RooAbsTestStatistic() ;
00041 RooAbsTestStatistic(const char *name, const char *title, RooAbsReal& real, RooAbsData& data,
00042 const RooArgSet& projDeps, const char* rangeName=0, const char* addCoefRangeName=0,
00043 Int_t nCPU=1, Bool_t interleave=kFALSE, Bool_t verbose=kTRUE, Bool_t splitCutRange=kTRUE) ;
00044 RooAbsTestStatistic(const RooAbsTestStatistic& other, const char* name=0);
00045 virtual ~RooAbsTestStatistic();
00046 virtual RooAbsTestStatistic* create(const char *name, const char *title, RooAbsReal& real, RooAbsData& data,
00047 const RooArgSet& projDeps, const char* rangeName=0, const char* addCoefRangeName=0,
00048 Int_t nCPU=1, Bool_t interleave=kFALSE, Bool_t verbose=kTRUE, Bool_t splitCutRange=kFALSE) = 0 ;
00049
00050 virtual void constOptimizeTestStatistic(ConstOpCode opcode) ;
00051
00052 virtual Double_t combinedValue(RooAbsReal** gofArray, Int_t nVal) const = 0 ;
00053 virtual Double_t globalNormalization() const {
00054
00055 return 1.0 ;
00056 }
00057
00058 protected:
00059
00060 virtual void printCompactTreeHook(ostream& os, const char* indent="") ;
00061
00062 virtual Bool_t redirectServersHook(const RooAbsCollection& newServerList, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive) ;
00063 virtual Double_t evaluate() const ;
00064
00065 virtual Double_t evaluatePartition(Int_t firstEvent, Int_t lastEvent, Int_t stepSize) const = 0 ;
00066
00067 void setMPSet(Int_t setNum, Int_t numSets) ;
00068 void setSimCount(Int_t simCount) {
00069
00070 _simCount = simCount ;
00071 }
00072
00073 void setEventCount(Int_t nEvents) {
00074
00075 _nEvents = nEvents ;
00076 }
00077
00078 Int_t numSets() const {
00079
00080 return _numSets ;
00081 }
00082 Int_t setNum() const {
00083
00084 return _setNum ;
00085 }
00086
00087 RooSetProxy _paramSet ;
00088
00089 enum GOFOpMode { SimMaster,MPMaster,Slave } ;
00090 GOFOpMode operMode() const {
00091
00092 return _gofOpMode ;
00093 }
00094
00095
00096 RooAbsReal* _func ;
00097 RooAbsData* _data ;
00098 const RooArgSet* _projDeps ;
00099 std::string _rangeName ;
00100 std::string _addCoefRangeName ;
00101 Bool_t _splitRange ;
00102 Int_t _simCount ;
00103 Bool_t _verbose ;
00104
00105 private:
00106
00107 virtual Bool_t processEmptyDataSets() const { return kTRUE ; }
00108
00109 Bool_t initialize() ;
00110 void initSimMode(RooSimultaneous* pdf, RooAbsData* data, const RooArgSet* projDeps, const char* rangeName, const char* addCoefRangeName) ;
00111 void initMPMode(RooAbsReal* real, RooAbsData* data, const RooArgSet* projDeps, const char* rangeName, const char* addCoefRangeName) ;
00112
00113 mutable Bool_t _init ;
00114 GOFOpMode _gofOpMode ;
00115
00116 Int_t _nEvents ;
00117 Int_t _setNum ;
00118 Int_t _numSets ;
00119
00120
00121 Int_t _nGof ;
00122 pRooAbsTestStatistic* _gofArray ;
00123
00124
00125 Int_t _nCPU ;
00126 pRooRealMPFE* _mpfeArray ;
00127
00128 Bool_t _mpinterl ;
00129
00130 ClassDef(RooAbsTestStatistic,1)
00131 };
00132
00133 #endif