00001 /******************************************************************************* 00002 * Project: BaBar detector at the SLAC PEP-II B-factory 00003 * Package: EvtGenBase 00004 * File: $Id: EvtIntervalFlatPdf.hh,v 1.1.1.2 2007/10/26 05:03:14 pingrg Exp $ 00005 * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 00006 * 00007 * Copyright (C) 2002 Caltech 00008 *******************************************************************************/ 00009 00010 /* 00011 * Uniform PDF defined on a 1D interval. 00012 */ 00013 00014 #ifndef EVT_INTERVAL_FLAT_PDF_HH 00015 #define EVT_INTERVAL_FLAT_PDF_HH 00016 00017 #include <assert.h> 00018 #include "EvtGenBase/EvtPdf.hh" 00019 #include "EvtGenBase/EvtPoint1D.hh" 00020 00021 class EvtIntervalFlatPdf : public EvtPdf<EvtPoint1D> { 00022 public: 00023 00024 EvtIntervalFlatPdf(double min, double max); 00025 EvtIntervalFlatPdf(const EvtIntervalFlatPdf& other); 00026 virtual ~EvtIntervalFlatPdf(); 00027 virtual EvtPdf<EvtPoint1D>* clone() const; 00028 00029 virtual EvtValError compute_integral() const; 00030 virtual EvtPoint1D randomPoint(); 00031 00032 protected: 00033 00034 virtual double pdf(const EvtPoint1D&) const; 00035 00036 double _min; 00037 double _max; 00038 }; 00039 00040 #endif