41 #include "Geant4/G4Fragment.hh" 42 #include "Geant4/G4Gamma.hh" 43 #include "Geant4/G4IonTable.hh" 44 #include "Geant4/G4Nucleus.hh" 45 #include "Geant4/G4ParticleHPDataUsed.hh" 46 #include "Geant4/G4ParticleHPManager.hh" 47 #include "Geant4/G4PhotonEvaporation.hh" 48 #include "Geant4/G4PhysicalConstants.hh" 49 #include "Geant4/G4ReactionProduct.hh" 50 #include "Geant4/G4SystemOfUnits.hh" 56 if (theResult.Get() == NULL)
57 theResult.Put(
new G4HadFinalState);
58 theResult.Get()->Clear();
63 G4double eKinetic = theTrack.GetKineticEnergy();
64 const G4HadProjectile* incidentParticle = &theTrack;
65 G4ReactionProduct theNeutron(
66 const_cast<G4ParticleDefinition*>(incidentParticle->GetDefinition()));
67 theNeutron.SetMomentum(incidentParticle->Get4Momentum().vect());
68 theNeutron.SetKineticEnergy(eKinetic);
73 G4double eps = 0.0001;
75 targetMass = (G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA + eps),
76 static_cast<G4int>(theBaseZ + eps))) /
77 G4Neutron::Neutron()->GetPDGMass();
78 G4ThreeVector neutronVelocity =
79 1. / G4Neutron::Neutron()->GetPDGMass() * theNeutron.GetMomentum();
80 G4double temperature = theTrack.GetMaterial()->GetTemperature();
81 theTarget = aNucleus.GetBiasedThermalNucleus(
targetMass, neutronVelocity, temperature);
82 theTarget.SetDefinitionAndUpdateE(
83 G4IonTable::GetIonTable()->GetIon(G4int(theBaseZ), G4int(theBaseA), 0.0));
86 theNeutron.Lorentz(theNeutron, theTarget);
87 eKinetic = theNeutron.GetKineticEnergy();
90 G4ReactionProductVector* thePhotons = 0;
94 if (HasFSData() && !G4ParticleHPManager::GetInstance()->GetUseOnlyPhotoEvaporation()) {
103 if (thePhotons == NULL) {
104 throw G4HadronicException(
105 __FILE__, __LINE__,
"Final state data for photon is not properly allocated");
109 G4ThreeVector aCMSMomentum = theNeutron.GetMomentum() + theTarget.GetMomentum();
110 G4LorentzVector p4(aCMSMomentum, theTarget.GetTotalEnergy() + theNeutron.GetTotalEnergy());
111 G4Fragment nucleus(static_cast<G4int>(theBaseA + 1), static_cast<G4int>(theBaseZ), p4);
112 G4PhotonEvaporation photonEvaporation;
114 photonEvaporation.SetICM(TRUE);
115 G4FragmentVector* products = photonEvaporation.BreakItUp(nucleus);
117 thePhotons =
new G4ReactionProductVector;
118 for (it = products->begin(); it != products->end(); it++) {
119 G4ReactionProduct* theOne =
new G4ReactionProduct;
121 if ((*it)->GetParticleDefinition() != 0)
122 theOne->SetDefinition((*it)->GetParticleDefinition());
124 theOne->SetDefinition(G4Gamma::Gamma());
128 G4IonTable* theTable = G4IonTable::GetIonTable();
129 if ((*it)->GetMomentum().mag() > 10 * MeV)
130 theOne->SetDefinition(
131 theTable->GetIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA + 1), 0));
133 if ((*it)->GetExcitationEnergy() > 1.0e-2 * eV) {
134 G4double ex = (*it)->GetExcitationEnergy();
135 G4ReactionProduct* aPhoton =
new G4ReactionProduct;
136 aPhoton->SetDefinition(G4Gamma::Gamma());
137 aPhoton->SetMomentum((*it)->GetMomentum().vect().unit() * ex);
139 thePhotons->push_back(aPhoton);
142 theOne->SetMomentum((*it)->GetMomentum().vect() *
143 ((*it)->GetMomentum().t() - (*it)->GetExcitationEnergy()) /
144 (*it)->GetMomentum().t());
145 thePhotons->push_back(theOne);
154 nPhotons = thePhotons->size();
157 if (DoNotAdjustFinalState()) {
161 G4ReactionProduct* theOne =
new G4ReactionProduct;
162 theOne->SetDefinition(G4Gamma::Gamma());
164 G4double costheta = 2. * G4UniformRand() - 1.;
165 G4double theta = std::acos(costheta);
166 G4double phi = twopi * G4UniformRand();
167 G4double sinth = std::sin(theta);
168 G4ThreeVector direction(sinth * std::cos(phi), sinth * std::sin(phi), costheta);
169 theOne->SetMomentum(direction);
170 thePhotons->push_back(theOne);
176 if (nPhotons == 1 && thePhotons->operator[](0)->GetDefinition()->GetBaryonNumber() == 0) {
177 G4ThreeVector direction = thePhotons->operator[](0)->GetMomentum().unit();
179 G4double Q = G4IonTable::GetIonTable()->GetIonMass(
180 static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA), 0) +
181 G4Neutron::Neutron()->GetPDGMass() -
182 G4IonTable::GetIonTable()->GetIonMass(
183 static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA + 1), 0);
185 thePhotons->operator[](0)->SetMomentum(Q * direction);
191 for (i = 0; i < nPhotons; i++) {
192 thePhotons->operator[](i)->Lorentz(*(thePhotons->operator[](i)), -1 * theTarget);
197 if (nPhotons == 1 && thePhotons->operator[](0)->GetDefinition()->GetBaryonNumber() == 0) {
198 G4DynamicParticle* theOne =
new G4DynamicParticle;
199 G4ParticleDefinition* aRecoil = G4IonTable::GetIonTable()->GetIon(
200 static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA + 1), 0);
201 theOne->SetDefinition(aRecoil);
204 G4ThreeVector aMomentum = theTrack.Get4Momentum().vect() + theTarget.GetMomentum() -
205 thePhotons->operator[](0)->GetMomentum();
217 theOne->SetMomentum(aMomentum);
218 theResult.Get()->AddSecondary(theOne);
222 for (i = 0; i < nPhotons; i++) {
224 G4DynamicParticle* theOne =
new G4DynamicParticle;
225 theOne->SetDefinition(thePhotons->operator[](i)->GetDefinition());
226 theOne->SetMomentum(thePhotons->operator[](i)->GetMomentum());
227 theResult.Get()->AddSecondary(theOne);
228 delete thePhotons->operator[](i);
233 G4bool residual =
false;
234 G4ParticleDefinition* aRecoil = G4IonTable::GetIonTable()->GetIon(
235 static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA + 1), 0);
236 for (G4int j = 0; j != theResult.Get()->GetNumberOfSecondaries(); j++) {
237 if (theResult.Get()->GetSecondary(j)->GetParticle()->GetDefinition() == aRecoil)
241 if (residual ==
false) {
243 G4LorentzVector p_photons(0, 0, 0, 0);
244 for (G4int j = 0; j != theResult.Get()->GetNumberOfSecondaries(); j++) {
245 p_photons += theResult.Get()->GetSecondary(j)->GetParticle()->Get4Momentum();
247 if (theResult.Get()->GetSecondary(j)->GetParticle()->Get4Momentum().e() > 0)
252 G4double deltaE = (theTrack.Get4Momentum().e() + theTarget.GetTotalEnergy()) -
253 (p_photons.e() + aRecoil->GetPDGMass());
256 if (nPhotons - nNonZero > 0) {
259 std::vector<G4double> vRand;
260 vRand.push_back(0.0);
261 for (G4int j = 0; j != nPhotons - nNonZero - 1; j++) {
262 vRand.push_back(G4UniformRand());
264 vRand.push_back(1.0);
265 std::sort(vRand.begin(), vRand.end());
267 std::vector<G4double> vEPhoton;
268 for (G4int j = 0; j < (G4int)vRand.size() - 1; j++) {
269 vEPhoton.push_back(deltaE * (vRand[j + 1] - vRand[j]));
271 std::sort(vEPhoton.begin(), vEPhoton.end());
273 for (G4int j = 0; j < nPhotons - nNonZero - 1; j++) {
276 G4double costheta = 2. * G4UniformRand() - 1.;
277 G4double theta = std::acos(costheta);
278 G4double phi = twopi * G4UniformRand();
279 G4double sinth = std::sin(theta);
280 G4double en = vEPhoton[j];
281 G4ThreeVector tempVector(
282 en * sinth * std::cos(phi), en * sinth * std::sin(phi), en * costheta);
284 p_photons += G4LorentzVector(tempVector, tempVector.mag());
285 G4DynamicParticle* theOne =
new G4DynamicParticle;
286 theOne->SetDefinition(G4Gamma::Gamma());
287 theOne->SetMomentum(tempVector);
288 theResult.Get()->AddSecondary(theOne);
292 G4DynamicParticle* theOne =
new G4DynamicParticle;
293 theOne->SetDefinition(G4Gamma::Gamma());
295 G4ThreeVector lastPhoton = -p_photons.vect().unit() * vEPhoton.back();
296 p_photons += G4LorentzVector(lastPhoton, lastPhoton.mag());
297 theOne->SetMomentum(lastPhoton);
298 theResult.Get()->AddSecondary(theOne);
302 G4DynamicParticle* theOne =
new G4DynamicParticle;
303 G4ThreeVector aMomentum =
304 theTrack.Get4Momentum().vect() + theTarget.GetMomentum() - p_photons.vect();
305 theOne->SetDefinition(aRecoil);
306 theOne->SetMomentum(aMomentum);
307 theResult.Get()->AddSecondary(theOne);
312 theResult.Get()->SetStatusChange(stopAndKill);
318 return theResult.Get();
328 G4ParticleDefinition*)
332 std::stringstream ss;
333 ss << static_cast<G4int>(
Z);
337 ss << static_cast<G4int>(A);
351 G4String filenameMF6 = dirName +
"/FSMF6/" + sZ +
"_" + sA + sM +
"_" + element_name;
355 G4ParticleHPManager::GetInstance()->GetDataStream(filenameMF6, theData);
359 if (theData.good() ==
true) {
369 G4ParticleHPDataUsed aFile =
370 theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, dirName, tString, dbool);
372 G4String filename = aFile.GetName();
373 SetAZMs(A, Z, M, aFile);
376 if (!dbool || (Z < 2.5 && (
std::abs(theBaseZ - Z) > 0.0001 ||
std::abs(theBaseA - A) > 0.0001))) {
385 G4ParticleHPManager::GetInstance()->GetDataStream(filename, theData);
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack) override
constexpr auto abs(T v)
Returns the absolute value of the argument.
G4ParticleHPNames theNames
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *) override
G4ReactionProductVector * GetGammas()
ArCaptureGammas theFinalgammas
G4ErrorTarget * theTarget
G4ParticleHPEnAngCorrelation theMF6FinalState
G4ParticleHPPhotonDist theFinalStatePhotons