Warning, file /include/root/RooAbsTestStatistic.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ROO_ABS_TEST_STATISTIC
0017 #define ROO_ABS_TEST_STATISTIC
0018
0019
0020
0021 #ifdef __CLING__
0022 #ifndef ROOFIT_BUILDS_ITSELF
0023
0024 #warning "Including RooAbsTestStatistic.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
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
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 "RooAbsReal.h"
0045 #include "RooSetProxy.h"
0046 #include "RooRealProxy.h"
0047 #include "TStopwatch.h"
0048 #include "Math/Util.h"
0049
0050 #include <string>
0051 #include <vector>
0052
0053 class RooArgSet ;
0054 class RooAbsData ;
0055 class RooAbsReal ;
0056 class RooSimultaneous ;
0057 class RooRealMPFE ;
0058
0059 class RooAbsTestStatistic ;
0060 typedef RooAbsData* pRooAbsData ;
0061 typedef RooRealMPFE* pRooRealMPFE ;
0062
0063 class RooAbsTestStatistic : public RooAbsReal {
0064 friend class RooRealMPFE;
0065 public:
0066
0067 struct Configuration {
0068
0069 std::string rangeName;
0070 std::string addCoefRangeName;
0071 int nCPU = 1;
0072 RooFit::MPSplit interleave = RooFit::BulkPartition;
0073 bool verbose = true;
0074 bool splitCutRange = false;
0075 bool cloneInputData = true;
0076 double integrateOverBinsPrecision = -1.;
0077 bool binnedL = false;
0078 bool takeGlobalObservablesFromData = false;
0079 };
0080
0081
0082 RooAbsTestStatistic(const char *name, const char *title, RooAbsReal& real, RooAbsData& data,
0083 const RooArgSet& projDeps, Configuration const& cfg);
0084 RooAbsTestStatistic(const RooAbsTestStatistic& other, const char* name=nullptr);
0085 ~RooAbsTestStatistic() override;
0086 virtual RooAbsTestStatistic* create(const char *name, const char *title, RooAbsReal& real, RooAbsData& data,
0087 const RooArgSet& projDeps, Configuration const& cfg) = 0;
0088
0089 void constOptimizeTestStatistic(ConstOpCode opcode, bool doAlsoTrackingOpt=true) override ;
0090
0091 virtual double combinedValue(RooAbsReal** gofArray, Int_t nVal) const = 0 ;
0092 virtual double globalNormalization() const {
0093
0094 return 1.0 ;
0095 }
0096
0097 bool setData(RooAbsData& data, bool cloneData=true) override ;
0098
0099 void enableOffsetting(bool flag) override ;
0100 bool isOffsetting() const override { return _doOffset ; }
0101 double offset() const override { return _offset.Sum() ; }
0102 virtual double offsetCarry() const { return _offset.Carry(); }
0103
0104 enum GOFOpMode { SimMaster,MPMaster,Slave } ;
0105 GOFOpMode operMode() const {
0106
0107 return _gofOpMode ;
0108 }
0109
0110 protected:
0111
0112 void printCompactTreeHook(std::ostream& os, const char* indent="") override ;
0113
0114 bool redirectServersHook(const RooAbsCollection& newServerList, bool mustReplaceAll, bool nameChange, bool isRecursive) override ;
0115 double evaluate() const override ;
0116
0117 virtual double evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const = 0 ;
0118 virtual double getCarry() const;
0119
0120
0121 virtual void runRecalculateCache(std::size_t , std::size_t , std::size_t ) const {}
0122
0123 void setMPSet(Int_t setNum, Int_t numSets) ;
0124 void setSimCount(Int_t simCount) {
0125
0126 _simCount = simCount ;
0127 }
0128
0129 void setEventCount(Int_t nEvents) {
0130
0131 _nEvents = nEvents ;
0132 }
0133
0134 Int_t numSets() const {
0135
0136 return _numSets ;
0137 }
0138 Int_t setNum() const {
0139
0140 return _setNum ;
0141 }
0142
0143 RooSetProxy _paramSet ;
0144
0145
0146
0147 RooAbsReal* _func = nullptr;
0148 RooAbsData* _data = nullptr;
0149 const RooArgSet* _projDeps = nullptr;
0150 std::string _rangeName ;
0151 std::string _addCoefRangeName ;
0152 bool _splitRange = false;
0153 Int_t _simCount = 1;
0154 bool _verbose = false;
0155
0156 virtual bool setDataSlave(RooAbsData& , bool =true, bool =false) { return true ; }
0157
0158
0159
0160
0161 virtual bool processEmptyDataSets() const { return true ; }
0162
0163 bool initialize() ;
0164 void initSimMode(RooSimultaneous* pdf, RooAbsData* data, const RooArgSet* projDeps, std::string const& rangeName, std::string const& addCoefRangeName) ;
0165 void initMPMode(RooAbsReal* real, RooAbsData* data, const RooArgSet* projDeps, std::string const& rangeName, std::string const& addCoefRangeName) ;
0166
0167 mutable bool _init = false;
0168 GOFOpMode _gofOpMode = Slave;
0169
0170 Int_t _nEvents = 0;
0171 Int_t _setNum = 0;
0172 Int_t _numSets = 1;
0173 Int_t _extSet = 0;
0174
0175
0176 std::vector<std::unique_ptr<RooAbsTestStatistic>> _gofArray;
0177
0178
0179 Int_t _nCPU = 1;
0180 pRooRealMPFE* _mpfeArray = nullptr;
0181
0182 RooFit::MPSplit _mpinterl = RooFit::BulkPartition;
0183 bool _doOffset = false;
0184 const bool _takeGlobalObservablesFromData = false;
0185 mutable ROOT::Math::KahanSum<double> _offset {0.0};
0186 mutable double _evalCarry = 0.0;
0187
0188 ClassDefOverride(RooAbsTestStatistic,0)
0189
0190 #ifndef ROOFIT_BUILDS_ITSELF
0191 } R__DEPRECATED(6,34, "RooAbsTestStatistic is a RooFit implementation detail that should not be instantiated in user code.");
0192 #else
0193 };
0194 #endif
0195
0196 #endif