File indexing completed on 2025-01-18 09:58:00
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 #ifndef G4_CASCADE_DATA_ICC
0040 #define G4_CASCADE_DATA_ICC
0041
0042 #include "G4InuclParticleNames.hh"
0043 #include <iostream>
0044 #include <iomanip>
0045
0046
0047
0048 template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8,int N9>
0049 void G4CascadeData<NE,N2,N3,N4,N5,N6,N7,N8,N9>::initialize() {
0050
0051 index[0] = 0; index[1] = N02; index[2] = N23; index[3] = N24;
0052 index[4] = N25; index[5] = N26; index[6] = N27; index[7] = N28;
0053 index[8] = N29;
0054
0055
0056 for (G4int im = 0; im < NM; im++) {
0057 G4int start = index[im];
0058 G4int stop = index[im+1];
0059 for (G4int k = 0; k < NE; k++) {
0060 multiplicities[im][k] = 0.0;
0061 for (G4int i = start; i < stop; i++) {
0062 multiplicities[im][k] += crossSections[i][k];
0063 }
0064 }
0065 }
0066
0067
0068 for (G4int k = 0; k < NE; k++) {
0069 sum[k] = 0.0;
0070 for (G4int im = 0; im < NM; im++) {
0071 sum[k] += multiplicities[im][k];
0072 }
0073 }
0074
0075
0076 G4int i2b = 0;
0077 for (i2b=index[0]; i2b<index[1]; i2b++) {
0078 if (x2bfs[i2b][0]*x2bfs[i2b][1] == initialState) break;
0079 }
0080
0081 for (G4int k = 0; k < NE; k++) {
0082 if (i2b<index[1]) inelastic[k] = tot[k] - crossSections[i2b][k];
0083 else inelastic[k] = tot[k];
0084 }
0085 }
0086
0087
0088
0089 template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8,int N9>
0090 void G4CascadeData<NE,N2,N3,N4,N5,N6,N7,N8,N9>::print(std::ostream& os) const {
0091 os << "\n " << name << " Total cross section:" << G4endl;
0092 printXsec(tot, os);
0093 os << "\n Summed cross section:" << G4endl;
0094 printXsec(sum, os);
0095 os << "\n Inelastic cross section:" << G4endl;
0096 printXsec(inelastic, os);
0097 os << "\n Individual channel cross sections" << G4endl;
0098
0099 for (int im=2; im<NM+2; im++) print(im, os);
0100 return;
0101 }
0102
0103
0104 template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8,int N9>
0105 void G4CascadeData<NE,N2,N3,N4,N5,N6,N7,N8,N9>::
0106 print(G4int mult, std::ostream& os) const {
0107 if (mult < 0) {
0108 print(os);
0109 return;
0110 }
0111
0112 G4int im = mult-2;
0113
0114 G4int start = index[im];
0115 G4int stop = index[im+1];
0116 os << "\n Mulitplicity " << mult << " (indices " << start << " to "
0117 << stop-1 << ") summed cross section:" << G4endl;
0118
0119 printXsec(multiplicities[im], os);
0120
0121 for (G4int i=start; i<stop; i++) {
0122 G4int ichan=i-start;
0123 os << "\n final state x" << mult << "bfs[" << ichan << "] : ";
0124 for (G4int fsi=0; fsi<mult; fsi++) {
0125 switch (mult) {
0126 case 2: os << " " << G4InuclParticleNames::nameShort(x2bfs[ichan][fsi]);
0127 break;
0128 case 3: os << " " << G4InuclParticleNames::nameShort(x3bfs[ichan][fsi]);
0129 break;
0130 case 4: os << " " << G4InuclParticleNames::nameShort(x4bfs[ichan][fsi]);
0131 break;
0132 case 5: os << " " << G4InuclParticleNames::nameShort(x5bfs[ichan][fsi]);
0133 break;
0134 case 6: os << " " << G4InuclParticleNames::nameShort(x6bfs[ichan][fsi]);
0135 break;
0136 case 7: os << " " << G4InuclParticleNames::nameShort(x7bfs[ichan][fsi]);
0137 break;
0138 case 8: os << " " << G4InuclParticleNames::nameShort(x8bfs[ichan][fsi]);
0139 break;
0140 case 9: os << " " << G4InuclParticleNames::nameShort(x9bfs[ichan][fsi]);
0141 break;
0142 default: ;
0143 }
0144 }
0145 os << " -- cross section [" << i << "]:" << G4endl;
0146 printXsec(crossSections[i], os);
0147 }
0148 }
0149
0150
0151 template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8,int N9>
0152 void G4CascadeData<NE,N2,N3,N4,N5,N6,N7,N8,N9>::
0153 printXsec(const G4double (&xsec)[NE], std::ostream& os) const {
0154 for (G4int k=0; k<NE; k++) {
0155 os << " " << std::setw(6) << xsec[k];
0156 if ((k+1)%10 == 0) os << G4endl;
0157 }
0158 os << G4endl;
0159 }
0160
0161 #endif