35 {
36
37 G4int nMeson(0), nBaryon(0), npi0(0), ngamma(0), nLepton(0);
42 {
44 }
45
47 {
49 {
50 maxE = i;
52 }
53 }
54
56 {
58 if(i==maxE)
59 {
60 }
62 {
63 nBaryon++;
64 }
66 {
67 nLepton++;
68 }
70 {
71 ngamma++;
72 }
74 {
75 npi0++;
76 }
77 else
78 {
79 nMeson++;
80 }
81 }
82
83
94
95 std::vector<G4HadSecondary> buffer;
96 G4int cMeson(0), cBaryon(0), cpi0(0), cgamma(0), cLepton(0);
98 {
103 if(i==maxE)
104 {
105 aCatch = true;
106 weight = 1;
107 }
109 {
110 if(++cBaryon==randomBaryon)
111 {
112 aCatch = true;
113 weight = baryonWeight;
114 }
115 }
117 {
118 if(++cLepton==randomLepton)
119 {
120 aCatch = true;
121 weight = leptonWeight;
122 }
123 }
125 {
126 if(++cgamma==randomGamma)
127 {
128 aCatch = true;
129 weight = gammaWeight;
130 }
131 }
133 {
134 if(++cpi0==randomPi0)
135 {
136 aCatch = true;
137 weight = npi0Weight;
138 }
139 }
140 else
141 {
142 if(++cMeson==randomMeson)
143 {
144 aCatch = true;
145 weight = mesonWeight;
146 }
147 }
148 if(aCatch)
149 {
150 buffer.push_back(*aSecTrack);
151 buffer.back().SetWeight(aSecTrack->
GetWeight()*weight);
152 }
153 else
154 {
155 delete aSecTrack;
156 }
157 }
159
161
162
163 return result;
164 }
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double GetEnergyChange() const
G4HadFinalStateStatus GetStatusChange() const
void AddSecondaries(const std::vector< G4HadSecondary > &addSecs)
std::size_t GetNumberOfSecondaries() const
G4HadSecondary * GetSecondary(size_t i)
G4DynamicParticle * GetParticle()
G4double GetWeight() const
G4int GetLeptonNumber() const
G4int GetBaryonNumber() const
static G4PionZero * PionZero()