ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitModels                                                     *
 *    File: $Id: RooKeysPdf.h,v 1.10 2007/05/11 09:13:07 verkerke Exp $
 * Authors:                                                                  *
 *   GR, Gerhard Raven,   UC San Diego,        raven@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/
#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 RooKeysPdf& other, const char* name=0);
  virtual TObject* clone(const char* newname) const {return new RooKeysPdf(*this,newname); }
  virtual ~RooKeysPdf();
  
  void LoadDataSet( RooDataSet& data);

protected:
  
  RooRealProxy _x ;
  Double_t evaluate() const;

private:
  
  Double_t evaluateFull(Double_t x) const;

  Int_t _nEvents;
  Double_t *_dataPts; //[_nEvents]
  Double_t *_weights; //[_nEvents]
  
  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;

  // cached info on variable
  Char_t _varName[128];
  Double_t _lo, _hi, _binWidth;
  Double_t _rho;
  
  ClassDef(RooKeysPdf,1) // One-dimensional non-parametric kernel estimation p.d.f.
};

#endif
 RooKeysPdf.h:1
 RooKeysPdf.h:2
 RooKeysPdf.h:3
 RooKeysPdf.h:4
 RooKeysPdf.h:5
 RooKeysPdf.h:6
 RooKeysPdf.h:7
 RooKeysPdf.h:8
 RooKeysPdf.h:9
 RooKeysPdf.h:10
 RooKeysPdf.h:11
 RooKeysPdf.h:12
 RooKeysPdf.h:13
 RooKeysPdf.h:14
 RooKeysPdf.h:15
 RooKeysPdf.h:16
 RooKeysPdf.h:17
 RooKeysPdf.h:18
 RooKeysPdf.h:19
 RooKeysPdf.h:20
 RooKeysPdf.h:21
 RooKeysPdf.h:22
 RooKeysPdf.h:23
 RooKeysPdf.h:24
 RooKeysPdf.h:25
 RooKeysPdf.h:26
 RooKeysPdf.h:27
 RooKeysPdf.h:28
 RooKeysPdf.h:29
 RooKeysPdf.h:30
 RooKeysPdf.h:31
 RooKeysPdf.h:32
 RooKeysPdf.h:33
 RooKeysPdf.h:34
 RooKeysPdf.h:35
 RooKeysPdf.h:36
 RooKeysPdf.h:37
 RooKeysPdf.h:38
 RooKeysPdf.h:39
 RooKeysPdf.h:40
 RooKeysPdf.h:41
 RooKeysPdf.h:42
 RooKeysPdf.h:43
 RooKeysPdf.h:44
 RooKeysPdf.h:45
 RooKeysPdf.h:46
 RooKeysPdf.h:47
 RooKeysPdf.h:48
 RooKeysPdf.h:49
 RooKeysPdf.h:50
 RooKeysPdf.h:51
 RooKeysPdf.h:52
 RooKeysPdf.h:53
 RooKeysPdf.h:54
 RooKeysPdf.h:55
 RooKeysPdf.h:56
 RooKeysPdf.h:57
 RooKeysPdf.h:58
 RooKeysPdf.h:59
 RooKeysPdf.h:60
 RooKeysPdf.h:61
 RooKeysPdf.h:62
 RooKeysPdf.h:63
 RooKeysPdf.h:64
 RooKeysPdf.h:65
 RooKeysPdf.h:66
 RooKeysPdf.h:67
 RooKeysPdf.h:68
 RooKeysPdf.h:69
 RooKeysPdf.h:70