BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDalitzPlot.cc
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// File and Version Information:
3// $Id: EvtDalitzPlot.cc,v 1.1.1.2 2007/10/26 05:03:14 pingrg Exp $
4//
5// Environment:
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.
9//
10// Copyright Information:
11// Copyright (C) 1998 Caltech, UCSB
12//
13// Module creator:
14// Alexei Dvoretskii, Caltech, 2001-2002.
15//-----------------------------------------------------------------------
16#include "EvtPatches.hh"
17
18// Global 3-body Dalitz decay kinematics as defined by the mass
19// of the mother and the daughters. Spins are not considered.
20
21#include "EvtDalitzPlot.hh"
22#include "EvtDecayMode.hh"
23#include "EvtPDL.hh"
24#include "EvtPatches.hh"
25#include "EvtTwoBodyVertex.hh"
26#include <assert.h>
27#include <math.h>
28#include <stdio.h>
29
30using namespace EvtCyclic3;
31
33 : _mA( 0. ), _mB( 0. ), _mC( 0. ), _bigM( 0. ), _ldel( 0. ), _rdel( 0. ) {}
34
35EvtDalitzPlot::EvtDalitzPlot( double mA, double mB, double mC, double bigM, double ldel,
36 double rdel )
37 : _mA( mA ), _mB( mB ), _mC( mC ), _bigM( bigM ), _ldel( ldel ), _rdel( rdel ) {
39}
40
41EvtDalitzPlot::EvtDalitzPlot( const EvtDecayMode& mode, double ldel, double rdel ) {
46
47 _ldel = ldel;
48 _rdel = rdel;
49
51}
52
60
62
64 bool ret = false;
65 if ( _mA == other._mA && _mB == other._mB && _mC == other._mC && _bigM == other._bigM )
66 ret = true;
67
68 return ret;
69}
70
71const EvtDalitzPlot* EvtDalitzPlot::clone() const { return new EvtDalitzPlot( *this ); }
72
74 if ( _mA < 0 || _mB < 0 || _mC < 0 || _bigM <= 0 || _bigM - _mA - _mB - _mC < 0. )
75 {
76
77 printf( "Invalid Dalitz plot %f %f %f %f\n", _mA, _mB, _mC, _bigM );
78 assert( 0 );
79 }
80 assert( _ldel <= 0. );
81 assert( _rdel >= 0. );
82}
83
84double EvtDalitzPlot::m( Index i ) const {
85
86 double m = _mA;
87 if ( i == B ) m = _mB;
88 else if ( i == C ) m = _mC;
89
90 return m;
91}
92
93double EvtDalitzPlot::sum() const { return _mA * _mA + _mB * _mB + _mC * _mC + _bigM * _bigM; }
94
95double EvtDalitzPlot::qAbsMin( Pair i ) const {
96 Index j = first( i );
97 Index k = second( i );
98
99 return ( m( j ) + m( k ) ) * ( m( j ) + m( k ) );
100}
101
102double EvtDalitzPlot::qAbsMax( Pair i ) const {
103 Index j = other( i );
104 return ( _bigM - m( j ) ) * ( _bigM - m( j ) );
105}
106
108 return qAbsMin( i ) - sum() / 3.;
109}
110
112 return qAbsMax( i ) - sum() / 3.;
113}
114
116 Pair j = next( i );
117 Pair k = prev( i );
118 return ( qAbsMin( j ) - qAbsMax( k ) ) / 2.;
119}
120
122 Pair j = next( i );
123 Pair k = prev( i );
124 return ( qAbsMax( j ) - qAbsMin( k ) ) / 2.;
125}
126
127double EvtDalitzPlot::mAbsMin( Pair i ) const { return sqrt( qAbsMin( i ) ); }
128
129double EvtDalitzPlot::mAbsMax( Pair i ) const { return sqrt( qAbsMax( i ) ); }
130
131// parallel
132
133double EvtDalitzPlot::qMin( Pair i, Pair j, double q ) const {
134 if ( i == j ) return q;
135
136 else
137 {
138
139 // Particle pair j defines the rest-frame
140 // 0 - particle common to r.f. and angle calculations
141 // 1 - particle belonging to r.f. but not angle
142 // 2 - particle not belonging to r.f.
143
144 Index k0 = common( i, j );
145 Index k2 = other( j );
146 Index k1 = other( k0, k2 );
147
148 // Energy, momentum of particle common to rest-frame and angle
149 EvtTwoBodyKine jpair( m( k0 ), m( k1 ), sqrt( q ) );
150 double pk = jpair.p();
151 double ek = jpair.e( EvtTwoBodyKine::A, EvtTwoBodyKine::AB );
152
153 // Energy and momentum of the other particle
154 EvtTwoBodyKine mother( sqrt( q ), m( k2 ), bigM() );
155 double ej = mother.e( EvtTwoBodyKine::B, EvtTwoBodyKine::A );
156 double pj = mother.p( EvtTwoBodyKine::A );
157
158 // See PDG 34.4.3.1
159 return ( ek + ej ) * ( ek + ej ) - ( pk + pj ) * ( pk + pj );
160 }
161}
162
163// antiparallel
164
165double EvtDalitzPlot::qMax( Pair i, Pair j, double q ) const {
166
167 if ( i == j ) return q;
168 else
169 {
170
171 // Particle pair j defines the rest-frame
172 // 0 - particle common to r.f. and angle calculations
173 // 1 - particle belonging to r.f. but not angle
174 // 2 - particle not belonging to r.f.
175
176 Index k0 = common( i, j );
177 Index k2 = other( j );
178 Index k1 = other( k0, k2 );
179
180 // Energy, momentum of particle common to rest-frame and angle
181 EvtTwoBodyKine jpair( m( k0 ), m( k1 ), sqrt( q ) );
182 double ek = jpair.e( EvtTwoBodyKine::A, EvtTwoBodyKine::AB );
183 double pk = jpair.p();
184
185 // Energy and momentum of the other particle
186 EvtTwoBodyKine mother( sqrt( q ), m( k2 ), bigM() );
187 double ej = mother.e( EvtTwoBodyKine::B, EvtTwoBodyKine::A );
188 double pj = mother.p( EvtTwoBodyKine::A );
189
190 // See PDG 34.4.3.1
191 return ( ek + ej ) * ( ek + ej ) - ( pk - pj ) * ( pk - pj );
192 }
193}
194
195double EvtDalitzPlot::getArea( int N, Pair i, Pair j ) const {
196 // Trapezoidal integral over qi. qj can be calculated.
197 // The first and the last point are zero, so they are not counted
198
199 double dh = ( qAbsMax( i ) - qAbsMin( i ) ) / ( (double)N );
200 double sum = 0;
201
202 int ii;
203 for ( ii = 1; ii < N; ii++ )
204 {
205
206 double x = qAbsMin( i ) + ii * dh;
207 double dy = qMax( j, i, x ) - qMin( j, i, x );
208 sum += dy;
209 }
210
211 return sum * dh;
212}
213
215 double q2 ) const {
216 if ( i1 == i2 ) return 1.;
217
218 double qmax = qMax( i1, i2, q2 );
219 double qmin = qMin( i1, i2, q2 );
220
221 double cos = ( qmax + qmin - 2 * q1 ) / ( qmax - qmin );
222
223 return cos;
224}
225
226double EvtDalitzPlot::e( Index i, Pair j, double q ) const {
227 if ( i == other( j ) )
228 {
229
230 // i does not belong to pair j
231
232 return ( bigM() * bigM() - q - m( i ) * m( i ) ) / 2 / sqrt( q );
233 }
234 else
235 {
236
237 // i and k make pair j
238
239 Index k;
240 if ( first( j ) == i ) k = second( j );
241 else k = first( j );
242
243 double e = ( q + m( i ) * m( i ) - m( k ) * m( k ) ) / 2 / sqrt( q );
244 return e;
245 }
246}
247
248double EvtDalitzPlot::p( Index i, Pair j, double q ) const {
249 double en = e( i, j, q );
250 double p2 = en * en - m( i ) * m( i );
251
252 if ( p2 < 0 )
253 {
254 printf( "Bad value of p2 %f %d %d %f %f\n", p2, i, j, en, m( i ) );
255 assert( 0 );
256 }
257
258 return sqrt( p2 );
259}
260
262 double q2 ) const {
263 if ( i1 == i2 ) return q2;
264
265 EvtCyclic3::Index f = first( i1 );
266 EvtCyclic3::Index s = second( i1 );
267 return m( f ) * m( f ) + m( s ) * m( s ) + 2 * e( f, i2, q2 ) * e( s, i2, q2 ) -
268 2 * p( f, i2, q2 ) * p( s, i2, q2 ) * cosTh;
269}
270
271double EvtDalitzPlot::jacobian( EvtCyclic3::Pair i, double q ) const {
272 return 2 * p( first( i ), i, q ) * p( other( i ), i, q ); // J(BC) = 2pA*pB = 2pA*pC
273}
274
275EvtTwoBodyVertex EvtDalitzPlot::vD( Pair iRes, double m0, int L ) const {
276 return EvtTwoBodyVertex( m( first( iRes ) ), m( second( iRes ) ), m0, L );
277}
278
279EvtTwoBodyVertex EvtDalitzPlot::vB( Pair iRes, double m0, int L ) const {
280 return EvtTwoBodyVertex( m0, m( other( iRes ) ), bigM(), L );
281}
282
284 // masses
285 printf( "Mass M %f\n", bigM() );
286 printf( "Mass mA %f\n", _mA );
287 printf( "Mass mB %f\n", _mB );
288 printf( "Mass mC %f\n", _mC );
289 // limits
290 printf( "Limits qAB %f : %f\n", qAbsMin( AB ), qAbsMax( AB ) );
291 printf( "Limits qBC %f : %f\n", qAbsMin( BC ), qAbsMax( BC ) );
292 printf( "Limits qCA %f : %f\n", qAbsMin( CA ), qAbsMax( CA ) );
293 printf( "Sum q %f\n", sum() );
294 printf( "Limit qsum %f : %f\n", qSumMin(), qSumMax() );
295}
double p2[4]
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
XmlRpcServer s
void sanityCheck() const
double qHelAbsMax(EvtCyclic3::Pair i) const
double getArea(int N=1000, EvtCyclic3::Pair i=EvtCyclic3::AB, EvtCyclic3::Pair j=EvtCyclic3::BC) const
double qAbsMin(EvtCyclic3::Pair i) const
double qSumMin() const
double jacobian(EvtCyclic3::Pair i, double q) const
double q(EvtCyclic3::Pair i1, double cosTh, EvtCyclic3::Pair i2, double q2) const
void print() const
double sum() const
double mB() const
double qSumMax() const
EvtTwoBodyVertex vD(EvtCyclic3::Pair iRes, double m0, int L) const
const EvtDalitzPlot * clone() const
double bigM() const
EvtTwoBodyVertex vB(EvtCyclic3::Pair iRes, double m0, int L) const
double m(EvtCyclic3::Index i) const
double qHelAbsMin(EvtCyclic3::Pair i) const
double mAbsMax(EvtCyclic3::Pair i) const
double mAbsMin(EvtCyclic3::Pair i) const
double p(EvtCyclic3::Index i, EvtCyclic3::Pair j, double q) const
double qMin(EvtCyclic3::Pair i, EvtCyclic3::Pair j, double q) const
double qAbsMax(EvtCyclic3::Pair i) const
double mA() const
double qMax(EvtCyclic3::Pair i, EvtCyclic3::Pair j, double q) const
bool operator==(const EvtDalitzPlot &other) const
double e(EvtCyclic3::Index i, EvtCyclic3::Pair j, double q) const
double cosTh(EvtCyclic3::Pair i1, double q1, EvtCyclic3::Pair i2, double q2) const
double mC() const
double qResAbsMin(EvtCyclic3::Pair i) const
double qResAbsMax(EvtCyclic3::Pair i) const
const char * mother() const
const char * dau(int i) const
static double getMeanMass(EvtId i)
Definition EvtPDL.hh:43
static EvtId getId(const std::string &name)
Definition EvtPDL.cc:272
double p(Index i=AB) const
double e(Index i, Index j) const
Index common(Pair i, Pair j)
Index second(Pair i)
Index prev(Index i)
Definition EvtCyclic3.cc:94
Index other(Index i, Index j)