CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtIntegPdf1D.cc
Go to the documentation of this file.
2/*******************************************************************************
3 * Project: BaBar detector at the SLAC PEP-II B-factory
4 * Package: EvtGenBase
5 * File: $Id: EvtIntegPdf1D.cc,v 1.1.1.2 2007/10/26 05:03:14 pingrg Exp $
6 * Author: Alexei Dvoretskii, [email protected], 2001-2002
7 *
8 * Copyright (C) 2002 Caltech
9 *******************************************************************************/
10
11#include <assert.h>
15
16EvtIntegPdf1D::EvtIntegPdf1D(double min, double max)
17 : EvtPdf<EvtPoint1D>(), _min(min), _max(max)
18{
19 assert(min <= max);
20}
21
23 : EvtPdf<EvtPoint1D>(other), _min(other._min), _max(other._max)
24{}
25
28
30{
31 double x1 = pdfIntegral(_min);
32 double x2 = pdfIntegral(_max);
33 return EvtValError(x2-x1,0.);
34}
35
36
38{
39 double itgmin = pdfIntegral(_min);
40 double itgmax = pdfIntegral(_max);
41 double itgrnd = EvtRandom::Flat(itgmin,itgmax);
42
43 return EvtPoint1D(_min,_max,pdfIntegralInverse(itgrnd));
44}
45
46
virtual EvtValError compute_integral() const
virtual double pdfIntegral(double x) const =0
virtual double pdfIntegralInverse(double x) const =0
EvtIntegPdf1D(double min, double max)
virtual ~EvtIntegPdf1D()
virtual EvtPoint1D randomPoint()
static double Flat()
Definition EvtRandom.cc:73