RooXYChi2Var.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooXYChi2Var.h 28259 2009-04-16 16:21:16Z wouter $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00015  *****************************************************************************/
00016 
00017 #ifndef ROO_XY_CHI2_VAR
00018 #define ROO_XY_CHI2_VAR
00019 
00020 #include "RooAbsOptTestStatistic.h"
00021 #include "RooCmdArg.h"
00022 #include "RooDataSet.h"
00023 #include "RooAbsPdf.h"
00024 #include "RooNumIntConfig.h"
00025 #include <list>
00026 class RooAbsIntegrator ;
00027 
00028 
00029 class RooXYChi2Var : public RooAbsOptTestStatistic {
00030 public:
00031 
00032   // Constructors, assignment etc
00033   RooXYChi2Var() ;
00034   RooXYChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataSet& data, Bool_t integrate=kFALSE) ;
00035   RooXYChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataSet& data, RooRealVar& yvar, Bool_t integrate=kFALSE) ;
00036   RooXYChi2Var(const char *name, const char* title, RooAbsPdf& extPdf, RooDataSet& data, Bool_t integrate=kFALSE) ;
00037   RooXYChi2Var(const char *name, const char* title, RooAbsPdf& extPdf, RooDataSet& data, RooRealVar& yvar, Bool_t integrate=kFALSE) ;
00038   
00039   RooXYChi2Var(const RooXYChi2Var& other, const char* name=0);
00040   virtual TObject* clone(const char* newname) const { return new RooXYChi2Var(*this,newname); }
00041 
00042   virtual RooAbsTestStatistic* create(const char *name, const char *title, RooAbsReal& pdf, RooAbsData& adata,
00043                                       const RooArgSet&, const char*, const char*,Int_t, Bool_t,Bool_t, Bool_t) {
00044     // Virtual constructor
00045     return new RooXYChi2Var(name,title,pdf,(RooDataSet&)adata) ;
00046   }
00047   
00048   virtual ~RooXYChi2Var();
00049 
00050   virtual Double_t defaultErrorLevel() const { 
00051     // The default error level for MINUIT error analysis for a chi^2 is 1.0
00052     return 1.0 ; 
00053   }
00054 
00055   RooNumIntConfig& binIntegratorConfig() { return _intConfig ; }
00056   const RooNumIntConfig& binIntegratorConfig() const { return _intConfig ; }
00057 
00058 protected:
00059 
00060   Bool_t allowFunctionCache() { 
00061     // Disable function (component) caching if integration is requested as the function
00062     // will be evaluated at coordinates other than the points in the dataset
00063     return !_integrate ; 
00064   }
00065 
00066   RooArgSet requiredExtraObservables() const ;
00067 
00068   Double_t fy() const ; 
00069 
00070   Bool_t _extended ; // Is the input function and extended p.d.f.
00071   Bool_t _integrate ; // Is integration over the bin volume requested
00072  
00073   RooRealVar* _yvar ; // Y variable if so designated
00074   RooArgSet _rrvArgs ; // Set of real-valued observables
00075   TIterator* _rrvIter ; //! Iterator over set of real-valued observables
00076 
00077   void initialize() ;
00078   void initIntegrator() ;
00079   Double_t xErrorContribution(Double_t ydata) const ;
00080 
00081   virtual Double_t evaluatePartition(Int_t firstEvent, Int_t lastEvent, Int_t stepSize) const ;
00082 
00083   RooNumIntConfig   _intConfig ; // Numeric integrator configuration for integration of function over bin
00084   RooAbsReal*       _funcInt ; //! Function integral
00085   std::list<RooAbsBinning*> _binList ; //! Bin ranges
00086   
00087   ClassDef(RooXYChi2Var,1) // Chi^2 function of p.d.f w.r.t a unbinned dataset with X and Y values
00088 };
00089 
00090 
00091 #endif

Generated on Tue Jul 5 14:26:29 2011 for ROOT_528-00b_version by  doxygen 1.5.1