Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/RooXYChi2Var.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$
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_XY_CHI2_VAR
0018 #define ROO_XY_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 RooXYChi2Var.h is deprecated, and this header will be removed in ROOT v6.34: please use RooAbsReal::createChi2(RooAbsData &, ...) to create chi-square test statistics objects on X-Y data"
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 "RooDataSet.h"
0047 #include "RooAbsPdf.h"
0048 #include "RooNumIntConfig.h"
0049 #include <list>
0050 class RooAbsIntegrator ;
0051 
0052 
0053 class RooXYChi2Var : public RooAbsOptTestStatistic {
0054 public:
0055 
0056   // Constructors, assignment etc
0057   RooXYChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataSet& data, bool integrate=false) ;
0058   RooXYChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataSet& data, RooRealVar& yvar, bool integrate=false) ;
0059   /// \cond ROOFIT_INTERNAL
0060   // For internal use in RooAbsReal::createChi2().
0061   RooXYChi2Var(const char *name, const char *title, RooAbsReal& func, RooAbsData& data, RooRealVar *yvar, bool integrate,
0062                RooAbsTestStatistic::Configuration const& cfg);
0063   /// \endcond ROOFIT_INTERNAL
0064 
0065   RooXYChi2Var(const RooXYChi2Var& other, const char* name=nullptr);
0066   TObject* clone(const char* newname) const override { return new RooXYChi2Var(*this,newname); }
0067 
0068   RooAbsTestStatistic* create(const char *name, const char *title, RooAbsReal& pdf, RooAbsData& adata,
0069                                       const RooArgSet&, RooAbsTestStatistic::Configuration const&) override {
0070     // Virtual constructor
0071     return new RooXYChi2Var(name,title,pdf,(RooDataSet&)adata) ;
0072   }
0073 
0074   ~RooXYChi2Var() override;
0075 
0076   double defaultErrorLevel() const override {
0077     // The default error level for MINUIT error analysis for a chi^2 is 1.0
0078     return 1.0 ;
0079   }
0080 
0081   RooNumIntConfig& binIntegratorConfig() { return _intConfig ; }
0082   const RooNumIntConfig& binIntegratorConfig() const { return _intConfig ; }
0083 
0084 protected:
0085 
0086   bool allowFunctionCache() override {
0087     // Disable function (component) caching if integration is requested as the function
0088     // will be evaluated at coordinates other than the points in the dataset
0089     return !_integrate ;
0090   }
0091 
0092   RooArgSet requiredExtraObservables() const override ;
0093 
0094   double fy() const ;
0095 
0096   bool _extended ; ///< Is the input function and extended p.d.f.
0097   bool _integrate ; ///< Is integration over the bin volume requested
0098 
0099   RooRealVar* _yvar ; ///< Y variable if so designated
0100   RooArgSet _rrvArgs ; ///< Set of real-valued observables
0101 
0102   void initialize() ;
0103   void initIntegrator() ;
0104   double xErrorContribution(double ydata) const ;
0105 
0106   double evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const override ;
0107 
0108   RooNumIntConfig   _intConfig ; ///< Numeric integrator configuration for integration of function over bin
0109   std::unique_ptr<RooAbsReal>    _funcInt; ///<! Function integral
0110   std::list<RooAbsBinning*> _binList ; ///<! Bin ranges
0111 
0112   ClassDefOverride(RooXYChi2Var,0) // Chi^2 function of p.d.f w.r.t a unbinned dataset with X and Y values
0113 
0114 #ifndef ROOFIT_BUILDS_ITSELF
0115 } R__DEPRECATED(6,34, "Please use RooAbsReal::createChi2(RooAbsData &, ...) to create chi-square test statistics objects on X-Y data");
0116 #else
0117 };
0118 #endif
0119 
0120 
0121 #endif