#ifndef ROO_XY_CHI2_VAR
#define ROO_XY_CHI2_VAR
#include "RooAbsOptTestStatistic.h"
#include "RooCmdArg.h"
#include "RooDataSet.h"
#include "RooAbsPdf.h"
#include "RooNumIntConfig.h"
#include <list>
class RooAbsIntegrator ;
class RooXYChi2Var : public RooAbsOptTestStatistic {
public:
RooXYChi2Var() ;
RooXYChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataSet& data, Bool_t integrate=kFALSE) ;
RooXYChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataSet& data, RooRealVar& yvar, Bool_t integrate=kFALSE) ;
RooXYChi2Var(const char *name, const char* title, RooAbsPdf& extPdf, RooDataSet& data, Bool_t integrate=kFALSE) ;
RooXYChi2Var(const char *name, const char* title, RooAbsPdf& extPdf, RooDataSet& data, RooRealVar& yvar, Bool_t integrate=kFALSE) ;
RooXYChi2Var(const RooXYChi2Var& other, const char* name=0);
virtual TObject* clone(const char* newname) const { return new RooXYChi2Var(*this,newname); }
virtual RooAbsTestStatistic* create(const char *name, const char *title, RooAbsReal& pdf, RooAbsData& adata,
const RooArgSet&, const char*, const char*,Int_t, Bool_t,Bool_t, Bool_t) {
return new RooXYChi2Var(name,title,pdf,(RooDataSet&)adata) ;
}
virtual ~RooXYChi2Var();
virtual Double_t defaultErrorLevel() const {
return 1.0 ;
}
RooNumIntConfig& binIntegratorConfig() { return _intConfig ; }
const RooNumIntConfig& binIntegratorConfig() const { return _intConfig ; }
protected:
Bool_t allowFunctionCache() {
return !_integrate ;
}
RooArgSet requiredExtraObservables() const ;
Double_t fy() const ;
Bool_t _extended ;
Bool_t _integrate ;
RooRealVar* _yvar ;
RooArgSet _rrvArgs ;
TIterator* _rrvIter ;
void initialize() ;
void initIntegrator() ;
Double_t xErrorContribution(Double_t ydata) const ;
virtual Double_t evaluatePartition(Int_t firstEvent, Int_t lastEvent, Int_t stepSize) const ;
RooNumIntConfig _intConfig ;
RooAbsReal* _funcInt ;
std::list<RooAbsBinning*> _binList ;
ClassDef(RooXYChi2Var,1)
};
#endif