/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitModels                                                     *
 *    File: $Id: RooCBShape.h,v 1.11 2007/07/12 20:30:49 wouter Exp $
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.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_CB_SHAPE
#define ROO_CB_SHAPE

#include "RooAbsPdf.h"
#include "RooRealProxy.h"

class RooRealVar;

class RooCBShape : public RooAbsPdf {
public:
  RooCBShape() {} ;
  RooCBShape(const char *name, const char *title, RooAbsReal& _m,
	     RooAbsReal& _m0, RooAbsReal& _sigma,
	     RooAbsReal& _alpha, RooAbsReal& _n);

  RooCBShape(const RooCBShape& other, const char* name = 0);
  virtual TObject* clone(const char* newname) const { return new RooCBShape(*this,newname); }

  inline virtual ~RooCBShape() { }

  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;

  // Optimized accept/reject generator support
  virtual Int_t getMaxVal(const RooArgSet& vars) const ;
  virtual Double_t maxVal(Int_t code) const ;

protected:

  Double_t ApproxErf(Double_t arg) const ;

  RooRealProxy m;
  RooRealProxy m0;
  RooRealProxy sigma;
  RooRealProxy alpha;
  RooRealProxy n;

  Double_t evaluate() const;

private:

  ClassDef(RooCBShape,1) // Crystal Ball lineshape PDF
};

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