EvtGen 2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Loading...
Searching...
No Matches
EvtDalitzPoint.cpp
Go to the documentation of this file.
1
2/***********************************************************************
3* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4* *
5* This file is part of EvtGen. *
6* *
7* EvtGen is free software: you can redistribute it and/or modify *
8* it under the terms of the GNU General Public License as published by *
9* the Free Software Foundation, either version 3 of the License, or *
10* (at your option) any later version. *
11* *
12* EvtGen is distributed in the hope that it will be useful, *
13* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15* GNU General Public License for more details. *
16* *
17* You should have received a copy of the GNU General Public License *
18* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19***********************************************************************/
20
22
23#include <assert.h>
24#include <math.h>
25#include <stdio.h>
26using namespace EvtCyclic3;
27
29 m_mA( -1. ), m_mB( -1. ), m_mC( -1. ), m_qAB( -1. ), m_qBC( -1. ), m_qCA( -1. )
30{
31}
32
33EvtDalitzPoint::EvtDalitzPoint( double mA, double mB, double mC, double qAB,
34 double qBC, double qCA ) :
35 m_mA( mA ), m_mB( mB ), m_mC( mC ), m_qAB( qAB ), m_qBC( qBC ), m_qCA( qCA )
36{
37}
38
39// Constructor from Zemach coordinates
40
41EvtDalitzPoint::EvtDalitzPoint( double mA, double mB, double mC,
42 EvtCyclic3::Pair i, double qres, double qhel,
43 double qsum ) :
44 m_mA( mA ), m_mB( mB ), m_mC( mC )
45{
46 double qi = qres + qsum / 3.;
47 double qj = -qres / 2. + qhel + qsum / 3.;
48 double qk = -qres / 2. - qhel + qsum / 3.;
49
50 if ( i == AB ) {
51 m_qAB = qi;
52 m_qBC = qj;
53 m_qCA = qk;
54 } else if ( i == BC ) {
55 m_qAB = qk;
56 m_qBC = qi;
57 m_qCA = qj;
58 } else if ( i == CA ) {
59 m_qAB = qj;
60 m_qBC = qk;
61 m_qCA = qi;
62 }
63}
64
66 const EvtDalitzCoord& x ) :
67 m_mA( dp.m( A ) ), m_mB( dp.m( B ) ), m_mC( dp.m( C ) )
68{
69 if ( x.pair1() == AB )
70 m_qAB = x.q1();
71 else if ( x.pair2() == AB )
72 m_qAB = x.q2();
73 else
74 m_qAB = dp.sum() - x.q1() - x.q2();
75
76 if ( x.pair1() == BC )
77 m_qBC = x.q1();
78 else if ( x.pair2() == BC )
79 m_qBC = x.q2();
80 else
81 m_qBC = dp.sum() - x.q1() - x.q2();
82
83 if ( x.pair1() == CA )
84 m_qCA = x.q1();
85 else if ( x.pair2() == CA )
86 m_qCA = x.q2();
87 else
88 m_qCA = dp.sum() - x.q1() - x.q2();
89}
90
92{
93 double ret = m_qAB;
94 if ( BC == i )
95 ret = m_qBC;
96 else if ( CA == i )
97 ret = m_qCA;
98
99 return ret;
100}
101
103{
104 double ret = m_mA;
105 if ( B == i )
106 ret = m_mB;
107 else if ( C == i )
108 ret = m_mC;
109
110 return ret;
111}
112
113// Zemach variables
114
116{
117 return ( 2. * q( i ) - q( EvtCyclic3::prev( i ) ) -
118 q( EvtCyclic3::next( i ) ) ) /
119 3.;
120}
122{
123 Pair j = next( i );
124 Pair k = prev( i );
125 return ( q( j ) - q( k ) ) / 2.;
126}
128{
129 return m_qAB + m_qBC + m_qCA;
130}
131
133{
135 return dp.qMin( i, j, q( j ) );
136}
137
139{
141 return dp.qMax( i, j, q( j ) );
142}
143
145{
146 if ( i == j )
147 return m( i ) * m( i );
148 else
149 return ( q( combine( i, j ) ) - m( i ) * m( i ) - m( j ) * m( j ) ) / 2.;
150}
151
153{
155 return dp.e( i, j, q( j ) );
156}
157
159{
161 return dp.p( i, j, q( j ) );
162}
163
165 EvtCyclic3::Pair pairRes ) const
166{
168 return dp.cosTh( pairAng, q( pairAng ), pairRes, q( pairRes ) );
169}
170
172 EvtCyclic3::Pair j ) const
173{
174 return EvtDalitzCoord( i, q( i ), j, q( j ) );
175}
176
181
183{
184 // Check masses
185
186 double M = bigM();
187 if ( m_mA < 0 || m_mB < 0 || m_mC < 0 || M <= 0 )
188 return false;
189 if ( M < m_mA + m_mB + m_mC )
190 return false;
191
192 // Check that first coordinate is within absolute limits
193
194 bool inside = false;
196
197 if ( dp.qAbsMin( AB ) <= m_qAB && m_qAB <= dp.qAbsMax( AB ) )
198 if ( qMin( BC, AB ) <= m_qBC && m_qBC <= qMax( BC, AB ) )
199 inside = true;
200
201 return inside;
202}
203
205{
206 return sqrt( m_qAB + m_qBC + m_qCA - m_mA * m_mA - m_mB * m_mB - m_mC * m_mC );
207}
208
210{
212 printf( "%f %f %f\n", m_qAB, m_qBC, m_qCA );
213}
EvtCyclic3::Pair pair1() const
EvtCyclic3::Pair pair2() const
double q1() const
double q2() const
double qAbsMin(EvtCyclic3::Pair i) const
void print() const
double sum() 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 qMax(EvtCyclic3::Pair i, EvtCyclic3::Pair j, double q) 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 p(EvtCyclic3::Index i, EvtCyclic3::Pair j) const
double bigM() const
double e(EvtCyclic3::Index i, EvtCyclic3::Pair j) const
double m(EvtCyclic3::Index) const
void print() const
double q(EvtCyclic3::Pair) const
double qMin(EvtCyclic3::Pair i, EvtCyclic3::Pair j) const
bool isValid() const
double qsum() const
EvtDalitzCoord getDalitzPoint(EvtCyclic3::Pair i, EvtCyclic3::Pair j) const
double qMax(EvtCyclic3::Pair i, EvtCyclic3::Pair j) const
double pp(EvtCyclic3::Index i, EvtCyclic3::Index j) const
double cosTh(EvtCyclic3::Pair pairAng, EvtCyclic3::Pair pairRes) const
EvtDalitzPlot getDalitzPlot() const
double qhel(EvtCyclic3::Pair i) const
double qres(EvtCyclic3::Pair i) const
Index next(Index i)
Pair combine(Index i, Index j)
Index prev(Index i)