Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooAbsOptTestStatistic.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id: RooAbsOptGoodnessOfFit.h,v 1.15 2007/05/11 09:11:30 verkerke Exp $
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
0008  *                                                                           *
0009  * Copyright (c) 2000-2005, Regents of the University of California          *
0010  *                          and Stanford University. All rights reserved.    *
0011  *                                                                           *
0012  * Redistribution and use in source and binary forms,                        *
0013  * with or without modification, are permitted according to the terms        *
0014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0015  *****************************************************************************/
0016 #ifndef ROO_ABS_OPT_TEST_STATISTIC
0017 #define ROO_ABS_OPT_TEST_STATISTIC
0018 
0019 // We can't print deprecation warnings when including headers in cling, because
0020 // this will be done automatically anyway.
0021 #ifdef __CLING__
0022 #ifndef ROOFIT_BUILDS_ITSELF
0023 // These warnings should only be suppressed when building ROOT itself!
0024 #warning "Including RooAbsOptTestStatistic.h is deprecated, and this header will be removed in ROOT v6.34: it is an implementation detail that should not be part of the public user interface"
0025 #else
0026 // If we are builting RooFit itself, this will serve as a reminder to actually
0027 // remove this deprecate public header. Here is now this needs to be done:
0028 //    1. Move this header file from inc/ to src/
0029 //    2. Remove the LinkDef entry, ClassDefOverride, and ClassImpl macros for
0030 //       this class
0031 //    3. If there are are tests using this class in the test/ directory, change
0032 //       the include to use a relative path the moved header file in the src/
0033 //       directory, e.g. #include <RemovedInterface.h> becomes #include
0034 //       "../src/RemovedInterface.h"
0035 //    4. Remove this ifndef-else-endif block from the header
0036 //    5. Remove the deprecation warning at the end of the class declaration
0037 #include <RVersion.h>
0038 #if ROOT_VERSION_CODE >= ROOT_VERSION(6, 34, 00)
0039 #error "Please remove this deprecated public interface."
0040 #endif
0041 #endif
0042 #endif
0043 
0044 #include "RooAbsTestStatistic.h"
0045 #include "RooSetProxy.h"
0046 #include "RooCategoryProxy.h"
0047 #include "TString.h"
0048 
0049 class RooArgSet ;
0050 class RooAbsData ;
0051 class RooAbsReal ;
0052 
0053 class RooAbsOptTestStatistic : public RooAbsTestStatistic {
0054 public:
0055 
0056   // Constructors, assignment etc
0057   RooAbsOptTestStatistic(const char *name, const char *title, RooAbsReal& real, RooAbsData& data,
0058                          const RooArgSet& projDeps,
0059                          RooAbsTestStatistic::Configuration const& cfg);
0060   RooAbsOptTestStatistic(const RooAbsOptTestStatistic& other, const char* name=nullptr);
0061   ~RooAbsOptTestStatistic() override;
0062 
0063   double combinedValue(RooAbsReal** gofArray, Int_t nVal) const override ;
0064 
0065   RooAbsReal& function() { return *_funcClone ; }
0066   const RooAbsReal& function() const { return *_funcClone ; }
0067 
0068   RooAbsData& data() ;
0069   const RooAbsData& data() const ;
0070 
0071 
0072   const char* cacheUniqueSuffix() const override;
0073 
0074   // Override this to be always true to force calculation of likelihood without parameters
0075   bool isDerived() const override { return true ; }
0076 
0077   void seal(const char* notice="") { _sealed = true ; _sealNotice = notice ; }
0078   bool isSealed() const { return _sealed ; }
0079   const char* sealNotice() const { return _sealNotice.Data() ; }
0080 
0081 private:
0082   void setUpBinSampling();
0083 
0084 protected:
0085 
0086   bool setDataSlave(RooAbsData& data, bool cloneData=true, bool ownNewDataAnyway=false) override ;
0087   void initSlave(RooAbsReal& real, RooAbsData& indata, const RooArgSet& projDeps, const char* rangeName,
0088        const char* addCoefRangeName)  ;
0089 
0090   friend class RooAbsReal ;
0091   friend class RooAbsTestStatistic ;
0092 
0093   virtual bool allowFunctionCache() { return true ;  }
0094   void constOptimizeTestStatistic(ConstOpCode opcode, bool doAlsoTrackingOpt=true) override ;
0095 
0096   bool redirectServersHook(const RooAbsCollection& newServerList, bool mustReplaceAll, bool nameChange, bool isRecursive) override ;
0097   void printCompactTreeHook(std::ostream& os, const char* indent="") override ;
0098   virtual RooArgSet requiredExtraObservables() const { return RooArgSet() ; }
0099   void optimizeCaching() ;
0100   void optimizeConstantTerms(bool,bool=true) ;
0101   void runRecalculateCache(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const override;
0102 
0103   RooArgSet*  _normSet = nullptr;           ///< Pointer to set with observables used for normalization
0104   RooArgSet*  _funcCloneSet = nullptr;      ///< Set owning all components of internal clone of input function
0105   RooAbsData* _dataClone = nullptr; ///< Pointer to internal clone if input data
0106   RooAbsReal* _funcClone = nullptr;   ///< Pointer to internal clone of input function
0107   RooArgSet*  _projDeps = nullptr;    ///< Set of projected observable
0108   bool      _ownData = false;    ///< Do we own the dataset
0109   bool      _sealed = false;      ///< Is test statistic sealed -- i.e. no access to data
0110   TString     _sealNotice ;  ///< User-defined notice shown when reading a sealed likelihood
0111   RooArgSet*  _funcObsSet = nullptr;  ///< List of observables in the pdf expression
0112   RooArgSet   _cachedNodes ; ///<! List of nodes that are cached as constant expressions
0113   bool _skipZeroWeights = false; ///<! Whether to skip entries with weight zero in the evaluation
0114 
0115   RooAbsReal* _origFunc = nullptr;  ///< Original function
0116   RooAbsData* _origData = nullptr;  ///< Original data
0117   bool      _optimized = false; ///<!
0118   double      _integrateBinsPrecision{-1.}; // Precision for finer sampling of bins.
0119 
0120   ClassDefOverride(RooAbsOptTestStatistic,0) // Abstract base class for optimized test statistics
0121 #ifndef ROOFIT_BUILDS_ITSELF
0122 } R__DEPRECATED(6,34, "RooAbsOptTestStatistic is a RooFit implementation detail that should not be instantiated in user code.");
0123 #else
0124 };
0125 #endif
0126 
0127 #endif