RooAbsOptTestStatistic.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooAbsOptGoodnessOfFit.h,v 1.15 2007/05/11 09:11:30 verkerke Exp $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00015  *****************************************************************************/
00016 #ifndef ROO_ABS_OPT_TEST_STATISTIC
00017 #define ROO_ABS_OPT_TEST_STATISTIC
00018 
00019 #include "Riosfwd.h"
00020 #include "RooAbsTestStatistic.h"
00021 #include "RooSetProxy.h"
00022 #include "RooCategoryProxy.h"
00023 #include "TString.h"
00024 
00025 class RooArgSet ;
00026 class RooAbsData ;
00027 class RooAbsReal ;
00028 
00029 class RooAbsOptTestStatistic : public RooAbsTestStatistic {
00030 public:
00031 
00032   // Constructors, assignment etc
00033   RooAbsOptTestStatistic() ;
00034   RooAbsOptTestStatistic(const char *name, const char *title, RooAbsReal& real, RooAbsData& data,
00035                          const RooArgSet& projDeps, const char* rangeName=0, const char* addCoefRangeName=0,
00036                          Int_t nCPU=1, Bool_t interleave=kFALSE, Bool_t verbose=kTRUE, Bool_t splitCutRange=kFALSE,
00037                          Bool_t cloneInputData=kTRUE) ;
00038   RooAbsOptTestStatistic(const RooAbsOptTestStatistic& other, const char* name=0);
00039   virtual ~RooAbsOptTestStatistic();
00040 
00041   virtual Double_t combinedValue(RooAbsReal** gofArray, Int_t nVal) const ;
00042 
00043   RooAbsReal& function() { return *_funcClone ; }
00044   const RooAbsReal& function() const { return *_funcClone ; }
00045 
00046   RooAbsData& data() ;
00047   const RooAbsData& data() const ;
00048   Bool_t setData(RooAbsData& data, Bool_t cloneData=kTRUE) ;
00049 
00050 
00051   virtual const char* cacheUniqueSuffix() const { return Form("_%lx", (ULong_t)_dataClone) ; }
00052 
00053   // Override this to be always true to force calculation of likelihood without parameters
00054   virtual Bool_t isDerived() const { return kTRUE ; }
00055 
00056   void seal(const char* notice="") { _sealed = kTRUE ; _sealNotice = notice ; }
00057   Bool_t isSealed() const { return _sealed ; }
00058   const char* sealNotice() const { return _sealNotice.Data() ; }
00059 
00060 protected:
00061 
00062   friend class RooAbsReal ;
00063 
00064   virtual Bool_t allowFunctionCache() { return kTRUE ;  }
00065   void constOptimizeTestStatistic(ConstOpCode opcode) ;
00066 
00067   virtual Bool_t redirectServersHook(const RooAbsCollection& newServerList, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive) ;
00068   virtual void printCompactTreeHook(ostream& os, const char* indent="") ;
00069   virtual RooArgSet requiredExtraObservables() const { return RooArgSet() ; }
00070   void optimizeCaching() ;
00071   void optimizeConstantTerms(Bool_t) ;
00072 
00073   RooArgSet*  _normSet ; // Pointer to set with observables used for normalization
00074   RooArgSet*  _funcCloneSet ; // Set owning all components of internal clone of input function
00075   RooAbsData* _dataClone ; // Pointer to internal clone if input data
00076   RooAbsReal* _funcClone ; // Pointer to internal clone of input function
00077   RooArgSet*  _projDeps ; // Set of projected observable
00078   Bool_t      _ownData  ; // Do we own the dataset
00079   Bool_t      _sealed ; // Is test statistic sealed -- i.e. no access to data 
00080   TString     _sealNotice ; // User-defined notice shown when reading a sealed likelihood 
00081   ClassDef(RooAbsOptTestStatistic,3) // Abstract base class for optimized test statistics
00082 };
00083 
00084 #endif

Generated on Tue Jul 5 14:25:59 2011 for ROOT_528-00b_version by  doxygen 1.5.1