9#include "FemtoWeightGeneratorKisiel.h"
20#define COULOMBSTEPS 170
23 FemtoWeightGeneratorKisiel::FemtoWeightGeneratorKisiel() :
24 FemtoWeightGenerator(),
40 void FemtoWeightGeneratorKisiel::InitializeGamow() {
44 fF0 = 7.77 / 0.197327;
45 fD0 = 2.77 / 0.197327;
57 static unsigned short int isospin = 0;
59 case Femto::EPairType::kPionPlusPionPlus: {
60 fPionac = 387.5 / 0.197327;
62 case Femto::EPairType::kKaonPlusKaonPlus: {
63 fPionac = 109.55 / 0.197327;
65 case Femto::EPairType::kPionPlusKaonPlus: {
66 fPionac = 248.519 / 0.197327;
69 case Femto::EPairType::kPionPlusKaonMinus: {
70 fPionac = -248.519 / 0.197327;
73 case Femto::EPairType::kPionPlusProton: {
74 fPionac = 222.564 / 0.197327;
77 case Femto::EPairType::kPionPlusAntiproton: {
78 fPionac = -222.564 / 0.197327;
81 case Femto::EPairType::kProtonSigmaPlus: {
82 fPionac = 51.5553 / 0.197327;
85 fF0s.re = 3.85 / 0.197327;
86 fD0s.re = 3.40 / 0.197327;
87 fF0t.re = -0.62 / 0.197327;
88 fD0t.re = -2.13 / 0.197327;
90 case Femto::EPairType::kProtonAntiSigmaPlus: {
91 fPionac = -51.5553 / 0.197327;
94 fF0s.re = -1.20 / 0.197327;
95 fF0s.im = 0.37 / 0.197327;
96 fF0t.re = -1.20 / 0.197327;
97 fF0t.im = 0.37 / 0.197327;
99 case Femto::EPairType::kProtonLambda: {
101 fF0s.re = 2.70 / 0.197327;
102 fD0s.re = 2.97 / 0.197327;
103 fF0t.re = 1.65 / 0.197327;
104 fD0t.re = 3.63 / 0.197327;
106 case Femto::EPairType::kProtonAntiLambda: {
109 fF0s.re = -1.20 / 0.197327;
110 fF0s.im = 0.37 / 0.197327;
111 fF0t.re = -1.20 / 0.197327;
112 fF0t.im = 0.37 / 0.197327;
114 case Femto::EPairType::kSigmaPlusSigmaPlus: {
115 fPionac = 45.4709 / 0.197327;
118 case Femto::EPairType::kSigmaPlusAntiSigmaPlus: {
119 fPionac = -45.4709 / 0.197327;
121 case Femto::EPairType::kProtonProton: {
122 fPionac = 57.63975274 / 0.197327;
127 fD0t.re = 1.7 / 0.197327;
128 fF0t.re = -5.4 / 0.197327;
131 fF0s.re = 7.771 / 0.197327;
132 fD0s.re = 2.754 / 0.197327;
136 case Femto::EPairType::kKaonPlusProton: {
137 fPionac = 83.59432006 / 0.197327;
139 case Femto::EPairType::kKaonPlusAntiproton: {
140 fPionac = -83.59432006 / 0.197327;
142 case Femto::EPairType::kPionPlusPionMinus: {
143 fPionac = -387.5 / 0.197327;
148 case Femto::EPairType::kLambdaLambda: {
152 fF0s.re = 0.88 / 0.197327;
153 fD0s.re = 4.34 / 0.197327;
154 fF0t.re = 0.88 / 0.197327;
155 fD0t.re = 4.34 / 0.197327;
157 case Femto::EPairType::kProtonXiZero: {
164 fF0t.re = -6.90 / 0.197327;
165 fD0t.re = 1.18 / 0.197327;
167 }
else if (isospin == 1) {
168 fF0s.re = -0.58 / 0.197327;
169 fD0s.re = -2.71 / 0.197327;
170 fF0t.re = -3.49 / 0.197327;
171 fD0t.re = 0.60 / 0.197327;
175 case Femto::EPairType::kNeutronXiMinus: {
182 fF0t.re = -6.90 / 0.197327;
183 fD0t.re = 1.18 / 0.197327;
185 }
else if (isospin == 1) {
186 fF0s.re = -0.58 / 0.197327;
187 fD0s.re = -2.71 / 0.197327;
188 fF0t.re = -3.49 / 0.197327;
189 fD0t.re = 0.60 / 0.197327;
193 case Femto::EPairType::kProtonXIMInus: {
194 fPionac = 49.2788901 / 0.197327;
200 fF0t.re = -6.90 / 0.197327;
201 fD0t.re = 1.18 / 0.197327;
203 }
else if (isospin == 1) {
204 fF0s.re = -0.58 / 0.197327;
205 fD0s.re = -2.71 / 0.197327;
206 fF0t.re = -3.49 / 0.197327;
207 fD0t.re = 0.60 / 0.197327;
211 case Femto::EPairType::kNeutronXiZero: {
218 fF0t.re = -6.90 / 0.197327;
219 fD0t.re = 1.18 / 0.197327;
221 }
else if (isospin == 1) {
222 fF0s.re = -0.58 / 0.197327;
223 fD0s.re = -2.71 / 0.197327;
224 fF0t.re = -3.49 / 0.197327;
225 fD0t.re = 0.60 / 0.197327;
229 case Femto::EPairType::kNeutronProton: {
233 fF0s.re = 23.735 / 0.197327;
234 fD0s.re = 2.694 / 0.197327;
235 fF0t.re = -5.428 / 0.197327;
236 fD0t.re = 1.753 / 0.197327;
238 case Femto::EPairType::kNeutronNeutron: {
242 fF0s.re = 16.51 / 0.197327;
243 fD0s.re = 2.85 / 0.197327;
245 case Femto::EPairType::kProtonSigmaZero: {
249 fF0s.re = 2.70 / 0.197327;
250 fD0s.re = 2.97 / 0.197327;
251 fF0t.re = 1.65 / 0.197327;
252 fD0t.re = 3.63 / 0.197327;
254 case Femto::EPairType::kSigmaZeroSigmaZero: {
258 fF0s.re = 0.88 / 0.197327;
259 fD0s.re = 4.34 / 0.197327;
260 fF0t.re = 0.88 / 0.197327;
261 fD0t.re = 4.34 / 0.197327;
263 case Femto::EPairType::kLambdaSigmaZero: {
266 fF0s.re = 0.88 / 0.197327;
267 fD0s.re = 4.34 / 0.197327;
268 fF0t.re = 0.88 / 0.197327;
269 fD0t.re = 4.34 / 0.197327;
271 default: fPionac = 0;
break;
273 fOneoveracsq = 1.0 / (fPionac * fPionac);
274 fTwopioverac = 2.0 * TMath::Pi() / fPionac;
277 for (
int iter = 0; iter < 2000; iter++) {
278 tpaoverk = fTwopioverac / (iter * 0.0002 + 0.0001);
283 void FemtoWeightGeneratorKisiel::PairKinematics(FemtoPair* pair) {
284 Double_t tPx = pair->TruePx1() + pair->TruePx2();
285 Double_t tPy = pair->TruePy1() + pair->TruePy2();
286 Double_t tPz = pair->TruePz1() + pair->TruePz2();
287 Double_t tE1 = pair->TrueE1();
288 Double_t tE2 = pair->TrueE2();
289 Double_t tE = tE1 + tE2;
290 Double_t tPt = tPx * tPx + tPy * tPy;
291 Double_t tMt = tE * tE - tPz * tPz;
292 Double_t tM = sqrt(tMt - tPt);
298 Double_t tBeta = tPz / tE;
299 Double_t tGamma = tE / tMt;
300 fKStarLong = tGamma * (pair->TruePz1() - tBeta * tE1);
301 Double_t tE1L = tGamma * (tE1 - tBeta * pair->TruePz1());
303 fKStarOut = (pair->TruePx1() * tPx + pair->TruePy1() * tPy) / tPt;
304 fKStarSide = (-pair->TruePx1() * tPy + pair->TruePy1() * tPx) / tPt;
306 fKStarOut = tMt / tM * (fKStarOut - tPt / tMt * tE1L);
309 Double_t tDX = pair->GetX1() - pair->GetX2();
310 Double_t tDY = pair->GetY1() - pair->GetY2();
311 Double_t tRLong = pair->GetZ1() - pair->GetZ2();
312 Double_t tDTime = pair->GetT1() - pair->GetT2();
314 Double_t tROut = (tDX * tPx + tDY * tPy) / tPt;
315 Double_t tRSide = (-tDX * tPy + tDY * tPx) / tPt;
318 fRStarSideS = fRStarSide / 0.197327;
320 fRStarLong = tGamma * (tRLong - tBeta * tDTime);
321 Double_t tDTimePairLCMS = tGamma * (tDTime - tBeta * tRLong);
323 fRStarLongS = fRStarLong / 0.197327;
327 fRStarOut = tGamma * (tROut - tBeta * tDTimePairLCMS);
328 fRStarOutS = fRStarOut / 0.197327;
330 fRStar = ::sqrt(fRStarOut * fRStarOut + fRStarSide * fRStarSide + fRStarLong * fRStarLong);
331 fKStar = ::sqrt(fKStarOut * fKStarOut + fKStarSide * fKStarSide + fKStarLong * fKStarLong);
332 if (fKStarOut < 0) fKStar = -fKStar;
333 fRStarS = fRStar / 0.197327;
336 Double_t FemtoWeightGeneratorKisiel::GenerateWeight(
FemtoPair* pair) {
337 double coulombweight;
338 fPairType = Femto::PidToPairType(pair->
GetPdg1(), pair->
GetPdg2());
343 if (Femto::IsPairIdentical(fPairType) == kFALSE) {
344 if (fabs(fPionac) > 0.1) {
346 if (fabs(fD0s.re) > 0.00001)
347 coulombweight = GetCoulombStrong();
349 coulombweight = GetCoulomb();
351 coulombweight = GetStrong();
352 if (std::isnan(coulombweight) == 1)
return 1;
355 if (fPairType == Femto::EPairType::kPionZeroPionZero) {
return GetQuantum(); }
356 if (fabs(fPionac) > 0.1) {
357 if (fPairType != Femto::EPairType::kProtonProton)
358 coulombweight = GetQuantumCoulomb();
360 coulombweight = GetQuantumCoulombStrong();
362 coulombweight = GetQuantumStrong();
367 return coulombweight;
370 double FemtoWeightGeneratorKisiel::Gamow(
double arg)
const {
374 long double eta = fTwopioverac / arg;
375 return (eta) *1.0 / (exp(eta) - 1.0);
382 double FemtoWeightGeneratorKisiel::GetQuantumCoulombStrong() {
383 if (fRStarS < 0.0000000001)
return 1.0;
385 if (fRStarS < 1.0 / 0.197327)
return GetQuantumCoulomb();
387 double tKstRst = fKStarOut * fRStarOutS + fKStarSide * fRStarSideS + fKStarLong * fRStarLongS;
388 long double kstar = fabs(fKStar);
389 long double rho = fRStarS * kstar;
392 static int pcount = 0;
401 long double testp = rho * (1.0 + tKstRst / (rho));
402 long double testm = rho * (1.0 - tKstRst / (rho));
404 dcomplex ffplus, ffminus;
405 if ((testp > 15.0) && (testm > 15.0)) {
407 asym = (1.0 - 1.0 / (fRStarS * (1.0 - tKstRst / rho) * fPionac * kstar * kstar)) / Gamow(kstar);
411 ffminus.re = 1.0 + (asym - 1.0) * 2.0;
413 ffminus.re = 1.0 + (asym - 1.0) / 2.0;
414 ffminus.im = sqrt(asym * asym - ffminus.re * ffminus.re);
416 asym = (1.0 - 1.0 / (fRStarS * (1.0 + tKstRst / rho) * fPionac * kstar * kstar)) / Gamow(kstar);
420 ffplus.re = 1.0 + (asym - 1.0) * 2.0;
422 ffplus.re = 1.0 + (asym - 1.0) / 2.0;
423 ffplus.im = sqrt(asym * asym - ffplus.re * ffplus.re);
428 else if (((testp < 15.0) && (testm < 15.0)))
431 GetFFdouble(ffplus, ffminus);
433 }
else if (testp < 15.0) {
435 GetFFsingle(ffplus, 1);
436 GetFFsingle(ffminus, -1);
437 if ((fabs(ffminus.re) > 2.0) || fabs(ffminus.im) > 2.0) {
438 asym = (1.0 - 1.0 / (fRStarS * (1.0 - tKstRst / (rho) *fPionac * kstar * kstar))) / Gamow(kstar);
441 ffminus.re = 1.0 + (asym - 1.0) * 2.0;
443 ffminus.re = 1.0 + (asym - 1.0) / 2.0;
444 ffminus.im = sqrt(asym * asym - ffminus.re * ffminus.re);
449 GetFFsingle(ffminus, -1);
450 GetFFsingle(ffplus, 1);
451 if ((fabs(ffplus.re) > 2.0) || fabs(ffplus.im) > 2.0) {
452 asym = (1.0 - 1.0 / (fRStarS * (1.0 + tKstRst / (rho) *fPionac * kstar * kstar))) / Gamow(kstar);
455 ffplus.re = 1.0 + (asym - 1.0) * 2.0;
457 ffplus.re = 1.0 + (asym - 1.0) / 2.0;
458 ffplus.im = sqrt(asym * asym - ffplus.re * ffplus.re);
463 long double eta = 1.0 / (kstar * fPionac);
464 long double hfun = GetH(eta);
465 dcomplex gtilde = GetG(eta, rho, hfun);
466 dcomplex gtilor = mult(gtilde, 1.0 / fRStarS);
468 dcomplex fcouls, fcoult;
469 Getfc(kstar, eta, hfun, fcouls, fcoult);
471 dcomplex fgs = mult(gtilor, fcouls);
472 long double fgmods = modl2(fgs);
474 dcomplex fgt = mult(gtilor, fcoult);
475 long double fgmodt = modl2(fgt);
478 expikr.re = cos(tKstRst);
479 expikr.im = -sin(tKstRst);
480 dcomplex expikrc = conj(expikr);
481 dcomplex ffplusc = conj(ffplus);
482 dcomplex ffminusc = conj(ffminus);
484 dcomplex expikr2 = mult(expikr, expikr);
485 dcomplex expikrc2 = conj(expikr2);
486 dcomplex sterm = mult(expikr2, mult(ffplus, ffminusc));
487 dcomplex tterm = mult(expikrc2, mult(ffminus, ffplusc));
489 dcomplex epfpc = mult(expikr, ffplus);
490 dcomplex emfmc = mult(expikrc, ffminus);
492 long double fcgefhs = (fgs.re * emfmc.re + fgs.im * emfmc.im);
493 long double fcgefgs = (fgs.re * epfpc.re + fgs.im * epfpc.im);
495 long double fcgefht = (fgt.re * emfmc.re + fgt.im * emfmc.im);
496 long double fcgefgt = (fgt.re * epfpc.re + fgt.im * epfpc.im);
498 long double smult = 1 + wavesign;
500 if (!std::isfinite(ffminus.re))
501 std::cout <<
"FFMinus Re not a number ! " << testp <<
" " << testm <<
" " << ccase << std::endl;
503 if (!std::isfinite(ffminus.im))
504 std::cout <<
"FFMinus Im not a number !" << testp <<
" " << testm <<
" " << ccase << std::endl;
506 if ((ffplus.re > 2.0) || (ffplus.re < -2.0))
507 std::cout << std::endl <<
"FFplus Re wild !" << ffplus.re <<
" case " << ccase <<
" " << testp <<
" " << testm << std::endl;
509 if ((ffplus.im > 2.0) || (ffplus.im < -2.0))
510 std::cout <<
"FFplus Im wild !" << ffplus.im <<
" case " << ccase <<
" " << testp <<
" " << testm << std::endl;
512 if ((ffminus.re > 2.0) || (ffminus.re < -2.0))
513 std::cout << std::endl <<
"FFminus Re wild !" << ffminus.re <<
" case " << ccase << std::endl;
515 if ((ffminus.im > 2.0) || (ffminus.im < -2.0))
516 std::cout <<
"FFminus Im wild !" << ffminus.im <<
" case " << ccase << std::endl;
525 long double singlet = (0.5 * Gamow(kstar)
526 * (2.0 * fgmods * smult + modl2(ffplus) + modl2(ffminus) + wavesign * sterm.re + wavesign * tterm.re
527 + smult * 2 * (fcgefhs + fcgefgs)));
530 long double triplet = (0.5 * Gamow(kstar)
531 * (2.0 * fgmodt * smult + modl2(ffplus) + modl2(ffminus) + wavesign * sterm.re + wavesign * tterm.re
532 + smult * 2 * (fcgefht + fcgefgt)));
539 return (0.25 * singlet + 0.75 * triplet);
542 return (0.5 * Gamow(kstar)
543 * (2.0 * fgmods * smult + modl2(ffplus) + modl2(ffminus) + wavesign * sterm.re + wavesign * tterm.re
544 + smult * 2 * (fcgefhs + fcgefgs)));
547 double FemtoWeightGeneratorKisiel::GetCoulombStrong() {
548 if (fRStarS < 0.0000000001)
return 1.0;
550 if (fRStarS < 1.0 / 0.197327)
return GetCoulomb();
552 double tKstRst = fKStarOut * fRStarOutS + fKStarSide * fRStarSideS + fKStarLong * fRStarLongS;
553 long double kstar = fabs(fKStar);
554 long double rho = fRStarS * kstar;
558 long double testp = rho * (1.0 + tKstRst / (rho));
563 asym = (1.0 - 1.0 / (fRStarS * (1.0 + tKstRst / rho) * fPionac * kstar * kstar)) / Gamow(kstar);
566 ffplus.re = 1.0 + (asym - 1.0) * 2.0;
568 ffplus.re = 1.0 + (asym - 1.0) / 2.0;
569 ffplus.im = sqrt(asym * asym - ffplus.re * ffplus.re);
571 GetFFsingle(ffplus, 1);
574 long double eta = 1.0 / (kstar * fPionac);
575 long double hfun = GetH(eta);
576 dcomplex gtilde = GetG(eta, rho, hfun);
577 dcomplex gtilor = mult(gtilde, 1.0 / fRStarS);
579 dcomplex fcouls, fcoult;
580 Getfc(kstar, eta, hfun, fcouls, fcoult);
582 dcomplex fgs = mult(gtilor, fcouls);
585 dcomplex fgt = mult(gtilor, fcoult);
589 expikr.re = cos(tKstRst);
590 expikr.im = -sin(tKstRst);
597 dcomplex epfpc = mult(expikr, ffplus);
606 fvfs.re = epfpc.re + fgs.re;
607 fvfs.im = epfpc.im + fgs.im;
610 fvft.re = epfpc.re + fgt.re;
611 fvft.im = epfpc.im + fgt.im;
640 long double singlet = Gamow(kstar) * modl2(fvfs);
641 long double triplet = Gamow(kstar) * modl2(fvft);
645 return (0.25 * singlet + 0.75 * triplet);
648 return Gamow(kstar) * modl2(fvfs);
655 double FemtoWeightGeneratorKisiel::GetStrong() {
667 double d0_sr = fD0s.re;
668 double d0_si = fD0s.im;
669 double d0_tr = fD0t.re;
670 double d0_ti = fD0t.im;
672 double f0_sr = fF0s.re;
673 double f0_si = fF0s.im;
674 double f0_tr = fF0t.re;
675 double f0_ti = fF0t.im;
677 double kstar = fabs(fKStar);
678 double rstar = fRStarS;
679 double kstrst = fKStarOut * fRStarOutS + fKStarSide * fRStarSideS + fKStarLong * fRStarLongS;
702 if (rstar < 1.0 / 0.197327)
return 1.0;
704 fr = f0_sr / (f0_sr * f0_sr + f0_si * f0_si);
705 fi = -f0_si / (f0_sr * f0_sr + f0_si * f0_si);
707 dr = 0.5 * d0_sr * kstar * kstar;
712 ar = ir / (ir * ir + ii * ii);
713 ai = -ii / (ir * ir + ii * ii);
715 srk = sin(kstar * rstar);
716 crk = cos(kstar * rstar);
718 sr = (ar * crk - ai * srk) / rstar;
719 si = (ai * crk + ar * srk) / rstar;
721 fr = f0_tr / (f0_tr * f0_tr + f0_ti * f0_ti);
722 fi = -f0_ti / (f0_tr * f0_tr + f0_ti * f0_ti);
724 dr = 0.5 * d0_tr * kstar * kstar;
729 ar = ir / (ir * ir + ii * ii);
730 ai = -ii / (ir * ir + ii * ii);
732 tr = (ar * crk - ai * srk) / rstar;
733 ti = (ai * crk + ar * srk) / rstar;
738 return (0.25 * ((ckr + sr) * (ckr + sr) + (skr + si) * (skr + si))
739 + 0.75 * ((ckr + tr) * (ckr + tr) + (skr + ti) * (skr + ti)));
742 double FemtoWeightGeneratorKisiel::GetQuantumStrong() {
748 double sgrp, sgip, sgrm, sgim;
749 double trrp, trip, trrm, trim;
766 double kstar = fabs(fKStar);
767 double rstar = fRStarS;
768 double kstrst = fKStarOut * fRStarOutS + fKStarSide * fRStarSideS + fKStarLong * fRStarLongS;
774 double snr, sni, trr, tri;
776 double singlet, triplet;
799 if (rstar < 1.0 / 0.197327)
return 1.0;
801 fr = fF0s.re / (fF0s.re * fF0s.re + fF0s.im * fF0s.im);
802 fi = -fF0s.im / (fF0s.re * fF0s.re + fF0s.im * fF0s.im);
804 dr = 0.5 * fD0s.re * kstar * kstar;
809 ar = ir / (ir * ir + ii * ii);
810 ai = -ii / (ir * ir + ii * ii);
812 srk = sin(kstar * rstar);
813 crk = cos(kstar * rstar);
815 sgrp = (ar * crk - ai * srk) / rstar;
816 sgip = (ai * crk + ar * srk) / rstar;
818 srm = sin(kstar * rstar);
819 crm = cos(kstar * rstar);
821 sgrm = (ar * crm - ai * srm) / rstar;
822 sgim = (ai * crm + ar * srm) / rstar;
830 snr = ckr + sgrp + ckm + sgrm;
831 sni = skr + sgip + skm + sgim;
833 singlet = 0.5 * (snr * snr + sni * sni);
835 fr = fF0t.re / (fF0t.re * fF0t.re + fF0t.im * fF0t.im);
836 fi = -fF0t.im / (fF0t.re * fF0t.re + fF0t.im * fF0t.im);
838 dr = 0.5 * fD0t.re * kstar * kstar;
843 ar = ir / (ir * ir + ii * ii);
844 ai = -ii / (ir * ir + ii * ii);
846 trrp = (ar * crk - ai * srk) / rstar;
847 trip = (ai * crk + ar * srk) / rstar;
849 trrm = (ar * crm - ai * srm) / rstar;
850 trim = (ai * crm + ar * srm) / rstar;
852 trr = ckr + trrp - ckm - trrm;
853 tri = skr + trip - skm - trim;
855 triplet = 0.5 * (trr * trr + tri * tri);
862 return (0.25 * singlet + 0.75 * triplet);
865 double FemtoWeightGeneratorKisiel::GetQuantum() {
866 double quantumweight;
869 quantumweight = 1.0 + TMath::Cos(2.0 * (fKStarOut * fRStarOutS + fKStarSide * fRStarSideS + fKStarLong * fRStarLongS));
870 }
else if (fTwospin == 1) {
872 quantumweight = 1.0 + TMath::Cos(2.0 * (fKStarOut * fRStarOutS + fKStarSide * fRStarSideS + fKStarLong * fRStarLongS));
874 quantumweight = 1.0 - TMath::Cos(2.0 * (fKStarOut * fRStarOutS + fKStarSide * fRStarSideS + fKStarLong * fRStarLongS));
877 if (fPcount == 4) fPcount = 0;
880 return quantumweight;
883 FemtoWeightGeneratorKisiel::dcomplex
884 FemtoWeightGeneratorKisiel::GetG(
long double eta,
long double rho,
long double hfun)
const {
886 long double bres, pres;
889 Bfunpfun(eta, rho, bres, pres);
890 bmult = 2.0 * eta * rho * bres;
892 gtemp.re = pres + bmult * (log(fabs(2.0 * eta * rho)) + 2.0 * fEuler - 1.0 + hfun);
893 gtemp.im = bmult * Chiim(eta);
899 FemtoWeightGeneratorKisiel::Getfc(
long double kstar,
long double eta,
long double hfun, dcomplex& fcs, dcomplex& fct)
const {
913 cia = mult(ci, 2.0 / fPionac);
916 dis = mult(fD0s, 0.5 * kstar * kstar);
917 fcinvs.re = fis.re + dis.re - cia.re;
918 fcinvs.im = fis.im + dis.im - cia.im;
922 dit = mult(fD0t, 0.5 * kstar * kstar);
923 fcinvt.re = fit.re + dit.re - cia.re;
924 fcinvt.im = fit.im + dit.im - cia.im;
928 void FemtoWeightGeneratorKisiel::Bfunpfun(
long double eta,
long double rho,
long double& bret,
long double& pret)
const {
930 long double b1 = eta * rho;
931 long double bsum = b0 + b1;
932 long double bnpu, bn, bnmu;
933 long double p0 = 1.0;
934 long double p1 = 0.0;
935 long double psum = p0 + p1;
936 long double pnpu, pn, pnmu;
938 if (rho > TMath::TwoPi() * 2.0) {
939 bret = sin(rho) / rho;
949 for (
int iter = 1; iter < 100000; iter++) {
950 bnpu = 2 * eta * rho * bn - rho * rho * bnmu;
951 bnpu /= (1.0 * iter + 1.0) * (1.0 * iter + 2.0);
955 pnpu = 2 * eta * rho * pn - rho * rho * pnmu - (2.0 * iter + 1.0) * 2.0 * eta * rho * bn;
956 pnpu /= (1.0 * iter) * (1.0 * iter + 1.0);
965 if ((fabs(pnmu) + fabs(bnmu) + fabs(bnpu) + fabs(pnpu)) < 1.0e-20) {
976 long double FemtoWeightGeneratorKisiel::GetH(
long double eta)
const {
977 long double etasum = log(1.0 / eta) - fEuler;
978 long double series = 0.0;
979 long double x2inv = (eta * eta);
982 for (
int iter = 1; iter < 1000000; iter++) {
983 element = ((1.0 * iter) * (1.0 * iter) + x2inv) * (1.0 * iter);
985 element = 1.0 / element;
986 if (iter == 1) save = 1.0e-10 * element;
990 if (element < save)
break;
998 double FemtoWeightGeneratorKisiel::GetCoulomb() {
999 double kstrst = fKStarOut * fRStarOutS + fKStarSide * fRStarSideS + fKStarLong * fRStarLongS;
1003 if (fabs(fRStarS) > fabs(fPionac))
return (1.0);
1004 if (fabs(fRStarS) == 0.0)
return (Gamow(fabs(fKStar)));
1008 if (fabs(fKStar) * fRStarS * (1.0 + kstrst / (fRStarS * fabs(fKStar))) > 15.0)
1009 return (1.0 - 1.0 / (fRStarS * fPionac * fKStar * fKStar));
1013 GetFFsingle(ffplus);
1015 if (!std::isfinite(ffplus.re)) {
1016 std::cout <<
"FFPlus Re not a number !"
1017 <<
" " << std::endl;
1018 std::cout << fRStarS <<
" " << fKStar <<
" " << fRStarOutS <<
" " << fRStarSideS <<
" " << fRStarLongS << std::endl;
1021 if (!std::isfinite(ffplus.im))
1022 std::cout <<
"FFPlus Im not a number !"
1023 <<
" " << std::endl;
1026 return (Gamow(fabs(fKStar)) * modl2(ffplus));
1029 double FemtoWeightGeneratorKisiel::GetQuantumCoulomb() {
1030 if (fRStarS < 0.0000000001)
return 1.0;
1032 double kstrst = fKStarOut * fRStarOutS + fKStarSide * fRStarSideS + fKStarLong * fRStarLongS;
1036 if (fTwospin == 1) {
1042 if (fPcount == 4) fPcount = 0;
1047 if (fabs(fRStarS) > fabs(fPionac))
return (1.0 + wavesign * cos(2 * kstrst));
1051 long double testp = fabs(fKStar) * fRStarS * (1.0 + kstrst / (fRStarS * fabs(fKStar)));
1052 long double testm = fabs(fKStar) * fRStarS * (1.0 - kstrst / (fRStarS * fabs(fKStar)));
1054 if ((testp > 15.0) && (testm > 15.0)) {
1055 double fasymplus = (1.0 - 1.0 / ((fRStarS + kstrst) * fPionac * fKStar * fKStar));
1056 double fasymminus = (1.0 - 1.0 / ((fRStarS - kstrst) * fPionac * fKStar * fKStar));
1057 return 0.5 * ((fasymplus + fasymminus) * cos(2 * kstrst) + (2.0 * sqrt(fasymplus * fasymminus)));
1061 dcomplex ffplus, ffminus;
1063 if (((testp < 15.0) && (testm < 15.0)))
1068 GetFFdouble(ffplus, ffminus);
1070 }
else if (testp < 15.0) {
1072 GetFFsingle(ffplus);
1075 (1.0 - 1.0 / (fRStarS * (1.0 - kstrst / (fRStarS * fabs(fKStar)) * fPionac * fKStar * fKStar))) / Gamow(fabs(fKStar));
1078 ffminus.re = 1.0 + (asym - 1.0) * 2.0;
1080 ffminus.re = 1.0 + (asym - 1.0) / 2.0;
1081 ffminus.im = sqrt(asym * asym - ffminus.re * ffminus.re);
1086 GetFFsingle(ffminus, -1);
1088 (1.0 - 1.0 / (fRStarS * (1.0 + kstrst / (fRStarS * fabs(fKStar)) * fPionac * fKStar * fKStar))) / Gamow(fabs(fKStar));
1091 ffplus.re = 1.0 + (asym - 1.0) * 2.0;
1093 ffplus.re = 1.0 + (asym - 1.0) / 2.0;
1094 ffplus.im = sqrt(asym * asym - ffplus.re * ffplus.re);
1099 expikr.re = cos(kstrst);
1100 expikr.im = sin(kstrst);
1101 dcomplex expikrc = conj(expikr);
1102 dcomplex ffplusc = conj(ffplus);
1103 dcomplex ffminusc = conj(ffminus);
1105 dcomplex expikr2 = mult(expikr, expikr);
1106 dcomplex expikrc2 = conj(expikr2);
1107 dcomplex sterm = mult(expikr2, mult(ffplus, ffminusc));
1108 dcomplex tterm = mult(expikrc2, mult(ffminus, ffplusc));
1111 if (!std::isfinite(ffminus.re))
1112 std::cout <<
"FFMinus Re not a number !"
1113 <<
" " << ccase << std::endl;
1115 if (!std::isfinite(ffminus.im))
1116 std::cout <<
"FFMinus Im not a number !"
1117 <<
" " << ccase << std::endl;
1119 if ((ffplus.re > 2.0) || (ffplus.re < -2.0)) std::cout << std::endl <<
"FFplus Re wild !" << ffplus.re << std::endl;
1121 if ((ffplus.im > 2.0) || (ffplus.im < -2.0)) std::cout <<
"FFplus Im wild !" << ffplus.im << std::endl;
1123 if ((ffminus.re > 2.0) || (ffminus.re < -2.0))
1124 std::cout << std::endl <<
"FFminus Re wild !" << ffminus.re <<
" " << ccase << std::endl;
1126 if ((ffminus.im > 2.0) || (ffminus.im < -2.0)) std::cout <<
"FFminus Im wild !" << ffminus.im <<
" " << ccase << std::endl;
1128 fCoulqscpart = 0.5 * Gamow(fabs(fKStar)) * (modl2(ffplus) + modl2(ffminus));
1130 return (0.5 * Gamow(fabs(fKStar)) * (modl2(ffplus) + wavesign * sterm.re + wavesign * tterm.re + modl2(ffminus)));
1133 void FemtoWeightGeneratorKisiel::GetFFdouble(dcomplex& ffp, dcomplex& ffm)
const {
1134 long double comprep[COULOMBSTEPS];
1135 long double compimp[COULOMBSTEPS];
1136 long double comprem[COULOMBSTEPS];
1137 long double compimm[COULOMBSTEPS];
1138 long double eta, ksip, ksim;
1139 dcomplex alfa, zetp, zetm;
1143 long double kstar = fabs(fKStar);
1144 long double kstrst = fKStarOut * fRStarOutS + fKStarSide * fRStarSideS + fKStarLong * fRStarLongS;
1145 long double coskr = kstrst / (fabs(fKStar) * fRStarS);
1147 if ((kstar * fRStarS * (1 + coskr) < 5.0) && (kstar * fRStarS * (1 - coskr) < 5.0))
1149 else if ((kstar * fRStarS * (1 + coskr) < 10.0) && (kstar * fRStarS * (1 - coskr) < 10.0))
1151 else if ((kstar * fRStarS * (1 + coskr) < 15.0) && (kstar * fRStarS * (1 - coskr) < 15.0))
1156 eta = 1.0 / (kstar * fPionac);
1160 dcomplex fcomp, scompp, scompm;
1162 dcomplex sump, summ;
1165 long double rad = fRStarS;
1167 ksip = kstar * rad * (1 + coskr);
1168 ksim = kstar * rad * (1 - coskr);
1184 for (
int istep = 0; istep < nsteps; istep++) {
1185 sump = mult(fcomp, scompp);
1186 summ = mult(fcomp, scompm);
1188 sump = mult(sump, 1.0 / (tcomp * tcomp));
1189 summ = mult(summ, 1.0 / (tcomp * tcomp));
1193 comprep[istep] = sump.re;
1194 compimp[istep] = sump.im;
1196 comprem[istep] = summ.re;
1197 compimm[istep] = summ.im;
1199 comprep[istep] = comprep[istep - 1] + sump.re;
1200 compimp[istep] = compimp[istep - 1] + sump.im;
1202 comprem[istep] = comprem[istep - 1] + summ.re;
1203 compimm[istep] = compimm[istep - 1] + summ.im;
1206 fcmult.re = alfa.re + istep;
1207 fcmult.im = alfa.im;
1209 fcomp = mult(fcomp, fcmult);
1210 scompp = mult(scompp, zetp);
1211 scompm = mult(scompm, zetm);
1212 tcomp *= (istep + 1);
1215 ffp.re = comprep[nsteps - 1];
1216 ffp.im = compimp[nsteps - 1];
1218 ffm.re = comprem[nsteps - 1];
1219 ffm.im = compimm[nsteps - 1];
1222 void FemtoWeightGeneratorKisiel::GetFFsingle(dcomplex& ffp,
int sign)
const {
1223 double comprep[COULOMBSTEPS];
1224 double compimp[COULOMBSTEPS];
1226 dcomplex alfa, zetp;
1230 double kstar = fabs(fKStar);
1231 double kstrst = fKStarOut * fRStarOutS + fKStarSide * fRStarSideS + fKStarLong * fRStarLongS;
1232 double coskr = sign * kstrst / (fabs(fKStar) * fRStarS);
1234 if (kstar * fRStarS * (1 + coskr) > 15.0)
1236 else if (kstar * fRStarS * (1 + coskr) > 10.0)
1238 else if (kstar * fRStarS * (1 + coskr) > 5.0)
1243 eta = 1.0 / (kstar * fPionac);
1247 dcomplex fcomp, scompp;
1252 double rad = fRStarS;
1254 ksip = kstar * rad * (1 + coskr);
1265 for (
int istep = 0; istep < nsteps; istep++) {
1266 sump = mult(fcomp, scompp);
1268 sump = mult(sump, 1.0 / (tcomp * tcomp));
1271 comprep[istep] = sump.re;
1272 compimp[istep] = sump.im;
1274 comprep[istep] = comprep[istep - 1] + sump.re;
1275 compimp[istep] = compimp[istep - 1] + sump.im;
1278 fcmult.re = alfa.re + istep;
1279 fcmult.im = alfa.im;
1281 fcomp = mult(fcomp, fcmult);
1282 scompp = mult(scompp, zetp);
1283 tcomp *= (istep + 1);
1285 if ((sump.re * sump.re + sump.im * sump.im) < 1.0e-14) {
1291 ffp.re = comprep[nsteps - 1];
1292 ffp.im = compimp[nsteps - 1];
1295 FemtoWeightGeneratorKisiel::dcomplex FemtoWeightGeneratorKisiel::conj(
const dcomplex& arg)
const {
1304 FemtoWeightGeneratorKisiel::dcomplex FemtoWeightGeneratorKisiel::mult(
const dcomplex& arga,
long double argb)
const {
1307 res.re = arga.re * argb;
1308 res.im = arga.im * argb;
1313 FemtoWeightGeneratorKisiel::dcomplex FemtoWeightGeneratorKisiel::mult(
const dcomplex& arga,
const dcomplex& argb)
const {
1316 res.re = arga.re * argb.re - arga.im * argb.im;
1317 res.im = arga.re * argb.im + argb.re * arga.im;
1322 Package* FemtoWeightGeneratorKisiel::Report()
const {
1323 Package* pack = FemtoWeightGenerator::Report();
1324 pack->AddObject(
new ParameterString(
"PairType", Femto::PairTypeToString(fPairType)));
1328 Bool_t FemtoWeightGeneratorKisiel::IsPairSupported(Femto::EPairType type)
const {
1329 if (
static_cast<int>(type) >= 100)
return kTRUE;
1333 FemtoWeightGeneratorKisiel::~FemtoWeightGeneratorKisiel() {}