19const int MediumMagboltz::DxcTypeRad = 0;
20const int MediumMagboltz::DxcTypeCollIon = 1;
21const int MediumMagboltz::DxcTypeCollNonIon = -1;
26 eStep(eFinal / nEnergySteps),
35 useDeexcitation(false),
38 nIonisationProducts(0),
39 nDeexcitationProducts(0),
41 useGreenSawada(false),
43 eStepGamma(eFinalGamma / nEnergyStepsGamma) {
78 for (
int i = nMaxLevels; i--;) {
80 lambdaPenning[i] = 0.;
90 nCollisionsDetailed.clear();
91 for (
int i = nCsTypes; i--;) nCollisions[i] = 0;
92 for (
int i = nCsTypesGamma; i--;) nPhotonCollisions[i] = 0;
97 for (
unsigned int i = 0; i <
m_nMaxGases; ++i) scaleExc[i] = 1.;
103 std::cerr <<
m_className <<
"::SetMaxElectronEnergy:\n";
104 std::cerr <<
" Provided upper electron energy limit (" << e
105 <<
" eV) is too small.\n";
111 if (eFinal <= eHigh) {
112 eStep = eFinal / nEnergySteps;
114 eStep = eHigh / nEnergySteps;
130 std::cerr <<
m_className <<
"::SetMaxPhotonEnergy:\n";
131 std::cerr <<
" Provided upper photon energy limit (" << e
132 <<
" eV) is too small.\n";
138 eStepGamma = eFinalGamma / nEnergyStepsGamma;
149 useGreenSawada =
false;
154 useOpalBeaty =
false;
155 useGreenSawada =
true;
160 if (!m_hasGreenSawada[i]) {
162 std::cout <<
m_className <<
"::SetSplittingFunctionGreenSawada:\n";
165 std::cout <<
" Fit parameters for " <<
gas[i] <<
" not available.\n";
166 std::cout <<
" Opal-Beaty formula is used instead.\n";
173 useOpalBeaty =
false;
174 useGreenSawada =
false;
180 std::cout <<
m_className <<
"::EnableDeexcitation:\n";
181 std::cout <<
" Penning transfer will be switched off.\n";
189 useDeexcitation =
true;
191 nDeexcitationProducts = 0;
197 if (!useDeexcitation) {
198 std::cout <<
m_className <<
"::EnableRadiationTrapping:\n";
199 std::cout <<
" Radiation trapping is enabled"
200 <<
" but de-excitation is not.\n";
207 const double lambda) {
209 if (r < 0. || r > 1.) {
210 std::cerr <<
m_className <<
"::EnablePenningTransfer:\n";
211 std::cerr <<
" Penning transfer probability must be "
212 <<
" in the range [0, 1].\n";
217 if (lambda < Small) {
223 std::cout <<
m_className <<
"::EnablePenningTransfer:\n";
224 std::cout <<
" Global Penning transfer parameters set to: \n";
228 for (
int i = nTerms; i--;) {
233 if (useDeexcitation) {
234 std::cout <<
m_className <<
"::EnablePenningTransfer:\n";
235 std::cout <<
" Deexcitation handling will be switched off.\n";
241 std::string gasname) {
243 if (r < 0. || r > 1.) {
244 std::cerr <<
m_className <<
"::EnablePenningTransfer:\n";
245 std::cerr <<
" Penning transfer probability must be "
246 <<
" in the range [0, 1].\n";
252 std::cerr <<
m_className <<
"::EnablePenningTransfer:\n";
253 std::cerr <<
" Unknown gas name.\n";
261 if (
gas[i] == gasname) {
263 if (lambda < Small) {
275 std::cerr <<
m_className <<
"::EnablePenningTransfer:\n";
276 std::cerr <<
" Specified gas (" << gasname
277 <<
") is not part of the present gas mixture.\n";
284 std::cerr <<
m_className <<
"::EnablePenningTransfer:\n";
285 std::cerr <<
" Error calculating the collision rates table.\n";
291 int nLevelsFound = 0;
292 for (
int i = nTerms; i--;) {
293 if (
int(csType[i] / nCsTypes) == iGas) {
294 if (csType[i] % nCsTypes == ElectronCollisionTypeExcitation) {
302 if (nLevelsFound > 0) {
303 std::cout <<
m_className <<
"::EnablePenningTransfer:\n";
304 std::cout <<
" Penning transfer parameters for " << nLevelsFound
305 <<
" excitation levels set to:\n";
309 std::cerr <<
m_className <<
"::EnablePenningTransfer:\n";
310 std::cerr <<
" Specified gas (" << gasname
311 <<
") has no excitation levels in the present energy range.\n";
319 for (
int i = nTerms; i--;) {
321 lambdaPenning[i] = 0.;
338 std::cerr <<
m_className <<
"::DisablePenningTransfer:\n";
339 std::cerr <<
" Gas " << gasname <<
" is not defined.\n";
347 if (
gas[i] == gasname) {
357 std::cerr <<
m_className <<
"::DisablePenningTransfer:\n";
358 std::cerr <<
" Specified gas (" << gasname
359 <<
") is not part of the present gas mixture.\n";
363 int nLevelsFound = 0;
364 for (
int i = nTerms; i--;) {
365 if (
int(csType[i] / nCsTypes) == iGas) {
367 lambdaPenning[i] = 0.;
369 if (csType[i] % nCsTypes == ElectronCollisionTypeExcitation &&
370 rPenning[i] > Small) {
376 if (nLevelsFound <= 0) {
378 std::cout <<
m_className <<
"::DisablePenningTransfer:\n";
379 std::cout <<
" Penning transfer globally switched off.\n";
385 std::string gasname) {
388 std::cerr <<
m_className <<
"::SetScalingFactor:\n";
389 std::cerr <<
" Incorrect value for scaling factor: " << r <<
"\n";
395 std::cerr <<
m_className <<
"::SetExcitationScalingFactor:\n";
396 std::cerr <<
" Unknown gas name.\n";
403 if (
gas[i] == gasname) {
411 std::cerr <<
m_className <<
"::SetExcitationScalingFactor:\n";
412 std::cerr <<
" Specified gas (" << gasname
413 <<
") is not part of the present gas mixture.\n";
426 std::cerr <<
" Nothing changed.\n";
430 if (!Mixer(verbose)) {
432 std::cerr <<
" Error calculating the collision rates table.\n";
448 for (
int i = 0; i < nTerms; ++i) {
450 int type = csType[i] % nCsTypes;
451 int ngas = int(csType[i] / nCsTypes);
453 std::string descr = std::string(50,
' ');
454 for (
int j = 50; j--;) descr[j] = description[i][j];
456 double e = rgas[ngas] * energyLoss[i];
457 std::cout <<
" Level " << i <<
": " << descr <<
"\n";
458 std::cout <<
" Type " << type;
459 if (type == ElectronCollisionTypeElastic) {
460 std::cout <<
" (elastic)\n";
461 }
else if (type == ElectronCollisionTypeIonisation) {
462 std::cout <<
" (ionisation)\n";
463 std::cout <<
" Ionisation threshold: " << e <<
" eV\n";
464 }
else if (type == ElectronCollisionTypeAttachment) {
465 std::cout <<
" (attachment)\n";
466 }
else if (type == ElectronCollisionTypeInelastic) {
467 std::cout <<
" (inelastic)\n";
468 std::cout <<
" Energy loss: " << e <<
" eV\n";
469 }
else if (type == ElectronCollisionTypeExcitation) {
470 std::cout <<
" (excitation)\n";
471 std::cout <<
" Excitation energy: " << e <<
" eV\n";
472 }
else if (type == ElectronCollisionTypeSuperelastic) {
473 std::cout <<
" (super-elastic)\n";
474 std::cout <<
" Energy gain: " << -e <<
" eV\n";
476 std::cout <<
" (unknown)\n";
478 if (type == ElectronCollisionTypeExcitation &&
usePenning &&
480 std::cout <<
" Penning transfer coefficient: " << rPenning[i]
482 }
else if (type == ElectronCollisionTypeExcitation && useDeexcitation) {
483 const int idxc = iDeexcitation[i];
484 if (idxc < 0 || idxc >= nDeexcitations) {
485 std::cout <<
" Deexcitation cascade not implemented.\n";
488 if (deexcitations[idxc].osc > 0.) {
489 std::cout <<
" Oscillator strength: " << deexcitations[idxc].osc
492 std::cout <<
" Decay channels:\n";
493 for (
int j = 0; j < deexcitations[idxc].nChannels; ++j) {
494 if (deexcitations[idxc].type[j] == DxcTypeRad) {
495 std::cout <<
" Radiative decay to ";
496 if (deexcitations[idxc].
final[j] < 0) {
497 std::cout <<
"ground state: ";
499 std::cout << deexcitations[deexcitations[idxc].final[j]].label
502 }
else if (deexcitations[idxc].type[j] == DxcTypeCollIon) {
503 if (deexcitations[idxc].
final[j] < 0) {
504 std::cout <<
" Penning ionisation: ";
506 std::cout <<
" Associative ionisation: ";
508 }
else if (deexcitations[idxc].type[j] == DxcTypeCollNonIon) {
509 if (deexcitations[idxc].
final[j] >= 0) {
510 std::cout <<
" Collision-induced transition to "
511 << deexcitations[deexcitations[idxc].final[j]].label
514 std::cout <<
" Loss: ";
518 std::cout << std::setprecision(5) << deexcitations[idxc].p[j] * 100.
521 std::cout << std::setprecision(5) << (deexcitations[idxc].p[j] -
522 deexcitations[idxc].p[j - 1]) *
535 std::cerr <<
m_className <<
"::GetElectronNullCollisionRate:\n";
536 std::cerr <<
" Error calculating the collision rates table.\n";
543 std::cerr <<
m_className <<
"::GetElectronNullCollisionRate:\n";
544 std::cerr <<
" Warning: unexpected band index.\n";
555 std::cerr <<
m_className <<
"::GetElectronCollisionRate:\n";
556 std::cerr <<
" Electron energy must be greater than zero.\n";
559 if (e > eFinal && useAutoAdjust) {
560 std::cerr <<
m_className <<
"::GetElectronCollisionRate:\n";
561 std::cerr <<
" Collision rate at " << e
562 <<
" eV is not included in the current table.\n";
563 std::cerr <<
" Increasing energy range to " << 1.05 * e <<
" eV.\n";
570 std::cerr <<
m_className <<
"::GetElectronCollisionRate:\n";
571 std::cerr <<
" Error calculating the collision rates table.\n";
578 std::cerr <<
m_className <<
"::GetElectronCollisionRate:\n";
579 std::cerr <<
" Warning: unexpected band index.\n";
587 if (iE >= nEnergySteps)
return cfTot[nEnergySteps - 1];
588 if (iE < 0)
return cfTot[0];
593 const double eLog = log(e);
594 iE = int((eLog - eHighLog) / lnStep);
596 const double fmax = cfTotLog[iE];
597 const double fmin = iE == 0 ? log(cfTot[nEnergySteps - 1]) : cfTotLog[iE - 1];
598 const double emin = eHighLog + iE * lnStep;
599 const double f = fmin + (eLog - emin) * (fmax - fmin) / lnStep;
608 std::cerr <<
m_className <<
"::GetElectronCollisionRate:\n";
609 std::cerr <<
" Electron energy must be greater than zero.\n";
615 std::cerr <<
m_className <<
"::GetElectronCollisionRate:\n";
616 std::cerr <<
" Level must be greater than zero.\n";
618 }
else if (level >= nTerms) {
619 std::cerr <<
m_className <<
"::GetElectronCollisionRate:\n";
620 std::cerr <<
" Level " << level <<
" does not exist.\n";
621 std::cerr <<
" The present gas mixture has " << nTerms
622 <<
" cross-section terms.\n";
633 if (iE >= nEnergySteps)
return cfTot[nEnergySteps - 1];
637 rate *= cf[iE][level] - cf[iE][level - 1];
641 iE = int((log(e) - eHighLog) / lnStep);
643 rate *= cfLog[iE][0];
645 rate *= cfLog[iE][level] - cfLog[iE][level - 1];
652 double& e1,
double& dx,
double& dy,
653 double& dz,
int& nion,
int& ndxc,
657 if (e > eFinal && useAutoAdjust) {
658 std::cerr <<
m_className <<
"::GetElectronCollision:\n";
659 std::cerr <<
" Provided electron energy (" << e
660 <<
" eV) exceeds current energy range (" << eFinal <<
" eV).\n";
661 std::cerr <<
" Increasing energy range to " << 1.05 * e <<
" eV.\n";
663 }
else if (e <= 0.) {
664 std::cerr <<
m_className <<
"::GetElectronCollision:\n";
665 std::cerr <<
" Electron energy must be greater than zero.\n";
672 std::cerr <<
m_className <<
"::GetElectronCollision:\n";
673 std::cerr <<
" Error calculating the collision rates table.\n";
680 std::cerr <<
m_className <<
"::GetElectronCollision:\n";
681 std::cerr <<
" Warning: unexpected band index.\n";
690 int iE = int(e / eStep);
691 if (iE >= nEnergySteps) iE = nEnergySteps - 1;
697 int iUp = nTerms - 1;
698 if (r <= cf[iE][iLow]) {
700 }
else if (r >= cf[iE][iUp]) {
704 while (iUp - iLow > 1) {
705 iMid = (iLow + iUp) >> 1;
706 if (r < cf[iE][iMid]) {
715 angCut = scatCut[iE][level];
716 angPar = scatParameter[iE][level];
720 int iE = int(log(e / eHigh) / lnStep);
722 if (iE >= nEnergyStepsLog) iE = nEnergyStepsLog - 1;
726 int iUp = nTerms - 1;
727 if (r <= cfLog[iE][iLow]) {
729 }
else if (r >= cfLog[iE][iUp]) {
733 while (iUp - iLow > 1) {
734 iMid = (iLow + iUp) >> 1;
735 if (r < cfLog[iE][iMid]) {
744 angCut = scatCutLog[iE][level];
745 angPar = scatParameterLog[iE][level];
749 type = csType[level] % nCsTypes;
750 const int igas = int(csType[level] / nCsTypes);
753 ++nCollisionsDetailed[level];
756 double loss = energyLoss[level];
759 if (type == ElectronCollisionTypeIonisation) {
765 const double w = wOpalBeaty[level];
766 esec = w * tan(
RndmUniform() * atan(0.5 * (e - loss) / w));
769 }
else if (useGreenSawada) {
770 const double w = gsGreenSawada[igas] * e / (e + gbGreenSawada[igas]);
772 tsGreenSawada[igas] - taGreenSawada[igas] / (e + tbGreenSawada[igas]);
774 esec = esec0 + w * tan((r - 1.) * atan(esec0 / w) +
775 r * atan((0.5 * (e - loss) - esec0) / w));
779 if (esec <= 0) esec = Small;
784 newIonProd.type = IonProdTypeElectron;
785 newIonProd.energy = esec;
786 ionProducts.push_back(newIonProd);
788 newIonProd.type = IonProdTypeIon;
789 newIonProd.energy = 0.;
790 ionProducts.push_back(newIonProd);
791 nIonisationProducts = nion = 2;
792 }
else if (type == ElectronCollisionTypeExcitation) {
803 if (useDeexcitation && iDeexcitation[level] >= 0) {
805 ComputeDeexcitationInternal(iDeexcitation[level], fLevel);
806 ndxc = nDeexcitationProducts;
808 nDeexcitationProducts = 0;
814 if (energyLoss[level] * rgas[igas] > minIonPot &&
818 double esec = energyLoss[level] * rgas[igas] - minIonPot;
819 if (esec <= 0) esec = Small;
824 if (lambdaPenning[level] > Small) {
828 newDxcProd.energy = esec;
829 newDxcProd.type = DxcProdTypeElectron;
830 dxcProducts.push_back(newDxcProd);
831 nDeexcitationProducts = ndxc = 1;
838 if (e < loss) loss = e - 0.0001;
842 if (useAnisotropic) {
843 switch (scatModel[level]) {
851 ctheta0 = (ctheta0 + angPar) / (1. + angPar * ctheta0);
854 std::cerr <<
m_className <<
"::GetElectronCollision:\n";
855 std::cerr <<
" Unknown scattering model. \n";
856 std::cerr <<
" Using isotropic distribution.\n";
861 const double s1 = rgas[igas];
862 const double s2 = (s1 * s1) / (s1 - 1.);
863 const double theta0 =
acos(ctheta0);
864 const double arg = std::max(1. - s1 * loss / e, Small);
865 const double d = 1. - ctheta0 *
sqrt(arg);
868 e1 = std::max(e * (1. - loss / (s1 * e) - 2. * d / s2), Small);
869 double q = std::min(
sqrt((e / e1) * arg) / s1, 1.);
870 const double theta =
asin(q *
sin(theta0));
871 double ctheta =
cos(theta);
873 const double u = (s1 - 1.) * (s1 - 1.) / arg;
874 if (ctheta0 * ctheta0 > u) ctheta = -ctheta;
876 const double stheta =
sin(theta);
878 dz = std::min(dz, 1.);
879 const double argZ =
sqrt(dx * dx + dy * dy);
883 const double cphi =
cos(phi);
884 const double sphi =
sin(phi);
891 const double a = stheta / argZ;
892 const double dz1 = dz * ctheta + argZ * stheta * sphi;
893 const double dy1 = dy * ctheta + a * (dx * cphi - dy * dz * sphi);
894 const double dx1 = dx * ctheta - a * (dy * cphi + dx * dz * sphi);
904 int& type,
double& energy) {
906 if (i < 0 || i >= nDeexcitationProducts || !(useDeexcitation ||
usePenning))
908 t = dxcProducts[i].t;
909 s = dxcProducts[i].s;
910 type = dxcProducts[i].type;
911 energy = dxcProducts[i].energy;
918 if (i < 0 || i >= nIonisationProducts) {
919 std::cerr <<
m_className <<
"::GetIonisationProduct:\n";
920 std::cerr <<
" Index out of range.\n";
924 type = ionProducts[i].type;
925 energy = ionProducts[i].energy;
932 std::cerr <<
m_className <<
"::GetPhotonCollisionRate:\n";
933 std::cerr <<
" Photon energy must be greater than zero.\n";
934 return cfTotGamma[0];
936 if (e > eFinalGamma && useAutoAdjust) {
937 std::cerr <<
m_className <<
"::GetPhotonCollisionRate:\n";
938 std::cerr <<
" Collision rate at " << e
939 <<
" eV is not included in the current table.\n";
940 std::cerr <<
" Increasing energy range to " << 1.05 * e <<
" eV.\n";
946 std::cerr <<
m_className <<
"::GetPhotonCollisionRate:\n";
947 std::cerr <<
" Error calculating the collision rates table.\n";
953 int iE = int(e / eStepGamma);
954 if (iE >= nEnergyStepsGamma) iE = nEnergyStepsGamma - 1;
957 double cfSum = cfTotGamma[iE];
958 if (useDeexcitation && useRadTrap && nDeexcitations > 0) {
960 for (
int i = nDeexcitations; i--;) {
961 if (deexcitations[i].cf > 0. &&
962 fabs(e - deexcitations[i].energy) <= deexcitations[i].width) {
964 deexcitations[i].cf * TMath::Voigt(e - deexcitations[i].energy,
965 deexcitations[i].sDoppler,
966 2 * deexcitations[i].gPressure);
975 double& e1,
double& ctheta,
int& nsec,
978 if (e > eFinalGamma && useAutoAdjust) {
979 std::cerr <<
m_className <<
"::GetPhotonCollision:\n";
980 std::cerr <<
" Provided electron energy (" << e
981 <<
" eV) exceeds current energy range (" << eFinalGamma
983 std::cerr <<
" Increasing energy range to " << 1.05 * e <<
" eV.\n";
985 }
else if (e <= 0.) {
986 std::cerr <<
m_className <<
"::GetPhotonCollision:\n";
987 std::cerr <<
" Photon energy must be greater than zero.\n";
993 std::cerr <<
m_className <<
"::GetPhotonCollision:\n";
994 std::cerr <<
" Error calculating the collision rates table.\n";
1001 int iE = int(e / eStepGamma);
1002 if (iE >= nEnergyStepsGamma) iE = nEnergyStepsGamma - 1;
1005 double r = cfTotGamma[iE];
1006 if (useDeexcitation && useRadTrap && nDeexcitations > 0) {
1008 std::vector<double> pLine(0);
1009 std::vector<int> iLine(0);
1011 for (
int i = nDeexcitations; i--;) {
1012 if (deexcitations[i].cf > 0. &&
1013 fabs(e - deexcitations[i].energy) <= deexcitations[i].width) {
1014 r += deexcitations[i].cf * TMath::Voigt(e - deexcitations[i].energy,
1015 deexcitations[i].sDoppler,
1016 2 * deexcitations[i].gPressure);
1023 if (nLines > 0 && r >= cfTotGamma[iE]) {
1025 for (
int i = 0; i < nLines; ++i) {
1026 if (r <= pLine[i]) {
1027 ++nPhotonCollisions[PhotonCollisionTypeExcitation];
1029 ComputeDeexcitationInternal(iLine[i], fLevel);
1030 type = PhotonCollisionTypeExcitation;
1031 nsec = nDeexcitationProducts;
1035 std::cerr <<
m_className <<
"::GetPhotonCollision:\n";
1036 std::cerr <<
" Random sampling of deexcitation line failed.\n";
1037 std::cerr <<
" Program bug!\n";
1045 int iUp = nPhotonTerms - 1;
1046 if (r <= cfGamma[iE][iLow]) {
1048 }
else if (r >= cfGamma[iE][iUp]) {
1052 while (iUp - iLow > 1) {
1053 iMid = (iLow + iUp) >> 1;
1054 if (r < cfGamma[iE][iMid]) {
1065 type = csTypeGamma[level];
1067 type = type % nCsTypesGamma;
1068 int ngas = int(csTypeGamma[level] / nCsTypesGamma);
1069 ++nPhotonCollisions[type];
1072 esec = e - ionPot[ngas];
1073 if (esec < Small) esec = Small;
1085 for (
int j = nCsTypes; j--;) nCollisions[j] = 0;
1086 nCollisionsDetailed.resize(nTerms);
1087 for (
int j = nTerms; j--;) nCollisionsDetailed[j] = 0;
1089 for (
int j = nCsTypesGamma; j--;) nPhotonCollisions[j] = 0;
1095 for (
int j = nCsTypes; j--;) ncoll += nCollisions[j];
1100 int& nElastic,
int& nIonisation,
int& nAttachment,
int& nInelastic,
1101 int& nExcitation,
int& nSuperelastic)
const {
1103 nElastic = nCollisions[ElectronCollisionTypeElastic];
1104 nIonisation = nCollisions[ElectronCollisionTypeIonisation];
1105 nAttachment = nCollisions[ElectronCollisionTypeAttachment];
1106 nInelastic = nCollisions[ElectronCollisionTypeInelastic];
1107 nExcitation = nCollisions[ElectronCollisionTypeExcitation];
1108 nSuperelastic = nCollisions[ElectronCollisionTypeSuperelastic];
1109 return nElastic + nIonisation + nAttachment + nInelastic + nExcitation +
1117 std::cerr <<
m_className <<
"::GetNumberOfLevels:\n";
1118 std::cerr <<
" Error calculating the collision rates table.\n";
1128 std::string& descr,
double& e) {
1133 std::cerr <<
" Error calculating the collision rates table.\n";
1139 if (i < 0 || i >= nTerms) {
1141 std::cerr <<
" Requested level (" << i <<
") does not exist.\n";
1146 type = csType[i] % nCsTypes;
1147 ngas = int(csType[i] / nCsTypes);
1149 descr = std::string(50,
' ');
1150 for (
int j = 50; j--;) descr[j] = description[i][j];
1152 e = rgas[ngas] * energyLoss[i];
1155 std::cout <<
" Level " << i <<
": " << descr <<
"\n";
1156 std::cout <<
" Type " << type <<
"\n",
1157 std::cout <<
" Threshold energy: " << e <<
" eV\n";
1158 if (type == ElectronCollisionTypeExcitation &&
usePenning &&
1160 std::cout <<
" Penning transfer coefficient: " << rPenning[i] <<
"\n";
1161 }
else if (type == ElectronCollisionTypeExcitation && useDeexcitation) {
1162 const int idxc = iDeexcitation[i];
1163 if (idxc < 0 || idxc >= nDeexcitations) {
1164 std::cout <<
" Deexcitation cascade not implemented.\n";
1167 if (deexcitations[idxc].osc > 0.) {
1168 std::cout <<
" Oscillator strength: " << deexcitations[idxc].osc
1171 std::cout <<
" Decay channels:\n";
1172 for (
int j = 0; j < deexcitations[idxc].nChannels; ++j) {
1173 if (deexcitations[idxc].type[j] == DxcTypeRad) {
1174 std::cout <<
" Radiative decay to ";
1175 if (deexcitations[idxc].
final[j] < 0) {
1176 std::cout <<
"ground state: ";
1178 std::cout << deexcitations[deexcitations[idxc].final[j]].label
1181 }
else if (deexcitations[idxc].type[j] == DxcTypeCollIon) {
1182 if (deexcitations[idxc].
final[j] < 0) {
1183 std::cout <<
" Penning ionisation: ";
1185 std::cout <<
" Associative ionisation: ";
1187 }
else if (deexcitations[idxc].type[j] == DxcTypeCollNonIon) {
1188 if (deexcitations[idxc].
final[j] >= 0) {
1189 std::cout <<
" Collision-induced transition to "
1190 << deexcitations[deexcitations[idxc].final[j]].label
1193 std::cout <<
" Loss: ";
1197 std::cout << std::setprecision(5) << deexcitations[idxc].p[j] * 100.
1200 std::cout << std::setprecision(5) << (deexcitations[idxc].p[j] -
1201 deexcitations[idxc].p[j - 1]) *
1213 if (level < 0 || level >= nTerms) {
1214 std::cerr <<
m_className <<
"::GetNumberOfElectronCollisions:\n";
1215 std::cerr <<
" Requested cross-section term (" << level
1216 <<
") does not exist.\n";
1219 return nCollisionsDetailed[level];
1225 for (
int j = nCsTypesGamma; j--;) ncoll += nPhotonCollisions[j];
1230 int& nInelastic)
const {
1232 nElastic = nPhotonCollisions[0];
1233 nIonising = nPhotonCollisions[1];
1234 nInelastic = nPhotonCollisions[2];
1235 return nElastic + nIonising + nInelastic;
1238bool MediumMagboltz::GetGasNumberMagboltz(
const std::string input,
1239 int& number)
const {
1247 if (input ==
"CF4") {
1252 if (input ==
"Ar") {
1257 if (input ==
"He" || input ==
"He-4") {
1262 if (input ==
"He-3") {
1267 if (input ==
"Ne") {
1272 if (input ==
"Kr") {
1277 if (input ==
"Xe") {
1282 if (input ==
"CH4") {
1287 if (input ==
"C2H6") {
1292 if (input ==
"C3H8") {
1297 if (input ==
"iC4H10") {
1302 if (input ==
"CO2") {
1307 if (input ==
"neoC5H12") {
1312 if (input ==
"H2O") {
1317 if (input ==
"O2") {
1322 if (input ==
"N2") {
1327 if (input ==
"NO") {
1332 if (input ==
"N2O") {
1337 if (input ==
"C2H4") {
1342 if (input ==
"C2H2") {
1347 if (input ==
"H2") {
1352 if (input ==
"D2") {
1357 if (input ==
"CO") {
1362 if (input ==
"Methylal") {
1367 if (input ==
"DME") {
1372 if (input ==
"Reid-Step") {
1377 if (input ==
"Maxwell-Model") {
1382 if (input ==
"Reid-Ramp") {
1387 if (input ==
"C2F6") {
1392 if (input ==
"SF6") {
1397 if (input ==
"NH3") {
1402 if (input ==
"C3H6") {
1407 if (input ==
"cC3H6") {
1412 if (input ==
"CH3OH") {
1417 if (input ==
"C2H5OH") {
1422 if (input ==
"C3H7OH") {
1427 if (input ==
"Cs") {
1432 if (input ==
"F2") {
1436 if (input ==
"CS2") {
1441 if (input ==
"COS") {
1446 if (input ==
"CD4") {
1451 if (input ==
"BF3") {
1456 if (input ==
"C2HF5" || input ==
"C2H2F4") {
1461 if (input ==
"TMA") {
1466 if (input ==
"CHF3") {
1471 if (input ==
"CF3Br") {
1476 if (input ==
"C3F8") {
1481 if (input ==
"O3") {
1486 if (input ==
"Hg") {
1491 if (input ==
"H2S") {
1496 if (input ==
"nC4H10") {
1501 if (input ==
"nC5H12") {
1506 if (input ==
"N2 (Phelps)") {
1511 if (input ==
"GeH4") {
1516 if (input ==
"SiH4") {
1521 std::cerr <<
m_className <<
"::GetGasNumberMagboltz:\n";
1522 std::cerr <<
" Gas " << input <<
" is not defined.\n";
1526bool MediumMagboltz::Mixer(
const bool verbose) {
1541 if (useAnisotropic) {
1550 const double prefactor = dens * SpeedOfLight *
sqrt(2. / ElectronMass);
1553 for (
int i = nEnergySteps; i--;) {
1555 for (
int j = nMaxLevels; j--;) {
1557 scatParameter[i][j] = 0.5;
1561 for (
int i = nEnergyStepsLog; i--;) {
1563 for (
int j = nMaxLevels; j--;) {
1565 scatParameter[i][j] = 0.5;
1571 deexcitations.clear();
1572 for (
int i = nMaxLevels; i--;) {
1574 iDeexcitation[i] = -1;
1581 gsGreenSawada[i] = 1.;
1582 gbGreenSawada[i] = 0.;
1583 tsGreenSawada[i] = 0.;
1584 taGreenSawada[i] = 0.;
1585 tbGreenSawada[i] = 0.;
1586 m_hasGreenSawada[i] =
false;
1592 static double q[nEnergySteps][6];
1594 static double pEqEl[nEnergySteps][6];
1596 static double qIn[nEnergySteps][nMaxInelasticTerms];
1598 static double qIon[nEnergySteps][8];
1600 static double pEqIn[nEnergySteps][nMaxInelasticTerms];
1602 static double pEqIon[nEnergySteps][8];
1604 static double eoby[nEnergySteps];
1606 static double penFra[nMaxInelasticTerms][3];
1608 static char scrpt[260][50];
1613 if (!GetGasNumberMagboltz(
gas[i], gasNumber[i])) {
1615 std::cerr <<
" Gas " <<
gas[i] <<
" has no corresponding"
1616 <<
" gas number in Magboltz.\n";
1623 std::cout <<
" Creating table of collision rates with\n";
1624 std::cout <<
" " << nEnergySteps <<
" linear energy steps between 0 and "
1625 << std::min(eFinal, eHigh) <<
" eV\n";
1626 if (eFinal > eHigh) {
1627 std::cout <<
" " << nEnergyStepsLog
1628 <<
" logarithmic energy steps between " << eHigh <<
" and "
1629 << eFinal <<
" eV\n";
1634 std::ofstream outfile;
1636 outfile.open(
"cs.txt", std::ios::out);
1637 outfile <<
"# energy [eV] vs. cross-section [cm2]\n";
1642 if (eFinal <= eHigh) {
1653 double e[6] = {0., 0., 0., 0., 0., 0.};
1654 double eIn[nMaxInelasticTerms] = {0.};
1655 double eIon[8] = {0.};
1659 long long kIn[nMaxInelasticTerms] = {0};
1660 long long kEl[6] = {0, 0, 0, 0, 0, 0};
1664 long long ngs = gasNumber[iGas];
1666 pEqEl[0], pEqIn[0], penFra[0], kEl, kIn, qIon[0],
1667 pEqIon[0], eIon, &nIon, scrpt);
1669 const double massAmu =
1670 (2. / e[1]) * ElectronMass / AtomicMassUnitElectronVolt;
1671 std::cout <<
" " << name <<
"\n";
1672 std::cout <<
" mass: " << massAmu <<
" amu\n";
1674 std::cout <<
" ionisation threshold: " << eIon[0] <<
" eV\n";
1676 std::cout <<
" ionisation threshold: " << e[2] <<
" eV\n";
1678 if (e[3] > 0. && e[4] > 0.) {
1679 std::cout <<
" cross-sections at minimum ionising energy:\n";
1680 std::cout <<
" excitation: " << e[3] * 1.e18 <<
" Mbarn\n";
1681 std::cout <<
" ionisation: " << e[4] * 1.e18 <<
" Mbarn\n";
1687 if (np0 + nIn + nIon + 1 >= nMaxLevels) {
1689 std::cerr <<
" Max. number of levels (" << nMaxLevels
1694 double van =
fraction[iGas] * prefactor;
1698 outfile <<
"# cross-sections for " << name <<
"\n";
1699 outfile <<
"# cross-section types:\n";
1700 outfile <<
"# elastic\n";
1704 scatModel[np] = kEl[1];
1705 const double r = 1. + e[1] / 2.;
1707 energyLoss[np] = 0.;
1708 for (
int j = 0; j < 50; ++j) {
1709 description[np][j] = scrpt[1][j];
1711 csType[np] = nCsTypes * iGas + ElectronCollisionTypeElastic;
1712 bool withIon =
false;
1715 for (
int j = 0; j < nIon; ++j) {
1716 if (eFinal < eIon[j])
continue;
1720 scatModel[np] = kEl[2];
1721 energyLoss[np] = eIon[j] / r;
1723 wOpalBeaty[np] = eoby[j];
1724 if (
gas[iGas] ==
"CH4") {
1725 if (
fabs(eIon[j] - 21.) < 0.1) {
1726 wOpalBeaty[np] = 14.;
1727 }
else if (
fabs(eIon[j] - 291.) < 0.1) {
1728 wOpalBeaty[np] = 200.;
1731 for (
int k = 0; k < 50; ++k) {
1732 description[np][k] = scrpt[2 + j][k];
1734 csType[np] = nCsTypes * iGas + ElectronCollisionTypeIonisation;
1736 outfile <<
"# " << description[np] <<
"\n";
1739 gsGreenSawada[iGas] = eoby[0];
1740 tbGreenSawada[iGas] = 2 * eIon[0];
1741 ionPot[iGas] = eIon[0];
1743 if (eFinal >= e[2]) {
1747 scatModel[np] = kEl[2];
1748 energyLoss[np] = e[2] / r;
1749 wOpalBeaty[np] = eoby[0];
1750 gsGreenSawada[iGas] = eoby[0];
1751 tbGreenSawada[iGas] = 2 * e[2];
1752 ionPot[iGas] = e[2];
1753 for (
int j = 0; j < 50; ++j) {
1754 description[np][j] = scrpt[2][j];
1756 csType[np] = nCsTypes * iGas + ElectronCollisionTypeIonisation;
1758 outfile <<
"# ionisation (gross)\n";
1766 energyLoss[np] = 0.;
1767 for (
int j = 0; j < 50; ++j) {
1768 description[np][j] = scrpt[2 + nIon][j];
1770 csType[np] = nCsTypes * iGas + ElectronCollisionTypeAttachment;
1772 outfile <<
"# attachment\n";
1775 int nExc = 0, nSuperEl = 0;
1776 for (
int j = 0; j < nIn; ++j) {
1778 scatModel[np] = kIn[j];
1779 energyLoss[np] = eIn[j] / r;
1780 for (
int k = 0; k < 50; ++k) {
1781 description[np][k] = scrpt[5 + nIon + j][k];
1783 if ((description[np][1] ==
'E' && description[np][2] ==
'X') ||
1784 (description[np][0] ==
'E' && description[np][1] ==
'X') ||
1785 (
gas[iGas] ==
"N2" && eIn[j] > 6.)) {
1787 csType[np] = nCsTypes * iGas + ElectronCollisionTypeExcitation;
1789 }
else if (eIn[j] < 0.) {
1791 csType[np] = nCsTypes * iGas + ElectronCollisionTypeSuperelastic;
1795 csType[np] = nCsTypes * iGas + ElectronCollisionTypeInelastic;
1798 outfile <<
"# " << description[np] <<
"\n";
1803 for (
int iE = 0; iE < nEnergySteps; ++iE) {
1806 outfile << (iE + 0.5) * eStep <<
" " << q[iE][1] <<
" ";
1809 cf[iE][np] = q[iE][1] * van;
1810 if (scatModel[np] == 1) {
1811 ComputeAngularCut(pEqEl[iE][1], scatCut[iE][np], scatParameter[iE][np]);
1812 }
else if (scatModel[np] == 2) {
1813 scatParameter[iE][np] = pEqEl[iE][1];
1818 for (
int j = 0; j < nIon; ++j) {
1819 if (eFinal < eIon[j])
continue;
1821 cf[iE][np] = qIon[iE][j] * van;
1822 if (scatModel[np] == 1) {
1823 ComputeAngularCut(pEqIon[iE][j], scatCut[iE][np],
1824 scatParameter[iE][np]);
1825 }
else if (scatModel[np] == 2) {
1826 scatParameter[iE][np] = pEqIon[iE][j];
1829 outfile << qIon[iE][j] <<
" ";
1834 cf[iE][np] = q[iE][2] * van;
1835 if (scatModel[np] == 1) {
1836 ComputeAngularCut(pEqEl[iE][2], scatCut[iE][np],
1837 scatParameter[iE][np]);
1838 }
else if (scatModel[np] == 2) {
1839 scatParameter[iE][np] = pEqEl[iE][2];
1842 outfile << q[iE][2] <<
" ";
1848 cf[iE][np] = q[iE][3] * van;
1849 scatParameter[iE][np] = 0.5;
1851 outfile << q[iE][3] <<
" ";
1854 for (
int j = 0; j < nIn; ++j) {
1856 if (useCsOutput) outfile << qIn[iE][j] <<
" ";
1857 cf[iE][np] = qIn[iE][j] * van;
1859 cf[iE][np] *= scaleExc[iGas];
1861 if (description[np][5] ==
'D' && description[np][6] ==
'I' &&
1862 description[np][7] ==
'S') {
1869 if (cf[iE][np] < 0.) {
1871 std::cerr <<
" Negative inelastic cross-section at "
1872 << (iE + 0.5) * eStep <<
" eV.\n";
1873 std::cerr <<
" Set to zero.\n";
1876 if (scatModel[np] == 1) {
1877 ComputeAngularCut(pEqIn[iE][j], scatCut[iE][np],
1878 scatParameter[iE][np]);
1879 }
else if (scatModel[np] == 2) {
1880 scatParameter[iE][np] = pEqIn[iE][j];
1883 if ((
m_debug || verbose) && nIn > 0 && iE == nEnergySteps - 1) {
1884 std::cout <<
" " << nIn <<
" inelastic terms (" << nExc
1885 <<
" excitations, " << nSuperEl <<
" superelastic, "
1886 << nIn - nExc - nSuperEl <<
" other)\n";
1888 if (useCsOutput) outfile <<
"\n";
1891 if (eFinal <= eHigh)
continue;
1894 const double rLog =
pow(eFinal / eHigh, 1. / nEnergyStepsLog);
1897 double emax = eHigh * rLog;
1898 int imax = nEnergySteps - 1;
1899 for (
int iE = 0; iE < nEnergyStepsLog; ++iE) {
1903 pEqEl[0], pEqIn[0], penFra[0], kEl, kIn, qIon[0],
1904 pEqIon[0], eIon, &nIon, scrpt);
1907 outfile << emax <<
" " << q[imax][1] <<
" ";
1910 cfLog[iE][np] = q[imax][1] * van;
1911 if (scatModel[np] == 1) {
1912 ComputeAngularCut(pEqEl[imax][1], scatCutLog[iE][np],
1913 scatParameterLog[iE][np]);
1914 }
else if (scatModel[np] == 2) {
1915 scatParameterLog[iE][np] = pEqEl[imax][1];
1920 for (
int j = 0; j < nIon; ++j) {
1921 if (eFinal < eIon[j])
continue;
1923 cfLog[iE][np] = qIon[imax][j] * van;
1924 if (scatModel[np] == 1) {
1925 ComputeAngularCut(pEqIon[imax][j], scatCutLog[iE][np],
1926 scatParameterLog[iE][np]);
1927 }
else if (scatModel[np] == 2) {
1928 scatParameterLog[iE][np] = pEqIon[imax][j];
1931 outfile << qIon[imax][j] <<
" ";
1937 cfLog[iE][np] = q[imax][2] * van;
1940 if (scatModel[np] == 1) {
1941 ComputeAngularCut(pEqEl[imax][2], scatCutLog[iE][np],
1942 scatParameterLog[iE][np]);
1943 }
else if (scatModel[np] == 2) {
1944 scatParameterLog[iE][np] = pEqEl[imax][2];
1950 cfLog[iE][np] = q[imax][3] * van;
1952 outfile << q[imax][3] <<
" ";
1955 for (
int j = 0; j < nIn; ++j) {
1957 if (useCsOutput) outfile << qIn[imax][j] <<
" ";
1958 cfLog[iE][np] = qIn[imax][j] * van;
1960 cfLog[iE][np] *= scaleExc[iGas];
1961 if (cfLog[iE][np] < 0.) {
1963 std::cerr <<
" Negative inelastic cross-section at " << emax
1965 std::cerr <<
" Set to zero.\n";
1968 if (scatModel[np] == 1) {
1969 ComputeAngularCut(pEqIn[imax][j], scatCutLog[iE][np],
1970 scatParameterLog[iE][np]);
1971 }
else if (scatModel[np] == 2) {
1972 scatParameterLog[iE][np] = pEqIn[imax][j];
1975 if (useCsOutput) outfile <<
"\n";
1980 if (useCsOutput) outfile.close();
1983 std::string minIonPotGas =
"";
1985 if (ionPot[i] < 0.)
continue;
1986 if (minIonPot < 0.) {
1987 minIonPot = ionPot[i];
1988 minIonPotGas =
gas[i];
1989 }
else if (ionPot[i] < minIonPot) {
1990 minIonPot = ionPot[i];
1991 minIonPotGas =
gas[i];
1997 std::cout <<
" Lowest ionisation threshold in the mixture:\n";
1998 std::cout <<
" " << minIonPot <<
" eV (" << minIonPotGas <<
")\n";
2001 for (
int iE = nEnergySteps; iE--;) {
2003 for (
int k = nTerms; k--;) {
2004 if (cf[iE][k] < 0.) {
2006 std::cerr <<
" Negative collision rate at " << (iE + 0.5) * eStep
2008 std::cerr <<
" Set to zero.\n";
2011 cfTot[iE] += cf[iE][k];
2014 if (cfTot[iE] > 0.) {
2015 for (
int k = nTerms; k--;) cf[iE][k] /= cfTot[iE];
2017 for (
int k = 1; k < nTerms; ++k) {
2018 cf[iE][k] += cf[iE][k - 1];
2020 const double ekin = eStep * (iE + 0.5);
2021 cfTot[iE] *=
sqrt(ekin);
2025 sqrt(1. + 0.5 * ekin / ElectronMass) / (1. + ekin / ElectronMass);
2029 if (eFinal > eHigh) {
2030 const double rLog =
pow(eFinal / eHigh, 1. / nEnergyStepsLog);
2031 for (
int iE = nEnergyStepsLog; iE--;) {
2033 for (
int k = nTerms; k--;) {
2034 if (cfLog[iE][k] < 0.) {
2037 cfTotLog[iE] += cfLog[iE][k];
2040 if (cfTotLog[iE] > 0.) {
2041 for (
int k = nTerms; k--;) cfLog[iE][k] /= cfTotLog[iE];
2043 for (
int k = 1; k < nTerms; ++k) {
2044 cfLog[iE][k] += cfLog[iE][k - 1];
2046 const double ekin = eHigh *
pow(rLog, iE + 1);
2047 cfTotLog[iE] *=
sqrt(ekin) *
sqrt(1. + 0.5 * ekin / ElectronMass) /
2048 (1. + ekin / ElectronMass);
2050 cfTotLog[iE] = log(cfTotLog[iE]);
2056 for (
int j = 0; j < nEnergySteps; ++j) {
2057 if (cfTot[j] > cfNull) cfNull = cfTot[j];
2059 if (eFinal > eHigh) {
2060 for (
int j = 0; j < nEnergyStepsLog; ++j) {
2061 const double r =
exp(cfTotLog[j]);
2062 if (r > cfNull) cfNull = r;
2067 nCollisionsDetailed.resize(nTerms);
2068 for (
int j = nCsTypes; j--;) nCollisions[j] = 0;
2069 for (
int j = nTerms; j--;) nCollisionsDetailed[j] = 0;
2073 std::cout <<
" Energy [eV] Collision Rate [ns-1]\n";
2074 for (
int i = 0; i < 8; ++i) {
2075 const double emax = std::min(eHigh, eFinal);
2076 std::cout <<
" " << std::fixed << std::setw(10) << std::setprecision(2)
2077 << (2 * i + 1) * emax / 16 <<
" " << std::setw(18)
2078 << std::setprecision(2) << cfTot[(i + 1) * nEnergySteps / 16]
2081 std::cout << std::resetiosflags(std::ios_base::floatfield);
2085 if (useDeexcitation) {
2086 ComputeDeexcitationTable(verbose);
2087 const int dxcCount = deexcitations.size();
2088 if (dxcCount != nDeexcitations) {
2090 std::cerr <<
" Mismatch in deexcitation count.\n";
2091 std::cerr <<
" Program bug!\n";
2092 std::cerr <<
" Deexcitation handling is switched off.\n";
2093 useDeexcitation =
false;
2095 for (
int j = nDeexcitations; j--;) {
2096 const int probCount = deexcitations[j].p.size();
2097 const int flvlCount = deexcitations[j].final.size();
2098 const int typeCount = deexcitations[j].type.size();
2099 if (!(probCount == flvlCount && flvlCount == typeCount &&
2100 typeCount == deexcitations[j].nChannels)) {
2102 std::cerr <<
" Mismatch in deexcitation channel count.\n";
2103 std::cerr <<
" Program bug!\n";
2104 std::cerr <<
" Deexcitation handling is switched off.\n";
2105 useDeexcitation =
false;
2112 if (!ComputePhotonCollisionTable(verbose)) {
2114 std::cerr <<
" Photon collision rates could not be calculated.\n";
2115 if (useDeexcitation) {
2116 std::cerr <<
" Deexcitation handling is switched off.\n";
2117 useDeexcitation =
false;
2122 for (
int i = nTerms; i--;) {
2124 int iGas = int(csType[i] / nCsTypes);
2137void MediumMagboltz::SetupGreenSawada() {
2140 taGreenSawada[i] = 1000.;
2141 m_hasGreenSawada[i] =
true;
2142 if (
gas[i] ==
"He" ||
gas[i] ==
"He-3") {
2143 tsGreenSawada[i] = -2.25;
2144 gsGreenSawada[i] = 15.5;
2145 gbGreenSawada[i] = 24.5;
2146 }
else if (
gas[i] ==
"Ne") {
2147 tsGreenSawada[i] = -6.49;
2148 gsGreenSawada[i] = 24.3;
2149 gbGreenSawada[i] = 21.6;
2150 }
else if (
gas[i] ==
"Ar") {
2151 tsGreenSawada[i] = 6.87;
2152 gsGreenSawada[i] = 6.92;
2153 gbGreenSawada[i] = 7.85;
2154 }
else if (
gas[i] ==
"Kr") {
2155 tsGreenSawada[i] = 3.90;
2156 gsGreenSawada[i] = 7.95;
2157 gbGreenSawada[i] = 13.5;
2158 }
else if (
gas[i] ==
"Xe") {
2159 tsGreenSawada[i] = 3.81;
2160 gsGreenSawada[i] = 7.93;
2161 gbGreenSawada[i] = 11.5;
2162 }
else if (
gas[i] ==
"H2" ||
gas[i] ==
"D2") {
2163 tsGreenSawada[i] = 1.87;
2164 gsGreenSawada[i] = 7.07;
2165 gbGreenSawada[i] = 7.7;
2166 }
else if (
gas[i] ==
"N2") {
2167 tsGreenSawada[i] = 4.71;
2168 gsGreenSawada[i] = 13.8;
2169 gbGreenSawada[i] = 15.6;
2170 }
else if (
gas[i] ==
"O2") {
2171 tsGreenSawada[i] = 1.86;
2172 gsGreenSawada[i] = 18.5;
2173 gbGreenSawada[i] = 12.1;
2174 }
else if (
gas[i] ==
"CH4") {
2175 tsGreenSawada[i] = 3.45;
2176 gsGreenSawada[i] = 7.06;
2177 gbGreenSawada[i] = 12.5;
2178 }
else if (
gas[i] ==
"H20") {
2179 tsGreenSawada[i] = 1.28;
2180 gsGreenSawada[i] = 12.8;
2181 gbGreenSawada[i] = 12.6;
2182 }
else if (
gas[i] ==
"CO") {
2183 tsGreenSawada[i] = 2.03;
2184 gsGreenSawada[i] = 13.3;
2185 gbGreenSawada[i] = 14.0;
2186 }
else if (
gas[i] ==
"C2H2") {
2187 tsGreenSawada[i] = 1.37;
2188 gsGreenSawada[i] = 9.28;
2189 gbGreenSawada[i] = 5.8;
2190 }
else if (
gas[i] ==
"NO") {
2191 tsGreenSawada[i] = -4.30;
2192 gsGreenSawada[i] = 10.4;
2193 gbGreenSawada[i] = 9.5;
2194 }
else if (
gas[i] ==
"CO2") {
2195 tsGreenSawada[i] = -2.46;
2196 gsGreenSawada[i] = 12.3;
2197 gbGreenSawada[i] = 13.8;
2199 taGreenSawada[i] = 0.;
2200 m_hasGreenSawada[i] =
false;
2201 if (useGreenSawada) {
2202 std::cout <<
m_className <<
"::SetupGreenSawada:\n";
2203 std::cout <<
" Fit parameters for " <<
gas[i] <<
" not available.\n";
2204 std::cout <<
" Opal-Beaty formula is used instead.\n";
2210void MediumMagboltz::ComputeAngularCut(
double parIn,
double& cut,
2222 const double rads = 2. / Pi;
2223 const double cns = parIn - 0.5;
2224 const double thetac =
asin(2. *
sqrt(cns - cns * cns));
2225 const double fac = (1. -
cos(thetac)) /
pow(
sin(thetac), 2.);
2226 parOut = cns * fac + 0.5;
2227 cut = thetac * rads;
2230void MediumMagboltz::ComputeDeexcitationTable(
const bool verbose) {
2232 for (
int i = nMaxLevels; i--;) iDeexcitation[i] = -1;
2233 deexcitations.clear();
2237 OpticalData optData;
2240 bool withAr =
false;
2243 bool withNe =
false;
2245 std::map<std::string, int> mapLevels;
2247 for (
int i = 0; i < nTerms; ++i) {
2249 if (csType[i] % nCsTypes != ElectronCollisionTypeExcitation)
continue;
2251 const int ngas = int(csType[i] / nCsTypes);
2252 if (
gas[ngas] ==
"Ar") {
2260 std::string level =
" ";
2261 for (
int j = 0; j < 7; ++j) level[j] = description[i][5 + j];
2262 if (level ==
"1S5 ")
2263 mapLevels[
"Ar_1S5"] = i;
2264 else if (level ==
"1S4 ")
2265 mapLevels[
"Ar_1S4"] = i;
2266 else if (level ==
"1S3 ")
2267 mapLevels[
"Ar_1S3"] = i;
2268 else if (level ==
"1S2 ")
2269 mapLevels[
"Ar_1S2"] = i;
2270 else if (level ==
"2P10 ")
2271 mapLevels[
"Ar_2P10"] = i;
2272 else if (level ==
"2P9 ")
2273 mapLevels[
"Ar_2P9"] = i;
2274 else if (level ==
"2P8 ")
2275 mapLevels[
"Ar_2P8"] = i;
2276 else if (level ==
"2P7 ")
2277 mapLevels[
"Ar_2P7"] = i;
2278 else if (level ==
"2P6 ")
2279 mapLevels[
"Ar_2P6"] = i;
2280 else if (level ==
"2P5 ")
2281 mapLevels[
"Ar_2P5"] = i;
2282 else if (level ==
"2P4 ")
2283 mapLevels[
"Ar_2P4"] = i;
2284 else if (level ==
"2P3 ")
2285 mapLevels[
"Ar_2P3"] = i;
2286 else if (level ==
"2P2 ")
2287 mapLevels[
"Ar_2P2"] = i;
2288 else if (level ==
"2P1 ")
2289 mapLevels[
"Ar_2P1"] = i;
2290 else if (level ==
"3D6 ")
2291 mapLevels[
"Ar_3D6"] = i;
2292 else if (level ==
"3D5 ")
2293 mapLevels[
"Ar_3D5"] = i;
2294 else if (level ==
"3D3 ")
2295 mapLevels[
"Ar_3D3"] = i;
2296 else if (level ==
"3D4! ")
2297 mapLevels[
"Ar_3D4!"] = i;
2298 else if (level ==
"3D4 ")
2299 mapLevels[
"Ar_3D4"] = i;
2300 else if (level ==
"3D1!! ")
2301 mapLevels[
"Ar_3D1!!"] = i;
2302 else if (level ==
"2S5 ")
2303 mapLevels[
"Ar_2S5"] = i;
2304 else if (level ==
"2S4 ")
2305 mapLevels[
"Ar_2S4"] = i;
2306 else if (level ==
"3D1! ")
2307 mapLevels[
"Ar_3D1!"] = i;
2308 else if (level ==
"3D2 ")
2309 mapLevels[
"Ar_3D2"] = i;
2310 else if (level ==
"3S1!!!!")
2311 mapLevels[
"Ar_3S1!!!!"] = i;
2312 else if (level ==
"3S1!! ")
2313 mapLevels[
"Ar_3S1!!"] = i;
2314 else if (level ==
"3S1!!! ")
2315 mapLevels[
"Ar_3S1!!!"] = i;
2316 else if (level ==
"2S3 ")
2317 mapLevels[
"Ar_2S3"] = i;
2318 else if (level ==
"2S2 ")
2319 mapLevels[
"Ar_2S2"] = i;
2320 else if (level ==
"3S1! ")
2321 mapLevels[
"Ar_3S1!"] = i;
2322 else if (level ==
"4D5 ")
2323 mapLevels[
"Ar_4D5"] = i;
2324 else if (level ==
"3S4 ")
2325 mapLevels[
"Ar_3S4"] = i;
2326 else if (level ==
"4D2 ")
2327 mapLevels[
"Ar_4D2"] = i;
2328 else if (level ==
"4S1! ")
2329 mapLevels[
"Ar_4S1!"] = i;
2330 else if (level ==
"3S2 ")
2331 mapLevels[
"Ar_3S2"] = i;
2332 else if (level ==
"5D5 ")
2333 mapLevels[
"Ar_5D5"] = i;
2334 else if (level ==
"4S4 ")
2335 mapLevels[
"Ar_4S4"] = i;
2336 else if (level ==
"5D2 ")
2337 mapLevels[
"Ar_5D2"] = i;
2338 else if (level ==
"6D5 ")
2339 mapLevels[
"Ar_6D5"] = i;
2340 else if (level ==
"5S1! ")
2341 mapLevels[
"Ar_5S1!"] = i;
2342 else if (level ==
"4S2 ")
2343 mapLevels[
"Ar_4S2"] = i;
2344 else if (level ==
"5S4 ")
2345 mapLevels[
"Ar_5S4"] = i;
2346 else if (level ==
"6D2 ")
2347 mapLevels[
"Ar_6D2"] = i;
2348 else if (level ==
"HIGH ")
2349 mapLevels[
"Ar_Higher"] = i;
2351 std::cerr <<
m_className <<
"::ComputeDeexcitationTable:\n";
2352 std::cerr <<
" Unknown excitation level:\n";
2353 std::cerr <<
" Ar " << level <<
"\n";
2355 }
else if (
gas[ngas] ==
"Ne") {
2360 std::string level =
" ";
2361 for (
int j = 0; j < 7; ++j) level[j] = description[i][3 + j];
2362 if (level ==
" 1S5 ")
2363 mapLevels[
"Ne_1S5"] = i;
2364 else if (level ==
" 1S4 ")
2365 mapLevels[
"Ne_1S4"] = i;
2366 else if (level ==
" 1S3 ")
2367 mapLevels[
"Ne_1S3"] = i;
2368 else if (level ==
" 1S2 ")
2369 mapLevels[
"Ne_1S2"] = i;
2370 else if (level ==
" 2P10 ")
2371 mapLevels[
"Ne_2P10"] = i;
2372 else if (level ==
" 2P9 ")
2373 mapLevels[
"Ne_2P9"] = i;
2374 else if (level ==
" 2P8 ")
2375 mapLevels[
"Ne_2P8"] = i;
2376 else if (level ==
" 2P7 ")
2377 mapLevels[
"Ne_2P7"] = i;
2378 else if (level ==
" 2P6 ")
2379 mapLevels[
"Ne_2P6"] = i;
2380 else if (level ==
" 2P5 ")
2381 mapLevels[
"Ne_2P5"] = i;
2382 else if (level ==
" 2P4 ")
2383 mapLevels[
"Ne_2P4"] = i;
2384 else if (level ==
" 2P3 ")
2385 mapLevels[
"Ne_2P3"] = i;
2386 else if (level ==
" 2P2 ")
2387 mapLevels[
"Ne_2P2"] = i;
2388 else if (level ==
" 2P1 ")
2389 mapLevels[
"Ne_2P1"] = i;
2390 else if (level ==
" 2S5 ")
2391 mapLevels[
"Ne_2S5"] = i;
2392 else if (level ==
" 2S4 ")
2393 mapLevels[
"Ne_2S4"] = i;
2394 else if (level ==
" 2S3 ")
2395 mapLevels[
"Ne_2S3"] = i;
2396 else if (level ==
" 2S2 ")
2397 mapLevels[
"Ne_2S2"] = i;
2398 else if (level ==
" 3D6 ")
2399 mapLevels[
"Ne_3D6"] = i;
2400 else if (level ==
" 3D5 ")
2401 mapLevels[
"Ne_3D5"] = i;
2402 else if (level ==
" 3D4! ")
2403 mapLevels[
"Ne_3D4!"] = i;
2404 else if (level ==
" 3D4 ")
2405 mapLevels[
"Ne_3D4"] = i;
2406 else if (level ==
" 3D3 ")
2407 mapLevels[
"Ne_3D3"] = i;
2408 else if (level ==
" 3D2 ")
2409 mapLevels[
"Ne_3D2"] = i;
2410 else if (level ==
" 3D1!! ")
2411 mapLevels[
"Ne_3D1!!"] = i;
2412 else if (level ==
" 3D1! ")
2413 mapLevels[
"Ne_3D1!"] = i;
2414 else if (level ==
"3S1!!!!")
2415 mapLevels[
"Ne_3S1!!!!"] = i;
2416 else if (level ==
"3S1!!! ")
2417 mapLevels[
"Ne_3S1!!!"] = i;
2418 else if (level ==
" 3S1!! ")
2419 mapLevels[
"Ne_3S1!!"] = i;
2420 else if (level ==
" 3S1! ")
2421 mapLevels[
"Ne_3S1!"] = i;
2422 else if (level ==
"SUM 3P1")
2423 mapLevels[
"Ne_3P10_3P6"] = i;
2424 else if (level ==
"SUM 3P5")
2425 mapLevels[
"Ne_3P5_3P2"] = i;
2426 else if (level ==
" 3P1 ")
2427 mapLevels[
"Ne_3P1"] = i;
2428 else if (level ==
" 3S4 ")
2429 mapLevels[
"Ne_3S4"] = i;
2430 else if (level ==
" 3S2 ")
2431 mapLevels[
"Ne_3S2"] = i;
2432 else if (level ==
" 4D5 ")
2433 mapLevels[
"Ne_4D5"] = i;
2434 else if (level ==
" 4D2 ")
2435 mapLevels[
"Ne_4D2"] = i;
2436 else if (level ==
" 4S1! ")
2437 mapLevels[
"Ne_4S1!"] = i;
2438 else if (level ==
" 4S4 ")
2439 mapLevels[
"Ne_4S4"] = i;
2440 else if (level ==
" 5D5 ")
2441 mapLevels[
"Ne_5D5"] = i;
2442 else if (level ==
" 5D2 ")
2443 mapLevels[
"Ne_5D2"] = i;
2444 else if (level ==
" 4S2 ")
2445 mapLevels[
"Ne_4S2"] = i;
2446 else if (level ==
" 5S1! ")
2447 mapLevels[
"Ne_5S1!"] = i;
2448 else if (level ==
"SUM S H")
2449 mapLevels[
"Ne_Sum_S_High"] = i;
2450 else if (level ==
"SUM D H")
2451 mapLevels[
"Ne_Sum_P_High"] = i;
2453 std::cerr <<
m_className <<
"::ComputeDeexcitationTable:\n";
2454 std::cerr <<
" Unknown excitation level:\n";
2455 std::cerr <<
" Ne " << level <<
"\n";
2462 std::map<std::string, int> mapDxc;
2463 std::map<std::string, int>::iterator itMap;
2464 for (itMap = mapLevels.begin(); itMap != mapLevels.end(); itMap++) {
2465 std::string level = (*itMap).first;
2466 mapDxc[level] = nDeexcitations;
2467 iDeexcitation[(*itMap).second] = nDeexcitations;
2473 2. * SpeedOfLight * FineStructureConstant / (3. * ElectronMass * HbarC);
2483 deexcitation newDxc;
2484 for (itMap = mapLevels.begin(); itMap != mapLevels.end(); itMap++) {
2485 std::string level = (*itMap).first;
2486 newDxc.gas = int(csType[(*itMap).second] / nCsTypes);
2487 newDxc.level = (*itMap).second;
2488 newDxc.label = level;
2490 newDxc.energy = energyLoss[(*itMap).second] * rgas[newDxc.gas];
2492 newDxc.osc = newDxc.cf = 0.;
2493 newDxc.sDoppler = newDxc.gPressure = newDxc.width = 0.;
2495 newDxc.final.clear();
2496 newDxc.type.clear();
2497 newDxc.nChannels = 0;
2498 if (level ==
"Ar_1S5" || level ==
"Ar_1S3") {
2500 }
else if (level ==
"Ar_1S4") {
2502 newDxc.osc = 0.0609;
2505 newDxc.nChannels = nc;
2506 newDxc.p.resize(nc);
2507 newDxc.final.resize(nc);
2508 newDxc.type.resize(nc, DxcTypeRad);
2509 newDxc.p[0] = 0.119;
2510 newDxc.final[0] = -1;
2511 }
else if (level ==
"Ar_1S2") {
2516 newDxc.nChannels = nc;
2517 newDxc.p.resize(nc);
2518 newDxc.final.resize(nc);
2519 newDxc.type.resize(nc, DxcTypeRad);
2521 newDxc.final[0] = -1;
2522 }
else if (level ==
"Ar_2P10") {
2524 newDxc.nChannels = nc;
2525 newDxc.p.resize(nc);
2526 newDxc.final.resize(nc);
2527 newDxc.type.resize(nc, DxcTypeRad);
2528 newDxc.p[0] = 0.0189;
2529 newDxc.final[0] = mapDxc[
"Ar_1S5"];
2530 newDxc.p[1] = 5.43e-3;
2531 newDxc.final[1] = mapDxc[
"Ar_1S4"];
2532 newDxc.p[2] = 9.8e-4;
2533 newDxc.final[2] = mapDxc[
"Ar_1S3"];
2534 newDxc.p[3] = 1.9e-4;
2535 newDxc.final[3] = mapDxc[
"Ar_1S2"];
2536 }
else if (level ==
"Ar_2P9") {
2538 newDxc.nChannels = nc;
2539 newDxc.p.resize(nc);
2540 newDxc.final.resize(nc);
2541 newDxc.type.resize(nc, DxcTypeRad);
2542 newDxc.p[0] = 0.0331;
2543 newDxc.final[0] = mapDxc[
"Ar_1S5"];
2544 }
else if (level ==
"Ar_2P8") {
2546 newDxc.nChannels = nc;
2547 newDxc.p.resize(nc);
2548 newDxc.final.resize(nc);
2549 newDxc.type.resize(nc, DxcTypeRad);
2550 newDxc.p[0] = 9.28e-3;
2551 newDxc.final[0] = mapDxc[
"Ar_1S5"];
2552 newDxc.p[1] = 0.0215;
2553 newDxc.final[1] = mapDxc[
"Ar_1S4"];
2554 newDxc.p[2] = 1.47e-3;
2555 newDxc.final[2] = mapDxc[
"Ar_1S2"];
2556 }
else if (level ==
"Ar_2P7") {
2558 newDxc.nChannels = nc;
2559 newDxc.p.resize(nc);
2560 newDxc.final.resize(nc);
2561 newDxc.type.resize(nc, DxcTypeRad);
2562 newDxc.p[0] = 5.18e-3;
2563 newDxc.final[0] = mapDxc[
"Ar_1S5"];
2564 newDxc.p[1] = 0.025;
2565 newDxc.final[1] = mapDxc[
"Ar_1S4"];
2566 newDxc.p[2] = 2.43e-3;
2567 newDxc.final[2] = mapDxc[
"Ar_1S3"];
2568 newDxc.p[3] = 1.06e-3;
2569 newDxc.final[3] = mapDxc[
"Ar_1S2"];
2570 }
else if (level ==
"Ar_2P6") {
2572 newDxc.nChannels = nc;
2573 newDxc.p.resize(nc);
2574 newDxc.final.resize(nc);
2575 newDxc.type.resize(nc, DxcTypeRad);
2576 newDxc.p[0] = 0.0245;
2577 newDxc.final[0] = mapDxc[
"Ar_1S5"];
2578 newDxc.p[1] = 4.9e-3;
2579 newDxc.final[1] = mapDxc[
"Ar_1S4"];
2580 newDxc.p[2] = 5.03e-3;
2581 newDxc.final[2] = mapDxc[
"Ar_1S2"];
2582 }
else if (level ==
"Ar_2P5") {
2584 newDxc.nChannels = nc;
2585 newDxc.p.resize(nc);
2586 newDxc.final.resize(nc);
2587 newDxc.type.resize(nc, DxcTypeRad);
2588 newDxc.p[0] = 0.0402;
2589 newDxc.final[0] = mapDxc[
"Ar_1S4"];
2590 }
else if (level ==
"Ar_2P4") {
2592 newDxc.nChannels = nc;
2593 newDxc.p.resize(nc);
2594 newDxc.final.resize(nc);
2595 newDxc.type.resize(nc, DxcTypeRad);
2596 newDxc.p[0] = 6.25e-4;
2597 newDxc.final[0] = mapDxc[
"Ar_1S5"];
2598 newDxc.p[1] = 2.2e-5;
2599 newDxc.final[1] = mapDxc[
"Ar_1S4"];
2600 newDxc.p[2] = 0.0186;
2601 newDxc.final[2] = mapDxc[
"Ar_1S3"];
2602 newDxc.p[3] = 0.0139;
2603 newDxc.final[3] = mapDxc[
"Ar_1S2"];
2604 }
else if (level ==
"Ar_2P3") {
2606 newDxc.nChannels = nc;
2607 newDxc.p.resize(nc);
2608 newDxc.final.resize(nc);
2609 newDxc.type.resize(nc, DxcTypeRad);
2610 newDxc.p[0] = 3.8e-3;
2611 newDxc.final[0] = mapDxc[
"Ar_1S5"];
2612 newDxc.p[1] = 8.47e-3;
2613 newDxc.final[1] = mapDxc[
"Ar_1S4"];
2614 newDxc.p[2] = 0.0223;
2615 newDxc.final[2] = mapDxc[
"Ar_1S2"];
2616 }
else if (level ==
"Ar_2P2") {
2618 newDxc.nChannels = nc;
2619 newDxc.p.resize(nc);
2620 newDxc.final.resize(nc);
2621 newDxc.type.resize(nc, DxcTypeRad);
2622 newDxc.p[0] = 6.39e-3;
2623 newDxc.final[0] = mapDxc[
"Ar_1S5"];
2624 newDxc.p[1] = 1.83e-3;
2625 newDxc.final[1] = mapDxc[
"Ar_1S4"];
2626 newDxc.p[2] = 0.0117;
2627 newDxc.final[2] = mapDxc[
"Ar_1S3"];
2628 newDxc.p[3] = 0.0153;
2629 newDxc.final[3] = mapDxc[
"Ar_1S2"];
2630 }
else if (level ==
"Ar_2P1") {
2632 newDxc.nChannels = nc;
2633 newDxc.p.resize(nc);
2634 newDxc.final.resize(nc);
2635 newDxc.type.resize(nc, DxcTypeRad);
2636 newDxc.p[0] = 2.36e-4;
2637 newDxc.final[0] = mapDxc[
"Ar_1S4"];
2638 newDxc.p[1] = 0.0445;
2639 newDxc.final[1] = mapDxc[
"Ar_1S2"];
2640 }
else if (level ==
"Ar_3D6") {
2642 newDxc.nChannels = nc;
2643 newDxc.p.resize(nc);
2644 newDxc.final.resize(nc);
2645 newDxc.type.resize(nc, DxcTypeRad);
2647 newDxc.p[0] = 8.1e-3;
2648 newDxc.final[0] = mapDxc[
"Ar_2P10"];
2649 newDxc.p[1] = 7.73e-4;
2650 newDxc.final[1] = mapDxc[
"Ar_2P7"];
2651 newDxc.p[2] = 1.2e-4;
2652 newDxc.final[2] = mapDxc[
"Ar_2P4"];
2653 newDxc.p[3] = 3.6e-4;
2654 newDxc.final[3] = mapDxc[
"Ar_2P2"];
2655 }
else if (level ==
"Ar_3D5") {
2657 newDxc.osc = 0.0011;
2659 newDxc.nChannels = nc;
2660 newDxc.p.resize(nc);
2661 newDxc.final.resize(nc);
2662 newDxc.type.resize(nc, DxcTypeRad);
2664 newDxc.p[0] = 7.4e-3;
2665 newDxc.final[0] = mapDxc[
"Ar_2P10"];
2666 newDxc.p[1] = 3.9e-5;
2667 newDxc.final[1] = mapDxc[
"Ar_2P8"];
2668 newDxc.p[2] = 3.09e-4;
2669 newDxc.final[2] = mapDxc[
"Ar_2P7"];
2670 newDxc.p[3] = 1.37e-3;
2671 newDxc.final[3] = mapDxc[
"Ar_2P6"];
2672 newDxc.p[4] = 5.75e-4;
2673 newDxc.final[4] = mapDxc[
"Ar_2P5"];
2674 newDxc.p[5] = 3.2e-5;
2675 newDxc.final[5] = mapDxc[
"Ar_2P4"];
2676 newDxc.p[6] = 1.4e-4;
2677 newDxc.final[6] = mapDxc[
"Ar_2P3"];
2678 newDxc.p[7] = 1.7e-4;
2679 newDxc.final[7] = mapDxc[
"Ar_2P2"];
2680 newDxc.p[8] = 2.49e-6;
2681 newDxc.final[8] = mapDxc[
"Ar_2P1"];
2683 newDxc.p[9] = f2A *
pow(newDxc.energy, 2) * newDxc.osc;
2684 newDxc.final[9] = -1;
2685 }
else if (level ==
"Ar_3D3") {
2687 newDxc.nChannels = nc;
2688 newDxc.p.resize(nc);
2689 newDxc.final.resize(nc);
2690 newDxc.type.resize(nc, DxcTypeRad);
2692 newDxc.p[0] = 4.9e-3;
2693 newDxc.final[0] = mapDxc[
"Ar_2P10"];
2694 newDxc.p[1] = 9.82e-5;
2695 newDxc.final[1] = mapDxc[
"Ar_2P9"];
2696 newDxc.p[2] = 1.2e-4;
2697 newDxc.final[2] = mapDxc[
"Ar_2P8"];
2698 newDxc.p[3] = 2.6e-4;
2699 newDxc.final[3] = mapDxc[
"Ar_2P7"];
2700 newDxc.p[4] = 2.5e-3;
2701 newDxc.final[4] = mapDxc[
"Ar_2P6"];
2702 newDxc.p[5] = 9.41e-5;
2703 newDxc.final[5] = mapDxc[
"Ar_2P4"];
2704 newDxc.p[6] = 3.9e-4;
2705 newDxc.final[6] = mapDxc[
"Ar_2P3"];
2706 newDxc.p[7] = 1.1e-4;
2707 newDxc.final[7] = mapDxc[
"Ar_2P2"];
2708 }
else if (level ==
"Ar_3D4!") {
2710 newDxc.nChannels = nc;
2712 newDxc.p.resize(nc);
2713 newDxc.final.resize(nc);
2714 newDxc.type.resize(nc, DxcTypeRad);
2715 newDxc.p[0] = 0.01593;
2716 newDxc.final[0] = mapDxc[
"Ar_2P9"];
2717 }
else if (level ==
"Ar_3D4") {
2719 newDxc.nChannels = nc;
2720 newDxc.p.resize(nc);
2721 newDxc.final.resize(nc);
2722 newDxc.type.resize(nc, DxcTypeRad);
2724 newDxc.p[0] = 2.29e-3;
2725 newDxc.final[0] = mapDxc[
"Ar_2P9"];
2726 newDxc.p[1] = 0.011;
2727 newDxc.final[1] = mapDxc[
"Ar_2P8"];
2728 newDxc.p[2] = 8.8e-5;
2729 newDxc.final[2] = mapDxc[
"Ar_2P6"];
2730 newDxc.p[3] = 2.53e-6;
2731 newDxc.final[3] = mapDxc[
"Ar_2P3"];
2732 }
else if (level ==
"Ar_3D1!!") {
2734 newDxc.nChannels = nc;
2735 newDxc.p.resize(nc);
2736 newDxc.final.resize(nc);
2737 newDxc.type.resize(nc, DxcTypeRad);
2739 newDxc.p[0] = 5.85e-6;
2740 newDxc.final[0] = mapDxc[
"Ar_2P10"];
2741 newDxc.p[1] = 1.2e-4;
2742 newDxc.final[1] = mapDxc[
"Ar_2P9"];
2743 newDxc.p[2] = 5.7e-3;
2744 newDxc.final[2] = mapDxc[
"Ar_2P8"];
2745 newDxc.p[3] = 7.3e-3;
2746 newDxc.final[3] = mapDxc[
"Ar_2P7"];
2747 newDxc.p[4] = 2.e-4;
2748 newDxc.final[4] = mapDxc[
"Ar_2P6"];
2749 newDxc.p[5] = 1.54e-6;
2750 newDxc.final[5] = mapDxc[
"Ar_2P4"];
2751 newDxc.p[6] = 2.08e-5;
2752 newDxc.final[6] = mapDxc[
"Ar_2P3"];
2753 newDxc.p[7] = 6.75e-7;
2754 newDxc.final[7] = mapDxc[
"Ar_2P2"];
2755 }
else if (level ==
"Ar_2S5") {
2757 newDxc.nChannels = nc;
2758 newDxc.p.resize(nc);
2759 newDxc.final.resize(nc);
2760 newDxc.type.resize(nc, DxcTypeRad);
2761 newDxc.p[0] = 4.9e-3;
2762 newDxc.final[0] = mapDxc[
"Ar_2P10"];
2763 newDxc.p[1] = 0.011;
2764 newDxc.final[1] = mapDxc[
"Ar_2P9"];
2765 newDxc.p[2] = 1.1e-3;
2766 newDxc.final[2] = mapDxc[
"Ar_2P8"];
2767 newDxc.p[3] = 4.6e-4;
2768 newDxc.final[3] = mapDxc[
"Ar_2P7"];
2769 newDxc.p[4] = 3.3e-3;
2770 newDxc.final[4] = mapDxc[
"Ar_2P6"];
2771 newDxc.p[5] = 5.9e-5;
2772 newDxc.final[5] = mapDxc[
"Ar_2P4"];
2773 newDxc.p[6] = 1.2e-4;
2774 newDxc.final[6] = mapDxc[
"Ar_2P3"];
2775 newDxc.p[7] = 3.1e-4;
2776 newDxc.final[7] = mapDxc[
"Ar_2P2"];
2777 }
else if (level ==
"Ar_2S4") {
2782 newDxc.nChannels = nc;
2783 newDxc.p.resize(nc);
2784 newDxc.final.resize(nc);
2785 newDxc.type.resize(nc, DxcTypeRad);
2786 newDxc.p[0] = 0.077;
2787 newDxc.final[0] = -1;
2788 newDxc.p[1] = 2.44e-3;
2789 newDxc.final[1] = mapDxc[
"Ar_2P10"];
2790 newDxc.p[2] = 8.9e-3;
2791 newDxc.final[2] = mapDxc[
"Ar_2P8"];
2792 newDxc.p[3] = 4.6e-3;
2793 newDxc.final[3] = mapDxc[
"Ar_2P7"];
2794 newDxc.p[4] = 2.7e-3;
2795 newDxc.final[4] = mapDxc[
"Ar_2P6"];
2796 newDxc.p[5] = 1.3e-3;
2797 newDxc.final[5] = mapDxc[
"Ar_2P5"];
2798 newDxc.p[6] = 4.5e-4;
2799 newDxc.final[6] = mapDxc[
"Ar_2P4"];
2800 newDxc.p[7] = 2.9e-5;
2801 newDxc.final[7] = mapDxc[
"Ar_2P3"];
2802 newDxc.p[8] = 3.e-5;
2803 newDxc.final[8] = mapDxc[
"Ar_2P2"];
2804 newDxc.p[9] = 1.6e-4;
2805 newDxc.final[9] = mapDxc[
"Ar_2P1"];
2806 }
else if (level ==
"Ar_3D1!") {
2808 newDxc.nChannels = nc;
2809 newDxc.p.resize(nc);
2810 newDxc.final.resize(nc);
2811 newDxc.type.resize(nc, DxcTypeRad);
2813 newDxc.p[0] = 3.1e-3;
2814 newDxc.final[0] = mapDxc[
"Ar_2P9"];
2815 newDxc.p[1] = 2.e-3;
2816 newDxc.final[1] = mapDxc[
"Ar_2P8"];
2817 newDxc.p[2] = 0.015;
2818 newDxc.final[2] = mapDxc[
"Ar_2P6"];
2819 newDxc.p[3] = 9.8e-6;
2820 newDxc.final[3] = mapDxc[
"Ar_2P3"];
2821 }
else if (level ==
"Ar_3D2") {
2823 newDxc.osc = 0.0932;
2826 newDxc.nChannels = nc;
2827 newDxc.p.resize(nc);
2828 newDxc.final.resize(nc);
2829 newDxc.type.resize(nc, DxcTypeRad);
2832 newDxc.final[0] = -1;
2833 newDxc.p[1] = 1.35e-5;
2834 newDxc.final[1] = mapDxc[
"Ar_2P10"];
2835 newDxc.p[2] = 9.52e-4;
2836 newDxc.final[2] = mapDxc[
"Ar_2P8"];
2837 newDxc.p[3] = 0.011;
2838 newDxc.final[3] = mapDxc[
"Ar_2P7"];
2839 newDxc.p[4] = 4.01e-5;
2840 newDxc.final[4] = mapDxc[
"Ar_2P6"];
2841 newDxc.p[5] = 4.3e-3;
2842 newDxc.final[5] = mapDxc[
"Ar_2P5"];
2843 newDxc.p[6] = 8.96e-4;
2844 newDxc.final[6] = mapDxc[
"Ar_2P4"];
2845 newDxc.p[7] = 4.45e-5;
2846 newDxc.final[7] = mapDxc[
"Ar_2P3"];
2847 newDxc.p[8] = 5.87e-5;
2848 newDxc.final[8] = mapDxc[
"Ar_2P2"];
2849 newDxc.p[9] = 8.77e-4;
2850 newDxc.final[9] = mapDxc[
"Ar_2P1"];
2851 }
else if (level ==
"Ar_3S1!!!!") {
2853 newDxc.nChannels = nc;
2854 newDxc.p.resize(nc);
2855 newDxc.final.resize(nc);
2856 newDxc.type.resize(nc, DxcTypeRad);
2858 newDxc.p[0] = 7.51e-6;
2859 newDxc.final[0] = mapDxc[
"Ar_2P10"];
2860 newDxc.p[1] = 4.3e-5;
2861 newDxc.final[1] = mapDxc[
"Ar_2P9"];
2862 newDxc.p[2] = 8.3e-4;
2863 newDxc.final[2] = mapDxc[
"Ar_2P8"];
2864 newDxc.p[3] = 5.01e-5;
2865 newDxc.final[3] = mapDxc[
"Ar_2P7"];
2866 newDxc.p[4] = 2.09e-4;
2867 newDxc.final[4] = mapDxc[
"Ar_2P6"];
2868 newDxc.p[5] = 0.013;
2869 newDxc.final[5] = mapDxc[
"Ar_2P4"];
2870 newDxc.p[6] = 2.2e-3;
2871 newDxc.final[6] = mapDxc[
"Ar_2P3"];
2872 newDxc.p[7] = 3.35e-6;
2873 newDxc.final[7] = mapDxc[
"Ar_2P2"];
2874 }
else if (level ==
"Ar_3S1!!") {
2876 newDxc.nChannels = nc;
2877 newDxc.p.resize(nc);
2878 newDxc.final.resize(nc);
2879 newDxc.type.resize(nc, DxcTypeRad);
2881 newDxc.p[0] = 1.89e-4;
2882 newDxc.final[0] = mapDxc[
"Ar_2P10"];
2883 newDxc.p[1] = 1.52e-4;
2884 newDxc.final[1] = mapDxc[
"Ar_2P9"];
2885 newDxc.p[2] = 7.21e-4;
2886 newDxc.final[2] = mapDxc[
"Ar_2P8"];
2887 newDxc.p[3] = 3.69e-4;
2888 newDxc.final[3] = mapDxc[
"Ar_2P7"];
2889 newDxc.p[4] = 3.76e-3;
2890 newDxc.final[4] = mapDxc[
"Ar_2P6"];
2891 newDxc.p[5] = 1.72e-4;
2892 newDxc.final[5] = mapDxc[
"Ar_2P4"];
2893 newDxc.p[6] = 5.8e-4;
2894 newDxc.final[6] = mapDxc[
"Ar_2P3"];
2895 newDxc.p[7] = 6.2e-3;
2896 newDxc.final[7] = mapDxc[
"Ar_2P2"];
2897 }
else if (level ==
"Ar_3S1!!!") {
2899 newDxc.nChannels = nc;
2900 newDxc.p.resize(nc);
2901 newDxc.final.resize(nc);
2902 newDxc.type.resize(nc, DxcTypeRad);
2904 newDxc.p[0] = 7.36e-4;
2905 newDxc.final[0] = mapDxc[
"Ar_2P9"];
2906 newDxc.p[1] = 4.2e-5;
2907 newDxc.final[1] = mapDxc[
"Ar_2P8"];
2908 newDxc.p[2] = 9.3e-5;
2909 newDxc.final[2] = mapDxc[
"Ar_2P6"];
2910 newDxc.p[3] = 0.015;
2911 newDxc.final[3] = mapDxc[
"Ar_2P3"];
2912 }
else if (level ==
"Ar_2S3") {
2914 newDxc.nChannels = nc;
2915 newDxc.p.resize(nc);
2916 newDxc.final.resize(nc);
2917 newDxc.type.resize(nc, DxcTypeRad);
2918 newDxc.p[0] = 3.26e-3;
2919 newDxc.final[0] = mapDxc[
"Ar_2P10"];
2920 newDxc.p[1] = 2.22e-3;
2921 newDxc.final[1] = mapDxc[
"Ar_2P7"];
2923 newDxc.final[2] = mapDxc[
"Ar_2P4"];
2924 newDxc.p[3] = 5.1e-3;
2925 newDxc.final[3] = mapDxc[
"Ar_2P2"];
2926 }
else if (level ==
"Ar_2S2") {
2928 newDxc.osc = 0.0119;
2931 newDxc.nChannels = nc;
2932 newDxc.p.resize(nc);
2933 newDxc.final.resize(nc);
2934 newDxc.type.resize(nc, DxcTypeRad);
2935 newDxc.p[0] = 0.035;
2936 newDxc.final[0] = -1;
2937 newDxc.p[1] = 1.76e-3;
2938 newDxc.final[1] = mapDxc[
"Ar_2P10"];
2939 newDxc.p[2] = 2.1e-4;
2940 newDxc.final[2] = mapDxc[
"Ar_2P8"];
2941 newDxc.p[3] = 2.8e-4;
2942 newDxc.final[3] = mapDxc[
"Ar_2P7"];
2943 newDxc.p[4] = 1.39e-3;
2944 newDxc.final[4] = mapDxc[
"Ar_2P6"];
2945 newDxc.p[5] = 3.8e-4;
2946 newDxc.final[5] = mapDxc[
"Ar_2P5"];
2947 newDxc.p[6] = 2.0e-3;
2948 newDxc.final[6] = mapDxc[
"Ar_2P4"];
2949 newDxc.p[7] = 8.9e-3;
2950 newDxc.final[7] = mapDxc[
"Ar_2P3"];
2951 newDxc.p[8] = 3.4e-3;
2952 newDxc.final[8] = mapDxc[
"Ar_2P2"];
2953 newDxc.p[9] = 1.9e-3;
2954 newDxc.final[9] = mapDxc[
"Ar_2P1"];
2955 }
else if (level ==
"Ar_3S1!") {
2960 newDxc.nChannels = nc;
2961 newDxc.p.resize(nc);
2962 newDxc.final.resize(nc);
2963 newDxc.type.resize(nc, DxcTypeRad);
2965 newDxc.p[0] = 0.313;
2966 newDxc.final[0] = -1;
2967 newDxc.p[1] = 2.05e-5;
2968 newDxc.final[1] = mapDxc[
"Ar_2P10"];
2969 newDxc.p[2] = 8.33e-5;
2970 newDxc.final[2] = mapDxc[
"Ar_2P8"];
2971 newDxc.p[3] = 3.9e-4;
2972 newDxc.final[3] = mapDxc[
"Ar_2P7"];
2973 newDxc.p[4] = 3.96e-4;
2974 newDxc.final[4] = mapDxc[
"Ar_2P6"];
2975 newDxc.p[5] = 4.2e-4;
2976 newDxc.final[5] = mapDxc[
"Ar_2P5"];
2977 newDxc.p[6] = 4.5e-3;
2978 newDxc.final[6] = mapDxc[
"Ar_2P4"];
2979 newDxc.p[7] = 4.84e-5;
2980 newDxc.final[7] = mapDxc[
"Ar_2P3"];
2981 newDxc.p[8] = 7.1e-3;
2982 newDxc.final[8] = mapDxc[
"Ar_2P2"];
2983 newDxc.p[9] = 5.2e-3;
2984 newDxc.final[9] = mapDxc[
"Ar_2P1"];
2985 }
else if (level ==
"Ar_4D5") {
2987 newDxc.osc = 0.0019;
2989 newDxc.nChannels = nc;
2990 newDxc.p.resize(nc);
2991 newDxc.final.resize(nc);
2992 newDxc.type.resize(nc, DxcTypeRad);
2993 newDxc.p[0] = 2.78e-3;
2994 newDxc.final[0] = mapDxc[
"Ar_2P10"];
2995 newDxc.p[1] = 2.8e-4;
2996 newDxc.final[1] = mapDxc[
"Ar_2P8"];
2997 newDxc.p[2] = 8.6e-4;
2998 newDxc.final[2] = mapDxc[
"Ar_2P6"];
2999 newDxc.p[3] = 9.2e-4;
3000 newDxc.final[3] = mapDxc[
"Ar_2P5"];
3001 newDxc.p[4] = 4.6e-4;
3002 newDxc.final[4] = mapDxc[
"Ar_2P3"];
3003 newDxc.p[5] = 1.6e-4;
3004 newDxc.final[5] = mapDxc[
"Ar_2P2"];
3006 newDxc.p[6] = f2A *
pow(newDxc.energy, 2) * newDxc.osc;
3007 newDxc.final[6] = -1;
3008 }
else if (level ==
"Ar_3S4") {
3010 newDxc.osc = 0.0144;
3012 newDxc.nChannels = nc;
3013 newDxc.p.resize(nc);
3014 newDxc.final.resize(nc);
3015 newDxc.type.resize(nc, DxcTypeRad);
3016 newDxc.p[0] = 4.21e-4;
3017 newDxc.final[0] = mapDxc[
"Ar_2P10"];
3018 newDxc.p[1] = 2.e-3;
3019 newDxc.final[1] = mapDxc[
"Ar_2P8"];
3020 newDxc.p[2] = 1.7e-3;
3021 newDxc.final[2] = mapDxc[
"Ar_2P7"];
3022 newDxc.p[3] = 7.2e-4;
3023 newDxc.final[3] = mapDxc[
"Ar_2P6"];
3024 newDxc.p[4] = 3.5e-4;
3025 newDxc.final[4] = mapDxc[
"Ar_2P5"];
3026 newDxc.p[5] = 1.2e-4;
3027 newDxc.final[5] = mapDxc[
"Ar_2P4"];
3028 newDxc.p[6] = 4.2e-6;
3029 newDxc.final[6] = mapDxc[
"Ar_2P3"];
3030 newDxc.p[7] = 3.3e-5;
3031 newDxc.final[7] = mapDxc[
"Ar_2P2"];
3032 newDxc.p[8] = 9.7e-5;
3033 newDxc.final[8] = mapDxc[
"Ar_2P1"];
3035 newDxc.p[9] = f2A *
pow(newDxc.energy, 2) * newDxc.osc;
3036 newDxc.final[9] = -1;
3037 }
else if (level ==
"Ar_4D2") {
3041 newDxc.nChannels = nc;
3042 newDxc.p.resize(nc);
3043 newDxc.final.resize(nc);
3044 newDxc.type.resize(nc, DxcTypeRad);
3045 newDxc.p[0] = 1.7e-4;
3046 newDxc.final[0] = mapDxc[
"Ar_2P7"];
3048 newDxc.p[1] = f2A *
pow(newDxc.energy, 2) * newDxc.osc;
3049 newDxc.final[1] = -1;
3050 }
else if (level ==
"Ar_4S1!") {
3052 newDxc.osc = 0.0209;
3054 newDxc.nChannels = nc;
3055 newDxc.p.resize(nc);
3056 newDxc.final.resize(nc);
3057 newDxc.type.resize(nc, DxcTypeRad);
3058 newDxc.p[0] = 1.05e-3;
3059 newDxc.final[0] = mapDxc[
"Ar_2P10"];
3060 newDxc.p[1] = 3.1e-5;
3061 newDxc.final[1] = mapDxc[
"Ar_2P8"];
3062 newDxc.p[2] = 2.5e-5;
3063 newDxc.final[2] = mapDxc[
"Ar_2P7"];
3064 newDxc.p[3] = 4.0e-4;
3065 newDxc.final[3] = mapDxc[
"Ar_2P6"];
3066 newDxc.p[4] = 5.8e-5;
3067 newDxc.final[4] = mapDxc[
"Ar_2P5"];
3068 newDxc.p[5] = 1.2e-4;
3069 newDxc.final[5] = mapDxc[
"Ar_2P3"];
3071 newDxc.p[6] = f2A *
pow(newDxc.energy, 2) * newDxc.osc;
3072 newDxc.final[6] = -1;
3073 }
else if (level ==
"Ar_3S2") {
3075 newDxc.osc = 0.0221;
3077 newDxc.nChannels = nc;
3078 newDxc.p.resize(nc);
3079 newDxc.final.resize(nc);
3080 newDxc.type.resize(nc, DxcTypeRad);
3081 newDxc.p[0] = 2.85e-4;
3082 newDxc.final[0] = mapDxc[
"Ar_2P10"];
3083 newDxc.p[1] = 5.1e-5;
3084 newDxc.final[1] = mapDxc[
"Ar_2P8"];
3085 newDxc.p[2] = 5.3e-5;
3086 newDxc.final[2] = mapDxc[
"Ar_2P7"];
3087 newDxc.p[3] = 1.6e-4;
3088 newDxc.final[3] = mapDxc[
"Ar_2P6"];
3089 newDxc.p[4] = 1.5e-4;
3090 newDxc.final[4] = mapDxc[
"Ar_2P5"];
3091 newDxc.p[5] = 6.0e-4;
3092 newDxc.final[5] = mapDxc[
"Ar_2P4"];
3093 newDxc.p[6] = 2.48e-3;
3094 newDxc.final[6] = mapDxc[
"Ar_2P3"];
3095 newDxc.p[7] = 9.6e-4;
3096 newDxc.final[7] = mapDxc[
"Ar_2P2"];
3097 newDxc.p[8] = 3.59e-4;
3098 newDxc.final[8] = mapDxc[
"Ar_2P1"];
3100 newDxc.p[9] = f2A *
pow(newDxc.energy, 2) * newDxc.osc;
3101 newDxc.final[9] = -1;
3102 }
else if (level ==
"Ar_5D5") {
3104 newDxc.osc = 0.0041;
3106 newDxc.nChannels = nc;
3107 newDxc.p.resize(nc);
3108 newDxc.final.resize(nc);
3109 newDxc.type.resize(nc, DxcTypeRad);
3110 newDxc.p[0] = 2.2e-3;
3111 newDxc.final[0] = mapDxc[
"Ar_2P10"];
3112 newDxc.p[1] = 1.1e-4;
3113 newDxc.final[1] = mapDxc[
"Ar_2P8"];
3114 newDxc.p[2] = 7.6e-5;
3115 newDxc.final[2] = mapDxc[
"Ar_2P7"];
3116 newDxc.p[3] = 4.2e-4;
3117 newDxc.final[3] = mapDxc[
"Ar_2P6"];
3118 newDxc.p[4] = 2.4e-4;
3119 newDxc.final[4] = mapDxc[
"Ar_2P5"];
3120 newDxc.p[5] = 2.1e-4;
3121 newDxc.final[5] = mapDxc[
"Ar_2P4"];
3122 newDxc.p[6] = 2.4e-4;
3123 newDxc.final[6] = mapDxc[
"Ar_2P3"];
3124 newDxc.p[7] = 1.2e-4;
3125 newDxc.final[7] = mapDxc[
"Ar_2P2"];
3127 newDxc.p[8] = f2A *
pow(newDxc.energy, 2) * newDxc.osc;
3128 newDxc.final[8] = -1;
3129 }
else if (level ==
"Ar_4S4") {
3131 newDxc.osc = 0.0139;
3133 newDxc.nChannels = nc;
3134 newDxc.p.resize(nc);
3135 newDxc.final.resize(nc);
3136 newDxc.type.resize(nc, DxcTypeRad);
3137 newDxc.p[0] = 1.9e-4;
3138 newDxc.final[0] = mapDxc[
"Ar_2P10"];
3139 newDxc.p[1] = 1.1e-3;
3140 newDxc.final[1] = mapDxc[
"Ar_2P8"];
3141 newDxc.p[2] = 5.2e-4;
3142 newDxc.final[2] = mapDxc[
"Ar_2P7"];
3143 newDxc.p[3] = 5.1e-4;
3144 newDxc.final[3] = mapDxc[
"Ar_2P6"];
3145 newDxc.p[4] = 9.4e-5;
3146 newDxc.final[4] = mapDxc[
"Ar_2P5"];
3147 newDxc.p[5] = 5.4e-5;
3148 newDxc.final[5] = mapDxc[
"Ar_2P4"];
3150 newDxc.p[6] = f2A *
pow(newDxc.energy, 2) * newDxc.osc;
3151 newDxc.final[6] = -1;
3152 }
else if (level ==
"Ar_5D2") {
3154 newDxc.osc = 0.0426;
3156 newDxc.nChannels = nc;
3157 newDxc.p.resize(nc);
3158 newDxc.final.resize(nc);
3159 newDxc.type.resize(nc, DxcTypeRad);
3160 newDxc.p[0] = 5.9e-5;
3161 newDxc.final[0] = mapDxc[
"Ar_2P8"];
3162 newDxc.p[1] = 9.0e-6;
3163 newDxc.final[1] = mapDxc[
"Ar_2P7"];
3164 newDxc.p[2] = 1.5e-4;
3165 newDxc.final[2] = mapDxc[
"Ar_2P5"];
3166 newDxc.p[3] = 3.1e-5;
3167 newDxc.final[3] = mapDxc[
"Ar_2P2"];
3169 newDxc.p[4] = f2A *
pow(newDxc.energy, 2) * newDxc.osc;
3170 newDxc.final[4] = -1;
3171 }
else if (level ==
"Ar_6D5") {
3173 newDxc.osc = 0.00075;
3177 newDxc.nChannels = nc;
3178 newDxc.p.resize(nc);
3179 newDxc.final.resize(nc);
3180 newDxc.type.resize(nc, DxcTypeRad);
3181 newDxc.p[0] = 1.9e-3;
3182 newDxc.final[0] = mapDxc[
"Ar_2P10"];
3183 newDxc.p[1] = 4.2e-4;
3184 newDxc.final[1] = mapDxc[
"Ar_2P6"];
3185 newDxc.p[2] = 3.e-4;
3186 newDxc.final[2] = mapDxc[
"Ar_2P5"];
3187 newDxc.p[3] = 5.1e-5;
3188 newDxc.final[3] = mapDxc[
"Ar_2P4"];
3189 newDxc.p[4] = 6.6e-5;
3190 newDxc.final[4] = mapDxc[
"Ar_2P3"];
3191 newDxc.p[5] = 1.21e-4;
3192 newDxc.final[5] = mapDxc[
"Ar_2P1"];
3194 newDxc.p[6] = f2A *
pow(newDxc.energy, 2) * newDxc.osc;
3195 newDxc.final[6] = -1;
3196 }
else if (level ==
"Ar_5S1!") {
3198 newDxc.osc = 0.00051;
3202 newDxc.nChannels = nc;
3203 newDxc.p.resize(nc);
3204 newDxc.final.resize(nc);
3205 newDxc.type.resize(nc, DxcTypeRad);
3206 newDxc.p[0] = 7.7e-5;
3207 newDxc.final[0] = mapDxc[
"Ar_2P5"];
3209 newDxc.p[1] = f2A *
pow(newDxc.energy, 2) * newDxc.osc;
3210 newDxc.final[1] = -1;
3211 }
else if (level ==
"Ar_4S2") {
3213 newDxc.osc = 0.00074;
3217 newDxc.nChannels = nc;
3218 newDxc.p.resize(nc);
3219 newDxc.final.resize(nc);
3220 newDxc.type.resize(nc, DxcTypeRad);
3221 newDxc.p[0] = 4.5e-4;
3222 newDxc.final[0] = mapDxc[
"Ar_2P10"];
3223 newDxc.p[1] = 2.e-4;
3224 newDxc.final[1] = mapDxc[
"Ar_2P8"];
3225 newDxc.p[2] = 2.1e-4;
3226 newDxc.final[2] = mapDxc[
"Ar_2P7"];
3227 newDxc.p[3] = 1.2e-4;
3228 newDxc.final[3] = mapDxc[
"Ar_2P5"];
3229 newDxc.p[4] = 1.8e-4;
3230 newDxc.final[4] = mapDxc[
"Ar_2P4"];
3231 newDxc.p[5] = 9.e-4;
3232 newDxc.final[5] = mapDxc[
"Ar_2P3"];
3233 newDxc.p[6] = 3.3e-4;
3234 newDxc.final[6] = mapDxc[
"Ar_2P2"];
3236 newDxc.p[7] = f2A *
pow(newDxc.energy, 2) * newDxc.osc;
3237 newDxc.final[7] = -1;
3238 }
else if (level ==
"Ar_5S4") {
3240 newDxc.osc = 0.0130;
3243 newDxc.osc = 0.0211;
3245 newDxc.nChannels = nc;
3246 newDxc.p.resize(nc);
3247 newDxc.final.resize(nc);
3248 newDxc.type.resize(nc, DxcTypeRad);
3249 newDxc.p[0] = 3.6e-4;
3250 newDxc.final[0] = mapDxc[
"Ar_2P8"];
3251 newDxc.p[1] = 1.2e-4;
3252 newDxc.final[1] = mapDxc[
"Ar_2P6"];
3253 newDxc.p[2] = 1.5e-4;
3254 newDxc.final[2] = mapDxc[
"Ar_2P4"];
3255 newDxc.p[3] = 1.4e-4;
3256 newDxc.final[3] = mapDxc[
"Ar_2P3"];
3257 newDxc.p[4] = 7.5e-5;
3258 newDxc.final[4] = mapDxc[
"Ar_2P2"];
3260 newDxc.p[5] = f2A *
pow(newDxc.energy, 2) * newDxc.osc;
3261 newDxc.final[5] = -1;
3262 }
else if (level ==
"Ar_6D2") {
3264 newDxc.osc = 0.0290;
3267 newDxc.osc = 0.0574;
3269 newDxc.nChannels = nc;
3270 newDxc.p.resize(nc);
3271 newDxc.final.resize(nc);
3272 newDxc.type.resize(nc, DxcTypeRad);
3274 newDxc.p[0] = 3.33e-3;
3275 newDxc.final[0] = mapDxc[
"Ar_2P7"];
3277 newDxc.p[1] = f2A *
pow(newDxc.energy, 2) * newDxc.osc;
3278 newDxc.final[1] = -1;
3279 }
else if (level ==
"Ar_Higher") {
3285 newDxc.nChannels = nc;
3286 newDxc.p.resize(nc);
3287 newDxc.final.resize(nc);
3288 newDxc.type.resize(nc, DxcTypeCollNonIon);
3290 newDxc.final[0] = mapDxc[
"Ar_6D5"];
3292 newDxc.final[1] = mapDxc[
"Ar_5S1!"];
3294 newDxc.final[2] = mapDxc[
"Ar_4S2"];
3296 newDxc.final[3] = mapDxc[
"Ar_5S4"];
3298 newDxc.final[4] = mapDxc[
"Ar_6D2"];
3300 std::cerr <<
m_className <<
"::ComputeDeexcitationTable:\n";
3301 std::cerr <<
" Missing de-excitation data for level " << level
3303 std::cerr <<
" Program bug!\n";
3306 deexcitations.push_back(newDxc);
3310 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
3311 std::cout <<
" Found " << nDeexcitations <<
" levels "
3312 <<
"with available radiative de-excitation data.\n";
3318 newDxc.label =
"Ar_Dimer";
3321 newDxc.energy = 14.71;
3322 newDxc.osc = newDxc.cf = 0.;
3323 newDxc.sDoppler = newDxc.gPressure = newDxc.width = 0.;
3325 newDxc.final.clear();
3326 newDxc.type.clear();
3327 newDxc.nChannels = 0;
3328 mapDxc[
"Ar_Dimer"] = nDeexcitations;
3329 deexcitations.push_back(newDxc);
3332 newDxc.label =
"Ar_Excimer";
3335 newDxc.energy = 14.71;
3336 newDxc.osc = newDxc.cf = 0.;
3337 newDxc.sDoppler = newDxc.gPressure = newDxc.width = 0.;
3339 newDxc.final.clear();
3340 newDxc.type.clear();
3341 newDxc.nChannels = 0;
3342 mapDxc[
"Ar_Excimer"] = nDeexcitations;
3343 deexcitations.push_back(newDxc);
3346 for (
int j = nDeexcitations; j--;) {
3347 std::string level = deexcitations[j].label;
3348 if (level ==
"Ar_1S5") {
3352 const bool useTachibanaData =
false;
3353 const bool useKoltsSetserData =
true;
3354 const bool useCollMixing =
true;
3355 if (useTachibanaData) {
3357 const double k2b = 2.3e-24;
3358 const double k3b = 1.4e-41;
3359 deexcitations[j].p.push_back(k3b * nAr * nAr);
3360 deexcitations[j].final.push_back(mapDxc[
"Ar_Excimer"]);
3361 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3362 deexcitations[j].nChannels += 1;
3363 if (useCollMixing) {
3364 deexcitations[j].p.push_back(k2b * nAr);
3365 deexcitations[j].final.push_back(mapDxc[
"Ar_1S4"]);
3366 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3367 deexcitations[j].nChannels += 1;
3369 }
else if (useKoltsSetserData) {
3371 const double k2b = 2.1e-24;
3372 const double k3b = 1.1e-41;
3373 deexcitations[j].p.push_back(k3b * nAr * nAr);
3374 deexcitations[j].final.push_back(mapDxc[
"Ar_Excimer"]);
3375 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3376 deexcitations[j].nChannels += 1;
3377 if (useCollMixing) {
3378 deexcitations[j].p.push_back(k2b * nAr);
3379 deexcitations[j].final.push_back(mapDxc[
"Ar_1S4"]);
3380 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3381 deexcitations[j].nChannels += 1;
3385 if (level ==
"Ar_1S3") {
3387 const bool useTachibanaData =
false;
3388 const bool useKoltsSetserData =
true;
3389 const bool useCollMixing =
true;
3390 if (useTachibanaData) {
3392 const double k2b = 4.3e-24;
3393 const double k3b = 1.5e-41;
3394 deexcitations[j].p.push_back(k3b * nAr * nAr);
3395 deexcitations[j].final.push_back(mapDxc[
"Ar_Excimer"]);
3396 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3397 deexcitations[j].nChannels += 1;
3398 if (useCollMixing) {
3399 deexcitations[j].p.push_back(k2b * nAr);
3400 deexcitations[j].final.push_back(mapDxc[
"Ar_1S4"]);
3401 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3402 deexcitations[j].nChannels += 1;
3404 }
else if (useKoltsSetserData) {
3406 const double k2b = 5.3e-24;
3407 const double k3b = 0.83e-41;
3408 deexcitations[j].p.push_back(k3b * nAr * nAr);
3409 deexcitations[j].final.push_back(mapDxc[
"Ar_Excimer"]);
3410 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3411 deexcitations[j].nChannels += 1;
3412 if (useCollMixing) {
3413 deexcitations[j].p.push_back(k2b * nAr);
3414 deexcitations[j].final.push_back(mapDxc[
"Ar_1S4"]);
3415 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3416 deexcitations[j].nChannels += 1;
3420 if (level ==
"Ar_2P1") {
3425 const double k4s = 1.6e-20;
3426 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3427 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3428 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3429 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3430 deexcitations[j].final.push_back(mapDxc[
"Ar_1S5"]);
3431 deexcitations[j].final.push_back(mapDxc[
"Ar_1S4"]);
3432 deexcitations[j].final.push_back(mapDxc[
"Ar_1S3"]);
3433 deexcitations[j].final.push_back(mapDxc[
"Ar_1S2"]);
3434 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3435 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3436 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3437 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3438 deexcitations[j].nChannels += 4;
3440 if (level ==
"Ar_2P2") {
3443 const double k23 = 0.5e-21;
3444 deexcitations[j].p.push_back(k23 * nAr);
3445 deexcitations[j].final.push_back(mapDxc[
"Ar_2P3"]);
3446 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3447 deexcitations[j].nChannels += 1;
3452 const double k4s = 5.3e-20;
3453 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3454 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3455 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3456 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3457 deexcitations[j].final.push_back(mapDxc[
"Ar_1S5"]);
3458 deexcitations[j].final.push_back(mapDxc[
"Ar_1S4"]);
3459 deexcitations[j].final.push_back(mapDxc[
"Ar_1S3"]);
3460 deexcitations[j].final.push_back(mapDxc[
"Ar_1S2"]);
3461 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3462 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3463 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3464 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3465 deexcitations[j].nChannels += 4;
3467 if (level ==
"Ar_2P3") {
3470 const double k34 = 27.5e-21;
3471 const double k35 = 0.3e-21;
3472 const double k36 = 44.0e-21;
3473 const double k37 = 1.4e-21;
3474 const double k38 = 1.9e-21;
3475 const double k39 = 0.8e-21;
3476 deexcitations[j].p.push_back(k34 * nAr);
3477 deexcitations[j].p.push_back(k35 * nAr);
3478 deexcitations[j].p.push_back(k36 * nAr);
3479 deexcitations[j].p.push_back(k37 * nAr);
3480 deexcitations[j].p.push_back(k38 * nAr);
3481 deexcitations[j].p.push_back(k39 * nAr);
3482 deexcitations[j].final.push_back(mapDxc[
"Ar_2P4"]);
3483 deexcitations[j].final.push_back(mapDxc[
"Ar_2P5"]);
3484 deexcitations[j].final.push_back(mapDxc[
"Ar_2P6"]);
3485 deexcitations[j].final.push_back(mapDxc[
"Ar_2P7"]);
3486 deexcitations[j].final.push_back(mapDxc[
"Ar_2P8"]);
3487 deexcitations[j].final.push_back(mapDxc[
"Ar_2P9"]);
3488 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3489 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3490 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3491 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3492 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3493 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3494 deexcitations[j].nChannels += 6;
3497 const double k4s = 4.7e-20;
3498 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3499 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3500 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3501 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3502 deexcitations[j].final.push_back(mapDxc[
"Ar_1S5"]);
3503 deexcitations[j].final.push_back(mapDxc[
"Ar_1S4"]);
3504 deexcitations[j].final.push_back(mapDxc[
"Ar_1S3"]);
3505 deexcitations[j].final.push_back(mapDxc[
"Ar_1S2"]);
3506 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3507 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3508 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3509 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3510 deexcitations[j].nChannels += 4;
3512 if (level ==
"Ar_2P4") {
3515 const double k43 = 23.0e-21;
3516 const double k45 = 0.7e-21;
3517 const double k46 = 4.8e-21;
3518 const double k47 = 3.2e-21;
3519 const double k48 = 1.4e-21;
3520 const double k49 = 3.3e-21;
3521 deexcitations[j].p.push_back(k43 * nAr);
3522 deexcitations[j].p.push_back(k45 * nAr);
3523 deexcitations[j].p.push_back(k46 * nAr);
3524 deexcitations[j].p.push_back(k47 * nAr);
3525 deexcitations[j].p.push_back(k48 * nAr);
3526 deexcitations[j].p.push_back(k49 * nAr);
3527 deexcitations[j].final.push_back(mapDxc[
"Ar_2P3"]);
3528 deexcitations[j].final.push_back(mapDxc[
"Ar_2P5"]);
3529 deexcitations[j].final.push_back(mapDxc[
"Ar_2P6"]);
3530 deexcitations[j].final.push_back(mapDxc[
"Ar_2P7"]);
3531 deexcitations[j].final.push_back(mapDxc[
"Ar_2P8"]);
3532 deexcitations[j].final.push_back(mapDxc[
"Ar_2P9"]);
3533 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3534 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3535 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3536 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3537 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3538 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3539 deexcitations[j].nChannels += 6;
3542 const double k4s = 3.9e-20;
3543 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3544 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3545 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3546 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3547 deexcitations[j].final.push_back(mapDxc[
"Ar_1S5"]);
3548 deexcitations[j].final.push_back(mapDxc[
"Ar_1S4"]);
3549 deexcitations[j].final.push_back(mapDxc[
"Ar_1S3"]);
3550 deexcitations[j].final.push_back(mapDxc[
"Ar_1S2"]);
3551 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3552 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3553 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3554 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3555 deexcitations[j].nChannels += 4;
3557 if (level ==
"Ar_2P5") {
3560 const double k54 = 1.7e-21;
3561 const double k56 = 11.3e-21;
3562 const double k58 = 9.5e-21;
3563 deexcitations[j].p.push_back(k54 * nAr);
3564 deexcitations[j].p.push_back(k56 * nAr);
3565 deexcitations[j].p.push_back(k58 * nAr);
3566 deexcitations[j].final.push_back(mapDxc[
"Ar_2P4"]);
3567 deexcitations[j].final.push_back(mapDxc[
"Ar_2P6"]);
3568 deexcitations[j].final.push_back(mapDxc[
"Ar_2P8"]);
3569 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3570 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3571 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3572 deexcitations[j].nChannels += 3;
3574 if (level ==
"Ar_2P6") {
3577 const double k67 = 4.1e-21;
3578 const double k68 = 6.0e-21;
3579 const double k69 = 1.0e-21;
3580 deexcitations[j].p.push_back(k67 * nAr);
3581 deexcitations[j].p.push_back(k68 * nAr);
3582 deexcitations[j].p.push_back(k69 * nAr);
3583 deexcitations[j].final.push_back(mapDxc[
"Ar_2P7"]);
3584 deexcitations[j].final.push_back(mapDxc[
"Ar_2P8"]);
3585 deexcitations[j].final.push_back(mapDxc[
"Ar_2P9"]);
3586 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3587 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3588 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3589 deexcitations[j].nChannels += 3;
3591 if (level ==
"Ar_2P7") {
3594 const double k76 = 2.5e-21;
3595 const double k78 = 14.3e-21;
3596 const double k79 = 23.3e-21;
3597 deexcitations[j].p.push_back(k76 * nAr);
3598 deexcitations[j].p.push_back(k78 * nAr);
3599 deexcitations[j].p.push_back(k79 * nAr);
3600 deexcitations[j].final.push_back(mapDxc[
"Ar_2P6"]);
3601 deexcitations[j].final.push_back(mapDxc[
"Ar_2P8"]);
3602 deexcitations[j].final.push_back(mapDxc[
"Ar_2P9"]);
3603 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3604 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3605 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3606 deexcitations[j].nChannels += 3;
3609 const double k4s = 5.5e-20;
3610 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3611 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3612 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3613 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3614 deexcitations[j].final.push_back(mapDxc[
"Ar_1S5"]);
3615 deexcitations[j].final.push_back(mapDxc[
"Ar_1S4"]);
3616 deexcitations[j].final.push_back(mapDxc[
"Ar_1S3"]);
3617 deexcitations[j].final.push_back(mapDxc[
"Ar_1S2"]);
3618 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3619 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3620 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3621 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3622 deexcitations[j].nChannels += 4;
3624 if (level ==
"Ar_2P8") {
3627 const double k86 = 0.3e-21;
3628 const double k87 = 0.8e-21;
3629 const double k89 = 18.2e-21;
3630 const double k810 = 1.0e-21;
3631 deexcitations[j].p.push_back(k86 * nAr);
3632 deexcitations[j].p.push_back(k87 * nAr);
3633 deexcitations[j].p.push_back(k89 * nAr);
3634 deexcitations[j].p.push_back(k810 * nAr);
3635 deexcitations[j].final.push_back(mapDxc[
"Ar_2P6"]);
3636 deexcitations[j].final.push_back(mapDxc[
"Ar_2P7"]);
3637 deexcitations[j].final.push_back(mapDxc[
"Ar_2P9"]);
3638 deexcitations[j].final.push_back(mapDxc[
"Ar_2P10"]);
3639 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3640 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3641 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3642 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3643 deexcitations[j].nChannels += 4;
3646 const double k4s = 3.e-20;
3647 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3648 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3649 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3650 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3651 deexcitations[j].final.push_back(mapDxc[
"Ar_1S5"]);
3652 deexcitations[j].final.push_back(mapDxc[
"Ar_1S4"]);
3653 deexcitations[j].final.push_back(mapDxc[
"Ar_1S3"]);
3654 deexcitations[j].final.push_back(mapDxc[
"Ar_1S2"]);
3655 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3656 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3657 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3658 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3659 deexcitations[j].nChannels += 4;
3661 if (level ==
"Ar_2P9") {
3664 const double k98 = 6.8e-21;
3665 const double k910 = 5.1e-21;
3666 deexcitations[j].p.push_back(k98 * nAr);
3667 deexcitations[j].p.push_back(k910 * nAr);
3668 deexcitations[j].final.push_back(mapDxc[
"Ar_2P8"]);
3669 deexcitations[j].final.push_back(mapDxc[
"Ar_2P10"]);
3670 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3671 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3672 deexcitations[j].nChannels += 2;
3675 const double k4s = 3.5e-20;
3676 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3677 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3678 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3679 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3680 deexcitations[j].final.push_back(mapDxc[
"Ar_1S5"]);
3681 deexcitations[j].final.push_back(mapDxc[
"Ar_1S4"]);
3682 deexcitations[j].final.push_back(mapDxc[
"Ar_1S3"]);
3683 deexcitations[j].final.push_back(mapDxc[
"Ar_1S2"]);
3684 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3685 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3686 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3687 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3688 deexcitations[j].nChannels += 4;
3690 if (level ==
"Ar_2P10") {
3693 const double k4s = 2.0e-20;
3694 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3695 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3696 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3697 deexcitations[j].p.push_back(0.25 * k4s * nAr);
3698 deexcitations[j].final.push_back(mapDxc[
"Ar_1S5"]);
3699 deexcitations[j].final.push_back(mapDxc[
"Ar_1S4"]);
3700 deexcitations[j].final.push_back(mapDxc[
"Ar_1S3"]);
3701 deexcitations[j].final.push_back(mapDxc[
"Ar_1S2"]);
3702 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3703 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3704 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3705 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3706 deexcitations[j].nChannels += 4;
3708 if (level ==
"Ar_3D6" || level ==
"Ar_3D5" || level ==
"Ar_3D3" ||
3709 level ==
"Ar_3D4!" || level ==
"Ar_3D4" || level ==
"Ar_3D1!!" ||
3710 level ==
"Ar_3D1!" || level ==
"Ar_3D2" || level ==
"Ar_3S1!!!!" ||
3711 level ==
"Ar_3S1!!" || level ==
"Ar_3S1!!!" || level ==
"Ar_3S1!" ||
3712 level ==
"Ar_2S5" || level ==
"Ar_2S4" || level ==
"Ar_2S3" ||
3713 level ==
"Ar_2S2") {
3716 const double k4p =
fit3d4p * 1.e-20;
3717 deexcitations[j].final.push_back(mapDxc[
"Ar_2P10"]);
3718 deexcitations[j].final.push_back(mapDxc[
"Ar_2P9"]);
3719 deexcitations[j].final.push_back(mapDxc[
"Ar_2P8"]);
3720 deexcitations[j].final.push_back(mapDxc[
"Ar_2P7"]);
3721 deexcitations[j].final.push_back(mapDxc[
"Ar_2P6"]);
3722 deexcitations[j].final.push_back(mapDxc[
"Ar_2P5"]);
3723 deexcitations[j].final.push_back(mapDxc[
"Ar_2P4"]);
3724 deexcitations[j].final.push_back(mapDxc[
"Ar_2P3"]);
3725 deexcitations[j].final.push_back(mapDxc[
"Ar_2P2"]);
3726 deexcitations[j].final.push_back(mapDxc[
"Ar_2P1"]);
3727 for (
int k = 10; k--;) {
3728 deexcitations[j].p.push_back(0.1 * k4p * nAr);
3729 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3731 deexcitations[j].nChannels += 10;
3733 if (level ==
"Ar_4D5" || level ==
"Ar_3S4" || level ==
"Ar_4D2" ||
3734 level ==
"Ar_4S1!" || level ==
"Ar_3S2" || level ==
"Ar_5D5" ||
3735 level ==
"Ar_4S4" || level ==
"Ar_5D2" || level ==
"Ar_6D5" ||
3736 level ==
"Ar_5S1!" || level ==
"Ar_4S2" || level ==
"Ar_5S4" ||
3737 level ==
"Ar_6D2") {
3740 deexcitations[j].final.push_back(mapDxc[
"Ar_2P10"]);
3741 deexcitations[j].final.push_back(mapDxc[
"Ar_2P9"]);
3742 deexcitations[j].final.push_back(mapDxc[
"Ar_2P8"]);
3743 deexcitations[j].final.push_back(mapDxc[
"Ar_2P7"]);
3744 deexcitations[j].final.push_back(mapDxc[
"Ar_2P6"]);
3745 deexcitations[j].final.push_back(mapDxc[
"Ar_2P5"]);
3746 deexcitations[j].final.push_back(mapDxc[
"Ar_2P4"]);
3747 deexcitations[j].final.push_back(mapDxc[
"Ar_2P3"]);
3748 deexcitations[j].final.push_back(mapDxc[
"Ar_2P2"]);
3749 deexcitations[j].final.push_back(mapDxc[
"Ar_2P1"]);
3750 for (
int k = 10; k--;) {
3751 deexcitations[j].p.push_back(0.1 * k4p * nAr);
3752 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3754 deexcitations[j].nChannels += 10;
3759 const double kHM = 2.e-18;
3760 const bool useHornbeckMolnar =
true;
3761 if (useHornbeckMolnar) {
3762 deexcitations[j].p.push_back(kHM * nAr);
3763 deexcitations[j].final.push_back(mapDxc[
"Ar_Dimer"]);
3764 deexcitations[j].type.push_back(DxcTypeCollIon);
3765 deexcitations[j].nChannels += 1;
3772 bool withCO2 =
false;
3775 bool withCH4 =
false;
3778 bool withC2H6 =
false;
3781 bool withIso =
false;
3784 bool withC2H2 =
false;
3787 bool withCF4 =
false;
3791 if (
gas[i] ==
"CO2") {
3795 }
else if (
gas[i] ==
"CH4") {
3799 }
else if (
gas[i] ==
"C2H6") {
3803 }
else if (
gas[i] ==
"C2H2") {
3807 }
else if (
gas[i] ==
"CF4") {
3811 }
else if (
gas[i] ==
"iC4H10") {
3818 if (withAr && withCO2) {
3821 for (
int j = nDeexcitations; j--;) {
3822 std::string level = deexcitations[j].label;
3824 double pacs = 0., eta = 0.;
3825 if (!optData.GetPhotoabsorptionCrossSection(
3826 "CO2", deexcitations[j].energy, pacs, eta)) {
3829 const double pPenningWK =
pow(eta, 2. / 5.);
3830 if (level ==
"Ar_1S5") {
3832 const double kQ = 5.3e-19;
3833 deexcitations[j].p.push_back(kQ * nQ);
3834 deexcitations[j].final.push_back(-1);
3835 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3836 deexcitations[j].nChannels += 1;
3837 }
else if (level ==
"Ar_1S4") {
3839 const double kQ = 5.0e-19;
3840 deexcitations[j].p.push_back(kQ * nQ);
3841 deexcitations[j].final.push_back(-1);
3842 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3843 deexcitations[j].nChannels += 1;
3844 }
else if (level ==
"Ar_1S3") {
3845 const double kQ = 5.9e-19;
3846 deexcitations[j].p.push_back(kQ * nQ);
3847 deexcitations[j].final.push_back(-1);
3848 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3849 deexcitations[j].nChannels += 1;
3850 }
else if (level ==
"Ar_1S2") {
3851 const double kQ = 7.4e-19;
3852 deexcitations[j].p.push_back(kQ * nQ);
3853 deexcitations[j].final.push_back(-1);
3854 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3855 deexcitations[j].nChannels += 1;
3856 }
else if (level ==
"Ar_2P8") {
3858 const double kQ = 6.4e-19;
3859 deexcitations[j].p.push_back(kQ * nQ);
3860 deexcitations[j].final.push_back(-1);
3861 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3862 deexcitations[j].nChannels += 1;
3863 }
else if (level ==
"Ar_2P6") {
3865 const double kQ = 6.1e-19;
3866 deexcitations[j].p.push_back(kQ * nQ);
3867 deexcitations[j].final.push_back(-1);
3868 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3869 deexcitations[j].nChannels += 1;
3870 }
else if (level ==
"Ar_2P5") {
3872 const double kQ = 6.6e-19;
3873 deexcitations[j].p.push_back(kQ * nQ);
3874 deexcitations[j].final.push_back(-1);
3875 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3876 deexcitations[j].nChannels += 1;
3877 }
else if (level ==
"Ar_2P1") {
3879 const double kQ = 6.2e-19;
3880 deexcitations[j].p.push_back(kQ * nQ);
3881 deexcitations[j].final.push_back(-1);
3882 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3883 deexcitations[j].nChannels += 1;
3884 }
else if (level ==
"Ar_2P10" || level ==
"Ar_2P9" || level ==
"Ar_2P7" ||
3885 level ==
"Ar_2P4" || level ==
"Ar_2P3" || level ==
"Ar_2P2") {
3887 const double kQ = 6.33e-19;
3888 deexcitations[j].p.push_back(kQ * nQ);
3889 deexcitations[j].final.push_back(-1);
3890 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3891 deexcitations[j].nChannels += 1;
3892 }
else if (deexcitations[j].osc > 0.) {
3895 const double m1 = ElectronMassGramme / (rgas[iAr] - 1.);
3896 const double m2 = ElectronMassGramme / (rgas[iCO2] - 1.);
3898 double mR = m1 * m2 / (m1 + m2);
3899 mR /= AtomicMassUnit;
3901 (RydbergEnergy / deexcitations[j].energy) * deexcitations[j].osc;
3903 (2 * RydbergEnergy / deexcitations[j].energy) * pacs /
3904 (4 * Pi2 * FineStructureConstant * BohrRadius * BohrRadius);
3908 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
3909 std::cout <<
" Rate constant for coll. deexcitation of\n"
3910 <<
" " << level <<
" by CO2 (W-K formula):\n"
3911 <<
" " << kQ <<
" cm3 ns-1\n";
3913 double pPenning = pPenningWK;
3914 deexcitations[j].p.push_back(kQ * nQ * pPenning);
3915 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
3916 deexcitations[j].final.push_back(-1);
3917 deexcitations[j].final.push_back(-1);
3918 deexcitations[j].type.push_back(DxcTypeCollIon);
3919 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3920 deexcitations[j].nChannels += 2;
3921 }
else if (level ==
"Ar_3D6" || level ==
"Ar_3D3" || level ==
"Ar_3D4!" ||
3922 level ==
"Ar_3D4" || level ==
"Ar_3D1!!" ||
3923 level ==
"Ar_3D1!" || level ==
"Ar_3S1!!!!" ||
3924 level ==
"Ar_3S1!!" || level ==
"Ar_3S1!!!") {
3927 const double rAr3d = 436.e-10;
3928 const double rCO2 = 165.e-10;
3930 const double sigma =
pow(rAr3d + rCO2, 2) * Pi;
3932 const double m1 = ElectronMass / (rgas[iAr] - 1.);
3933 const double m2 = ElectronMass / (rgas[iCO2] - 1.);
3934 const double mR = m1 * m2 / (m1 + m2);
3936 const double vel = SpeedOfLight *
sqrt(8. * BoltzmannConstant *
3938 const double kQ =
fit3dQCO2 * sigma * vel;
3940 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
3941 std::cout <<
" Rate constant for coll. deexcitation of\n"
3942 <<
" " << level <<
" by CO2 (hard sphere):\n"
3943 <<
" " << kQ <<
" cm3 ns-1\n";
3946 deexcitations[j].p.push_back(kQ * nQ * pPenning);
3947 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
3948 deexcitations[j].final.push_back(-1);
3949 deexcitations[j].final.push_back(-1);
3950 deexcitations[j].type.push_back(DxcTypeCollIon);
3951 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3952 deexcitations[j].nChannels += 2;
3953 }
else if (level ==
"Ar_2S5" || level ==
"Ar_2S3") {
3956 const double rAr5s = 635.e-10;
3957 const double rCO2 = 165.e-10;
3959 const double sigma =
pow(rAr5s + rCO2, 2) * Pi;
3961 const double m1 = ElectronMass / (rgas[iAr] - 1.);
3962 const double m2 = ElectronMass / (rgas[iCO2] - 1.);
3963 const double mR = m1 * m2 / (m1 + m2);
3965 const double vel = SpeedOfLight *
sqrt(8. * BoltzmannConstant *
3967 const double kQ =
fit3dQCO2 * sigma * vel;
3969 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
3970 std::cout <<
" Rate constant for coll. deexcitation of\n"
3971 <<
" " << level <<
" by CO2 (hard sphere):\n"
3972 <<
" " << kQ <<
" cm3 ns-1\n";
3975 deexcitations[j].p.push_back(kQ * nQ * pPenning);
3976 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
3977 deexcitations[j].final.push_back(-1);
3978 deexcitations[j].final.push_back(-1);
3979 deexcitations[j].type.push_back(DxcTypeCollIon);
3980 deexcitations[j].type.push_back(DxcTypeCollNonIon);
3981 deexcitations[j].nChannels += 2;
3985 if (withAr && withCH4) {
3988 for (
int j = nDeexcitations; j--;) {
3989 std::string level = deexcitations[j].label;
3991 double pacs = 0., eta = 0.;
3992 if (!optData.GetPhotoabsorptionCrossSection(
3993 "CH4", deexcitations[j].energy, pacs, eta)) {
3996 const double pPenningWK =
pow(eta, 2. / 5.);
3997 if (level ==
"Ar_1S5") {
3999 const double kQ = 4.55e-19;
4000 deexcitations[j].p.push_back(kQ * nQ);
4001 deexcitations[j].final.push_back(-1);
4002 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4003 deexcitations[j].nChannels += 1;
4004 }
else if (level ==
"Ar_1S4") {
4006 const double kQ = 4.5e-19;
4007 deexcitations[j].p.push_back(kQ * nQ);
4008 deexcitations[j].final.push_back(-1);
4009 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4010 deexcitations[j].nChannels += 1;
4011 }
else if (level ==
"Ar_1S3") {
4013 const double kQ = 5.30e-19;
4014 deexcitations[j].p.push_back(kQ * nQ);
4015 deexcitations[j].final.push_back(-1);
4016 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4017 deexcitations[j].nChannels += 1;
4018 }
else if (level ==
"Ar_1S2") {
4020 const double kQ = 5.7e-19;
4021 deexcitations[j].p.push_back(kQ * nQ);
4022 deexcitations[j].final.push_back(-1);
4023 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4024 deexcitations[j].nChannels += 1;
4025 }
else if (level ==
"Ar_2P8") {
4027 const double kQ = 7.4e-19;
4028 double pPenning = pPenningWK;
4030 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4031 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4032 deexcitations[j].final.push_back(-1);
4033 deexcitations[j].final.push_back(-1);
4034 deexcitations[j].type.push_back(DxcTypeCollIon);
4035 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4036 deexcitations[j].nChannels += 2;
4037 }
else if (level ==
"Ar_2P6") {
4039 const double kQ = 3.4e-19;
4040 double pPenning = pPenningWK;
4042 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4043 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4044 deexcitations[j].final.push_back(-1);
4045 deexcitations[j].final.push_back(-1);
4046 deexcitations[j].type.push_back(DxcTypeCollIon);
4047 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4048 deexcitations[j].nChannels += 2;
4049 }
else if (level ==
"Ar_2P5") {
4051 const double kQ = 6.0e-19;
4052 double pPenning = pPenningWK;
4054 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4055 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4056 deexcitations[j].final.push_back(-1);
4057 deexcitations[j].final.push_back(-1);
4058 deexcitations[j].type.push_back(DxcTypeCollIon);
4059 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4060 deexcitations[j].nChannels += 2;
4061 }
else if (level ==
"Ar_2P1") {
4063 const double kQ = 9.3e-19;
4064 double pPenning = pPenningWK;
4066 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4067 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4068 deexcitations[j].final.push_back(-1);
4069 deexcitations[j].final.push_back(-1);
4070 deexcitations[j].type.push_back(DxcTypeCollIon);
4071 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4072 deexcitations[j].nChannels += 2;
4073 }
else if (level ==
"Ar_2P10" || level ==
"Ar_2P9" || level ==
"Ar_2P7" ||
4074 level ==
"Ar_2P4" || level ==
"Ar_2P3" || level ==
"Ar_2P2") {
4076 const double kQ = 6.53e-19;
4077 double pPenning = pPenningWK;
4079 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4080 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4081 deexcitations[j].final.push_back(-1);
4082 deexcitations[j].final.push_back(-1);
4083 deexcitations[j].type.push_back(DxcTypeCollIon);
4084 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4085 deexcitations[j].nChannels += 2;
4086 }
else if (deexcitations[j].osc > 0.) {
4089 const double m1 = ElectronMassGramme / (rgas[iAr] - 1.);
4090 const double m2 = ElectronMassGramme / (rgas[iCH4] - 1.);
4092 double mR = m1 * m2 / (m1 + m2);
4093 mR /= AtomicMassUnit;
4095 (RydbergEnergy / deexcitations[j].energy) * deexcitations[j].osc;
4097 (2 * RydbergEnergy / deexcitations[j].energy) * pacs /
4098 (4 * Pi2 * FineStructureConstant * BohrRadius * BohrRadius);
4102 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4103 std::cout <<
" Rate constant for coll. deexcitation of\n"
4104 <<
" " << level <<
" by CH4 (W-K formula):\n"
4105 <<
" " << kQ <<
" cm3 ns-1\n";
4107 double pPenning = pPenningWK;
4108 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4109 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4110 deexcitations[j].final.push_back(-1);
4111 deexcitations[j].final.push_back(-1);
4112 deexcitations[j].type.push_back(DxcTypeCollIon);
4113 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4114 deexcitations[j].nChannels += 2;
4115 }
else if (level ==
"Ar_3D6" || level ==
"Ar_3D3" || level ==
"Ar_3D4!" ||
4116 level ==
"Ar_3D4" || level ==
"Ar_3D1!!" ||
4117 level ==
"Ar_3D1!" || level ==
"Ar_3S1!!!!" ||
4118 level ==
"Ar_3S1!!" || level ==
"Ar_3S1!!!") {
4121 const double rAr3d = 436.e-10;
4122 const double rCH4 = 190.e-10;
4124 const double sigma =
pow(rAr3d + rCH4, 2) * Pi;
4126 const double m1 = ElectronMass / (rgas[iAr] - 1.);
4127 const double m2 = ElectronMass / (rgas[iCH4] - 1.);
4128 const double mR = m1 * m2 / (m1 + m2);
4130 const double vel = SpeedOfLight *
sqrt(8. * BoltzmannConstant *
4132 const double kQ =
fit3dQCH4 * sigma * vel;
4134 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4135 std::cout <<
" Rate constant for coll. deexcitation of\n"
4136 <<
" " << level <<
" by CH4 (hard sphere):\n"
4137 <<
" " << kQ <<
" cm3 ns-1\n";
4140 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4141 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4142 deexcitations[j].final.push_back(-1);
4143 deexcitations[j].final.push_back(-1);
4144 deexcitations[j].type.push_back(DxcTypeCollIon);
4145 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4146 deexcitations[j].nChannels += 2;
4147 }
else if (level ==
"Ar_2S5" || level ==
"Ar_2S3") {
4150 const double rAr5s = 635.e-10;
4151 const double rCH4 = 190.e-10;
4153 const double sigma =
pow(rAr5s + rCH4, 2) * Pi;
4155 const double m1 = ElectronMass / (rgas[iAr] - 1.);
4156 const double m2 = ElectronMass / (rgas[iCH4] - 1.);
4157 const double mR = m1 * m2 / (m1 + m2);
4159 const double vel = SpeedOfLight *
sqrt(8. * BoltzmannConstant *
4161 const double kQ =
fit3dQCH4 * sigma * vel;
4163 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4164 std::cout <<
" Rate constant for coll. deexcitation of\n"
4165 <<
" " << level <<
" by CH4 (hard sphere):\n"
4166 <<
" " << kQ <<
" cm3 ns-1\n";
4169 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4170 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4171 deexcitations[j].final.push_back(-1);
4172 deexcitations[j].final.push_back(-1);
4173 deexcitations[j].type.push_back(DxcTypeCollIon);
4174 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4175 deexcitations[j].nChannels += 2;
4179 if (withAr && withC2H6) {
4182 for (
int j = nDeexcitations; j--;) {
4183 std::string level = deexcitations[j].label;
4185 double pacs = 0., eta = 0.;
4186 if (!optData.GetPhotoabsorptionCrossSection(
4187 "C2H6", deexcitations[j].energy, pacs, eta)) {
4190 const double pPenningWK =
pow(eta, 2. / 5.);
4191 if (level ==
"Ar_1S5") {
4193 const double kQ = 5.29e-19;
4194 const double pPenning = pPenningWK;
4195 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4196 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4197 deexcitations[j].final.push_back(-1);
4198 deexcitations[j].final.push_back(-1);
4199 deexcitations[j].type.push_back(DxcTypeCollIon);
4200 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4201 deexcitations[j].nChannels += 2;
4202 }
else if (level ==
"Ar_1S4") {
4204 const double kQ = 6.2e-19;
4205 const double pPenning = pPenningWK;
4206 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4207 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4208 deexcitations[j].final.push_back(-1);
4209 deexcitations[j].final.push_back(-1);
4210 deexcitations[j].type.push_back(DxcTypeCollIon);
4211 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4212 deexcitations[j].nChannels += 2;
4213 }
else if (level ==
"Ar_1S3") {
4215 const double kQ = 6.53e-19;
4217 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4218 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4219 deexcitations[j].final.push_back(-1);
4220 deexcitations[j].final.push_back(-1);
4221 deexcitations[j].type.push_back(DxcTypeCollIon);
4222 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4223 deexcitations[j].nChannels += 2;
4224 }
else if (level ==
"Ar_1S2") {
4226 const double kQ = 10.7e-19;
4227 const double pPenning = pPenningWK;
4228 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4229 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4230 deexcitations[j].final.push_back(-1);
4231 deexcitations[j].final.push_back(-1);
4232 deexcitations[j].type.push_back(DxcTypeCollIon);
4233 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4234 deexcitations[j].nChannels += 2;
4235 }
else if (level ==
"Ar_2P8") {
4237 const double kQ = 9.2e-19;
4239 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4240 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4241 deexcitations[j].final.push_back(-1);
4242 deexcitations[j].final.push_back(-1);
4243 deexcitations[j].type.push_back(DxcTypeCollIon);
4244 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4245 deexcitations[j].nChannels += 2;
4246 }
else if (level ==
"Ar_2P6") {
4248 const double kQ = 4.8e-19;
4250 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4251 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4252 deexcitations[j].final.push_back(-1);
4253 deexcitations[j].final.push_back(-1);
4254 deexcitations[j].type.push_back(DxcTypeCollIon);
4255 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4256 deexcitations[j].nChannels += 2;
4257 }
else if (level ==
"Ar_2P5") {
4259 const double kQ = 9.9e-19;
4261 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4262 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4263 deexcitations[j].final.push_back(-1);
4264 deexcitations[j].final.push_back(-1);
4265 deexcitations[j].type.push_back(DxcTypeCollIon);
4266 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4267 deexcitations[j].nChannels += 2;
4268 }
else if (level ==
"Ar_2P1") {
4270 const double kQ = 11.0e-19;
4272 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4273 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4274 deexcitations[j].final.push_back(-1);
4275 deexcitations[j].final.push_back(-1);
4276 deexcitations[j].type.push_back(DxcTypeCollIon);
4277 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4278 deexcitations[j].nChannels += 2;
4279 }
else if (level ==
"Ar_2P10" || level ==
"Ar_2P9" || level ==
"Ar_2P7" ||
4280 level ==
"Ar_2P4" || level ==
"Ar_2P3" || level ==
"Ar_2P2") {
4282 const double kQ = 8.7e-19;
4284 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4285 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4286 deexcitations[j].final.push_back(-1);
4287 deexcitations[j].final.push_back(-1);
4288 deexcitations[j].type.push_back(DxcTypeCollIon);
4289 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4290 deexcitations[j].nChannels += 2;
4291 }
else if (deexcitations[j].osc > 0.) {
4294 const double m1 = ElectronMassGramme / (rgas[iAr] - 1.);
4295 const double m2 = ElectronMassGramme / (rgas[iC2H6] - 1.);
4297 double mR = m1 * m2 / (m1 + m2);
4298 mR /= AtomicMassUnit;
4300 (RydbergEnergy / deexcitations[j].energy) * deexcitations[j].osc;
4302 (2 * RydbergEnergy / deexcitations[j].energy) * pacs /
4303 (4 * Pi2 * FineStructureConstant * BohrRadius * BohrRadius);
4307 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4308 std::cout <<
" Rate constant for coll. deexcitation of\n"
4309 <<
" " << level <<
" by C2H6 (W-K formula):\n"
4310 <<
" " << kQ <<
" cm3 ns-1\n";
4312 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4313 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4314 deexcitations[j].final.push_back(-1);
4315 deexcitations[j].final.push_back(-1);
4316 deexcitations[j].type.push_back(DxcTypeCollIon);
4317 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4318 deexcitations[j].nChannels += 2;
4319 }
else if (level ==
"Ar_3D6" || level ==
"Ar_3D3" || level ==
"Ar_3D4!" ||
4320 level ==
"Ar_3D4" || level ==
"Ar_3D1!!" ||
4321 level ==
"Ar_3D1!" || level ==
"Ar_3S1!!!!" ||
4322 level ==
"Ar_3S1!!" || level ==
"Ar_3S1!!!") {
4325 const double rAr3d = 436.e-10;
4326 const double rC2H6 = 195.e-10;
4328 const double sigma =
pow(rAr3d + rC2H6, 2) * Pi;
4330 const double m1 = ElectronMass / (rgas[iAr] - 1.);
4331 const double m2 = ElectronMass / (rgas[iC2H6] - 1.);
4332 const double mR = m1 * m2 / (m1 + m2);
4334 const double vel = SpeedOfLight *
sqrt(8. * BoltzmannConstant *
4338 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4339 std::cout <<
" Rate constant for coll. deexcitation of\n"
4340 <<
" " << level <<
" by C2H6 (hard sphere):\n"
4341 <<
" " << kQ <<
" cm3 ns-1\n";
4344 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4345 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4346 deexcitations[j].final.push_back(-1);
4347 deexcitations[j].final.push_back(-1);
4348 deexcitations[j].type.push_back(DxcTypeCollIon);
4349 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4350 deexcitations[j].nChannels += 2;
4351 }
else if (level ==
"Ar_2S5" || level ==
"Ar_2S3") {
4354 const double rAr5s = 635.e-10;
4355 const double rC2H6 = 195.e-10;
4357 const double sigma =
pow(rAr5s + rC2H6, 2) * Pi;
4359 const double m1 = ElectronMass / (rgas[iAr] - 1.);
4360 const double m2 = ElectronMass / (rgas[iC2H6] - 1.);
4361 const double mR = m1 * m2 / (m1 + m2);
4363 const double vel = SpeedOfLight *
sqrt(8. * BoltzmannConstant *
4367 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4368 std::cout <<
" Rate constant for coll. deexcitation of\n"
4369 <<
" " << level <<
" by C2H6 (hard sphere):\n"
4370 <<
" " << kQ <<
" cm3 ns-1\n";
4373 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4374 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4375 deexcitations[j].final.push_back(-1);
4376 deexcitations[j].final.push_back(-1);
4377 deexcitations[j].type.push_back(DxcTypeCollIon);
4378 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4379 deexcitations[j].nChannels += 2;
4383 if (withAr && withIso) {
4386 for (
int j = nDeexcitations; j--;) {
4387 std::string level = deexcitations[j].label;
4389 double pacs = 0., eta = 0.;
4391 if (!optData.GetPhotoabsorptionCrossSection(
4392 "nC4H10", deexcitations[j].energy, pacs, eta)) {
4395 const double pPenningWK =
pow(eta, 2. / 5.);
4396 if (level ==
"Ar_1S5") {
4399 const double kQ = 7.1e-19;
4400 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4401 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4402 deexcitations[j].final.push_back(-1);
4403 deexcitations[j].final.push_back(-1);
4404 deexcitations[j].type.push_back(DxcTypeCollIon);
4405 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4406 deexcitations[j].nChannels += 2;
4407 }
else if (level ==
"Ar_1S4") {
4409 const double kQ = 6.1e-19;
4410 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4411 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4412 deexcitations[j].final.push_back(-1);
4413 deexcitations[j].final.push_back(-1);
4414 deexcitations[j].type.push_back(DxcTypeCollIon);
4415 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4416 deexcitations[j].nChannels += 2;
4417 }
else if (level ==
"Ar_1S3") {
4420 const double kQ = 8.5e-19;
4421 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4422 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4423 deexcitations[j].final.push_back(-1);
4424 deexcitations[j].final.push_back(-1);
4425 deexcitations[j].type.push_back(DxcTypeCollIon);
4426 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4427 deexcitations[j].nChannels += 2;
4428 }
else if (level ==
"Ar_1S2") {
4430 const double kQ = 11.0e-19;
4431 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4432 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4433 deexcitations[j].final.push_back(-1);
4434 deexcitations[j].final.push_back(-1);
4435 deexcitations[j].type.push_back(DxcTypeCollIon);
4436 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4437 deexcitations[j].nChannels += 2;
4438 }
else if (level ==
"Ar_2P8") {
4440 const double kEth = 9.2e-19;
4442 const double r4p = 340.;
4444 const double rEth = 195.;
4445 const double rIso = 250.;
4447 const double mAr = 39.9;
4448 const double mEth = 30.1;
4449 const double mIso = 58.1;
4452 kQ *=
pow((r4p + rIso) / (r4p + rEth), 2) *
4453 sqrt((mEth / mIso) * (mAr + mIso) / (mAr + mEth));
4455 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4456 std::cout <<
" Estim. rate constant for coll. deexcitation of\n"
4457 <<
" " << level <<
" by iC4H10:\n"
4458 <<
" " << kQ <<
" cm3 ns-1\n";
4460 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4461 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4462 deexcitations[j].final.push_back(-1);
4463 deexcitations[j].final.push_back(-1);
4464 deexcitations[j].type.push_back(DxcTypeCollIon);
4465 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4466 deexcitations[j].nChannels += 2;
4467 }
else if (level ==
"Ar_2P6") {
4469 const double kEth = 4.8e-19;
4471 const double r4p = 340.;
4473 const double rEth = 195.;
4474 const double rIso = 250.;
4476 const double mAr = 39.9;
4477 const double mEth = 30.1;
4478 const double mIso = 58.1;
4481 kQ *=
pow((r4p + rIso) / (r4p + rEth), 2) *
4482 sqrt((mEth / mIso) * (mAr + mIso) / (mAr + mEth));
4484 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4485 std::cout <<
" Estim. rate constant for coll. deexcitation of\n"
4486 <<
" " << level <<
" by iC4H10:\n"
4487 <<
" " << kQ <<
" cm3 ns-1\n";
4489 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4490 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4491 deexcitations[j].final.push_back(-1);
4492 deexcitations[j].final.push_back(-1);
4493 deexcitations[j].type.push_back(DxcTypeCollIon);
4494 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4495 deexcitations[j].nChannels += 2;
4496 }
else if (level ==
"Ar_2P5") {
4498 const double kEth = 9.9e-19;
4500 const double r4p = 340.;
4502 const double rEth = 195.;
4503 const double rIso = 250.;
4505 const double mAr = 39.9;
4506 const double mEth = 30.1;
4507 const double mIso = 58.1;
4510 kQ *=
pow((r4p + rIso) / (r4p + rEth), 2) *
4511 sqrt((mEth / mIso) * (mAr + mIso) / (mAr + mEth));
4513 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4514 std::cout <<
" Estim. rate constant for coll. deexcitation of\n"
4515 <<
" " << level <<
" by iC4H10:\n"
4516 <<
" " << kQ <<
" cm3 ns-1\n";
4518 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4519 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4520 deexcitations[j].final.push_back(-1);
4521 deexcitations[j].final.push_back(-1);
4522 deexcitations[j].type.push_back(DxcTypeCollIon);
4523 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4524 deexcitations[j].nChannels += 2;
4525 }
else if (level ==
"Ar_2P1") {
4527 const double kEth = 11.0e-19;
4529 const double r4p = 340.;
4531 const double rEth = 195.;
4532 const double rIso = 250.;
4534 const double mAr = 39.9;
4535 const double mEth = 30.1;
4536 const double mIso = 58.1;
4539 kQ *=
pow((r4p + rIso) / (r4p + rEth), 2) *
4540 sqrt((mEth / mIso) * (mAr + mIso) / (mAr + mEth));
4542 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4543 std::cout <<
" Estim. rate constant for coll. deexcitation of\n"
4544 <<
" " << level <<
" by iC4H10:\n"
4545 <<
" " << kQ <<
" cm3 ns-1\n";
4547 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4548 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4549 deexcitations[j].final.push_back(-1);
4550 deexcitations[j].final.push_back(-1);
4551 deexcitations[j].type.push_back(DxcTypeCollIon);
4552 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4553 deexcitations[j].nChannels += 2;
4554 }
else if (level ==
"Ar_2P10" || level ==
"Ar_2P9" || level ==
"Ar_2P7" ||
4555 level ==
"Ar_2P4" || level ==
"Ar_2P3" || level ==
"Ar_2P2") {
4557 const double kEth = 5.5e-19;
4559 const double r4p = 340.;
4561 const double rEth = 195.;
4562 const double rIso = 250.;
4564 const double mAr = 39.9;
4565 const double mEth = 30.1;
4566 const double mIso = 58.1;
4569 kQ *=
pow((r4p + rIso) / (r4p + rEth), 2) *
4570 sqrt((mEth / mIso) * (mAr + mIso) / (mAr + mEth));
4572 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4573 std::cout <<
" Estim. rate constant for coll. deexcitation of\n"
4574 <<
" " << level <<
" by iC4H10:\n"
4575 <<
" " << kQ <<
" cm3 ns-1\n";
4577 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4578 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4579 deexcitations[j].final.push_back(-1);
4580 deexcitations[j].final.push_back(-1);
4581 deexcitations[j].type.push_back(DxcTypeCollIon);
4582 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4583 deexcitations[j].nChannels += 2;
4584 }
else if (deexcitations[j].osc > 0.) {
4587 const double m1 = ElectronMassGramme / (rgas[iAr] - 1.);
4588 const double m2 = ElectronMassGramme / (rgas[iIso] - 1.);
4590 double mR = m1 * m2 / (m1 + m2);
4591 mR /= AtomicMassUnit;
4593 (RydbergEnergy / deexcitations[j].energy) * deexcitations[j].osc;
4595 (2 * RydbergEnergy / deexcitations[j].energy) * pacs /
4596 (4 * Pi2 * FineStructureConstant * BohrRadius * BohrRadius);
4600 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4601 std::cout <<
" Rate constant for coll. deexcitation of\n"
4602 <<
" " << level <<
" by C4H10 (W-K formula):\n"
4603 <<
" " << kQ <<
" cm3 ns-1\n";
4605 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4606 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4607 deexcitations[j].final.push_back(-1);
4608 deexcitations[j].final.push_back(-1);
4609 deexcitations[j].type.push_back(DxcTypeCollIon);
4610 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4611 deexcitations[j].nChannels += 2;
4612 }
else if (level ==
"Ar_3D6" || level ==
"Ar_3D3" || level ==
"Ar_3D4!" ||
4613 level ==
"Ar_3D4" || level ==
"Ar_3D1!!" ||
4614 level ==
"Ar_3D1!" || level ==
"Ar_3S1!!!!" ||
4615 level ==
"Ar_3S1!!" || level ==
"Ar_3S1!!!") {
4618 const double rAr3d = 436.e-10;
4619 const double rIso = 250.e-10;
4621 const double sigma =
pow(rAr3d + rIso, 2) * Pi;
4623 const double m1 = ElectronMass / (rgas[iAr] - 1.);
4624 const double m2 = ElectronMass / (rgas[iIso] - 1.);
4625 const double mR = m1 * m2 / (m1 + m2);
4627 const double vel = SpeedOfLight *
sqrt(8. * BoltzmannConstant *
4629 const double kQ = sigma * vel;
4631 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4632 std::cout <<
" Rate constant for coll. deexcitation of\n"
4633 <<
" " << level <<
" by iC4H10 (hard sphere):\n"
4634 <<
" " << kQ <<
" cm3 ns-1\n";
4636 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4637 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4638 deexcitations[j].final.push_back(-1);
4639 deexcitations[j].final.push_back(-1);
4640 deexcitations[j].type.push_back(DxcTypeCollIon);
4641 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4642 deexcitations[j].nChannels += 2;
4643 }
else if (level ==
"Ar_2S5" || level ==
"Ar_2S3") {
4646 const double rAr5s = 635.e-10;
4647 const double rIso = 250.e-10;
4649 const double sigma =
pow(rAr5s + rIso, 2) * Pi;
4651 const double m1 = ElectronMass / (rgas[iAr] - 1.);
4652 const double m2 = ElectronMass / (rgas[iIso] - 1.);
4653 const double mR = m1 * m2 / (m1 + m2);
4655 const double vel = SpeedOfLight *
sqrt(8. * BoltzmannConstant *
4657 const double kQ = sigma * vel;
4659 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4660 std::cout <<
" Rate constant for coll. deexcitation of\n"
4661 <<
" " << level <<
" by iC4H10 (hard sphere):\n"
4662 <<
" " << kQ <<
" cm3 ns-1\n";
4664 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4665 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4666 deexcitations[j].final.push_back(-1);
4667 deexcitations[j].final.push_back(-1);
4668 deexcitations[j].type.push_back(DxcTypeCollIon);
4669 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4670 deexcitations[j].nChannels += 2;
4674 if (withAr && withC2H2) {
4677 for (
int j = nDeexcitations; j--;) {
4678 std::string level = deexcitations[j].label;
4680 double pacs = 0., eta = 0.;
4681 if (!optData.GetPhotoabsorptionCrossSection(
4682 "C2H2", deexcitations[j].energy, pacs, eta)) {
4685 const double pPenningWK =
pow(eta, 2. / 5.);
4686 if (level ==
"Ar_1S5") {
4688 const double kQ = 5.6e-19;
4692 const double pPenning = 0.61;
4693 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4694 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4695 deexcitations[j].final.push_back(-1);
4696 deexcitations[j].final.push_back(-1);
4697 deexcitations[j].type.push_back(DxcTypeCollIon);
4698 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4699 deexcitations[j].nChannels += 2;
4700 }
else if (level ==
"Ar_1S4") {
4702 const double kQ = 4.6e-19;
4703 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4704 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4705 deexcitations[j].final.push_back(-1);
4706 deexcitations[j].final.push_back(-1);
4707 deexcitations[j].type.push_back(DxcTypeCollIon);
4708 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4709 deexcitations[j].nChannels += 2;
4710 }
else if (level ==
"Ar_1S3") {
4711 const double kQ = 5.6e-19;
4712 const double pPenning = 0.61;
4713 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4714 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4715 deexcitations[j].final.push_back(-1);
4716 deexcitations[j].final.push_back(-1);
4717 deexcitations[j].type.push_back(DxcTypeCollIon);
4718 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4719 deexcitations[j].nChannels += 2;
4720 }
else if (level ==
"Ar_1S2") {
4722 const double kQ = 8.7e-19;
4723 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4724 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4725 deexcitations[j].final.push_back(-1);
4726 deexcitations[j].final.push_back(-1);
4727 deexcitations[j].type.push_back(DxcTypeCollIon);
4728 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4729 deexcitations[j].nChannels += 2;
4730 }
else if (level ==
"Ar_2P8") {
4732 const double kQ = 5.0e-19;
4733 const double pPenning = 0.3;
4734 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4735 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4736 deexcitations[j].final.push_back(-1);
4737 deexcitations[j].final.push_back(-1);
4738 deexcitations[j].type.push_back(DxcTypeCollIon);
4739 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4740 deexcitations[j].nChannels += 2;
4741 }
else if (level ==
"Ar_2P6") {
4743 const double kQ = 5.7e-19;
4744 const double pPenning = 0.3;
4745 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4746 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4747 deexcitations[j].final.push_back(-1);
4748 deexcitations[j].final.push_back(-1);
4749 deexcitations[j].type.push_back(DxcTypeCollIon);
4750 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4751 deexcitations[j].nChannels += 2;
4752 }
else if (level ==
"Ar_2P5") {
4754 const double kQ = 6.0e-19;
4755 const double pPenning = 0.3;
4756 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4757 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4758 deexcitations[j].final.push_back(-1);
4759 deexcitations[j].final.push_back(-1);
4760 deexcitations[j].type.push_back(DxcTypeCollIon);
4761 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4762 deexcitations[j].nChannels += 2;
4763 }
else if (level ==
"Ar_2P1") {
4765 const double kQ = 5.3e-19;
4766 const double pPenning = 0.3;
4767 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4768 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4769 deexcitations[j].final.push_back(-1);
4770 deexcitations[j].final.push_back(-1);
4771 deexcitations[j].type.push_back(DxcTypeCollIon);
4772 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4773 deexcitations[j].nChannels += 2;
4774 }
else if (level ==
"Ar_2P10" || level ==
"Ar_2P9" || level ==
"Ar_2P7" ||
4775 level ==
"Ar_2P4" || level ==
"Ar_2P3" || level ==
"Ar_2P2") {
4777 const double kQ = 5.5e-19;
4778 const double pPenning = 0.3;
4779 deexcitations[j].p.push_back(kQ * nQ * pPenning);
4780 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenning));
4781 deexcitations[j].final.push_back(-1);
4782 deexcitations[j].final.push_back(-1);
4783 deexcitations[j].type.push_back(DxcTypeCollIon);
4784 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4785 deexcitations[j].nChannels += 2;
4786 }
else if (deexcitations[j].osc > 0.) {
4789 const double m1 = ElectronMassGramme / (rgas[iAr] - 1.);
4790 const double m2 = ElectronMassGramme / (rgas[iC2H2] - 1.);
4792 double mR = m1 * m2 / (m1 + m2);
4793 mR /= AtomicMassUnit;
4795 (RydbergEnergy / deexcitations[j].energy) * deexcitations[j].osc;
4797 (2 * RydbergEnergy / deexcitations[j].energy) * pacs /
4798 (4 * Pi2 * FineStructureConstant * BohrRadius * BohrRadius);
4802 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4803 std::cout <<
" Rate constant for coll. deexcitation of\n"
4804 <<
" " << level <<
" by C2H2 (W-K formula):\n"
4805 <<
" " << kQ <<
" cm3 ns-1\n";
4807 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4808 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4809 deexcitations[j].final.push_back(-1);
4810 deexcitations[j].final.push_back(-1);
4811 deexcitations[j].type.push_back(DxcTypeCollIon);
4812 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4813 deexcitations[j].nChannels += 2;
4814 }
else if (level ==
"Ar_3D6" || level ==
"Ar_3D3" || level ==
"Ar_3D4!" ||
4815 level ==
"Ar_3D4" || level ==
"Ar_3D1!!" ||
4816 level ==
"Ar_3D1!" || level ==
"Ar_3S1!!!!" ||
4817 level ==
"Ar_3S1!!" || level ==
"Ar_3S1!!!") {
4820 const double rAr3d = 436.e-10;
4821 const double rC2H2 = 165.e-10;
4823 const double sigma =
pow(rAr3d + rC2H2, 2) * Pi;
4825 const double m1 = ElectronMass / (rgas[iAr] - 1.);
4826 const double m2 = ElectronMass / (rgas[iC2H2] - 1.);
4827 const double mR = m1 * m2 / (m1 + m2);
4829 const double vel = SpeedOfLight *
sqrt(8. * BoltzmannConstant *
4831 const double kQ = sigma * vel;
4833 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4834 std::cout <<
" Rate constant for coll. deexcitation of\n"
4835 <<
" " << level <<
" by C2H2 (hard sphere):\n"
4836 <<
" " << kQ <<
" cm3 ns-1\n";
4838 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4839 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4840 deexcitations[j].final.push_back(-1);
4841 deexcitations[j].final.push_back(-1);
4842 deexcitations[j].type.push_back(DxcTypeCollIon);
4843 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4844 deexcitations[j].nChannels += 2;
4845 }
else if (level ==
"Ar_2S5" || level ==
"Ar_2S3") {
4848 const double rAr5s = 635.e-10;
4849 const double rC2H2 = 165.e-10;
4851 const double sigma =
pow(rAr5s + rC2H2, 2) * Pi;
4853 const double m1 = ElectronMass / (rgas[iAr] - 1.);
4854 const double m2 = ElectronMass / (rgas[iC2H2] - 1.);
4855 const double mR = m1 * m2 / (m1 + m2);
4857 const double vel = SpeedOfLight *
sqrt(8. * BoltzmannConstant *
4859 const double kQ = sigma * vel;
4861 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4862 std::cout <<
" Rate constant for coll. deexcitation of\n"
4863 <<
" " << level <<
" by C2H2 (hard sphere):\n"
4864 <<
" " << kQ <<
" cm3 ns-1\n";
4866 deexcitations[j].p.push_back(kQ * nQ * pPenningWK);
4867 deexcitations[j].p.push_back(kQ * nQ * (1. - pPenningWK));
4868 deexcitations[j].final.push_back(-1);
4869 deexcitations[j].final.push_back(-1);
4870 deexcitations[j].type.push_back(DxcTypeCollIon);
4871 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4872 deexcitations[j].nChannels += 2;
4876 if (withAr && withCF4) {
4879 for (
int j = nDeexcitations; j--;) {
4880 std::string level = deexcitations[j].label;
4882 double pacs = 0., eta = 0.;
4883 if (!optData.GetPhotoabsorptionCrossSection(
4884 "CF4", deexcitations[j].energy, pacs, eta)) {
4887 if (level ==
"Ar_1S5") {
4889 const double kQ = 0.33e-19;
4890 deexcitations[j].p.push_back(kQ * nQ);
4891 deexcitations[j].final.push_back(-1);
4892 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4893 deexcitations[j].nChannels += 1;
4894 }
else if (level ==
"Ar_1S3") {
4896 const double kQ = 0.26e-19;
4897 deexcitations[j].p.push_back(kQ * nQ);
4898 deexcitations[j].final.push_back(-1);
4899 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4900 deexcitations[j].nChannels += 1;
4901 }
else if (level ==
"Ar_2P8") {
4903 const double kQ = 1.7e-19;
4904 deexcitations[j].p.push_back(kQ * nQ);
4905 deexcitations[j].final.push_back(-1);
4906 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4907 deexcitations[j].nChannels += 1;
4908 }
else if (level ==
"Ar_2P6") {
4910 const double kQ = 1.7e-19;
4911 deexcitations[j].p.push_back(kQ * nQ);
4912 deexcitations[j].final.push_back(-1);
4913 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4914 deexcitations[j].nChannels += 1;
4915 }
else if (level ==
"Ar_2P5") {
4917 const double kQ = 1.6e-19;
4918 deexcitations[j].p.push_back(kQ * nQ);
4919 deexcitations[j].final.push_back(-1);
4920 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4921 deexcitations[j].nChannels += 1;
4922 }
else if (level ==
"Ar_2P1") {
4924 const double kQ = 2.2e-19;
4925 deexcitations[j].p.push_back(kQ * nQ);
4926 deexcitations[j].final.push_back(-1);
4927 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4928 deexcitations[j].nChannels += 1;
4929 }
else if (level ==
"Ar_2P10" || level ==
"Ar_2P9" || level ==
"Ar_2P7" ||
4930 level ==
"Ar_2P4" || level ==
"Ar_2P3" || level ==
"Ar_2P2") {
4932 const double kQ = 1.8e-19;
4933 deexcitations[j].p.push_back(kQ * nQ);
4934 deexcitations[j].final.push_back(-1);
4935 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4936 deexcitations[j].nChannels += 1;
4937 }
else if (deexcitations[j].osc > 0.) {
4940 const double m1 = ElectronMassGramme / (rgas[iAr] - 1.);
4941 const double m2 = ElectronMassGramme / (rgas[iCF4] - 1.);
4943 double mR = m1 * m2 / (m1 + m2);
4944 mR /= AtomicMassUnit;
4946 (RydbergEnergy / deexcitations[j].energy) * deexcitations[j].osc;
4948 (2 * RydbergEnergy / deexcitations[j].energy) * pacs /
4949 (4 * Pi2 * FineStructureConstant * BohrRadius * BohrRadius);
4953 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4954 std::cout <<
" Rate constant for coll. deexcitation of\n"
4955 <<
" " << level <<
" by CF4 (W-K formula):\n"
4956 <<
" " << kQ <<
" cm3 ns-1\n";
4958 deexcitations[j].p.push_back(kQ * nQ);
4959 deexcitations[j].final.push_back(-1);
4960 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4961 deexcitations[j].nChannels += 1;
4962 }
else if (level ==
"Ar_3D6" || level ==
"Ar_3D3" || level ==
"Ar_3D4!" ||
4963 level ==
"Ar_3D4" || level ==
"Ar_3D1!!" ||
4964 level ==
"Ar_3D1!" || level ==
"Ar_3S1!!!!" ||
4965 level ==
"Ar_3S1!!" || level ==
"Ar_3S1!!!") {
4968 const double rAr3d = 436.e-10;
4969 const double rCF4 = 235.e-10;
4971 const double sigma =
pow(rAr3d + rCF4, 2) * Pi;
4973 const double m1 = ElectronMass / (rgas[iAr] - 1.);
4974 const double m2 = ElectronMass / (rgas[iCF4] - 1.);
4975 const double mR = m1 * m2 / (m1 + m2);
4977 const double vel = SpeedOfLight *
sqrt(8. * BoltzmannConstant *
4979 const double kQ = sigma * vel;
4981 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
4982 std::cout <<
" Rate constant for coll. deexcitation of\n"
4983 <<
" " << level <<
" by CF4 (hard sphere):\n"
4984 <<
" " << kQ <<
" cm3 ns-1\n";
4986 deexcitations[j].p.push_back(kQ * nQ);
4987 deexcitations[j].final.push_back(-1);
4988 deexcitations[j].type.push_back(DxcTypeCollNonIon);
4989 deexcitations[j].nChannels += 1;
4990 }
else if (level ==
"Ar_2S5" || level ==
"Ar_2S3") {
4993 const double rAr5s = 635.e-10;
4994 const double rCF4 = 190.e-10;
4996 const double sigma =
pow(rAr5s + rCF4, 2) * Pi;
4998 const double m1 = ElectronMass / (rgas[iAr] - 1.);
4999 const double m2 = ElectronMass / (rgas[iCF4] - 1.);
5000 const double mR = m1 * m2 / (m1 + m2);
5002 const double vel = SpeedOfLight *
sqrt(8. * BoltzmannConstant *
5004 const double kQ = sigma * vel;
5006 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
5007 std::cout <<
" Rate constant for coll. deexcitation of\n"
5008 <<
" " << level <<
" by CF4 (hard sphere):\n"
5009 <<
" " << kQ <<
" cm3 ns-1\n";
5011 deexcitations[j].p.push_back(kQ * nQ);
5012 deexcitations[j].final.push_back(-1);
5013 deexcitations[j].type.push_back(DxcTypeCollNonIon);
5014 deexcitations[j].nChannels += 1;
5019 if ((
m_debug || verbose) && nDeexcitations > 0) {
5020 std::cout <<
m_className <<
"::ComputeDeexcitationTable:\n";
5021 std::cout <<
" Level Energy [eV] "
5022 <<
" Lifetimes [ns]\n";
5024 <<
" Total Radiative "
5025 <<
" Collisional\n";
5027 <<
" Ionisation Transfer Loss\n";
5030 for (
int i = 0; i < nDeexcitations; ++i) {
5032 deexcitations[i].rate = 0.;
5034 double fCollIon = 0., fCollTransfer = 0., fCollLoss = 0.;
5035 for (
int j = deexcitations[i].nChannels; j--;) {
5036 deexcitations[i].rate += deexcitations[i].p[j];
5037 if (deexcitations[i].type[j] == DxcTypeRad) {
5038 fRad += deexcitations[i].p[j];
5039 }
else if (deexcitations[i].type[j] == DxcTypeCollIon) {
5040 fCollIon += deexcitations[i].p[j];
5041 }
else if (deexcitations[i].type[j] == DxcTypeCollNonIon) {
5042 if (deexcitations[i].
final[j] < 0) {
5043 fCollLoss += deexcitations[i].p[j];
5045 fCollTransfer += deexcitations[i].p[j];
5048 std::cerr <<
m_className <<
"::ComputeDeexcitationTable:\n";
5049 std::cerr <<
" Unknown type of deexcitation channel (level "
5050 << deexcitations[i].label <<
")\n";
5051 std::cerr <<
" Program bug!\n";
5054 if (deexcitations[i].rate > 0.) {
5057 std::cout << std::setw(12) << deexcitations[i].label <<
" "
5058 << std::fixed << std::setprecision(3) << std::setw(7)
5059 << deexcitations[i].energy <<
" " << std::setw(10)
5060 << 1. / deexcitations[i].rate <<
" ";
5062 std::cout << std::fixed << std::setprecision(3) << std::setw(10)
5063 << 1. / fRad <<
" ";
5065 std::cout <<
"---------- ";
5067 if (fCollIon > 0.) {
5068 std::cout << std::fixed << std::setprecision(3) << std::setw(10)
5069 << 1. / fCollIon <<
" ";
5071 std::cout <<
"---------- ";
5073 if (fCollTransfer > 0.) {
5074 std::cout << std::fixed << std::setprecision(3) << std::setw(10)
5075 << 1. / fCollTransfer <<
" ";
5077 std::cout <<
"---------- ";
5079 if (fCollLoss > 0.) {
5080 std::cout << std::fixed << std::setprecision(3) << std::setw(10)
5081 << 1. / fCollLoss <<
"\n";
5083 std::cout <<
"---------- \n";
5087 for (
int j = 0; j < deexcitations[i].nChannels; ++j) {
5088 deexcitations[i].p[j] /= deexcitations[i].rate;
5089 if (j > 0) deexcitations[i].p[j] += deexcitations[i].p[j - 1];
5097 if (!useDeexcitation) {
5098 std::cerr <<
m_className <<
"::ComputeDeexcitation:\n";
5099 std::cerr <<
" Deexcitation is disabled.\n";
5106 std::cerr <<
m_className <<
"::ComputeDeexcitation:\n";
5107 std::cerr <<
" Error calculating the collision rates table.\n";
5113 if (iLevel < 0 || iLevel >= nTerms) {
5114 std::cerr <<
m_className <<
"::ComputeDeexcitation:\n";
5115 std::cerr <<
" Level index is out of range.\n";
5119 iLevel = iDeexcitation[iLevel];
5120 if (iLevel < 0 || iLevel >= nDeexcitations) {
5121 std::cerr <<
m_className <<
"::ComputeDeexcitation:\n";
5122 std::cerr <<
" Level is not deexcitable.\n";
5126 ComputeDeexcitationInternal(iLevel, fLevel);
5127 if (fLevel >= 0 && fLevel < nDeexcitations) {
5128 fLevel = deexcitations[fLevel].level;
5132void MediumMagboltz::ComputeDeexcitationInternal(
int iLevel,
int& fLevel) {
5134 nDeexcitationProducts = 0;
5135 dxcProducts.clear();
5142 while (iLevel >= 0 && iLevel < nDeexcitations) {
5143 if (deexcitations[iLevel].rate <= 0. ||
5144 deexcitations[iLevel].nChannels <= 0) {
5150 newDxcProd.t += -log(
RndmUniformPos()) / deexcitations[iLevel].rate;
5153 int type = DxcTypeRad;
5155 for (
int j = 0; j < deexcitations[iLevel].nChannels; ++j) {
5156 if (r <= deexcitations[iLevel].p[j]) {
5157 fLevel = deexcitations[iLevel].final[j];
5158 type = deexcitations[iLevel].type[j];
5162 if (type == DxcTypeRad) {
5164 newDxcProd.type = DxcProdTypePhoton;
5165 newDxcProd.energy = deexcitations[iLevel].energy;
5168 newDxcProd.energy -= deexcitations[fLevel].energy;
5169 if (newDxcProd.energy < Small) newDxcProd.energy = Small;
5170 dxcProducts.push_back(newDxcProd);
5171 ++nDeexcitationProducts;
5176 double delta =
RndmVoigt(0., deexcitations[iLevel].sDoppler,
5177 deexcitations[iLevel].gPressure);
5178 while (newDxcProd.energy + delta < Small ||
5179 fabs(delta) >= deexcitations[iLevel].width) {
5180 delta =
RndmVoigt(0., deexcitations[iLevel].sDoppler,
5181 deexcitations[iLevel].gPressure);
5183 newDxcProd.energy += delta;
5184 dxcProducts.push_back(newDxcProd);
5185 ++nDeexcitationProducts;
5190 }
else if (type == DxcTypeCollIon) {
5192 newDxcProd.type = DxcProdTypeElectron;
5193 newDxcProd.energy = deexcitations[iLevel].energy;
5196 newDxcProd.energy -= deexcitations[fLevel].energy;
5197 if (newDxcProd.energy < Small) newDxcProd.energy = Small;
5199 dxcProducts.push_back(newDxcProd);
5200 ++nDeexcitationProducts;
5205 newDxcProd.energy -= minIonPot;
5206 if (newDxcProd.energy < Small) newDxcProd.energy = Small;
5208 dxcProducts.push_back(newDxcProd);
5209 ++nDeexcitationProducts;
5214 }
else if (type == DxcTypeCollNonIon) {
5218 std::cerr <<
m_className <<
"::ComputeDeexcitationInternal:\n";
5219 std::cerr <<
" Unknown deexcitation channel type (" << type <<
").\n";
5220 std::cerr <<
" Program bug!\n";
5228bool MediumMagboltz::ComputePhotonCollisionTable(
const bool verbose) {
5239 cfTotGamma.resize(nEnergyStepsGamma, 0.);
5241 cfGamma.resize(nEnergyStepsGamma);
5242 for (
int j = nEnergyStepsGamma; j--;) cfGamma[j].clear();
5243 csTypeGamma.clear();
5247 const double prefactor = dens * SpeedOfLight *
fraction[i];
5249 std::string gasname =
gas[i];
5250 if (gasname ==
"iC4H10") {
5253 std::cout <<
m_className <<
"::ComputePhotonCollisionTable:\n";
5254 std::cout <<
" Photoabsorption cross-section for "
5255 <<
"iC4H10 not available.\n";
5256 std::cout <<
" Using n-butane cross-section instead.\n";
5259 if (!data.IsAvailable(gasname))
return false;
5260 csTypeGamma.push_back(i * nCsTypesGamma + PhotonCollisionTypeIonisation);
5261 csTypeGamma.push_back(i * nCsTypesGamma + PhotonCollisionTypeInelastic);
5263 for (
int j = 0; j < nEnergyStepsGamma; ++j) {
5265 data.GetPhotoabsorptionCrossSection(gasname, (j + 0.5) * eStepGamma, cs,
5267 cfTotGamma[j] += cs * prefactor;
5269 cfGamma[j].push_back(cs * prefactor * eta);
5271 cfGamma[j].push_back(cs * prefactor * (1. - eta));
5277 std::ofstream csfile;
5278 csfile.open(
"csgamma.txt", std::ios::out);
5279 for (
int j = 0; j < nEnergyStepsGamma; ++j) {
5280 csfile << (j + 0.5) * eStepGamma <<
" ";
5281 for (
int i = 0; i < nPhotonTerms; ++i) csfile << cfGamma[j][i] <<
" ";
5288 for (
int j = 0; j < nEnergyStepsGamma; ++j) {
5289 for (
int i = 0; i < nPhotonTerms; ++i) {
5290 if (i > 0) cfGamma[j][i] += cfGamma[j][i - 1];
5295 std::cout <<
m_className <<
"::ComputePhotonCollisionTable:\n";
5296 std::cout <<
" Energy [eV] Mean free path [um]\n";
5297 for (
int i = 0; i < 10; ++i) {
5299 cfTotGamma[(2 * i + 1) * nEnergyStepsGamma / 20] / SpeedOfLight;
5300 std::cout <<
" " << std::fixed << std::setw(10) << std::setprecision(2)
5301 << (2 * i + 1) * eFinalGamma / 20 <<
" " << std::setw(18)
5302 << std::setprecision(4);
5304 std::cout << 1.e4 / imfp <<
"\n";
5306 std::cout <<
"------------\n";
5309 std::cout << std::resetiosflags(std::ios_base::floatfield);
5312 if (!useDeexcitation)
return true;
5316 FineStructureConstant * 2 * Pi2 * HbarC * HbarC / ElectronMass;
5318 int nResonanceLines = 0;
5319 for (
int i = 0; i < nDeexcitations; ++i) {
5320 if (deexcitations[i].osc < Small)
continue;
5321 const double prefactor =
5322 dens * SpeedOfLight *
fraction[deexcitations[i].gas];
5323 deexcitations[i].cf = prefactor * f2cs * deexcitations[i].osc;
5325 const double mgas = ElectronMass / (rgas[deexcitations[i].gas] - 1.);
5327 deexcitations[i].sDoppler = wDoppler * deexcitations[i].energy;
5331 const double kResBroad = 1.92 * Pi *
sqrt(1. / 3.);
5332 deexcitations[i].gPressure = kResBroad * FineStructureConstant *
5333 pow(HbarC, 3) * deexcitations[i].osc * dens *
5335 (ElectronMass * deexcitations[i].energy);
5343 const double fwhmGauss = deexcitations[i].sDoppler *
sqrt(2. * log(2.));
5344 const double fwhmLorentz = deexcitations[i].gPressure;
5345 const double fwhmVoigt =
5346 0.5 * (1.0692 * fwhmLorentz +
sqrt(0.86639 * fwhmLorentz * fwhmLorentz +
5347 4 * fwhmGauss * fwhmGauss));
5348 deexcitations[i].width = nWidths * fwhmVoigt;
5352 if (nResonanceLines <= 0) {
5353 std::cerr <<
m_className <<
"::ComputePhotonCollisionTable:\n";
5354 std::cerr <<
" No resonance lines found.\n";
5359 std::cout <<
m_className <<
"::ComputePhotonCollisionTable:\n";
5360 std::cout <<
" Discrete absorption lines:\n";
5361 std::cout <<
" Energy [eV] Line width (FWHM) [eV] "
5362 <<
" Mean free path [um]\n";
5363 std::cout <<
" Doppler Pressure "
5365 for (
int i = 0; i < nDeexcitations; ++i) {
5366 if (deexcitations[i].osc < Small)
continue;
5367 const double imfpP = (deexcitations[i].cf / SpeedOfLight) *
5368 TMath::Voigt(0., deexcitations[i].sDoppler,
5369 2 * deexcitations[i].gPressure);
5370 std::cout <<
" " << std::fixed << std::setw(6)
5371 << std::setprecision(3) << deexcitations[i].energy <<
" +/- "
5372 << std::scientific << std::setprecision(1)
5373 << deexcitations[i].width <<
" " << std::setprecision(2)
5374 << 2 *
sqrt(2 * log(2.)) * deexcitations[i].sDoppler <<
" "
5375 << std::scientific << std::setprecision(3)
5376 << 2 * deexcitations[i].gPressure <<
" " << std::fixed
5377 << std::setw(10) << std::setprecision(4);
5379 std::cout << 1.e4 / imfpP;
5381 std::cout <<
"----------";
5391 const double btheta,
const int ncoll,
5392 bool verbose,
double& vx,
double& vy,
5393 double& vz,
double& dl,
double& dt,
5394 double& alpha,
double& eta,
double& vxerr,
5395 double& vyerr,
double& vzerr,
double& dlerr,
5396 double& dterr,
double& alphaerr,
5397 double& etaerr,
double& alphatof) {
5402 alpha = eta = alphatof = 0.;
5403 vxerr = vyerr = vzerr = 0.;
5405 alphaerr = etaerr = 0.;
5426 if (!GetGasNumberMagboltz(
gas[i], ng)) {
5428 std::cerr <<
" Gas " <<
gas[i] <<
" has no corresponding"
5429 <<
" gas number in Magboltz.\n";
5448 long long ielow = 1;
5449 while (ielow == 1) {
5451 if (bmag == 0. || btheta == 0. ||
fabs(btheta) == Pi) {
5453 }
else if (btheta == HalfPi) {
5470 }
else if (btheta == 0. || btheta == Pi) {
5472 }
else if (btheta == HalfPi) {
5481 const double sstmin = 30.;
5485 bool useSST =
false;
5486 if (
fabs(alpp - attp) > sstmin || alpp > sstmin || attp > sstmin) {
5490 }
else if (btheta == 0. || btheta == Pi) {
5492 }
else if (btheta == HalfPi) {
5503 alphatof = fc1 -
sqrt(fc1 * fc1 - fc2);
5528 std::cout <<
" Results: \n";
5529 std::cout <<
" Drift velocity along E: " << std::right
5530 << std::setw(10) << std::setprecision(6) << vz <<
" cm/ns +/- "
5531 << std::setprecision(2) << vzerr <<
"%\n";
5532 std::cout <<
" Drift velocity along Bt: " << std::right
5533 << std::setw(10) << std::setprecision(6) << vx <<
" cm/ns +/- "
5534 << std::setprecision(2) << vxerr <<
"%\n";
5535 std::cout <<
" Drift velocity along ExB: " << std::right
5536 << std::setw(10) << std::setprecision(6) << vy <<
" cm/ns +/- "
5537 << std::setprecision(2) << vyerr <<
"%\n";
5538 std::cout <<
" Longitudinal diffusion: " << std::right
5539 << std::setw(10) << std::setprecision(6) << dl <<
" cm1/2 +/- "
5540 << std::setprecision(2) << dlerr <<
"%\n";
5541 std::cout <<
" Transverse diffusion: " << std::right
5542 << std::setw(10) << std::setprecision(6) << dt <<
" cm1/2 +/- "
5543 << std::setprecision(2) << dterr <<
"%\n";
5545 std::cout <<
" Townsend coefficient (SST): " << std::right
5546 << std::setw(10) << std::setprecision(6) << alpha
5547 <<
" cm-1 +/- " << std::setprecision(2) << alphaerr <<
"%\n";
5548 std::cout <<
" Attachment coefficient (SST): " << std::right
5549 << std::setw(10) << std::setprecision(6) << eta <<
" cm-1 +/- "
5550 << std::setprecision(2) << etaerr <<
"%\n";
5551 std::cout <<
" Eff. Townsend coefficient (TOF): " << std::right
5552 << std::setw(10) << std::setprecision(6) << alphatof
5555 std::cout <<
" Townsend coefficient: " << std::right
5556 << std::setw(10) << std::setprecision(6) << alpha
5557 <<
" cm-1 +/- " << std::setprecision(2) << alphaerr <<
"%\n";
5558 std::cout <<
" Attachment coefficient: " << std::right
5559 << std::setw(10) << std::setprecision(6) << eta <<
" cm-1 +/- "
5560 << std::setprecision(2) << etaerr <<
"%\n";
5610 double vx = 0., vy = 0., vz = 0.;
5611 double difl = 0., dift = 0.;
5612 double alpha = 0., eta = 0.;
5613 double vxerr = 0., vyerr = 0., vzerr = 0.;
5614 double diflerr = 0., difterr = 0.;
5615 double alphaerr = 0., etaerr = 0.;
5616 double alphatof = 0.;
5619 for (
unsigned int i = 0; i <
m_nEfields; ++i) {
5620 for (
unsigned int j = 0; j <
m_nAngles; ++j) {
5621 for (
unsigned int k = 0; k <
m_nBfields; ++k) {
5623 std::cout <<
m_className <<
"::GenerateGasTable:\n";
5624 std::cout <<
" E = " <<
eFields[i] <<
" V/cm, B = " <<
bFields[k]
5625 <<
" T, angle: " <<
bAngles[j] <<
" rad\n";
5628 vy, vz, difl, dift, alpha, eta, vxerr, vyerr, vzerr,
5629 diflerr, difterr, alphaerr, etaerr, alphatof);
DoubleAc cos(const DoubleAc &f)
DoubleAc asin(const DoubleAc &f)
DoubleAc pow(const DoubleAc &f, double p)
DoubleAc sqrt(const DoubleAc &f)
DoubleAc sin(const DoubleAc &f)
DoubleAc acos(const DoubleAc &f)
DoubleAc exp(const DoubleAc &f)
DoubleAc fabs(const DoubleAc &f)
std::vector< ionListElement > ionisationList
std::vector< std::vector< std::vector< std::vector< double > > > > tabIonRates
bool GetGasName(const int gasnumber, const int version, std::string &gasname)
std::vector< std::vector< std::vector< double > > > tabTownsendNoPenning
double lambdaPenningGas[m_nMaxGases]
double lambdaPenningGlobal
double fraction[m_nMaxGases]
std::vector< std::vector< std::vector< std::vector< double > > > > tabExcRates
std::string gas[m_nMaxGases]
static const unsigned int m_nMaxGases
double rPenningGas[m_nMaxGases]
std::vector< excListElement > excitationList
double GetNumberDensity() const
void SetSplittingFunctionGreenSawada()
int GetNumberOfPhotonCollisions() const
void SetExcitationScalingFactor(const double r, std::string gasname)
bool GetDeexcitationProduct(const int i, double &t, double &s, int &type, double &energy)
bool GetIonisationProduct(const int i, int &type, double &energy)
void ResetCollisionCounters()
void EnableRadiationTrapping()
void EnablePenningTransfer(const double r, const double lambda)
void ComputeDeexcitation(int iLevel, int &fLevel)
void SetSplittingFunctionOpalBeaty()
double GetPhotonCollisionRate(const double &e)
void GenerateGasTable(const int numCollisions=10, const bool verbose=true)
void SetSplittingFunctionFlat()
bool SetMaxPhotonEnergy(const double e)
bool GetElectronCollision(const double e, int &type, int &level, double &e1, double &dx, double &dy, double &dz, int &nion, int &ndxc, int &band)
double GetElectronNullCollisionRate(const int band)
bool Initialise(const bool verbose=false)
bool GetLevel(const int i, int &ngas, int &type, std::string &descr, double &e)
bool SetMaxElectronEnergy(const double e)
int GetNumberOfElectronCollisions() const
void RunMagboltz(const double e, const double b, const double btheta, const int ncoll, bool verbose, double &vx, double &vy, double &vz, double &dl, double &dt, double &alpha, double &eta, double &vxerr, double &vyerr, double &vzerr, double &dlerr, double &dterr, double &alphaerr, double &etaerr, double &alphatof)
double GetElectronCollisionRate(const double e, const int band)
void EnableDeexcitation()
void DisablePenningTransfer()
bool GetPhotonCollision(const double e, int &type, int &level, double &e1, double &ctheta, int &nsec, double &esec)
bool m_hasElectronDiffTrans
bool m_hasElectronTownsend
std::vector< double > bFields
std::vector< std::vector< std::vector< double > > > tabElectronVelocityB
bool m_hasElectronVelocityB
std::vector< double > eFields
std::vector< std::vector< std::vector< double > > > tabElectronVelocityE
std::vector< double > bAngles
std::vector< std::vector< std::vector< double > > > tabElectronDiffLong
std::vector< std::vector< std::vector< double > > > tabElectronAttachment
virtual void EnableDrift()
bool m_hasElectronVelocityExB
bool m_hasElectronDiffLong
virtual void EnablePrimaryIonisation()
void InitParamArrays(const unsigned int &eRes, const unsigned int &bRes, const unsigned int &aRes, std::vector< std::vector< std::vector< double > > > &tab, const double &val)
unsigned int m_nComponents
bool m_hasIonDissociation
bool m_hasElectronVelocityE
std::vector< std::vector< std::vector< double > > > tabElectronTownsend
bool m_hasElectronAttachment
std::vector< std::vector< std::vector< double > > > tabElectronDiffTrans
std::vector< std::vector< std::vector< double > > > tabElectronVelocityExB
void gasmix_(long long *ngs, double *q, double *qin, long long *nin, double *e, double *ei, char *name, double *virl, double *eb, double *peqel, double *peqin, double *penfra, long long *kel, long long *kin, double *qion, double *peqion, double *eion, long long *nion, char scrpt[260][50])
struct Garfield::Magboltz::@5 ratio_
struct Garfield::Magboltz::@12 ctowns_
void elimitc_(long long *ielow)
struct Garfield::Magboltz::@13 ctwner_
struct Garfield::Magboltz::@4 gasn_
struct Garfield::Magboltz::@0 bfld_
struct Garfield::Magboltz::@7 velerr_
struct Garfield::Magboltz::@2 setp_
void elimit_(long long *ielow)
struct Garfield::Magboltz::@1 inpt_
void elimitb_(long long *ielow)
struct Garfield::Magboltz::@3 cnsts_
struct Garfield::Magboltz::@14 tofout_
struct Garfield::Magboltz::@10 difvel_
struct Garfield::Magboltz::@6 vel_
struct Garfield::Magboltz::@11 diferl_
double RndmVoigt(const double mu, const double sigma, const double gamma)