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
0040
0041
0042
0043 #ifndef G4_CASCADE_DATA_HH
0044 #define G4_CASCADE_DATA_HH
0045
0046 #include "globals.hh"
0047 #include "G4CascadeSampler.hh" /* To get number of energy bins */
0048 #include "G4String.hh"
0049
0050
0051 template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8=0,int N9=0>
0052 struct G4CascadeData
0053 {
0054
0055 enum { N02=N2, N23=N2+N3, N24=N23+N4, N25=N24+N5, N26=N25+N6, N27=N26+N7,
0056 N28=N27+N8, N29=N28+N9 };
0057
0058 enum { N8D=N8?N8:1, N9D=N9?N9:1 };
0059
0060 enum { NM=N9?8:N8?7:6, NXS=N29 };
0061
0062 G4int index[9];
0063 G4double multiplicities[NM][NE];
0064
0065 const G4int (&x2bfs)[N2][2];
0066 const G4int (&x3bfs)[N3][3];
0067 const G4int (&x4bfs)[N4][4];
0068 const G4int (&x5bfs)[N5][5];
0069 const G4int (&x6bfs)[N6][6];
0070 const G4int (&x7bfs)[N7][7];
0071 const G4int (&x8bfs)[N8D][8];
0072 const G4int (&x9bfs)[N9D][9];
0073 const G4double (&crossSections)[NXS][NE];
0074
0075 G4double sum[NE];
0076 const G4double (&tot)[NE];
0077
0078 G4double inelastic[NE];
0079
0080 static const G4int empty8bfs[1][8];
0081 static const G4int empty9bfs[1][9];
0082
0083 const G4String name;
0084 const G4int initialState;
0085
0086 G4int maxMultiplicity() const { return NM+1; }
0087
0088
0089 void print(std::ostream& os=G4cout) const;
0090 void print(G4int mult, std::ostream& os) const;
0091 void printXsec(const G4double (&xsec)[NE], std::ostream& os) const;
0092
0093
0094 G4CascadeData(const G4int (&the2bfs)[N2][2], const G4int (&the3bfs)[N3][3],
0095 const G4int (&the4bfs)[N4][4], const G4int (&the5bfs)[N5][5],
0096 const G4int (&the6bfs)[N6][6], const G4int (&the7bfs)[N7][7],
0097 const G4double (&xsec)[NXS][NE], G4int ini,
0098 const G4String& aName="G4CascadeData")
0099 : x2bfs(the2bfs), x3bfs(the3bfs), x4bfs(the4bfs), x5bfs(the5bfs),
0100 x6bfs(the6bfs), x7bfs(the7bfs), x8bfs(empty8bfs), x9bfs(empty9bfs),
0101 crossSections(xsec), tot(sum), name(aName), initialState(ini) {
0102 initialize();
0103 }
0104
0105
0106 G4CascadeData(const G4int (&the2bfs)[N2][2], const G4int (&the3bfs)[N3][3],
0107 const G4int (&the4bfs)[N4][4], const G4int (&the5bfs)[N5][5],
0108 const G4int (&the6bfs)[N6][6], const G4int (&the7bfs)[N7][7],
0109 const G4double (&xsec)[NXS][NE], const G4double (&theTot)[NE],
0110 G4int ini, const G4String& aName="G4CascadeData")
0111 : x2bfs(the2bfs), x3bfs(the3bfs), x4bfs(the4bfs), x5bfs(the5bfs),
0112 x6bfs(the6bfs), x7bfs(the7bfs), x8bfs(empty8bfs), x9bfs(empty9bfs),
0113 crossSections(xsec), tot(theTot), name(aName), initialState(ini) {
0114 initialize();
0115 }
0116
0117
0118 G4CascadeData(const G4int (&the2bfs)[N2][2], const G4int (&the3bfs)[N3][3],
0119 const G4int (&the4bfs)[N4][4], const G4int (&the5bfs)[N5][5],
0120 const G4int (&the6bfs)[N6][6], const G4int (&the7bfs)[N7][7],
0121 const G4int (&the8bfs)[N8D][8], const G4int (&the9bfs)[N9D][9],
0122 const G4double (&xsec)[NXS][NE], G4int ini,
0123 const G4String& aName="G4CascadeData")
0124 : x2bfs(the2bfs), x3bfs(the3bfs), x4bfs(the4bfs), x5bfs(the5bfs),
0125 x6bfs(the6bfs), x7bfs(the7bfs), x8bfs(the8bfs), x9bfs(the9bfs),
0126 crossSections(xsec), tot(sum), name(aName), initialState(ini) {
0127 initialize();
0128 }
0129
0130
0131 G4CascadeData(const G4int (&the2bfs)[N2][2], const G4int (&the3bfs)[N3][3],
0132 const G4int (&the4bfs)[N4][4], const G4int (&the5bfs)[N5][5],
0133 const G4int (&the6bfs)[N6][6], const G4int (&the7bfs)[N7][7],
0134 const G4int (&the8bfs)[N8D][8], const G4int (&the9bfs)[N9D][9],
0135 const G4double (&xsec)[NXS][NE], const G4double (&theTot)[NE],
0136 G4int ini, const G4String& aName="G4CascadeData")
0137 : x2bfs(the2bfs), x3bfs(the3bfs), x4bfs(the4bfs), x5bfs(the5bfs),
0138 x6bfs(the6bfs), x7bfs(the7bfs), x8bfs(the8bfs), x9bfs(the9bfs),
0139 crossSections(xsec), tot(theTot), name(aName), initialState(ini) {
0140 initialize();
0141 }
0142
0143 void initialize();
0144 };
0145
0146
0147 template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8,int N9>
0148 const G4int G4CascadeData<NE,N2,N3,N4,N5,N6,N7,N8,N9>::empty8bfs[1][8] = {{0}};
0149
0150 template <int NE,int N2,int N3,int N4,int N5,int N6,int N7,int N8,int N9>
0151 const G4int G4CascadeData<NE,N2,N3,N4,N5,N6,N7,N8,N9>::empty9bfs[1][9] = {{0}};
0152
0153
0154 #include "G4CascadeData.icc"
0155
0156 #endif