BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDalitzFlatPdf.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: EvtDalitzFlatPdf.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 "
EvtDalitzFlatPdf.hh
"
12
#include "
EvtPatches.hh
"
13
#include <cstdlib>
14
15
EvtDalitzFlatPdf::EvtDalitzFlatPdf
(
const
EvtDalitzPlot
& dp )
16
:
EvtPdf
<
EvtDalitzPoint
>(),
_dp
( dp ) {}
17
18
EvtDalitzFlatPdf::EvtDalitzFlatPdf
(
const
EvtDalitzFlatPdf
& other )
19
:
EvtPdf
<
EvtDalitzPoint
>( other ),
_dp
( other.
_dp
) {}
20
21
EvtDalitzFlatPdf::~EvtDalitzFlatPdf
() {}
22
23
EvtPdf<EvtDalitzPoint>
*
EvtDalitzFlatPdf::clone
()
const
{
24
return
new
EvtDalitzFlatPdf
( *
this
);
25
}
26
27
double
EvtDalitzFlatPdf::pdf
(
const
EvtDalitzPoint
& )
const
{
return
1.; }
28
29
EvtValError
EvtDalitzFlatPdf::compute_integral
(
int
N )
const
{
30
return
EvtValError
(
_dp
.getArea( N ), 0. );
31
}
32
33
EvtDalitzPoint
EvtDalitzFlatPdf::randomPoint
() {
34
// To obtain a uniform distribution generate
35
// in terms of q's. Generate in a box that circumscribes the
36
// Dalitz plot. Accept points inside. If there are two
37
// many unsuccessful attempts it's a hint that the Dalitz plot
38
// area is tiny compared to the box. It's a pathological
39
// case. Abort.
40
41
EvtCyclic3::Pair
pair1 =
EvtCyclic3::BC
;
42
EvtCyclic3::Pair
pair2 =
EvtCyclic3::CA
;
43
44
int
n
= 0;
45
int
maxTries = 1000;
46
while
(
n
++ < maxTries )
47
{
48
49
double
q1 =
EvtRandom::Flat
(
_dp
.qAbsMin( pair1 ),
_dp
.qAbsMax( pair2 ) );
50
double
q2 =
EvtRandom::Flat
(
_dp
.qAbsMin( pair2 ),
_dp
.qAbsMax( pair2 ) );
51
52
EvtDalitzCoord
point( pair1, q1, pair2, q2 );
53
EvtDalitzPoint
x
(
_dp
, point );
54
55
if
( x.isValid() )
return
x;
56
}
57
58
printf(
"No point generated for dalitz plot after %d tries\n"
, maxTries );
59
abort();
60
}
n
const Int_t n
Definition
DataBase/tau_mode.c:57
x
Double_t x[10]
Definition
DataBase/tau_mode.c:49
EvtDalitzFlatPdf.hh
EvtPatches.hh
EvtDalitzCoord
Definition
EvtDalitzCoord.hh:19
EvtDalitzFlatPdf::EvtDalitzFlatPdf
EvtDalitzFlatPdf(const EvtDalitzPlot &dp)
Definition
EvtDalitzFlatPdf.cc:15
EvtDalitzFlatPdf::_dp
EvtDalitzPlot _dp
Definition
EvtDalitzFlatPdf.hh:35
EvtDalitzFlatPdf::pdf
virtual double pdf(const EvtDalitzPoint &) const
Definition
EvtDalitzFlatPdf.cc:27
EvtDalitzFlatPdf::randomPoint
virtual EvtDalitzPoint randomPoint()
Definition
EvtDalitzFlatPdf.cc:33
EvtDalitzFlatPdf::~EvtDalitzFlatPdf
virtual ~EvtDalitzFlatPdf()
Definition
EvtDalitzFlatPdf.cc:21
EvtDalitzFlatPdf::clone
virtual EvtPdf< EvtDalitzPoint > * clone() const
Definition
EvtDalitzFlatPdf.cc:23
EvtDalitzPlot
Definition
EvtDalitzPlot.hh:25
EvtDalitzPoint
Definition
EvtDalitzPoint.hh:27
EvtPdf< EvtDalitzPoint >::compute_integral
virtual EvtValError compute_integral() const
Definition
EvtPdf.hh:91
EvtPdf< EvtDalitzPoint >::EvtPdf
EvtPdf()
Definition
EvtPdf.hh:59
EvtRandom::Flat
static double Flat()
Definition
EvtRandom.cc:69
EvtValError
Definition
EvtValError.hh:20
EvtCyclic3::Pair
Pair
Definition
EvtCyclic3.hh:20
EvtCyclic3::BC
@ BC
Definition
EvtCyclic3.hh:20
EvtCyclic3::CA
@ CA
Definition
EvtCyclic3.hh:20
8.0.0
BOSS_Gen
BesEvtGen
src
EvtGen
EvtGenBase
EvtDalitzFlatPdf.cc
Generated by
1.16.1