BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtIntegPdf1D.cc
Go to the documentation of this file.
1#include "EvtPatches.hh"
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, dvoretsk@slac.stanford.edu, 2001-2002
7 *
8 * Copyright (C) 2002 Caltech
9 *******************************************************************************/
10
11#include "EvtIntegPdf1D.hh"
12#include "EvtMacros.hh"
13#include "EvtPatches.hh"
14#include <assert.h>
15
17 : EvtPdf<EvtPoint1D>(), _min( min ), _max( max ) {
18 assert( min <= max );
19}
20
22 : EvtPdf<EvtPoint1D>( other ), _min( other._min ), _max( other._max ) {}
23
25
27 double x1 = pdfIntegral( _min );
28 double x2 = pdfIntegral( _max );
29 return EvtValError( x2 - x1, 0. );
30}
31
33 double itgmin = pdfIntegral( _min );
34 double itgmax = pdfIntegral( _max );
35 double itgrnd = EvtRandom::Flat( itgmin, itgmax );
36
37 return EvtPoint1D( _min, _max, pdfIntegralInverse( itgrnd ) );
38}
#define min(a, b)
#define max(a, b)
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:69