evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtBTo3hCP.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 "EvtGenBase/EvtCPUtil.hh"
24 #include "EvtGenBase/EvtComplex.hh"
25 #include "EvtGenBase/EvtGenKine.hh"
26 #include "EvtGenBase/EvtId.hh"
27 #include "EvtGenBase/EvtPDL.hh"
29 #include "EvtGenBase/EvtPatches.hh"
30 #include "EvtGenBase/EvtRandom.hh"
31 #include "EvtGenBase/EvtReport.hh"
33 
34 #include <cmath>
35 #include <stdlib.h>
36 #include <string>
37 
38 #define square( x ) ( ( x ) * ( x ) )
39 
40 /*
41  * MK - 25/Aug/2016
42  * The code bellow is not necessarilly well writen as it is 1-to-1 rewrite
43  * from FORTRAN code (which is spread over 4 different source codes in not
44  * fully obvious way). Once it is rewriten and giving correct results, I
45  * will think how to give it more proper structure (mainly by checking what
46  * is duplicated and how to simplify it).
47  */
48 
49 void EvtBTo3hCP::setConstants( double balpha, double bbeta )
50 {
51  alphaCP = balpha;
52  double calpha = cos( alphaCP );
53  double salpha = sin( alphaCP );
54  betaCP = bbeta;
55  double cbeta = cos( betaCP );
56  double sbeta = sin( betaCP );
57 
58  MA2 = square( M_B ) + square( M_pip ) + square( M_pi0 ) + square( M_pi0 );
59  MB2 = square( M_B ) + square( M_pip ) + square( M_pim ) + square( M_pi0 );
60  MC2 = square( M_B ) + square( M_Kp ) + square( M_pim ) + square( M_pi0 );
61 
62  double StrongPhase = 0;
63  EvtComplex StrongExp( cos( StrongPhase ), sin( StrongPhase ) );
64 
65  EvtComplex Mat_Tp0( calpha, -salpha );
66  Mat_Tp0 *= 1.09;
67  EvtComplex Mat_Tm0( calpha, -salpha );
68  Mat_Tm0 *= 1.09;
69  EvtComplex Mat_T0p( calpha, -salpha );
70  Mat_T0p *= 0.66;
71  EvtComplex Mat_T0m( calpha, -salpha );
72  Mat_T0m *= 0.66;
73  EvtComplex Mat_Tpm( calpha, -salpha );
74  Mat_Tpm *= 1.00;
75  EvtComplex Mat_Tmp( calpha, -salpha );
76  Mat_Tmp *= 0.47;
77 
78  EvtComplex Mat_Ppm( cos( -0.5 ), sin( -0.5 ) );
79  Mat_Ppm *= -0.2;
80  EvtComplex Mat_Pmp( cos( 2. ), sin( 2. ) );
81  Mat_Pmp *= 0.15;
82 
83  EvtComplex Mat_P1 = 0.5 * ( Mat_Ppm - Mat_Pmp );
84  EvtComplex Mat_P0 = 0.5 * ( Mat_Ppm + Mat_Pmp );
85  EvtComplex Nat_Tp0( calpha, salpha );
86  Nat_Tp0 *= 1.09;
87  EvtComplex Nat_Tm0( calpha, salpha );
88  Nat_Tm0 *= 1.09;
89  EvtComplex Nat_T0p( calpha, salpha );
90  Nat_T0p *= 0.66;
91  EvtComplex Nat_T0m( calpha, salpha );
92  Nat_T0m *= 0.66;
93  EvtComplex Nat_Tpm( calpha, salpha );
94  Nat_Tpm *= 1.00;
95  EvtComplex Nat_Tmp( calpha, salpha );
96  Nat_Tmp *= 0.47;
97  EvtComplex Nat_P1 = Mat_P1;
98  EvtComplex Nat_P0 = Mat_P0;
99 
100  Mat_Tpm = StrongExp * Mat_Tpm;
101  Nat_Tpm = StrongExp * Nat_Tpm;
102 
103  Mat_S1 = Mat_Tp0 + 2. * Mat_P1;
104  Mat_S2 = Mat_T0p - 2. * Mat_P1;
105  Mat_S3 = Mat_Tpm + Mat_P1 + Mat_P0;
106  Mat_S4 = Mat_Tmp - Mat_P1 + Mat_P0;
107  Mat_S5 = -Mat_Tpm - Mat_Tmp + Mat_Tp0 + Mat_T0p - 2. * Mat_P0;
108 
109  Nat_S1 = Nat_Tp0 + 2. * Nat_P1;
110  Nat_S2 = Nat_T0p - 2. * Nat_P1;
111  Nat_S3 = Nat_Tpm + Nat_P1 + Nat_P0;
112  Nat_S4 = Nat_Tmp - Nat_P1 + Nat_P0;
113  Nat_S5 = -Nat_Tpm - Nat_Tmp + Nat_Tp0 + Nat_T0p - 2. * Nat_P0;
114 
115  // B0 -->-- K*+ pi- Amplitudes (Trees + Penguins)
116  MatKstarp = EvtComplex( calpha, -salpha ) * EvtComplex( 0.220, 0. ) +
117  EvtComplex( cbeta, sbeta ) * EvtComplex( -1.200, 0. );
118  // B0 -->-- K*0 pi0 Amplitudes (Trees + Penguins)
119  MatKstar0 = EvtComplex( calpha, -salpha ) * EvtComplex( 0.015, 0. ) +
120  EvtComplex( cbeta, sbeta ) * EvtComplex( 0.850, 0. );
121  // B0 -->-- K+ rho- Amplitudes (Trees + Penguins)
122  MatKrho = EvtComplex( calpha, -salpha ) * EvtComplex( 0.130, 0. ) +
123  EvtComplex( cbeta, sbeta ) * EvtComplex( 0.160, 0. );
124  // B0bar -->-- K*+ pi- Amplitudes (Trees + Penguins)
125  NatKstarp = EvtComplex( 0., 0. );
126  // B0bar -->-- K*0 pi0 Amplitudes (Trees + Penguins)
127  NatKstar0 = EvtComplex( 0., 0. );
128  // B0bar -->-- K+ rho- Amplitudes (Trees + Penguins)
129  NatKrho = EvtComplex( 0., 0. );
130 
131 }
132 
133 void EvtBTo3hCP::Evt3pi( double alpha, int iset, EvtVector4R& p_pi_plus,
134  EvtVector4R& p_pi_minus, EvtVector4R& p_gamma_1,
135  EvtVector4R& p_gamma_2, double& Real_B0,
136  double& Imag_B0, double& Real_B0bar, double& Imag_B0bar )
137 {
138  EvtVector4R p_p2;
139  double AB0, AB0bar, Ainter, R1, R2;
140  double factor;
141  int ierr = 0;
142 
143  // Ghm : beta is not needed for this generation - put a default value
144  setConstants( alpha, 0.362 );
145 
146  if ( iset == 0 ) {
147  p_pi_plus.set( M_pip, 0, 0, 0 );
148  p_p2.set( M_pi0, 0, 0, 0 );
149  p_pi_minus.set( M_pim, 0, 0, 0 );
150 
151  do {
152  firstStep( p_pi_plus, p_p2, p_pi_minus, 1 );
153  ierr = compute3pi( p_pi_plus, p_p2, p_pi_minus, Real_B0, Imag_B0,
154  Real_B0bar, Imag_B0bar, iset );
155  } while ( ierr != 0 );
156  } else if ( iset < 0 ) {
157  p_p2 = p_gamma_1 + p_gamma_2;
158  ierr = compute3pi( p_pi_plus, p_p2, p_pi_minus, Real_B0, Imag_B0,
159  Real_B0bar, Imag_B0bar, iset );
160  if ( ierr != 0 ) {
161  std::cout << "Provided kinematics is not physical\n";
162  std::cout << "Program will stop\n";
163  exit( 1 );
164  }
165  } else // iset > 0
166  {
167  factor_max = 0;
168 
169  int endLoop = iset;
170  for ( int i = 0; i < endLoop; ++i ) {
171  p_pi_plus.set( M_pip, 0, 0, 0 );
172  p_p2.set( M_pi0, 0, 0, 0 );
173  p_pi_minus.set( M_pim, 0, 0, 0 );
174 
175  firstStep( p_pi_plus, p_p2, p_pi_minus, 1 );
176  ierr = compute3pi( p_pi_plus, p_p2, p_pi_minus, Real_B0, Imag_B0,
177  Real_B0bar, Imag_B0bar, iset );
178  if ( ierr != 0 ) {
179  continue;
180  }
181  AB0 = square( Real_B0 ) + square( Imag_B0 );
182  AB0bar = square( Real_B0bar ) + square( Imag_B0bar );
183  Ainter = Real_B0 * Imag_B0bar - Imag_B0 * Real_B0bar;
184  R1 = ( AB0 - AB0bar ) / ( AB0 + AB0bar );
185  R2 = ( 2.0 * Ainter ) / ( AB0 + AB0bar );
186  factor = ( 1.0 + sqrt( square( R1 ) + square( R2 ) ) ) *
187  ( AB0 + AB0bar ) / 2.0;
188  if ( factor > factor_max )
189  factor_max = factor;
190  }
191  factor_max = 1.0 / std::sqrt( factor_max );
192  }
193 
194  Real_B0 *= factor_max;
195  Imag_B0 *= factor_max;
196  Real_B0bar *= factor_max;
197  Imag_B0bar *= factor_max;
198 
199  if ( iset < 0 ) {
200  return;
201  }
202 
203  rotation( p_pi_plus, 1 );
204  rotation( p_p2, 0 );
205  rotation( p_pi_minus, 0 );
206 
207  gammaGamma( p_p2, p_gamma_1, p_gamma_2 );
208 }
209 
210 void EvtBTo3hCP::Evt3piMPP( double alpha, int iset, EvtVector4R& p_p1,
211  EvtVector4R& p_p2, EvtVector4R& p_p3,
212  double& Real_B0, double& Imag_B0,
213  double& Real_B0bar, double& Imag_B0bar )
214 {
215  double ABp, ABm;
216  int ierr = 0;
217 
218  // Ghm : beta is not needed for this generation - put a default value
219  setConstants( alpha, 0.362 );
220 
221  if ( iset == 0 ) {
222  p_p1.set( M_pim, 0, 0, 0 );
223  p_p2.set( M_pip, 0, 0, 0 );
224  p_p3.set( M_pip, 0, 0, 0 );
225 
226  do {
227  firstStep( p_p1, p_p2, p_p3, 2 );
228  ierr = compute3piMPP( p_p1, p_p2, p_p3, Real_B0, Imag_B0,
229  Real_B0bar, Imag_B0bar, iset );
230  } while ( ierr != 0 );
231  } else if ( iset < 0 ) {
232  ierr = compute3piMPP( p_p1, p_p2, p_p3, Real_B0, Imag_B0, Real_B0bar,
233  Imag_B0bar, iset );
234  if ( ierr != 0 ) {
235  std::cout << "Provided kinematics is not physical\n";
236  std::cout << "Program will stop\n";
237  exit( 1 );
238  }
239  } else // iset > 0
240  {
241  factor_max = 0;
242 
243  int endLoop = iset;
244  for ( int i = 0; i < endLoop; ++i ) {
245  p_p1.set( M_pim, 0, 0, 0 );
246  p_p2.set( M_pip, 0, 0, 0 );
247  p_p3.set( M_pip, 0, 0, 0 );
248 
249  firstStep( p_p1, p_p2, p_p3, 2 );
250  ierr = compute3piMPP( p_p1, p_p2, p_p3, Real_B0, Imag_B0,
251  Real_B0bar, Imag_B0bar, iset );
252  if ( ierr != 0 ) {
253  continue;
254  }
255  ABp = square( Real_B0 ) + square( Imag_B0 );
256  ABm = square( Real_B0bar ) + square( Imag_B0bar );
257  if ( ABp > factor_max )
258  factor_max = ABp;
259  if ( ABm > factor_max )
260  factor_max = ABm;
261  }
262  factor_max = 1.0 / std::sqrt( factor_max );
263  }
264 
265  Real_B0 *= factor_max;
266  Imag_B0 *= factor_max;
267  Real_B0bar *= factor_max;
268  Imag_B0bar *= factor_max;
269 
270  if ( iset < 0 ) {
271  return;
272  }
273 
274  rotation( p_p1, 1 );
275  rotation( p_p2, 0 );
276  rotation( p_p3, 0 );
277 }
278 
279 void EvtBTo3hCP::Evt3piP00( double alpha, int iset, EvtVector4R& p_p1,
280  EvtVector4R& p_p1_gamma1, EvtVector4R& p_p1_gamma2,
281  EvtVector4R& p_p2_gamma1, EvtVector4R& p_p2_gamma2,
282  double& Real_B0, double& Imag_B0,
283  double& Real_B0bar, double& Imag_B0bar )
284 {
285  double ABp, ABm;
286  EvtVector4R p_p2, p_p3;
287  int ierr = 0;
288 
289  // Ghm : beta is not needed for this generation - put a default value
290  setConstants( alpha, 0.362 );
291 
292  if ( iset == 0 ) {
293  p_p1.set( M_pip, 0, 0, 0 );
294  p_p2.set( M_pi0, 0, 0, 0 );
295  p_p3.set( M_pi0, 0, 0, 0 );
296 
297  do {
298  firstStep( p_p1, p_p2, p_p3, 3 );
299  ierr = compute3piP00( p_p1, p_p2, p_p3, Real_B0, Imag_B0,
300  Real_B0bar, Imag_B0bar, iset );
301  } while ( ierr != 0 );
302  } else if ( iset < 0 ) {
303  p_p2 = p_p1_gamma1 + p_p1_gamma2;
304  p_p3 = p_p2_gamma1 + p_p2_gamma2;
305  ierr = compute3piP00( p_p1, p_p2, p_p3, Real_B0, Imag_B0, Real_B0bar,
306  Imag_B0bar, iset );
307  if ( ierr != 0 ) {
308  std::cout << "Provided kinematics is not physical\n";
309  std::cout << "Program will stop\n";
310  exit( 1 );
311  }
312  } else // iset > 0
313  {
314  factor_max = 0;
315 
316  int endLoop = iset;
317  for ( int i = 0; i < endLoop; ++i ) {
318  p_p1.set( M_pip, 0, 0, 0 );
319  p_p2.set( M_pi0, 0, 0, 0 );
320  p_p3.set( M_pi0, 0, 0, 0 );
321 
322  firstStep( p_p1, p_p2, p_p3, 3 );
323  ierr = compute3piP00( p_p1, p_p2, p_p3, Real_B0, Imag_B0,
324  Real_B0bar, Imag_B0bar, iset );
325  if ( ierr != 0 ) {
326  continue;
327  }
328  ABp = square( Real_B0 ) + square( Imag_B0 );
329  ABm = square( Real_B0bar ) + square( Imag_B0bar );
330  if ( ABp > factor_max )
331  factor_max = ABp;
332  if ( ABm > factor_max )
333  factor_max = ABm;
334  }
335  factor_max = 1.0 / std::sqrt( factor_max );
336  }
337 
338  Real_B0 *= factor_max;
339  Imag_B0 *= factor_max;
340  Real_B0bar *= factor_max;
341  Imag_B0bar *= factor_max;
342 
343  if ( iset < 0 ) {
344  return;
345  }
346 
347  rotation( p_p1, 1 );
348  rotation( p_p2, 0 );
349  rotation( p_p3, 0 );
350 
351  gammaGamma( p_p2, p_p1_gamma1, p_p1_gamma2 );
352  gammaGamma( p_p3, p_p2_gamma1, p_p2_gamma2 );
353 }
354 
355 void EvtBTo3hCP::EvtKpipi( double alpha, double beta, int iset,
356  EvtVector4R& p_K_plus, EvtVector4R& p_pi_minus,
357  EvtVector4R& p_gamma_1, EvtVector4R& p_gamma_2,
358  double& Real_B0, double& Imag_B0, double& Real_B0bar,
359  double& Imag_B0bar )
360 {
361  EvtVector4R p_p3;
362  double ABp, ABm;
363  int ierr = 0;
364 
365  setConstants( alpha, beta );
366 
367  if ( iset == 0 ) {
368  p_K_plus.set( M_Kp, 0, 0, 0 );
369  p_pi_minus.set( M_pim, 0, 0, 0 );
370  p_p3.set( M_pi0, 0, 0, 0 );
371 
372  do {
373  firstStep( p_K_plus, p_pi_minus, p_p3, 0 );
374  ierr = computeKpipi( p_K_plus, p_pi_minus, p_p3, Real_B0, Imag_B0,
375  Real_B0bar, Imag_B0bar, iset );
376  } while ( ierr != 0 );
377  } else if ( iset < 0 ) {
378  p_p3 = p_gamma_1 + p_gamma_2;
379  ierr = computeKpipi( p_K_plus, p_pi_minus, p_p3, Real_B0, Imag_B0,
380  Real_B0bar, Imag_B0bar, iset );
381  if ( ierr != 0 ) {
382  std::cout << "Provided kinematics is not physical\n";
383  std::cout << "Program will stop\n";
384  exit( 1 );
385  }
386  } else // iset > 0
387  {
388  factor_max = 0;
389 
390  int endLoop = iset;
391  for ( int i = 0; i < endLoop; ++i ) {
392  p_K_plus.set( M_Kp, 0, 0, 0 );
393  p_pi_minus.set( M_pim, 0, 0, 0 );
394  p_p3.set( M_pi0, 0, 0, 0 );
395  firstStep( p_K_plus, p_pi_minus, p_p3, 0 );
396  ierr = computeKpipi( p_K_plus, p_pi_minus, p_p3, Real_B0, Imag_B0,
397  Real_B0bar, Imag_B0bar, iset );
398  if ( ierr != 0 ) {
399  continue;
400  }
401  ABp = square( Real_B0 ) + square( Imag_B0 );
402  ABm = square( Real_B0bar ) + square( Imag_B0bar );
403 
404  if ( ABp > factor_max ) {
405  factor_max = ABp;
406  }
407  if ( ABm > factor_max ) {
408  factor_max = ABm;
409  }
410  }
411  factor_max = 1.0 / std::sqrt( factor_max );
412  }
413 
414  Real_B0 *= factor_max;
415  Imag_B0 *= factor_max;
416  Real_B0bar *= factor_max;
417  Imag_B0bar *= factor_max;
418 
419  if ( iset < 0 ) {
420  return;
421  }
422 
423  rotation( p_K_plus, 1 );
424  rotation( p_pi_minus, 0 );
425  rotation( p_p3, 0 );
426 
427  gammaGamma( p_p3, p_gamma_1, p_gamma_2 );
428 }
429 
431  int mode )
432 {
433  const double m1sq = p1.mass2();
434  const double m2sq = p2.mass2();
435  const double m3sq = p3.mass2();
436  double min_m12, min_m13, min_m23;
437 
438  double max_m12 = square( M_B );
439  double max_m13 = square( M_B );
440  double max_m23 = square( M_B );
441 
442  if ( mode == 0 ) {
443  min_m12 = m1sq + m2sq + 2 * sqrt( m1sq * m2sq );
444  min_m13 = m1sq + m3sq + 2 * sqrt( m1sq * m3sq );
445  min_m23 = m2sq + m3sq + 2 * sqrt( m2sq * m3sq );
446  } else {
447  min_m12 = m1sq + m2sq;
448  min_m13 = m1sq + m3sq;
449  min_m23 = m2sq + m3sq;
450  }
451 
452  bool eventOK;
453  double m13, m12, m23;
454  double E1;
455  double E2;
456  double E3;
457  double p1mom;
458  double p2mom;
459  double p3mom;
460  double cost13;
461  double cost12;
462  double cost23;
463  eventOK = false;
464 
465  do {
466  switch ( mode ) {
467  case 0:
468  generateSqMasses_Kpipi( m12, m13, m23, MC2, m1sq, m2sq, m3sq );
469  break;
470  case 1:
471  generateSqMasses_3pi( m12, m13, m23, MB2, m1sq, m2sq, m3sq );
472  break;
473  case 2:
474  generateSqMasses_3piMPP( m12, m13, m23, MB2, m1sq, m2sq, m3sq );
475  break;
476  case 3:
477  generateSqMasses_3piP00( m12, m13, m23, MA2, m1sq, m2sq, m3sq );
478  break;
479  default:
480  break;
481  }
482  // Check whether event is physical
483  if ( ( m23 < min_m23 ) || ( m23 > max_m23 ) )
484  continue;
485  if ( ( m13 < min_m13 ) || ( m13 > max_m13 ) )
486  continue;
487  if ( ( m12 < min_m12 ) || ( m12 > max_m12 ) )
488  continue;
489 
490  // Now check the cosines of the angles
491  E1 = ( square( M_B ) + m1sq - m23 ) / ( 2. * M_B );
492  E2 = ( square( M_B ) + m2sq - m13 ) / ( 2. * M_B );
493  E3 = ( square( M_B ) + m3sq - m12 ) / ( 2. * M_B );
494  p1mom = square( E1 ) - m1sq;
495  p2mom = square( E2 ) - m2sq;
496  p3mom = square( E3 ) - m3sq;
497  if ( p1mom < 0 || p2mom < 0 || p3mom < 0 ) {
498  // std::cout<<"Momenta magnitude negative\n";
499  continue;
500  }
501  p1mom = sqrt( p1mom );
502  p2mom = sqrt( p2mom );
503  p3mom = sqrt( p3mom );
504 
505  cost13 = ( 2. * E1 * E3 + m1sq + m3sq - m13 ) / ( 2. * p1mom * p3mom );
506  cost12 = ( 2. * E1 * E2 + m1sq + m2sq - m12 ) / ( 2. * p1mom * p2mom );
507  cost23 = ( 2. * E2 * E3 + m2sq + m3sq - m23 ) / ( 2. * p2mom * p3mom );
508  if ( cost13 < -1. || cost13 > 1. || cost12 < -1. || cost12 > 1. ||
509  cost23 < -1. || cost23 > 1. ) {
510  continue;
511  }
512  eventOK = true;
513  } while ( eventOK == false );
514 
515  // Now is time to fill 4-vectors
516  p3.set( E3, 0, 0, p3mom );
517  p1.set( E1, p1mom * sqrt( 1 - square( cost13 ) ), 0, p1mom * cost13 );
518  p2.set( 0, E2 );
519  for ( int i = 1; i < 4; ++i ) {
520  p2.set( i, -p1.get( i ) - p3.get( i ) );
521  }
522  if ( p1.get( 0 ) < p1.d3mag() ) {
523  std::cout << "Unphysical p1 generated: " << p1 << std::endl;
524  }
525  if ( p2.get( 0 ) < p2.d3mag() ) {
526  std::cout << "Unphysical p2 generated: " << p2 << std::endl;
527  }
528  if ( p3.get( 0 ) < p3.d3mag() ) {
529  std::cout << "Unphysical p3 generated: " << p3 << std::endl;
530  }
531  double testMB2 = MB2;
532  switch ( mode ) {
533  case 0:
534  testMB2 = MC2;
535  break;
536  case 1:
537  case 2:
538  testMB2 = MB2;
539  break;
540  case 3:
541  testMB2 = MA2;
542  break;
543  }
544 
545  if ( fabs( m12 + m13 + m23 - testMB2 ) > 1e-4 ) {
546  std::cout << "Unphysical event generated: " << m12 << " " << m13 << " "
547  << m23 << std::endl;
548  }
549 }
550 
551 void EvtBTo3hCP::generateSqMasses_Kpipi( double& m12, double& m13, double& m23,
552  double MB2, double m1sq, double m2sq,
553  double m3sq )
554 {
555  /*
556  C There is two ways of generating the events:
557  C The first one used a pole-compensation method to generate the
558  C events efficiently taking into account the poles due to the
559  C Breit-Wigners of the rho s. It is activated by setting
560  C Phase_Space to .false.
561  C The second one generates events according to phase space. It is
562  C inneficient but allows the exploration of the full Dalitz plot
563  C in an uniform way. It was found to be usefull fopr some peculiar
564  C applications. It is activated by setting
565  C Phase_space to .true.
566  C Note that in that case, the generation is no longer correct.
567  */
568  static bool phaseSpace = false;
569 
570  double max_m12 = square( M_B );
571  double min_m12 = m1sq + m2sq + 2 * sqrt( m1sq * m2sq );
572 
573  double max_m13 = square( M_B );
574  double min_m13 = m1sq + m3sq + 2 * sqrt( m1sq * m3sq );
575 
576  double max_m23 = square( M_B );
577  double min_m23 = m2sq + m3sq + 2 * sqrt( m2sq * m3sq );
578 
579  double z = 3. * EvtRandom::Flat();
580  if ( z < 1. ) // K*+
581  {
582  if ( phaseSpace ) {
583  m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
584  } else {
585  double y = EvtRandom::Flat() * pi - pi / 2;
586  double x = std::tan( y );
587  double mass = x * Gam_Kstarp / 2. + Mass_Kstarp;
588  m13 = square( mass );
589  }
590  m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
591  m23 = MB2 - m12 - m13;
592  } else if ( z < 2. ) // K*0
593  {
594  if ( phaseSpace ) {
595  m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
596  } else {
597  double y = EvtRandom::Flat() * pi - pi / 2;
598  double x = std::tan( y );
599  double mass = x * Gam_Kstar0 / 2. + Mass_Kstar0;
600  m12 = square( mass );
601  }
602  m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
603  m23 = MB2 - m12 - m13;
604  } else // rho-
605  {
606  if ( phaseSpace ) {
607  m23 = EvtRandom::Flat() * ( max_m23 - min_m23 ) + min_m23;
608  } else {
609  double y = EvtRandom::Flat() * pi - pi / 2;
610  double x = std::tan( y );
611  double mass = x * Gam_rho / 2. + Mass_rho;
612  m23 = square( mass );
613  }
614  m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
615  m12 = MB2 - m23 - m13;
616  }
617 }
618 
619 void EvtBTo3hCP::generateSqMasses_3pi( double& m12, double& m13, double& m23,
620  double MB2, double m1sq, double m2sq,
621  double m3sq )
622 {
623  /*
624  C There is two ways of generating the events:
625  C The first one used a pole-compensation method to generate the
626  C events efficiently taking into account the poles due to the
627  C Breit-Wigners of the rho s. It is activated by setting
628  C Phase_Space to .false.
629  C The second one generates events according to phase space. It is
630  C inneficient but allows the exploration of the full Dalitz plot
631  C in an uniform way. It was found to be usefull fopr some peculiar
632  C applications. It is activated by setting
633  C Phase_space to .true.
634  C Note that in that case, the generation is no longer correct.
635  */
636  static bool phaseSpace = false;
637 
638  double max_m12 = square( M_B );
639  double min_m12 = m1sq + m2sq;
640 
641  double max_m13 = square( M_B );
642  double min_m13 = m1sq + m3sq;
643 
644  double max_m23 = square( M_B );
645  double min_m23 = m2sq + m3sq;
646  double mass = 0;
647 
648  if ( !phaseSpace ) {
649  double y = EvtRandom::Flat() * pi - pi / 2;
650  double x = std::tan( y );
651  mass = x * Gam_rho / 2. + Mass_rho;
652  }
653 
654  double z = 3. * EvtRandom::Flat();
655  if ( z < 1. ) {
656  if ( phaseSpace ) {
657  m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
658  } else {
659  m12 = square( mass );
660  }
661  m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
662  m23 = MB2 - m12 - m13;
663  } else if ( z < 2. ) {
664  if ( phaseSpace ) {
665  m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
666  } else {
667  m13 = square( mass );
668  }
669  m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
670  m23 = MB2 - m12 - m13;
671  } else {
672  if ( phaseSpace ) {
673  m23 = EvtRandom::Flat() * ( max_m23 - min_m23 ) + min_m23;
674  } else {
675  m23 = square( mass );
676  }
677  m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
678  m13 = MB2 - m12 - m23;
679  }
680 }
681 
682 void EvtBTo3hCP::generateSqMasses_3piMPP( double& m12, double& m13, double& m23,
683  double MB2, double m1sq, double m2sq,
684  double m3sq )
685 {
686  /*
687  C There is two ways of generating the events:
688  C The first one used a pole-compensation method to generate the
689  C events efficiently taking into account the poles due to the
690  C Breit-Wigners of the rho s. It is activated by setting
691  C Phase_Space to .false.
692  C The second one generates events according to phase space. It is
693  C inneficient but allows the exploration of the full Dalitz plot
694  C in an uniform way. It was found to be usefull fopr some peculiar
695  C applications. It is activated by setting
696  C Phase_space to .true.
697  C Note that in that case, the generation is no longer correct.
698  */
699  static bool phaseSpace = false;
700 
701  double max_m12 = square( M_B );
702  double min_m12 = m1sq + m2sq;
703 
704  double max_m13 = square( M_B );
705  double min_m13 = m1sq + m3sq;
706 
707  double mass = 0;
708 
709  if ( !phaseSpace ) {
710  double y = EvtRandom::Flat() * pi - pi / 2;
711  double x = std::tan( y );
712  mass = x * Gam_rho / 2. + Mass_rho;
713  }
714 
715  double z = EvtRandom::Flat();
716  if ( z < 0.5 ) {
717  if ( phaseSpace ) {
718  m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
719  } else {
720  m12 = square( mass );
721  }
722  m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
723  m23 = MB2 - m12 - m13;
724  } else {
725  if ( phaseSpace ) {
726  m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
727  } else {
728  m13 = square( mass );
729  }
730  m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
731  m23 = MB2 - m12 - m13;
732  }
733 }
734 
735 void EvtBTo3hCP::generateSqMasses_3piP00( double& m12, double& m13, double& m23,
736  double MB2, double m1sq, double m2sq,
737  double m3sq )
738 {
739  /*
740  C There is two ways of generating the events:
741  C The first one used a pole-compensation method to generate the
742  C events efficiently taking into account the poles due to the
743  C Breit-Wigners of the rho s. It is activated by setting
744  C Phase_Space to .false.
745  C The second one generates events according to phase space. It is
746  C inneficient but allows the exploration of the full Dalitz plot
747  C in an uniform way. It was found to be usefull fopr some peculiar
748  C applications. It is activated by setting
749  C Phase_space to .true.
750  C Note that in that case, the generation is no longer correct.
751  */
752  static bool phaseSpace = false;
753 
754  double max_m12 = square( M_B );
755  double min_m12 = m1sq + m2sq;
756 
757  double max_m13 = square( M_B );
758  double min_m13 = m1sq + m3sq;
759 
760  double mass = 0;
761 
762  if ( !phaseSpace ) {
763  double y = EvtRandom::Flat() * pi - pi / 2;
764  double x = std::tan( y );
765  mass = x * Gam_rho / 2. + Mass_rho;
766  }
767 
768  double z = EvtRandom::Flat();
769  if ( z < 0.5 ) {
770  if ( phaseSpace ) {
771  m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
772  } else {
773  m12 = square( mass );
774  }
775  m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
776  m23 = MB2 - m12 - m13;
777  } else {
778  if ( phaseSpace ) {
779  m13 = EvtRandom::Flat() * ( max_m13 - min_m13 ) + min_m13;
780  } else {
781  m13 = square( mass );
782  }
783  m12 = EvtRandom::Flat() * ( max_m12 - min_m12 ) + min_m12;
784  m23 = MB2 - m12 - m13;
785  }
786 }
788  double& real_B0, double& imag_B0,
789  double& real_B0bar, double& imag_B0bar, int iset )
790 {
791  int ierr = 0;
792 
793  double m12 = ( p1 + p2 ).mass();
794  double m13 = ( p1 + p3 ).mass();
795  double m23 = ( p2 + p3 ).mass();
796 
797  double W12 = 1. /
798  ( ( square( Mass_rho - m12 ) + square( Gam_rho / 2. ) ) * m12 );
799  double W13 = 1. /
800  ( ( square( Mass_rho - m13 ) + square( Gam_rho / 2. ) ) * m13 );
801  double W23 = 1. /
802  ( ( square( Mass_rho - m23 ) + square( Gam_rho / 2. ) ) * m23 );
803 
804  double Wtot = 1.;
805  if ( iset >= 0 ) {
806  Wtot = 1. / sqrt( W12 + W13 + W23 );
807  }
808 
809  EvtComplex Mat_rhop = BreitWigner( p1, p2, p3, ierr );
810  EvtComplex Mat_rhom = BreitWigner( p2, p3, p1, ierr );
811  EvtComplex Mat_rho0 = BreitWigner( p1, p3, p2, ierr );
812 
813  EvtComplex Mat_1 = Mat_S3 * Mat_rhop;
814  EvtComplex Mat_2 = Mat_S4 * Mat_rhom;
815  EvtComplex Mat_3 = Mat_S5 * Mat_rho0 * 0.5;
816 
817  EvtComplex MatBp = ( Mat_1 + Mat_2 + Mat_3 ) * Wtot;
818 
819  Mat_1 = Nat_S3 * Mat_rhom;
820  Mat_2 = Nat_S4 * Mat_rhop;
821  Mat_3 = Nat_S5 * Mat_rho0 * 0.5;
822 
823  EvtComplex MatBm = ( Mat_1 + Mat_2 + Mat_3 ) * Wtot;
824 
825  real_B0 = real( MatBp );
826  imag_B0 = imag( MatBp );
827 
828  real_B0bar = real( MatBm );
829  imag_B0bar = imag( MatBm );
830 
831  return ierr;
832 }
833 
835  EvtVector4R& p3, double& real_B0, double& imag_B0,
836  double& real_B0bar, double& imag_B0bar, int iset )
837 {
838  int ierr = 0;
839  const double ASHQ = sqrt( 2. );
840  double m12 = ( p1 + p2 ).mass();
841  double m13 = ( p1 + p3 ).mass();
842 
843  double W12 = 1. /
844  ( ( square( Mass_rho - m12 ) + square( Gam_rho / 2. ) ) * m12 );
845  double W13 = 1. /
846  ( ( square( Mass_rho - m13 ) + square( Gam_rho / 2. ) ) * m13 );
847 
848  double Wtot = 1.;
849  if ( iset >= 0 ) {
850  Wtot = 1. / sqrt( W12 + W13 );
851  }
852 
853  EvtComplex Mat_rhop = BreitWigner( p1, p2, p3, ierr ) +
854  BreitWigner( p1, p3, p2, ierr );
855 
856  EvtComplex MatBp = Mat_S2 * Mat_rhop * Wtot * ASHQ;
857  EvtComplex MatBm = Nat_S2 * Mat_rhop * Wtot * ASHQ;
858 
859  real_B0 = real( MatBp );
860  imag_B0 = imag( MatBp );
861 
862  real_B0bar = real( MatBm );
863  imag_B0bar = imag( MatBm );
864 
865  return ierr;
866 }
867 
869  EvtVector4R& p3, double& real_B0, double& imag_B0,
870  double& real_B0bar, double& imag_B0bar, int iset )
871 {
872  int ierr = 0;
873  const double ASHQ = sqrt( 2. );
874  double m12 = ( p1 + p2 ).mass();
875  double m13 = ( p1 + p3 ).mass();
876 
877  double W12 = 1. /
878  ( ( square( Mass_rho - m12 ) + square( Gam_rho / 2. ) ) * m12 );
879  double W13 = 1. /
880  ( ( square( Mass_rho - m13 ) + square( Gam_rho / 2. ) ) * m13 );
881 
882  double Wtot = 1.;
883  if ( iset >= 0 ) {
884  Wtot = 1. / sqrt( W12 + W13 );
885  }
886 
887  EvtComplex Mat_rhop = BreitWigner( p1, p2, p3, ierr ) +
888  BreitWigner( p1, p3, p2, ierr );
889 
890  EvtComplex MatBp = Mat_S1 * Mat_rhop * Wtot * ASHQ;
891  EvtComplex MatBm = Nat_S1 * Mat_rhop * Wtot * ASHQ;
892 
893  real_B0 = real( MatBp );
894  imag_B0 = imag( MatBp );
895 
896  real_B0bar = real( MatBm );
897  imag_B0bar = imag( MatBm );
898 
899  return ierr;
900 }
901 
903  double& real_B0, double& imag_B0,
904  double& real_B0bar, double& imag_B0bar, int iset )
905 {
906  int ierr = 0;
907 
908  double m12 = ( p1 + p2 ).mass();
909  double m13 = ( p1 + p3 ).mass();
910  double m23 = ( p2 + p3 ).mass();
911 
912  double W12 = 1. /
913  ( ( square( Mass_Kstar0 - m12 ) + square( Gam_Kstar0 / 2. ) ) *
914  m12 );
915  double W13 = 1. /
916  ( ( square( Mass_Kstarp - m13 ) + square( Gam_Kstarp / 2. ) ) *
917  m13 );
918  double W23 = 1. /
919  ( ( square( Mass_rho - m23 ) + square( Gam_rho / 2. ) ) * m23 );
920 
921  double Wtot = 1.;
922  if ( iset >= 0 ) {
923  Wtot = 1. / sqrt( W12 + W13 + W23 );
924  }
925 
926  EvtComplex BW13 = BreitWigner( p1, p3, p2, ierr, Mass_Kstarp, Gam_Kstarp );
927  if ( ierr != 0 )
928  return ierr;
929  EvtComplex BW12 = BreitWigner( p1, p2, p3, ierr, Mass_Kstar0, Gam_Kstar0 );
930  if ( ierr != 0 )
931  return ierr;
932  /*
933  If the rho is to be treated on the same footing as K* ==> use the line below
934  EvtComplex BW23=BreitWigner(p2, p3, p1, ierr, Mass_Rho, Gam_Rho);
935  */
936  EvtComplex BW23 = BreitWigner( p2, p3, p1, ierr );
937  if ( ierr != 0 )
938  return ierr;
939 
940  // Build up amplitudes
941  EvtComplex MatB0 = MatKstarp * BW13 + MatKstar0 * BW12 + MatKrho * BW23;
942  EvtComplex MatB0bar = NatKstarp * BW13 + NatKstar0 * BW12 + NatKrho * BW23;
943 
944  real_B0 = real( MatB0 ) * Wtot;
945  imag_B0 = imag( MatB0 ) * Wtot;
946  real_B0bar = real( MatB0bar ) * Wtot;
947  imag_B0bar = imag( MatB0bar ) * Wtot;
948 
949  return ierr;
950 }
951 
952 void EvtBTo3hCP::rotation( EvtVector4R& p, int newRot )
953 {
954  if ( newRot ) {
955  double phi2 = EvtRandom::Flat() * 2. * pi;
956  double phi3 = EvtRandom::Flat() * 2. * pi;
957 
958  double c1 = 2. * EvtRandom::Flat() - 1.;
959  double c2 = cos( phi2 );
960  double c3 = cos( phi3 );
961 
962  double s1 = sqrt( 1. - square( c1 ) );
963  double s2 = sin( phi2 );
964  double s3 = sin( phi3 );
965 
966  rotMatrix[0][0] = c1;
967  rotMatrix[0][1] = s1 * c3;
968  rotMatrix[0][2] = s1 * s3;
969  rotMatrix[1][0] = -s1 * c2;
970  rotMatrix[1][1] = c1 * c2 * c3 - s2 * s3;
971  rotMatrix[1][2] = c1 * c2 * s3 + s2 * c3;
972  rotMatrix[2][0] = s1 * s2;
973  rotMatrix[2][1] = -c1 * s2 * c3 - c2 * s3;
974  rotMatrix[2][2] = -c1 * s2 * s3 + c2 * c3;
975  }
976 
977  double mom[3];
978  for ( int i = 1; i < 4; ++i ) {
979  mom[i - 1] = p.get( i );
980  p.set( i, 0 );
981  }
982  for ( int i = 0; i < 3; ++i ) {
983  for ( int j = 0; j < 3; ++j ) {
984  p.set( i + 1, p.get( i + 1 ) + rotMatrix[i][j] * mom[j] );
985  }
986  }
987 }
988 
990  EvtVector4R& pgamma2 )
991 {
992  double EGammaCmsPi0 = sqrt( p.mass2() ) / 2.;
993 
994  double cosThetaRot = EvtRandom::Flat() * 2. - 1.;
995  double sinThetaRot = sqrt( 1. - square( cosThetaRot ) );
996  double PhiRot = EvtRandom::Flat() * 2. * pi;
997 
998  pgamma1.set( 1, EGammaCmsPi0 * sinThetaRot * cos( PhiRot ) );
999  pgamma1.set( 2, EGammaCmsPi0 * sinThetaRot * sin( PhiRot ) );
1000  pgamma1.set( 3, EGammaCmsPi0 * cosThetaRot );
1001  pgamma1.set( 0, EGammaCmsPi0 );
1002 
1003  for ( int i = 1; i < 4; ++i ) {
1004  pgamma2.set( i, -pgamma1.get( i ) );
1005  }
1006  pgamma2.set( 0, pgamma1.get( 0 ) );
1007 
1008  pgamma1.applyBoostTo( p );
1009  pgamma2.applyBoostTo( p );
1010 }
1011 
1013  EvtVector4R& p3, int& ierr, double Mass,
1014  double Width )
1015 {
1016  bool pipiMode = true;
1017 
1018  if ( Mass > 1e-5 ) {
1019  pipiMode = false;
1020  }
1021 
1022  bool relatBW = true;
1023  bool aleph = true;
1024  EvtComplex result( 0, 0 );
1025  ierr = 0;
1026 
1027  double m12 = ( p1 + p2 ).mass();
1028  double e12 = ( p1 + p2 ).get( 0 );
1029  double argu = 1. - square( m12 ) / square( e12 );
1030  double beta = 0;
1031  if ( argu > 0 ) {
1032  beta = sqrt( argu );
1033  } else {
1034  std::cout << "Abnormal beta ! Argu = " << argu << std::endl;
1035  argu = 0;
1036  }
1037  double gamma = e12 / m12;
1038 
1039  double m13sq = ( p1 + p3 ).mass2();
1040  double costet = ( 2. * p1.get( 0 ) * p3.get( 0 ) - m13sq + p1.mass2() +
1041  p3.mass2() ) /
1042  ( 2. * p1.d3mag() * p3.d3mag() );
1043 
1044  double p1z = p1.d3mag() * costet;
1045  double p1zcms12 = gamma * ( p1z + beta * p1.get( 0 ) );
1046  double e1cms12 = gamma * ( p1.get( 0 ) + beta * p1z );
1047  double p1cms12 = sqrt( square( e1cms12 ) - p1.mass2() );
1048  double coscms = p1zcms12 / p1cms12;
1049 
1050  if ( pipiMode ) {
1051  if ( aleph ) {
1052  double m12_2 = square( m12 );
1053  result = coscms * EvtCRhoF_W( m12_2 );
1054  } else {
1055  double factor = 2 * ( square( Mass_rho - m12 ) +
1056  square( 0.5 * Gam_rho ) );
1057  factor = coscms * Gam_rho / factor;
1058  double numReal = ( Mass_rho - m12 ) * factor;
1059  double numImg = 0.5 * Gam_rho * factor;
1060  result = EvtComplex( numReal, numImg );
1061  }
1062  } else {
1063  if ( relatBW ) {
1064  double Am2Min = p1.mass2() + p2.mass2() + 2 * p1.mass() * p2.mass();
1065  result = coscms *
1066  EvtRBW( square( m12 ), square( Mass ), Width, Am2Min );
1067  } else {
1068  double factor = 2 * ( square( Mass - m12 ) + square( 0.5 * Width ) );
1069  factor = coscms * Width / factor;
1070  double numReal = ( Mass - m12 ) * factor;
1071  double numImg = 0.5 * Width * factor;
1072  result = EvtComplex( numReal, numImg );
1073  }
1074  }
1075 
1076  return result;
1077 }
1078 
1080 {
1081  const bool kuhn_santa = true; // type of Breit-Wigner formula
1082  // double lambda = 1.0;
1083 
1084  double AmRho, GamRho, AmRhoP, GamRhoP, beta, AmRhoPP, GamRhoPP, gamma;
1085  if ( kuhn_santa ) {
1086  //...rho(770)
1087  AmRho = 0.7734;
1088  GamRho = 0.1477;
1089  //...rho(1450)
1090  AmRhoP = 1.465;
1091  GamRhoP = 0.696;
1092  beta = -0.229;
1093  //...rho(1700)
1094  AmRhoPP = 1.760;
1095  GamRhoPP = 0.215;
1096  gamma = 0.075;
1097  } else {
1098  //...rho(770)
1099  AmRho = 0.7757;
1100  GamRho = 0.1508;
1101  //...rho(1450)
1102  AmRhoP = 1.448;
1103  GamRhoP = 0.503;
1104  beta = -0.161;
1105  //...rho(1700)
1106  AmRhoPP = 1.757;
1107  GamRhoPP = 0.237;
1108  gamma = 0.076;
1109  }
1110 
1111  EvtComplex result( 0, 0 );
1112 
1113  if ( kuhn_santa ) {
1114  result = ( EvtcBW_KS( s, square( AmRho ), GamRho ) +
1115  EvtcBW_KS( s, square( AmRhoP ), GamRhoP ) *
1116  ( beta ) +
1117  EvtcBW_KS( s, square( AmRhoPP ), GamRhoPP ) *
1118  ( gamma ) ) /
1119  ( 1. + beta + gamma );
1120  } else {
1121  result = ( EvtcBW_GS( s, square( AmRho ), GamRho ) +
1122  EvtcBW_GS( s, square( AmRhoP ), GamRhoP ) * ( beta ) +
1123  EvtcBW_GS( s, square( AmRhoPP ), GamRhoPP ) * ( gamma ) ) /
1124  ( 1. + beta + gamma );
1125  }
1126  return result;
1127 }
1128 
1129 EvtComplex EvtBTo3hCP::EvtRBW( double s, double Am2, double Gam, double Am2Min )
1130 {
1131  EvtComplex result( 0, 0 );
1132 
1133  if ( s < Am2Min ) {
1134  return result;
1135  }
1136 
1137  double tmp = ( ( s - Am2Min ) / ( Am2 - Am2Min ) );
1138  double G = Gam * ( Am2 / s ) * sqrt( square( tmp ) * tmp );
1139  double D = square( Am2 - s ) + s * square( G );
1140  double X = Am2 * ( Am2 - s );
1141  double Y = Am2 * sqrt( s ) * G;
1142 
1143  result = EvtComplex( X / D, Y / D );
1144  return result;
1145 }
1146 
1147 EvtComplex EvtBTo3hCP::EvtcBW_KS( double s, double Am2, double Gam )
1148 {
1149  EvtComplex result( 0, 0 );
1150  const double AmPi2 = square( 0.13956995 );
1151  return EvtRBW( s, Am2, Gam, 4. * AmPi2 );
1152 }
1153 
1154 EvtComplex EvtBTo3hCP::EvtcBW_GS( double s, double Am2, double Gam )
1155 {
1156  EvtComplex result( 0, 0 );
1157  const double AmPi2 = square( 0.13956995 );
1158 
1159  if ( s < 4. * AmPi2 ) {
1160  return result;
1161  }
1162 
1163  double tmp = ( ( s - 4. * AmPi2 ) / ( Am2 - 4. * AmPi2 ) );
1164 
1165  double G = Gam * ( Am2 / s ) * sqrt( square( tmp ) * tmp );
1166  double z1 = Am2 - s + Evtfs( s, Am2, Gam );
1167  double z2 = sqrt( s ) * G;
1168  double z3 = Am2 + d( Am2 ) * Gam * sqrt( Am2 );
1169 
1170  double X = z3 * z1;
1171  double Y = z3 * z2;
1172  double N = square( z1 ) + square( z2 );
1173 
1174  result = EvtComplex( X / N, Y / N );
1175 
1176  return result;
1177 }
1178 
1179 double EvtBTo3hCP::d( double AmRho2 )
1180 {
1181  const double lpi = 3.141593;
1182  const double AmPi = 0.13956995;
1183  const double AmPi2 = square( AmPi );
1184  double AmRho = sqrt( AmRho2 );
1185  double k_AmRho2 = k( AmRho2 );
1186  double result = 3. / lpi * AmPi2 / square( k_AmRho2 ) *
1187  log( ( AmRho + 2. * k_AmRho2 ) / ( 2. * AmPi ) ) +
1188  AmRho / ( 2. * pi * k_AmRho2 ) -
1189  AmPi2 * AmRho / ( pi * ( square( k_AmRho2 ) * k_AmRho2 ) );
1190  return result;
1191 }
1192 
1193 double EvtBTo3hCP::k( double s )
1194 {
1195  const double AmPi2 = square( 0.13956995 );
1196  return 0.5 * sqrt( s - 4. * AmPi2 );
1197 }
1198 
1199 double EvtBTo3hCP::Evtfs( double s, double AmRho2, double GamRho )
1200 {
1201  double k_s = k( s );
1202  double k_Am2 = k( AmRho2 );
1203 
1204  return GamRho * AmRho2 / ( square( k_Am2 ) * k_Am2 ) *
1205  ( square( k_s ) * ( h( s ) - h( AmRho2 ) ) +
1206  ( AmRho2 - s ) * square( k_Am2 ) * dh_ds( AmRho2 ) );
1207 }
1208 
1209 double EvtBTo3hCP::h( double s )
1210 {
1211  const double pi = 3.141593;
1212  const double AmPi = 0.13956995;
1213  double sqrts = sqrt( s );
1214  double k_s = k( s );
1215  return 2. / pi * ( k_s / sqrts ) *
1216  log( ( sqrts + 2. * k_s ) / ( 2. * AmPi ) );
1217 }
1218 
1219 double EvtBTo3hCP::dh_ds( double s )
1220 {
1221  const double pi = 3.141593;
1222  return h( s ) * ( 1. / ( 8. * square( k( s ) ) ) - 1. / ( 2 * s ) ) +
1223  1. / ( 2. * pi * s );
1224 }
EvtComplex Mat_S4
Definition: EvtBTo3hCP.hh:95
double Gam_rho
Definition: EvtBTo3hCP.hh:105
EvtComplex Nat_S4
Definition: EvtBTo3hCP.hh:95
EvtComplex MatKstar0
Definition: EvtBTo3hCP.hh:95
double MB2
Definition: EvtBTo3hCP.hh:101
double d(double AmRho2)
EvtComplex MatKstarp
Definition: EvtBTo3hCP.hh:95
EvtComplex EvtRBW(double s, double Am2, double Gam, double Am2Min)
double M_pip
Definition: EvtBTo3hCP.hh:107
void generateSqMasses_3piMPP(double &m12, double &m13, double &m23, double MB2, double m1sq, double m2sq, double m3sq)
Definition: EvtBTo3hCP.cpp:682
EvtComplex Mat_S5
Definition: EvtBTo3hCP.hh:95
EvtComplex Mat_S1
Definition: EvtBTo3hCP.hh:95
void Evt3piMPP(double alpha, int iset, EvtVector4R &p_p1, EvtVector4R &p_p2, EvtVector4R &p_p3, double &Real_B0, double &Imag_B0, double &Real_B0bar, double &Imag_B0bar)
Definition: EvtBTo3hCP.cpp:210
void rotation(EvtVector4R &p, int newRot)
Definition: EvtBTo3hCP.cpp:952
double h(double s)
double MA2
Definition: EvtBTo3hCP.hh:100
double Evtfs(double s, double AmRho2, double GamRho)
double Mass_Kstarp
Definition: EvtBTo3hCP.hh:111
void setConstants(double balpha, double bbeta)
Definition: EvtBTo3hCP.cpp:49
int compute3piP00(EvtVector4R &p1, EvtVector4R &p2, EvtVector4R &p3, double &real_B0, double &imag_B0, double &real_B0bar, double &imag_B0bar, int set)
Definition: EvtBTo3hCP.cpp:868
double mass() const
Definition: EvtVector4R.cpp:49
EvtComplex BreitWigner(EvtVector4R &p1, EvtVector4R &p2, EvtVector4R &p3, int &ierr, double Mass=0, double Width=0)
double M_Kp
Definition: EvtBTo3hCP.hh:110
#define square(x)
Definition: EvtBTo3hCP.cpp:38
double M_B
Definition: EvtBTo3hCP.hh:106
EvtComplex Nat_S2
Definition: EvtBTo3hCP.hh:95
void set(int i, double d)
Definition: EvtVector4R.hh:167
void EvtKpipi(double alpha, double beta, int iset, EvtVector4R &p_K_plus, EvtVector4R &p_pi_minus, EvtVector4R &p_gamma_1, EvtVector4R &p_gamma_2, double &Real_B0, double &Imag_B0, double &Real_B0bar, double &Imag_B0bar)
Definition: EvtBTo3hCP.cpp:355
void generateSqMasses_Kpipi(double &m12, double &m13, double &m23, double MB2, double m1sq, double m2sq, double m3sq)
Definition: EvtBTo3hCP.cpp:551
EvtComplex Mat_S3
Definition: EvtBTo3hCP.hh:95
EvtComplex MatKrho
Definition: EvtBTo3hCP.hh:95
int computeKpipi(EvtVector4R &p1, EvtVector4R &p2, EvtVector4R &p3, double &real_B0, double &imag_B0, double &real_B0bar, double &imag_B0bar, int set)
Definition: EvtBTo3hCP.cpp:902
void gammaGamma(EvtVector4R &p, EvtVector4R &pgamma1, EvtVector4R &pgamma2)
Definition: EvtBTo3hCP.cpp:989
double Mass_Kstar0
Definition: EvtBTo3hCP.hh:112
void firstStep(EvtVector4R &p1, EvtVector4R &p2, EvtVector4R &p3, int mode)
Definition: EvtBTo3hCP.cpp:430
double mass2() const
Definition: EvtVector4R.hh:100
EvtComplex NatKrho
Definition: EvtBTo3hCP.hh:95
double get(int i) const
Definition: EvtVector4R.hh:162
double dh_ds(double s)
double rotMatrix[3][3]
Definition: EvtBTo3hCP.hh:116
double M_pi0
Definition: EvtBTo3hCP.hh:109
EvtComplex Mat_S2
Definition: EvtBTo3hCP.hh:95
void generateSqMasses_3piP00(double &m12, double &m13, double &m23, double MB2, double m1sq, double m2sq, double m3sq)
Definition: EvtBTo3hCP.cpp:735
void Evt3pi(double alpha, int iset, EvtVector4R &p_K_plus, EvtVector4R &p_pi_minus, EvtVector4R &p_gamma_1, EvtVector4R &p_gamma_2, double &Real_B0, double &Imag_B0, double &Real_B0bar, double &Imag_B0bar)
Definition: EvtBTo3hCP.cpp:133
EvtComplex NatKstar0
Definition: EvtBTo3hCP.hh:95
int compute3piMPP(EvtVector4R &p1, EvtVector4R &p2, EvtVector4R &p3, double &real_B0, double &imag_B0, double &real_B0bar, double &imag_B0bar, int set)
Definition: EvtBTo3hCP.cpp:834
static double Flat()
Definition: EvtRandom.cpp:72
double MC2
Definition: EvtBTo3hCP.hh:102
EvtComplex EvtCRhoF_W(double s)
double imag(const EvtComplex &c)
Definition: EvtComplex.hh:235
double factor_max
Definition: EvtBTo3hCP.hh:117
double alphaCP
Definition: EvtBTo3hCP.hh:98
void applyBoostTo(const EvtVector4R &p4, bool inverse=false)
EvtComplex Nat_S5
Definition: EvtBTo3hCP.hh:95
double d3mag() const
double pi
Definition: EvtBTo3hCP.hh:103
double Gam_Kstarp
Definition: EvtBTo3hCP.hh:113
void generateSqMasses_3pi(double &m12, double &m13, double &m23, double MB2, double m1sq, double m2sq, double m3sq)
Definition: EvtBTo3hCP.cpp:619
double Gam_Kstar0
Definition: EvtBTo3hCP.hh:114
EvtComplex EvtcBW_GS(double s, double Am2, double Gam)
int compute3pi(EvtVector4R &p1, EvtVector4R &p2, EvtVector4R &p3, double &real_B0, double &imag_B0, double &real_B0bar, double &imag_B0bar, int set)
Definition: EvtBTo3hCP.cpp:787
EvtComplex Nat_S1
Definition: EvtBTo3hCP.hh:95
EvtComplex EvtcBW_KS(double s, double Am2, double Gam)
EvtComplex Nat_S3
Definition: EvtBTo3hCP.hh:95
double M_pim
Definition: EvtBTo3hCP.hh:108
double k(double s)
double betaCP
Definition: EvtBTo3hCP.hh:99
double real(const EvtComplex &c)
Definition: EvtComplex.hh:230
double Mass_rho
Definition: EvtBTo3hCP.hh:104
void Evt3piP00(double alpha, int iset, EvtVector4R &p_p1, EvtVector4R &p_p1_gamma1, EvtVector4R &p_p1_gamma2, EvtVector4R &p_p2_gamma1, EvtVector4R &p_p2_gamma2, double &Real_B0, double &Imag_B0, double &Real_B0bar, double &Imag_B0bar)
Definition: EvtBTo3hCP.cpp:279
EvtComplex NatKstarp
Definition: EvtBTo3hCP.hh:95