Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooChi2Var.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: RooChi2Var.h,v 1.12 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 
0017 #ifndef ROO_CHI2_VAR
0018 #define ROO_CHI2_VAR
0019 
0020 // We can't print deprecation warnings when including headers in cling, because
0021 // this will be done automatically anyway.
0022 #ifdef __CLING__
0023 #ifndef ROOFIT_BUILDS_ITSELF
0024 // These warnings should only be suppressed when building ROOT itself!
0025 #warning "Including RooChi2Var.h is deprecated, and this header will be removed in ROOT v6.34: Please use RooAbsReal::createChi2() to create chi-square test statistics objects"
0026 #else
0027 // If we are builting RooFit itself, this will serve as a reminder to actually
0028 // remove this deprecate public header. Here is now this needs to be done:
0029 //    1. Move this header file from inc/ to src/
0030 //    2. Remove the LinkDef entry, ClassDefOverride, and ClassImpl macros for
0031 //       this class
0032 //    3. If there are are tests using this class in the test/ directory, change
0033 //       the include to use a relative path the moved header file in the src/
0034 //       directory, e.g. #include <RemovedInterface.h> becomes #include
0035 //       "../src/RemovedInterface.h"
0036 //    4. Remove this ifndef-else-endif block from the header
0037 //    5. Remove the deprecation warning at the end of the class declaration
0038 #include <RVersion.h>
0039 #if ROOT_VERSION_CODE >= ROOT_VERSION(6, 34, 00)
0040 #error "Please remove this deprecated public interface."
0041 #endif
0042 #endif
0043 #endif
0044 
0045 #include "RooAbsOptTestStatistic.h"
0046 #include "RooCmdArg.h"
0047 #include "RooDataHist.h"
0048 #include "RooAbsPdf.h"
0049 
0050 class RooChi2Var : public RooAbsOptTestStatistic {
0051 public:
0052   enum FuncMode { Function, Pdf, ExtendedPdf } ;
0053 
0054   // Constructors, assignment etc
0055   RooChi2Var(const char *name, const char *title, RooAbsReal& func, RooDataHist& data,
0056              bool extended, RooDataHist::ErrorType etype,
0057              RooAbsTestStatistic::Configuration const& cfg=RooAbsTestStatistic::Configuration{});
0058 
0059   RooChi2Var(const RooChi2Var& other, const char* name=nullptr);
0060   TObject* clone(const char* newname) const override { return new RooChi2Var(*this,newname); }
0061 
0062   RooAbsTestStatistic* create(const char *name, const char *title, RooAbsReal& pdf, RooAbsData& dhist,
0063                                       const RooArgSet& projDeps, RooAbsTestStatistic::Configuration const& cfg) override {
0064     // Virtual constructor
0065     return new RooChi2Var(name,title,(RooAbsPdf&)pdf,(RooDataHist&)dhist,projDeps,_funcMode,cfg,_etype) ;
0066   }
0067 
0068   double defaultErrorLevel() const override {
0069     // The default error level for MINUIT error analysis for a chi^2 is 1.0
0070     return 1.0 ;
0071   }
0072 
0073 private:
0074 
0075   RooChi2Var(const char *name, const char *title, RooAbsReal& func, RooDataHist& data,
0076              const RooArgSet& projDeps, FuncMode funcMode,
0077              RooAbsTestStatistic::Configuration const& cfg,
0078              RooDataHist::ErrorType etype)
0079     : RooAbsOptTestStatistic(name,title,func,data,projDeps,cfg), _etype(etype), _funcMode(funcMode) {}
0080 
0081 protected:
0082 
0083   double evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const override ;
0084 
0085   static RooArgSet _emptySet ;        ///< Supports named argument constructor
0086 
0087   RooDataHist::ErrorType _etype ;     ///< Error type store in associated RooDataHist
0088   FuncMode _funcMode ;                ///< Function, P.d.f. or extended p.d.f?
0089 
0090   ClassDefOverride(RooChi2Var,0) // Chi^2 function of p.d.f w.r.t a binned dataset
0091 
0092 #ifndef ROOFIT_BUILDS_ITSELF
0093 } R__DEPRECATED(6,34, "Please use RooAbsReal::createChi2() to create chi-square test statistics objects.");
0094 #else
0095 };
0096 #endif
0097 
0098 
0099 #endif