1 #include "EvtGenBase/EvtPatches.hh"
2 /*******************************************************************************
3 * Project: BaBar detector at the SLAC PEP-II B-factory
5 * File: $Id: EvtIntervalFlatPdf.cc,v 1.4 2004/12/21 19:58:44 ryd Exp $
6 * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002
8 * Copyright (C) 2002 Caltech
9 *******************************************************************************/
11 #include "EvtGenBase/EvtPatches.hh"
13 #include "EvtGenBase/EvtIntervalFlatPdf.hh"
14 #include "EvtGenBase/EvtRandom.hh"
16 EvtIntervalFlatPdf::EvtIntervalFlatPdf(double min, double max)
17 : EvtPdf<EvtPoint1D>(), _min(min), _max(max)
22 EvtIntervalFlatPdf::EvtIntervalFlatPdf(const EvtIntervalFlatPdf& other)
23 : EvtPdf<EvtPoint1D>(other), _min(other._min), _max(other._max)
26 EvtIntervalFlatPdf::~EvtIntervalFlatPdf()
29 EvtPdf<EvtPoint1D>* EvtIntervalFlatPdf::clone() const
31 return new EvtIntervalFlatPdf(*this);
34 double EvtIntervalFlatPdf::pdf(const EvtPoint1D&) const
39 EvtValError EvtIntervalFlatPdf::compute_integral() const
41 return EvtValError(_max-_min,0.);
44 EvtPoint1D EvtIntervalFlatPdf::randomPoint()
46 return EvtPoint1D(_min,_max,EvtRandom::Flat(_min,_max));