CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDalitzResPdf.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: EvtDalitzResPdf.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 <stdio.h>
12#include <math.h>
18using namespace EvtCyclic3;
19
21 double _m0, double _g0, EvtCyclic3::Pair pair)
23 _dp(dp), _m0(_m0), _g0(_g0), _pair(pair)
24{}
25
26
29 _dp(other._dp),_m0(other._m0), _g0(other._g0), _pair(other._pair)
30{}
31
32
34{}
35
37{
38 assert(N != 0);
39
40 EvtCyclic3::Pair i = _pair;
42
43 // Trapezoidal integral
44
45 double dh = (_dp.qAbsMax(j) - _dp.qAbsMin(j))/((double) N);
46 double sum = 0;
47
48 int ii;
49 for(ii=1;ii<N;ii++) {
50
51 double x = _dp.qAbsMin(j) + ii*dh;
52 double min = (_dp.qMin(i,j,x) - _m0*_m0)/_m0/_g0;
53 double max = (_dp.qMax(i,j,x) - _m0*_m0)/_m0/_g0;
54 double itg = 1/EvtConst::pi*(atan(max) - atan(min));
55 sum += itg;
56 }
57 EvtValError ret(sum*dh,0.);
58
59 return ret;
60}
61
62
64{
65 // Random point generation must be done in a box encompassing the
66 // Dalitz plot
67
68
69 EvtCyclic3::Pair i = _pair;
71 double min = 1/EvtConst::pi*atan((_dp.qAbsMin(i) - _m0*_m0)/_m0/_g0);
72 double max = 1/EvtConst::pi*atan((_dp.qAbsMax(i) - _m0*_m0)/_m0/_g0);
73
74 int n = 0;
75 while(n++ < 1000) {
76
77 double qj = EvtRandom::Flat(_dp.qAbsMin(j),_dp.qAbsMax(j));
78 double r = EvtRandom::Flat(min,max);
79 double qi = tan(EvtConst::pi*r)*_g0*_m0 + _m0*_m0;
80 EvtDalitzCoord x(i,qi,j,qj);
81 EvtDalitzPoint ret(_dp,x);
82 if(ret.isValid()) return ret;
83 }
84
85 // All generated points turned out to be outside of the Dalitz plot
86 // (in the outer box)
87
88 printf("No point generated for dalitz plot after 1000 tries\n");
89 assert(0);
90}
91
92
94{
95 EvtCyclic3::Pair i = _pair;
96 double dq = x.q(i) - _m0*_m0;
97 return 1/EvtConst::pi*_g0*_m0/(dq*dq + _g0*_g0*_m0*_m0);
98}
99
100
102{
103 return 1/(EvtConst::pi*_g0*_m0);
104}
105
double tan(const BesAngle a)
Definition: BesAngle.h:216
const Int_t n
Double_t x[10]
static const double pi
Definition: EvtConst.hh:28
double qAbsMin(EvtCyclic3::Pair i) const
double qMin(EvtCyclic3::Pair i, EvtCyclic3::Pair j, double q) const
double qAbsMax(EvtCyclic3::Pair i) const
double qMax(EvtCyclic3::Pair i, EvtCyclic3::Pair j, double q) const
bool isValid() const
EvtDalitzResPdf(const EvtDalitzPlot &dp, double m0, double g0, EvtCyclic3::Pair pairRes)
double pdfMaxValue() const
virtual double pdf(const EvtDalitzPoint &) const
virtual ~EvtDalitzResPdf()
virtual EvtDalitzPoint randomPoint()
Definition: EvtPdf.hh:57
virtual EvtValError compute_integral() const
Definition: EvtPdf.hh:92
static double Flat()
Definition: EvtRandom.cc:73
Index next(Index i)
Definition: EvtCyclic3.cc:107
Index other(Index i, Index j)
Definition: EvtCyclic3.cc:118