#ifndef ROO_KEYS
#define ROO_KEYS
#include "RooAbsPdf.h"
#include "RooRealProxy.h"
class RooRealVar;
class RooKeysPdf : public RooAbsPdf {
public:
enum Mirror { NoMirror, MirrorLeft, MirrorRight, MirrorBoth,
MirrorAsymLeft, MirrorAsymLeftRight,
MirrorAsymRight, MirrorLeftAsymRight,
MirrorAsymBoth };
RooKeysPdf() ;
RooKeysPdf(const char *name, const char *title,
RooAbsReal& x, RooDataSet& data, Mirror mirror= NoMirror,
Double_t rho=1);
RooKeysPdf(const char *name, const char *title,
RooAbsReal& x, RooRealVar& xdata, RooDataSet& data, Mirror mirror= NoMirror,
Double_t rho=1);
RooKeysPdf(const RooKeysPdf& other, const char* name=0);
virtual TObject* clone(const char* newname) const {return new RooKeysPdf(*this,newname); }
virtual ~RooKeysPdf();
virtual Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars,
const char* rangeName = 0) const;
virtual Double_t analyticalIntegral(Int_t code, const char* rangeName = 0) const;
virtual Int_t getMaxVal(const RooArgSet& vars) const;
virtual Double_t maxVal(Int_t code) const;
void LoadDataSet( RooDataSet& data);
protected:
RooRealProxy _x ;
Double_t evaluate() const;
private:
static const Double_t _nSigma;
Int_t _nEvents;
Double_t *_dataPts;
Double_t *_dataWgts;
Double_t *_weights;
Double_t _sumWgt ;
enum { _nPoints = 1000 };
Double_t _lookupTable[_nPoints+1];
Double_t g(Double_t x,Double_t sigma) const;
Bool_t _mirrorLeft, _mirrorRight;
Bool_t _asymLeft, _asymRight;
Char_t _varName[128];
Double_t _lo, _hi, _binWidth;
Double_t _rho;
ClassDef(RooKeysPdf,2)
};
#endif