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
16
EvtIntegPdf1D::EvtIntegPdf1D
(
double
min
,
double
max
)
17
:
EvtPdf
<
EvtPoint1D
>(),
_min
(
min
),
_max
(
max
) {
18
assert(
min
<=
max
);
19
}
20
21
EvtIntegPdf1D::EvtIntegPdf1D
(
const
EvtIntegPdf1D
& other )
22
:
EvtPdf
<
EvtPoint1D
>( other ),
_min
( other.
_min
),
_max
( other.
_max
) {}
23
24
EvtIntegPdf1D::~EvtIntegPdf1D
() {}
25
26
EvtValError
EvtIntegPdf1D::compute_integral
()
const
{
27
double
x1 =
pdfIntegral
(
_min
);
28
double
x2 =
pdfIntegral
(
_max
);
29
return
EvtValError
( x2 - x1, 0. );
30
}
31
32
EvtPoint1D
EvtIntegPdf1D::randomPoint
() {
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
}
min
#define min(a, b)
Definition
Eepipi/src/ee2eepp/basesv5.1/f2c.h:157
max
#define max(a, b)
Definition
Eepipi/src/ee2eepp/basesv5.1/f2c.h:158
EvtIntegPdf1D.hh
EvtMacros.hh
EvtPatches.hh
EvtIntegPdf1D::compute_integral
virtual EvtValError compute_integral() const
Definition
EvtIntegPdf1D.cc:26
EvtIntegPdf1D::pdfIntegral
virtual double pdfIntegral(double x) const =0
EvtIntegPdf1D::pdfIntegralInverse
virtual double pdfIntegralInverse(double x) const =0
EvtIntegPdf1D::EvtIntegPdf1D
EvtIntegPdf1D(double min, double max)
Definition
EvtIntegPdf1D.cc:16
EvtIntegPdf1D::_max
double _max
Definition
EvtIntegPdf1D.hh:35
EvtIntegPdf1D::~EvtIntegPdf1D
virtual ~EvtIntegPdf1D()
Definition
EvtIntegPdf1D.cc:24
EvtIntegPdf1D::_min
double _min
Definition
EvtIntegPdf1D.hh:34
EvtIntegPdf1D::randomPoint
virtual EvtPoint1D randomPoint()
Definition
EvtIntegPdf1D.cc:32
EvtPdf< EvtPoint1D >::EvtPdf
EvtPdf()
Definition
EvtPdf.hh:59
EvtPoint1D
Definition
EvtPoint1D.hh:16
EvtRandom::Flat
static double Flat()
Definition
EvtRandom.cc:69
EvtValError
Definition
EvtValError.hh:20
8.0.0
BOSS_Gen
BesEvtGen
src
EvtGen
EvtGenBase
EvtIntegPdf1D.cc
Generated by
1.16.1