9 #include "Pythia8/Pythia.h"
10 #include "Pythia8/HIUserHooks.h"
27 particleDataPtr = &particleDataIn;
51 bool NucleusModel::init() {
60 Particle NucleusModel::produceIon(
bool istarg) {
61 double e = max(A(), 1)*(istarg?
settingsPtr->parm(
"Beams:eB"):
63 double m = particleDataPtr->m0(
id());
64 Particle p(
id(), -12);
65 double pz = sqrt(max(e*e - m*m, 0.0));
73 p.daughter1(daughter);
90 double sel = rndPtr->flat()*(intlo + inthi0 + inthi1 + inthi2);
91 if ( sel > intlo ) r -=
a()*log(rndPtr->flat());
92 if ( sel > intlo + inthi0 ) r -=
a()*log(rndPtr->flat());
93 if ( sel > intlo + inthi0 + inthi1 ) r -=
a()*log(rndPtr->flat());
95 r = R()*pow(rndPtr->flat(), 1.0/3.0);
96 if ( rndPtr->flat()*(1.0 + exp((r - R())/
a())) > 1.0 )
continue;
98 if ( rndPtr->flat()*(1.0 + exp((r - R())/
a())) > exp((r - R())/
a()) )
101 double costhe = 2.0*rndPtr->flat() - 1.0;
102 double sinthe = sqrt(max(1.0 - costhe*costhe, 0.0));
103 double phi = 2.0*M_PI*rndPtr->flat();
105 return Vec4(r*sinthe*cos(phi), r*sinthe*sin(phi), r*costhe);
124 if ( A() == 0 )
return true;
125 gaussHardCore =
settingsPtr->flag(
"HeavyIon:gaussHardCore");
128 RhSave = 0.9*femtometer;
129 RSave = (1.1*pow(
double(A()),1.0/3.0) -
130 0.656*pow(
double(A()),-1.0/3.0))*femtometer;
131 aSave = 0.459*femtometer;
133 RSave = (1.12*pow(
double(A()),1.0/3.0) -
134 0.86*pow(
double(A()),-1.0/3.0))*femtometer;
135 aSave = 0.54*femtometer;
141 RSave = (1.1*pow(
double(A()),1.0/3.0) -
142 0.656*pow(
double(A()),-1.0/3.0))*femtometer;
143 aSave = 0.459*femtometer;
145 RSave = (1.12*pow(
double(A()),1.0/3.0) -
146 0.86*pow(
double(A()),-1.0/3.0))*femtometer;
147 aSave = 0.54*femtometer;
163 int sign =
id() > 0? 1: -1;
166 vector<Nucleon> nucleons;
172 if ( Z() == 1 ) nucleons.push_back(
Nucleon(pid, 0,
Vec4()));
178 vector<Vec4> positions;
179 while (
int(positions.size()) < A() ) {
182 bool overlap =
false;
183 for (
int i = 0, N = positions.size(); i < N && !overlap; ++i )
184 if ( (positions[i] - pos).pAbs() < (gaussHardCore ? RhGauss() :
Rh()) )
186 if ( overlap )
continue;
187 positions.push_back(pos);
194 nucleons.resize(A());
197 for (
int i = 0, N= positions.size(); i < N; ++i ) {
198 Vec4 pos(positions[i].px() - cms.px(),
199 positions[i].py() - cms.py());
200 if (
int(rndPtr->flat()*(Np + Nn)) >= Np ) {
202 nucleons[i] =
Nucleon(nid, i, pos);
205 nucleons[i] =
Nucleon(pid, i, pos);
229 settingsPtr = &settingsIn;
239 if ( settingsPtr->isParm(
"HI:bWidth") )
240 widthSave = settingsPtr->parm(
"HI:bWidth")*femtometer;
242 widthSave = settingsPtr->parm(
"HeavyIon:bWidth")*femtometer;
244 if ( widthSave <= 0.0 ) {
246 double RA = max(Rp, projPtr->R());
247 double RB = max(Rp, targPtr->R());
248 widthSave = RA + RB + 2.0*Rp;
249 cout <<
" HeavyIon Info: Initializing impact parameter generator "
250 <<
"with width " << widthSave/femtometer <<
" fm." << endl;
261 double b = sqrt(-2.0*log(rndPtr->flat()))*
width();
262 double phi = 2.0*M_PI*rndPtr->flat();
264 return Vec4(b*sin(phi), b*cos(phi), 0.0, 0.0);
279 sigTarg[0] = sigTotPtr->sigmaTot()*millibarn;
280 sigTarg[1] = sigTotPtr->sigmaND()*millibarn;
281 sigTarg[2] = sigTotPtr->sigmaXX()*millibarn;
282 sigTarg[3] = sigTotPtr->sigmaAX()*millibarn + sigTarg[1] + sigTarg[2];
283 sigTarg[4] = sigTotPtr->sigmaXB()*millibarn + sigTarg[1] + sigTarg[2];
284 sigTarg[5] = sigTotPtr->sigmaAXB()*millibarn;
285 sigTarg[6] = sigTotPtr->sigmaEl()*millibarn;
286 sigTarg[7] = sigTotPtr->bSlopeEl();
287 NInt = settingsPtr->mode(
"HeavyIon:SigFitNInt");
288 NGen = settingsPtr->mode(
"HeavyIon:SigFitNGen");
289 NPop = settingsPtr->mode(
"HeavyIon:SigFitNPop");
290 sigErr = settingsPtr->pvec(
"HeavyIon:SigFitErr");
291 sigFuzz = settingsPtr->parm(
"HeavyIon:SigFitFuzz");
292 fitPrint = settingsPtr->flag(
"HeavyIon:SigFitPrint");
295 avNDb = 2.0*sqrt(sigTarg[1]/M_PI)*
296 settingsPtr->parm(
"Angantyr:impactFudge")/3.0;
309 for (
int i = 0, Nval = se.
sig.size(); i < Nval; ++i ) {
310 if ( sigErr[i] == 0.0 )
continue;
312 chi2 += pow2(se.
sig[i] - sigTarg[i])/
313 (se.
dsig2[i] + pow2(sigTarg[i]*sigErr[i]));
315 return chi2/double(max(nval - npar, 1));
325 void printTarget(
string name,
double sig,
double sigerr,
326 string unit =
"mb ") {
327 cout << fixed << setprecision(2);
328 cout <<
" |" << setw(25) << name <<
": " << setw(8) << sig <<
" " << unit;
330 cout <<
" (+- " << setw(2) << int(100.0*sigerr)
333 cout <<
" not used | \n";
336 void printFit(
string name,
double fit,
double sig,
double sigerr,
337 string unit =
"mb ") {
338 cout <<
" |" << setw(25) << name <<
": "
340 << (sigerr > 0.0?
" *(":
" (")
342 <<
") " << unit <<
" | " << endl;
352 typedef vector<double> Parms;
353 Parms minp = minParm();
354 Parms maxp = maxParm();
355 int dim = minp.size();
356 if ( dim == 0 )
return true;
359 cout <<
" *------ HeavyIon fitting of SubCollisionModel to "
360 <<
"cross sections ------* " << endl;
361 printTarget(
"Total", sigTarg[0]/millibarn, sigErr[0]);
362 printTarget(
"non-diffractive", sigTarg[1]/millibarn, sigErr[1]);
363 printTarget(
"XX diffractive", sigTarg[2]/millibarn, sigErr[2]);
364 printTarget(
"wounded target (B)", sigTarg[3]/millibarn, sigErr[3]);
365 printTarget(
"wounded projectile (A)", sigTarg[4]/millibarn, sigErr[4]);
366 printTarget(
"AXB diffractive", sigTarg[5]/millibarn, sigErr[5]);
367 printTarget(
"elastic", sigTarg[6]/millibarn, sigErr[6]);
368 printTarget(
"elastic b-slope", sigTarg[7], sigErr[7],
"GeV^-2");
372 vector<Parms> pop(NPop, Parms(dim));
373 vector<double> def = settingsPtr->pvec(
"HeavyIon:SigFitDefPar");
374 if ( settingsPtr->isPVec(
"HI:SigFitDefPar") )
375 def = settingsPtr->pvec(
"HI:SigFitDefPar");
376 for (
int j = 0; j < dim; ++j )
377 pop[0][j] = max(minp[j], min(def[j], maxp[j]));
378 for (
int i = 1; i < NPop; ++i )
379 for (
int j = 0; j < dim; ++j )
380 pop[i][j] = minp[j] + rndPtr->flat()*(maxp[j] - minp[j]);
383 for (
int igen = 0; igen < NGen; ++igen ) {
385 multimap<double, Parms> chi2map;
386 double chi2max = 0.0;
387 double chi2sum = 0.0;
388 for (
int i = 0; i < NPop; ++i ) {
391 chi2map.insert(make_pair(chi2, pop[i]));
392 chi2max = max(chi2max, chi2);
398 multimap<double, Parms>::iterator it = chi2map.begin();
404 <<
" | Using a genetic algorithm "
406 <<
" | Generation best Chi2/Ndf "
408 cout <<
" |" << setw(25) << igen <<
":" << fixed << setprecision(2)
409 << setw(9) << it->first
413 for (
int i = 1; i < NPop; ++i ) {
414 pop[i] = (++it)->second;
415 if ( it->first > rndPtr->flat()*chi2max ) {
417 for (
int j = 0; j < dim; ++j )
418 pop[i][j] = minp[j] + rndPtr->flat()*(maxp[j] - minp[j]);
421 int ii = int(rndPtr->flat()*i);
422 for (
int j = 0; j < dim; ++j ) {
423 double d = pop[ii][j] - it->second[j];
424 double pl = max(minp[j], min(it->second[j] - sigFuzz*d, maxp[j]));
425 double pu = max(minp[j], min(it->second[j] +
426 (1.0 + sigFuzz)*d, maxp[j]));
427 pop[i][j] = pl + rndPtr->flat()*(pu - pl);
434 double chi2 =
Chi2(se, dim);
435 avNDb = se.
avNDb*settingsPtr->parm(
"Angantyr:impactFudge");
437 infoPtr->errorMsg(
"HeavyIon Warning: Chi^2 in fitting sub-collision "
438 "model to cross sections was high.");
440 cout << fixed << setprecision(2);
444 cout <<
" | Resulting cross sections (target value) "
447 printFit(
"Total", se.
sig[0]/millibarn,
448 sigTarg[0]/millibarn, sigErr[0]);
449 printFit(
"non-diffractive", se.
sig[1]/millibarn,
450 sigTarg[1]/millibarn, sigErr[1]);
451 printFit(
"XX diffractive", se.
sig[2]/millibarn,
452 sigTarg[2]/millibarn, sigErr[2]);
453 printFit(
"wounded target (B)", se.
sig[3]/millibarn,
454 sigTarg[3]/millibarn, sigErr[3]);
455 printFit(
"wounded projectile (A)", se.
sig[4]/millibarn,
456 sigTarg[4]/millibarn, sigErr[4]);
457 printFit(
"AXB diffractive", se.
sig[5]/millibarn,
458 sigTarg[5]/millibarn, sigErr[5]);
459 printFit(
"elastic", se.
sig[6]/millibarn,
460 sigTarg[6]/millibarn, sigErr[6]);
461 printFit(
"elastic b-slope", se.
sig[7], sigTarg[7], sigErr[7],
"GeV^-2");
462 cout <<
" | Chi2/Ndf: "
468 cout <<
" | Resulting parameters: "
471 for (
int j = 0; j < dim; ++j )
472 cout <<
" |" << setw(25) << j <<
":" << setw(9) << pop[0][j]
477 cout <<
" | Resulting non-diffractive average impact parameter: "
480 cout <<
" | <b>:" << setw(9) << se.
avNDb <<
" +- "
481 << setw(4) << sqrt(se.davNDb2) <<
" fm | "
487 cout <<
" *--- End HeavyIon fitting of parameters in "
488 <<
"nucleon collision model ---* "
491 cout <<
"HeavyIon Info: To avoid refitting, use the following settings "
492 <<
"for next run:\n HeavyIon:SigFitNGen = 0\n "
493 <<
"HeavyIon:SigFitDefPar = "
495 for (
int j = 1; j < dim; ++j ) cout <<
"," << pop[0][j];
496 for (
int j = dim; j < 8; ++j ) cout <<
",0.0";
515 const Vec4 & bvec,
double & T) {
516 multiset<SubCollision> ret;
519 for (
int i = 0, N = proj.size(); i < N; ++i ) {
521 proj[i].bShift(bvec/2.0);
523 for (
int i = 0, N = targ.size(); i < N; ++i ) {
525 targ[i].bShift(-bvec/2.0);
544 const Vec4 & bvec,
double & T) {
547 multiset<SubCollision> ret =
552 for (
int ip = 0, Np = proj.size(); ip < Np; ++ip )
553 for (
int it = 0, Nt = targ.size(); it < Nt; ++it ) {
556 double b = (p.
bPos() - t.
bPos()).pT();
557 if ( b > sqrt(
sigTot()/M_PI) )
continue;
559 if ( b < sqrt(
sigND()/M_PI) ) {
597 inline double el(
double s1,
double s2,
double u1,
double u2) {
598 return s1/u1 > s2/u2? s2*u1: s1*u2;
611 for (
int n = 0; n <
NInt; ++n ) {
612 double rp1 =
gamma();
613 double rp2 =
gamma();
614 double rt1 =
gamma();
615 double rt2 =
gamma();
616 double s11 = pow2(rp1 + rt1)*M_PI;
617 double s12 = pow2(rp1 + rt2)*M_PI;
618 double s21 = pow2(rp2 + rt1)*M_PI;
619 double s22 = pow2(rp2 + rt2)*M_PI;
621 double stot = (s11 + s12 + s21 + s22)/4.0;
623 s.
dsig2[0] += pow2(stot);
630 double avb = sqrt(2.0/M_PI)*(s11*sqrt(s11/(2.0*u11))*(1.0 - u11) +
631 s12*sqrt(s12/(2.0*u12))*(1.0 - u12) +
632 s21*sqrt(s21/(2.0*u21))*(1.0 - u21) +
633 s22*sqrt(s22/(2.0*u22))*(1.0 - u22))/12.0;
635 s.davNDb2 += pow2(avb);
637 double snd = (s11 - s11*u11 + s12 - s12*u12 +
638 s21 - s21*u21 + s22 - s22*u22)/4.0;
640 s.
dsig2[1] += pow2(snd);
642 double sel = (el(s11, s22, u11, u22) + el(s12, s21, u12, u21))/2.0;
644 s.
dsig2[6] += pow2(sel);
646 double swt = stot - (el(s11, s12, u11, u12) + el(s21, s22, u21, u22))/2.0;
647 double swp = stot - (el(s11, s21, u11, u21) + el(s12, s22, u12, u22))/2.0;
649 s.
dsig2[4] += pow2(swp);
651 s.
dsig2[3] += pow2(swt);
653 s.
sig[2] += swt + swp - snd + sel - stot;
654 s.
dsig2[2] += pow2(swt + swp - snd + sel - stot);
657 s.
dsig2[5] += pow2(s11);
659 s.
sig[7] += pow2(s11)/u11;
660 s.
dsig2[7] += pow2(pow2(s11)/u11);
666 s.
sig[0] /= double(NInt);
667 s.
dsig2[0] = (s.
dsig2[0]/double(NInt) - pow2(s.
sig[0]))/
double(NInt);
669 s.
sig[1] /= double(NInt);
670 s.
dsig2[1] = (s.
dsig2[1]/double(NInt) - pow2(s.
sig[1]))/
double(NInt);
672 s.
sig[2] /= double(NInt);
673 s.
dsig2[2] = (s.
dsig2[2]/double(NInt) - pow2(s.
sig[2]))/
double(NInt);
675 s.
sig[3] /= double(NInt);
676 s.
dsig2[3] = (s.
dsig2[3]/double(NInt) - pow2(s.
sig[3]))/
double(NInt);
678 s.
sig[4] /= double(NInt);
679 s.
dsig2[4] = (s.
dsig2[4]/double(NInt) - pow2(s.
sig[4]))/
double(NInt);
681 s.
sig[6] /= double(NInt);
682 s.
dsig2[6] = (s.
dsig2[6]/double(NInt) - pow2(s.
sig[6]))/
double(NInt);
684 s.
sig[5] /= double(NInt);
685 s.
dsig2[5] /= double(NInt);
687 s.
sig[7] /= double(NInt);
688 s.
dsig2[7] /= double(NInt);
689 double bS = (s.
sig[7]/s.
sig[5])/(16.0*M_PI*pow2(0.19732697));
690 double b2S = pow2(bS)*(s.
dsig2[7]/pow2(s.
sig[7]) - 1.0 +
691 s.
dsig2[5]/pow2(s.
sig[5]) - 1.0)/double(NInt);
697 s.
avNDb /= double(NInt);
698 s.davNDb2 = (s.davNDb2/double(NInt) - pow2(s.
avNDb))/
double(NInt);
700 s.davNDb2 /= pow2(s.
sig[1]);
711 if ( p.size() > 0 )
sigd = p[0];
712 if ( p.size() > 1 )
k0 = p[1];
713 if ( p.size() > 2 )
alpha = p[2];
718 vector<double> ret(3);
725 vector<double> DoubleStrikman::minParm()
const {
726 vector<double> ret(3);
733 vector<double> DoubleStrikman::maxParm()
const {
734 vector<double> ret(3);
747 static const double e = exp(1);
751 for (
int i = 0; i < k; ++i ) x += -log(rndPtr->flat());
753 if ( del == 0.0 )
return x*
r0;
756 double U = rndPtr->flat();
757 double V = rndPtr->flat();
758 double W = rndPtr->flat();
761 if ( U <= e/(e+del) ) {
762 xi = pow(V, 1.0/del);
763 if ( W <= exp(-xi) )
return r0*(x + xi);
766 if ( W <= pow(xi, del - 1.0) )
return r0*(x + xi);
777 void DoubleStrikman::shuffle(
double PND1,
double PND2,
778 double & PW1,
double & PW2) {
791 void DoubleStrikman::shuffel(
double & PEL11,
double P11,
792 double P12,
double P21,
double P22) {
793 double PEL12 = PEL11, PEL21 = PEL11, PEL22 = PEL11;
794 map<double, double *> ord;
799 map<double, double *>::iterator next = ord.begin();
800 map<double, double *>::iterator prev = next++;
801 while ( next != ord.end() ) {
802 if ( *prev->second > prev->first ) {
803 *next->second += *prev->second - prev->first;
804 *prev->second = prev->first;
816 const Vec4 & bvec,
double & T) {
819 multiset<SubCollision> ret =
823 for (
int ip = 0, Np = proj.size(); ip < Np; ++ip ) {
827 for (
int it = 0, Nt = targ.size(); it < Nt; ++it ) {
836 for (
int ip = 0, Np = proj.size(); ip < Np; ++ip )
837 for (
int it = 0, Nt = targ.size(); it < Nt; ++it ) {
840 double b = (p.
bPos() - t.
bPos()).pT();
846 double S11 = 1.0 - T11;
847 double S12 = 1.0 - T12;
848 double S21 = 1.0 - T21;
849 double S22 = 1.0 - T22;
851 double PND11 = 1.0 - pow2(S11);
854 if ( PND11 > rndPtr->flat() ) {
861 double PND12 = 1.0 - pow2(S12);
862 double PND21 = 1.0 - pow2(S21);
863 double PWp11 = 1.0 - S11*S21;
864 double PWp21 = 1.0 - S11*S21;
865 shuffle(PND11, PND21, PWp11, PWp21);
866 double PWt11 = 1.0 - S11*S12;
867 double PWt12 = 1.0 - S11*S12;
868 shuffle(PND11, PND12, PWt11, PWt12);
870 bool wt = ( PWt11 - PND11 > (1.0 - PND11)*rndPtr->flat() );
871 bool wp = ( PWp11 - PND11 > (1.0 - PND11)*rndPtr->flat() );
888 double PND22 = 1.0 - pow2(S22);
889 double PWp12 = 1.0 - S12*S22;
890 double PWp22 = 1.0 - S12*S22;
891 shuffle(PND12, PND22, PWp12, PWp22);
892 double PWt21 = 1.0 - S21*S22;
893 double PWt22 = 1.0 - S21*S22;
894 shuffle(PND21, PND22, PWt21, PWt22);
896 double PNW11 = PNW(PWp11, PWt11, PND11);
897 double PNW12 = PNW(PWp12, PWt12, PND12);
898 double PNW21 = PNW(PWp21, PWt21, PND21);
899 double PNW22 = PNW(PWp22, PWt22, PND22);
901 double PEL = (T12*T21 + T11*T22)/2.0;
902 shuffel(PEL, PNW11, PNW12, PNW21, PNW22);
903 if ( PEL > PNW11*rndPtr->flat() ) {
937 for (
int ip = 0; ip <
Nr; ++ip ) {
940 for (
int it = 0; it <
Nr; ++it ) {
942 sTpt +=
c[ip]*
T0[ip]*
c[it]*
T0[it]*pow2(Rp + Rt)*
sigTot();
943 sT2pt +=
c[ip]*pow2(
T0[ip])*
c[it]*pow2(
T0[it])*pow2(Rp + Rt)*
sigTot();
945 for (
int jp = 0; jp <
Nr; ++jp ) {
948 for (
int jt = 0; jt <
Nr; ++jt ) {
950 double fac =
T0[ip]*
T0[jp]*
T0[it]*
T0[jt]*pow2(min(Rp + Rt, rp + rt))
952 if ( ip == jp ) sTp2t +=
c[ip]*
c[it]*
c[jt]*fac;
982 double bS = (s.
sig[7]/s.
sig[5])/(16.0*M_PI*pow2(0.19732697));
983 double b2S = pow2(bS)*(s.
dsig2[7]/pow2(s.
sig[7]) - 1.0 +
1000 for (
int i = 0; i <
Nr; ++i ) {
1001 if ( ip < p.size() )
dR[i] = p[ip++];
1002 if ( ip < p.size() )
T0[i] = p[ip++];
1003 if ( ip < p.size() )
phi[i] = p[ip++];
1009 for (
int i = 0; i <
Nr; ++i ) {
1010 ret.push_back(
dR[i]);
1011 ret.push_back(
T0[i]);
1012 if ( i < Nr -1 ) ret.push_back(
phi[i]);
1017 vector<double> MultiRadial::minParm()
const {
1018 return vector<double>(
Nr*
Nr*(
Nr - 1), 0.0);
1021 vector<double> MultiRadial::maxParm()
const {
1022 return vector<double>(
Nr*
Nr*(
Nr - 1), 1.0);
1025 void MultiRadial::setProbs() {
1027 for (
int i = 0; i <
Nr - 1; ++i ) {
1028 c[i] = rProj*cos(
phi[i]*M_PI/2.0);
1029 rProj *= sin(
phi[i]*M_PI/2.0);
1036 double sel = rndPtr->flat();
1037 for (
int i = 0; i <
Nr - 1; ++i )
1038 if ( sel < ( sum +=
c[i] ) )
return i;
1051 const Vec4 & bvec,
double & T) {
1054 multiset<SubCollision> ret =
1072 return ++nCollSave[1];
1074 return ++nCollSave[2];
1076 return ++nCollSave[3];
1078 return ++nCollSave[4];
1080 return ++nCollSave[5];
1082 return ++nCollSave[6];
1092 int HIInfo::addProjectileNucleon(
const Nucleon & n) {
1094 switch ( n.status() ) {
1096 return ++nProjSave[1];
1098 return ++nProjSave[2];
1100 return ++nProjSave[3];
1106 int HIInfo::addTargetNucleon(
const Nucleon & n) {
1108 switch ( n.status() ) {
1110 return ++nTargSave[1];
1112 return ++nTargSave[2];
1114 return ++nTargSave[3];
1125 void HIInfo::addAttempt(
double T,
double bin,
double bweight) {
1127 nCollSave = nProjSave = nTargSave = vector<int>(10, 0);
1129 weightSave = bweight;
1130 weightSumSave += weightSave;
1132 double w = 2.0*T*bweight;
1133 double delta = w - sigmaTotSave;
1134 sigmaTotSave += delta/double(NSave);
1135 sigErr2TotSave += (delta*(w - sigmaTotSave) - sigErr2TotSave)/double(NSave);
1136 w = (2*T - T*T)*bweight;
1137 delta = w - sigmaNDSave;
1138 sigmaNDSave += delta/double(NSave);
1139 sigErr2NDSave += (delta*(w - sigmaNDSave) - sigErr2NDSave)/double(NSave);
1143 void HIInfo::accept() {
1144 int pc = primInfo.code();
1145 weightSumSave += weightSave;
1147 sumPrimW[pc] += weightSave;
1148 sumPrimW2[pc] += weightSave*weightSave;
1150 NamePrim[pc] = primInfo.nameProc(pc);
1163 cout <<
"Nucleon id: " <<
id() << endl;
1164 cout <<
"index: " <<
index() << endl;
1165 cout <<
"b(rel): " <<
nPos().px() <<
" " <<
nPos().py() << endl;
1166 cout <<
"b(abs): " <<
bPos().px() <<
" " <<
bPos().py() << endl;
1167 cout <<
"status: " <<
status() << (
done()?
" done":
" ") << endl;
1169 for (
int i = 0, N =
state().size(); i < N; ++i )
1170 cout <<
state()[i] <<
" ";
1172 for (
int j = 0, M = altStatesSave.size(); j < M; ++j ) {
1173 cout <<
"state " << j+1 <<
": ";
1174 for (
int i = 0, N = altStatesSave[j].size(); i < N; ++i )
1175 cout << altStatesSave[j][i] <<
" ";
The nucleon is absorptively wounded.
This is an absorptive (non-diffractive) collision.
Both excited but with central diffraction.
void debug()
Print out debugging information.
double sigd
Saturation scale of the nucleus.
double r0
The average radius of the nucleon.
Settings * settingsPtr
Pointers to useful objects.
virtual SigEst getSig() const
Calculate the cross sections for the given set of parameters.
bool done() const
Check if nucleon has been assigned.
const Vec4 & bPos() const
The absolute position in impact parameter space.
virtual bool init()
Virtual init method.
vector< double > c
The probability distribution.
double opacity(double sig) const
The opacity of the collision at a given sigma.
int id() const
Accessor functions:
int Nr
The number of radii.
virtual bool evolve()
Use a simlified genetic algorithm to fit the parameters.
Both projectile and target are diffractively excited.
vector< double > State
The state of a nucleon is a general vector of doubles.
SigEst getSig() const
Calculate the cross sections for the given set of parameters.
double sigDDE() const
The double diffractive excitation cross section.
vector< double > dsig2
The extimated error (squared)
void initPtr(int idIn, Settings &settingsIn, ParticleData &particleDataIn, Rndm &rndIn)
Init method.
vector< double > T0
The opacity for different radii.
double width() const
Get the width.
virtual vector< Nucleon > generate() const
virtual void setParm(const vector< double > &)
Set the parameters of this model.
double sigND() const
The non-diffractive (absorptive) cross section.
virtual multiset< SubCollision > getCollisions(vector< Nucleon > &proj, vector< Nucleon > &targ, const Vec4 &bvec, double &T)=0
double Chi2(const SigEst &sigs, int npar) const
Calculate the Chi2 for the given cross section estimates.
const Vec4 & nPos() const
The position of this nucleon relative to the nucleus center.
double sigEl() const
The total cross section.
virtual multiset< SubCollision > getCollisions(vector< Nucleon > &proj, vector< Nucleon > &targ, const Vec4 &bvec, double &T)
This is an elastic scattering.
The projectile is diffractively excited.
virtual vector< double > getParm() const
double Rh() const
Accessor functions.
double sigSDEP() const
The single diffractive excitation cross section (excited projectile).
The nucleon is elastically scattered.
int ISave
Cache information about the nucleus.
double k0
The power in the Gamma distribution.
double RSave
The estimate of the nucleus radius.
virtual vector< double > getParm() const
virtual void setParm(const vector< double > &)
Set the parameters of this model.
vector< double > phi
The angles defining the probability distribution for the radii.
virtual void setParm(const vector< double > &)
Set the parameters of this model.
double sigSDE() const
The single diffractive excitation cross section (both sides summed).
SigEst getSig() const
Calculate the cross sections for the given set of parameters.
Internal class to report cross section estimates.
SubCollisionModel * collPtr
Info from the controlling HeavyIons object.
The target is diffractively excited.
int id() const
Accessor functions.
const State & altState(int i=0)
Return an alternative state.
double Tpt(const Nucleon::State &p, const Nucleon::State &t, double b) const
Vec4 generateNucleon() const
The nucleon is diffractively wounded.
int choose() const
Choose a radius.
double a() const
Accessor functions:
Status status() const
The status.
int index() const
The nucleon type.
double gamma() const
Generate a random number according to a Gamma-distribution.
virtual Vec4 generate(double &weight) const
virtual multiset< SubCollision > getCollisions(vector< Nucleon > &proj, vector< Nucleon > &targ, const Vec4 &bvec, double &T)
vector< double > sig
The cross sections (tot, nd, dd, sdp, sdt, cd, el, bslope).
double sigCDE() const
The central diffractive excitation cross section.
double alpha
Power of the saturation scale.
virtual multiset< SubCollision > getCollisions(vector< Nucleon > &proj, vector< Nucleon > &targ, const Vec4 &bvec, double &T)
double sigTot() const
The total cross section.
Type type
The type of collison.
virtual bool init()
Virtual init method.
const State & state() const
The physical state of the incoming nucleon.
vector< double > dR
The difference between radii.