62 {
63
66
68
69
74 theNeutron.SetKineticEnergy( eKinetic );
75
76
80 if (targetMass < 500*MeV) targetMass =
87
88
89 theNeutron.Lorentz(theNeutron, theTarget);
90 eKinetic = theNeutron.GetKineticEnergy();
91
92
95 {
96
97 if ( hasExactMF6 ) {
100 thePhotons = theMF6FinalState.
Sample( eKinetic );
101 } else {
102 thePhotons = theFinalStatePhotons.
GetPhotons(eKinetic);
103 }
104 if ( thePhotons == NULL ) {
105 throw G4HadronicException(__FILE__, __LINE__,
"Final state data for photon is not properly allocated");
106 }
107 }
108 else
109 {
110
115
119 for(auto it=products->cbegin(); it!=products->cend(); ++it)
120 {
122
123 if ( (*it)->GetParticleDefinition() != 0 )
125 else
127
128
129
131 if ( (*it)->GetMomentum().mag() > 10*MeV)
133
134 if ( (*it)->GetExcitationEnergy() > 1.0e-2*eV) {
135 G4double ex = (*it)->GetExcitationEnergy();
138 aPhoton->
SetMomentum( (*it)->GetMomentum().vect().unit() * ex );
139
140 thePhotons->push_back(aPhoton);
141 }
142
143 theOne->
SetMomentum( (*it)->GetMomentum().vect() * ( (*it)->GetMomentum().t() - (*it)->GetExcitationEnergy() ) / (*it)->GetMomentum().t() ) ;
144 thePhotons->push_back(theOne);
145 delete *it;
146 }
147 delete products;
148 }
149
150
152 nPhotons=(
G4int)thePhotons->size();
153
154
156
157
158 if ( nPhotons == 0 )
159 {
162
164 G4double theta = std::acos(costheta);
167 G4ThreeVector direction(sinth*std::cos(phi), sinth*std::sin(phi), costheta);
169 thePhotons->push_back(theOne);
170 ++nPhotons;
171 }
172
173
174
175 if ( nPhotons == 1 && thePhotons->operator[](0)->GetDefinition()->GetBaryonNumber() == 0 )
176 {
178
181
182 thePhotons->operator[](0)->SetMomentum( Q*direction );
183 }
184
185 }
186
187
188 for(i=0; i<nPhotons; i++)
189 {
190 thePhotons->operator[](i)->Lorentz(*(thePhotons->operator[](i)), -1*theTarget);
191 }
192
193
194
195 if ( nPhotons == 1 && thePhotons->operator[](0)->GetDefinition()->GetBaryonNumber() == 0 )
196 {
201
202
205 -thePhotons->operator[](0)->GetMomentum();
206
207
208
209
210
211
212
213
214
215
216
219 }
220
221
222 for(i=0; i<nPhotons; i++)
223 {
224
226 theOne->
SetDefinition(thePhotons->operator[](i)->GetDefinition());
227 theOne->
SetMomentum(thePhotons->operator[](i)->GetMomentum());
229 delete thePhotons->operator[](i);
230 }
231 delete thePhotons;
232
233
237 for ( std::size_t j = 0 ; j !=
theResult.
Get()->GetNumberOfSecondaries() ; j++ )
238 {
240 }
241
242 if ( residual == false )
243 {
246 for ( std::size_t j = 0 ; j !=
theResult.
Get()->GetNumberOfSecondaries() ; j++ )
247 {
249
251 }
252
253
256
257
258 if ( nPhotons - nNonZero > 0 )
259 {
260
261 std::vector<G4double> vRand;
262 vRand.push_back( 0.0 );
263 for (
G4int j = 0 ; j != nPhotons - nNonZero - 1 ; j++ )
264 {
266 }
267 vRand.push_back( 1.0 );
268 std::sort( vRand.begin(), vRand.end() );
269
270 std::vector<G4double> vEPhoton;
271 for (
G4int j = 0 ; j < (
G4int)vRand.size() - 1 ; j++ )
272 {
273 vEPhoton.push_back( deltaE * ( vRand[j+1] - vRand[j] ) );
274 }
275 std::sort( vEPhoton.begin(), vEPhoton.end() );
276
277 for (
G4int j = 0 ; j < nPhotons - nNonZero - 1 ; j++ )
278 {
279
280
282 G4double theta = std::acos(costheta);
286 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costheta);
287
293 }
294
295
298
303 }
304
305
308 - p_photons.vect();
312
313 }
314
315
316
319 }
std::vector< G4Fragment * > G4FragmentVector
CLHEP::HepLorentzVector G4LorentzVector
std::vector< G4ReactionProduct * > G4ReactionProductVector
void Put(const value_type &val) const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4ParticleDefinition * GetDefinition() const
G4LorentzVector Get4Momentum() const
void SetMomentum(const G4ThreeVector &momentum)
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
G4HadSecondary * GetSecondary(size_t i)
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4DynamicParticle * GetParticle()
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
static G4IonTable * GetIonTable()
G4double GetIonMass(G4int Z, G4int A, G4int nL=0, G4int lvl=0) const
G4double GetTemperature() const
static G4Neutron * Neutron()
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
G4double GetPDGMass() const
void SetProjectileRP(G4ReactionProduct &aIncidentPart)
void SetTarget(G4ReactionProduct &aTarget)
G4ReactionProductVector * Sample(G4double anEnergy)
G4Cache< G4HadFinalState * > theResult
static G4ParticleHPManager * GetInstance()
G4bool GetDoNotAdjustFinalState()
G4ReactionProductVector * GetPhotons(G4double anEnergy)
void SetICM(G4bool) override
G4FragmentVector * BreakItUp(const G4Fragment &theNucleus)
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
void SetDefinitionAndUpdateE(const G4ParticleDefinition *aParticleDefinition)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)