// @(#)root/roostats:$Id$
// Author: Kyle Cranmer
/*************************************************************************
 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOSTATS_BernsteinCorrection
#define ROOSTATS_BernsteinCorrection


#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif

#include "TH1F.h"
#include "RooWorkspace.h"

namespace RooStats {

   class BernsteinCorrection {

   public:
      BernsteinCorrection(double tolerance = 0.05);
      virtual ~BernsteinCorrection() {}
      
      Int_t ImportCorrectedPdf(RooWorkspace*, const char*,const char*,const char*);
      void SetMaxCorrection(Double_t maxCorr){fMaxCorrection = maxCorr;}
      void SetMaxDegree(Int_t maxDegree){fMaxDegree = maxDegree;}
      void CreateQSamplingDist(RooWorkspace* wks, 
                               const char* nominalName, 
                               const char* varName, 
                               const char* dataName,
                               TH1F*, TH1F*,
                               Int_t degree, 
                               Int_t nToys=500);
      
   private:

      Int_t    fMaxDegree;     // maximum polynomial degree correction (default is 10)
      Double_t fMaxCorrection; // maximum correction factor at any point (default is 100)
      Double_t fTolerance; // probability to add an unnecessary term
      

   protected:
      ClassDef(BernsteinCorrection,2) // A utility to add polynomial corrrection terms to a model to improve the description of data.
   };
}


#endif
 BernsteinCorrection.h:1
 BernsteinCorrection.h:2
 BernsteinCorrection.h:3
 BernsteinCorrection.h:4
 BernsteinCorrection.h:5
 BernsteinCorrection.h:6
 BernsteinCorrection.h:7
 BernsteinCorrection.h:8
 BernsteinCorrection.h:9
 BernsteinCorrection.h:10
 BernsteinCorrection.h:11
 BernsteinCorrection.h:12
 BernsteinCorrection.h:13
 BernsteinCorrection.h:14
 BernsteinCorrection.h:15
 BernsteinCorrection.h:16
 BernsteinCorrection.h:17
 BernsteinCorrection.h:18
 BernsteinCorrection.h:19
 BernsteinCorrection.h:20
 BernsteinCorrection.h:21
 BernsteinCorrection.h:22
 BernsteinCorrection.h:23
 BernsteinCorrection.h:24
 BernsteinCorrection.h:25
 BernsteinCorrection.h:26
 BernsteinCorrection.h:27
 BernsteinCorrection.h:28
 BernsteinCorrection.h:29
 BernsteinCorrection.h:30
 BernsteinCorrection.h:31
 BernsteinCorrection.h:32
 BernsteinCorrection.h:33
 BernsteinCorrection.h:34
 BernsteinCorrection.h:35
 BernsteinCorrection.h:36
 BernsteinCorrection.h:37
 BernsteinCorrection.h:38
 BernsteinCorrection.h:39
 BernsteinCorrection.h:40
 BernsteinCorrection.h:41
 BernsteinCorrection.h:42
 BernsteinCorrection.h:43
 BernsteinCorrection.h:44
 BernsteinCorrection.h:45
 BernsteinCorrection.h:46
 BernsteinCorrection.h:47
 BernsteinCorrection.h:48
 BernsteinCorrection.h:49
 BernsteinCorrection.h:50
 BernsteinCorrection.h:51
 BernsteinCorrection.h:52
 BernsteinCorrection.h:53
 BernsteinCorrection.h:54