Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooAbsOptTestStatistic.h
Go to the documentation of this file.
1/// \cond ROOFIT_INTERNAL
2
3/*
4 * Project: RooFit
5 *
6 * Copyright (c) 2024, CERN
7 *
8 * Redistribution and use in source and binary forms,
9 * with or without modification, are permitted according to the terms
10 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
11 */
12
13#ifndef ROO_ABS_OPT_TEST_STATISTIC
14#define ROO_ABS_OPT_TEST_STATISTIC
15
16#include "RooAbsTestStatistic.h"
17#include "RooSetProxy.h"
18#include "RooCategoryProxy.h"
19#include "TString.h"
20
21class RooArgSet ;
22class RooAbsData ;
23class RooAbsReal ;
24
25class RooAbsOptTestStatistic : public RooAbsTestStatistic {
26public:
27
28 // Constructors, assignment etc
29 RooAbsOptTestStatistic(const char *name, const char *title, RooAbsReal& real, RooAbsData& data,
30 const RooArgSet& projDeps,
31 RooAbsTestStatistic::Configuration const& cfg);
32 RooAbsOptTestStatistic(const RooAbsOptTestStatistic& other, const char* name=nullptr);
33 ~RooAbsOptTestStatistic() override;
34
35 double combinedValue(RooAbsReal** gofArray, Int_t nVal) const override ;
36
37 RooAbsReal& function() { return *_funcClone ; }
38 const RooAbsReal& function() const { return *_funcClone ; }
39
40 RooAbsData& data() ;
41 const RooAbsData& data() const ;
42
43
44 const char* cacheUniqueSuffix() const override;
45
46 // Override this to be always true to force calculation of likelihood without parameters
47 bool isDerived() const override { return true ; }
48
49 void seal(const char* notice="") { _sealed = true ; _sealNotice = notice ; }
50 bool isSealed() const { return _sealed ; }
51 const char* sealNotice() const { return _sealNotice.Data() ; }
52
53private:
54 void setUpBinSampling();
55
56protected:
57
58 bool setDataSlave(RooAbsData& data, bool cloneData=true, bool ownNewDataAnyway=false) override ;
59 void initSlave(RooAbsReal& real, RooAbsData& indata, const RooArgSet& projDeps, const char* rangeName,
60 const char* addCoefRangeName) ;
61
62 friend class RooAbsReal ;
63 friend class RooAbsTestStatistic ;
64
65 virtual bool allowFunctionCache() { return true ; }
66 void constOptimizeTestStatistic(ConstOpCode opcode, bool doAlsoTrackingOpt=true) override ;
67
68 bool redirectServersHook(const RooAbsCollection& newServerList, bool mustReplaceAll, bool nameChange, bool isRecursive) override ;
69 void printCompactTreeHook(std::ostream& os, const char* indent="") override ;
70 virtual RooArgSet requiredExtraObservables() const { return RooArgSet() ; }
71 void optimizeCaching() ;
72 void optimizeConstantTerms(bool,bool=true) ;
73 void runRecalculateCache(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const override;
74
75 RooArgSet* _normSet = nullptr; ///< Pointer to set with observables used for normalization
76 RooArgSet* _funcCloneSet = nullptr; ///< Set owning all components of internal clone of input function
77 RooAbsData* _dataClone = nullptr; ///< Pointer to internal clone if input data
78 RooAbsReal* _funcClone = nullptr; ///< Pointer to internal clone of input function
79 RooArgSet* _projDeps = nullptr; ///< Set of projected observable
80 bool _ownData = false; ///< Do we own the dataset
81 bool _sealed = false; ///< Is test statistic sealed -- i.e. no access to data
82 TString _sealNotice ; ///< User-defined notice shown when reading a sealed likelihood
83 RooArgSet* _funcObsSet = nullptr; ///< List of observables in the pdf expression
84 RooArgSet _cachedNodes ; ///<! List of nodes that are cached as constant expressions
85 bool _skipZeroWeights = false; ///<! Whether to skip entries with weight zero in the evaluation
86
87 RooAbsReal* _origFunc = nullptr; ///< Original function
88 RooAbsData* _origData = nullptr; ///< Original data
89 bool _optimized = false; ///<!
90 double _integrateBinsPrecision{-1.}; // Precision for finer sampling of bins.
91};
92
93#endif
94
95/// \endcond
int Int_t
Definition RtypesCore.h:45
static void indent(ostringstream &buf, int indent_level)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
char name[80]
Definition TGX11.cxx:110
Abstract container object that can hold multiple RooAbsArg objects.
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:57
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Basic string class.
Definition TString.h:139
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Definition RExports.h:167