1 //-----------------------------------------------------------------------
2 // File and Version Information:
3 // $Id: EvtDalitzPlot.cc,v 1.23 2004/12/21 19:58:42 ryd Exp $
6 // This software is part of the EvtGen package developed jointly
7 // for the BaBar and CLEO collaborations. If you use all or part
8 // of it, please give an appropriate acknowledgement.
10 // Copyright Information:
11 // Copyright (C) 1998 Caltech, UCSB
14 // Alexei Dvoretskii, Caltech, 2001-2002.
15 //-----------------------------------------------------------------------
16 #include "EvtGenBase/EvtPatches.hh"
18 // Global 3-body Dalitz decay kinematics as defined by the mass
19 // of the mother and the daughters. Spins are not considered.
24 #include "EvtGenBase/EvtPatches.hh"
25 #include "EvtGenBase/EvtDalitzPlot.hh"
26 #include "EvtGenBase/EvtTwoBodyVertex.hh"
27 #include "EvtGenBase/EvtPDL.hh"
28 #include "EvtGenBase/EvtDecayMode.hh"
30 using namespace EvtCyclic3;
33 EvtDalitzPlot::EvtDalitzPlot()
34 : _mA(0.), _mB(0.), _mC(0.), _bigM(0.),
39 EvtDalitzPlot::EvtDalitzPlot(double mA, double mB, double mC, double bigM,
40 double ldel, double rdel)
41 : _mA(mA), _mB(mB), _mC(mC), _bigM(bigM),
42 _ldel(ldel), _rdel(rdel)
47 EvtDalitzPlot::EvtDalitzPlot(const EvtDecayMode& mode, double ldel, double rdel )
49 _mA = EvtPDL::getMeanMass(EvtPDL::getId(mode.dau(A)));
50 _mB = EvtPDL::getMeanMass(EvtPDL::getId(mode.dau(B)));
51 _mC = EvtPDL::getMeanMass(EvtPDL::getId(mode.dau(C)));
52 _bigM = EvtPDL::getMeanMass(EvtPDL::getId(mode.mother()));
61 EvtDalitzPlot::EvtDalitzPlot(const EvtDalitzPlot& other)
62 : _mA(other._mA), _mB(other._mB), _mC(other._mC), _bigM(other._bigM),
63 _ldel(other._ldel), _rdel(other._rdel)
67 EvtDalitzPlot::~EvtDalitzPlot()
71 bool EvtDalitzPlot::operator==(const EvtDalitzPlot& other) const
74 if(_mA == other._mA &&
77 _bigM == other._bigM) ret = true;
83 const EvtDalitzPlot* EvtDalitzPlot::clone() const
85 return new EvtDalitzPlot(*this);
89 void EvtDalitzPlot::sanityCheck() const
91 if(_mA < 0 || _mB < 0 || _mC < 0 || _bigM <= 0 || _bigM - _mA - _mB - _mC < 0.) {
93 printf("Invalid Dalitz plot %f %f %f %f\n",_mA,_mB,_mC,_bigM);
101 double EvtDalitzPlot::m(Index i) const {
112 double EvtDalitzPlot::sum() const
114 return _mA*_mA + _mB*_mB + _mC*_mC + _bigM*_bigM;
118 double EvtDalitzPlot::qAbsMin(Pair i) const
123 return (m(j) + m(k))*(m(j) + m(k));
127 double EvtDalitzPlot::qAbsMax(Pair i) const
130 return (_bigM-m(j))*(_bigM-m(j));
134 double EvtDalitzPlot::qResAbsMin(EvtCyclic3::Pair i) const
136 return qAbsMin(i) - sum()/3.;
139 double EvtDalitzPlot::qResAbsMax(EvtCyclic3::Pair i) const
141 return qAbsMax(i) - sum()/3.;
144 double EvtDalitzPlot::qHelAbsMin(EvtCyclic3::Pair i) const
148 return (qAbsMin(j) - qAbsMax(k))/2.;
151 double EvtDalitzPlot::qHelAbsMax(EvtCyclic3::Pair i) const
155 return (qAbsMax(j) - qAbsMin(k))/2.;
159 double EvtDalitzPlot::mAbsMin(Pair i) const
161 return sqrt(qAbsMin(i));
165 double EvtDalitzPlot::mAbsMax(Pair i) const
167 return sqrt(qAbsMax(i));
173 double EvtDalitzPlot::qMin(Pair i, Pair j, double q) const
179 // Particle pair j defines the rest-frame
180 // 0 - particle common to r.f. and angle calculations
181 // 1 - particle belonging to r.f. but not angle
182 // 2 - particle not belonging to r.f.
184 Index k0 = common(i,j);
186 Index k1 = other(k0,k2);
188 // Energy, momentum of particle common to rest-frame and angle
189 EvtTwoBodyKine jpair(m(k0),m(k1),sqrt(q));
190 double pk = jpair.p();
191 double ek = jpair.e(EvtTwoBodyKine::A,EvtTwoBodyKine::AB);
194 // Energy and momentum of the other particle
195 EvtTwoBodyKine mother(sqrt(q),m(k2),bigM());
196 double ej = mother.e(EvtTwoBodyKine::B,EvtTwoBodyKine::A);
197 double pj = mother.p(EvtTwoBodyKine::A);
201 return (ek+ej)*(ek+ej) - (pk+pj)*(pk+pj);
208 double EvtDalitzPlot::qMax(Pair i, Pair j, double q) const
214 // Particle pair j defines the rest-frame
215 // 0 - particle common to r.f. and angle calculations
216 // 1 - particle belonging to r.f. but not angle
217 // 2 - particle not belonging to r.f.
219 Index k0 = common(i,j);
221 Index k1 = other(k0,k2);
223 // Energy, momentum of particle common to rest-frame and angle
224 EvtTwoBodyKine jpair(m(k0),m(k1),sqrt(q));
225 double ek = jpair.e(EvtTwoBodyKine::A,EvtTwoBodyKine::AB);
226 double pk = jpair.p();
228 // Energy and momentum of the other particle
229 EvtTwoBodyKine mother(sqrt(q),m(k2),bigM());
230 double ej = mother.e(EvtTwoBodyKine::B,EvtTwoBodyKine::A);
231 double pj = mother.p(EvtTwoBodyKine::A);
235 return (ek+ej)*(ek+ej) - (pk-pj)*(pk-pj);
240 double EvtDalitzPlot::getArea(int N, Pair i, Pair j) const
242 // Trapezoidal integral over qi. qj can be calculated.
243 // The first and the last point are zero, so they are not counted
245 double dh = (qAbsMax(i) - qAbsMin(i))/((double) N);
249 for(ii=1;ii<N;ii++) {
251 double x = qAbsMin(i) + ii*dh;
252 double dy = qMax(j,i,x) - qMin(j,i,x);
260 double EvtDalitzPlot::cosTh(EvtCyclic3::Pair i1, double q1, EvtCyclic3::Pair i2, double q2) const
262 if(i1 == i2) return 1.;
264 double qmax = qMax(i1,i2,q2);
265 double qmin = qMin(i1,i2,q2);
267 double cos = (qmax + qmin - 2*q1)/(qmax - qmin);
273 double EvtDalitzPlot::e(Index i, Pair j, double q) const
277 // i does not belong to pair j
279 return (bigM()*bigM()-q-m(i)*m(i))/2/sqrt(q);
283 // i and k make pair j
286 if(first(j) == i) k = second(j);
289 double e = (q + m(i)*m(i) - m(k)*m(k))/2/sqrt(q);
295 double EvtDalitzPlot::p(Index i, Pair j, double q) const
297 double en = e(i,j,q);
298 double p2 = en*en - m(i)*m(i);
301 printf("Bad value of p2 %f %d %d %f %f\n",p2,i,j,en,m(i));
309 double EvtDalitzPlot::q(EvtCyclic3::Pair i1, double cosTh, EvtCyclic3::Pair i2, double q2) const
311 if(i1 == i2) return q2;
313 EvtCyclic3::Index f = first(i1);
314 EvtCyclic3::Index s = second(i1);
315 return m(f)*m(f) + m(s)*m(s) + 2*e(f,i2,q2)*e(s,i2,q2) - 2*p(f,i2,q2)*p(s,i2,q2)*cosTh;
319 double EvtDalitzPlot::jacobian(EvtCyclic3::Pair i, double q) const
321 return 2*p(first(i),i,q)*p(other(i),i,q); // J(BC) = 2pA*pB = 2pA*pC
325 EvtTwoBodyVertex EvtDalitzPlot::vD(Pair iRes, double m0, int L) const
327 return EvtTwoBodyVertex(m(first(iRes)),
328 m(second(iRes)),m0,L);
332 EvtTwoBodyVertex EvtDalitzPlot::vB(Pair iRes, double m0, int L) const
334 return EvtTwoBodyVertex(m0,m(other(iRes)),bigM(),L);
338 void EvtDalitzPlot::print() const
341 printf("Mass M %f\n",bigM());
342 printf("Mass mA %f\n",_mA);
343 printf("Mass mB %f\n",_mB);
344 printf("Mass mC %f\n",_mC);
346 printf("Limits qAB %f : %f\n",qAbsMin(AB),qAbsMax(AB));
347 printf("Limits qBC %f : %f\n",qAbsMin(BC),qAbsMax(BC));
348 printf("Limits qCA %f : %f\n",qAbsMin(CA),qAbsMax(CA));
349 printf("Sum q %f\n",sum());
350 printf("Limit qsum %f : %f\n",qSumMin(),qSumMax());