Geant4-11
G4ParticleHPCaptureFS.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// neutron_hp -- source file
27// J.P. Wellisch, Nov-1996
28// A prototype of the low energy neutron transport model.
29//
30// 12-April-06 Enable IC electron emissions T. Koi
31// 26-January-07 Add G4NEUTRONHP_USE_ONLY_PHOTONEVAPORATION flag
32// 081024 G4NucleiPropertiesTable:: to G4NucleiProperties::
33// 101203 Bugzilla/Geant4 Problem 1155 Lack of residual in some case
34// 110430 Temporary solution in the case of being MF6 final state in Capture reaction (MT102)
35//
36// P. Arce, June-2014 Conversion neutron_hp to particle_hp
37//
41#include "G4SystemOfUnits.hh"
42#include "G4Gamma.hh"
43#include "G4ReactionProduct.hh"
44#include "G4Nucleus.hh"
46#include "G4Fragment.hh"
47#include "G4IonTable.hh"
50
51
53 {
54 secID = G4PhysicsModelCatalog::GetModelID( "model_NeutronHPCapture" );
55 hasXsec = false;
56 hasExactMF6 = false;
57 targetMass = 0;
58 }
59
60
62 {
63
64 if ( theResult.Get() == NULL ) theResult.Put( new G4HadFinalState );
65 theResult.Get()->Clear();
66
67 G4int i;
68
69// prepare neutron
70 G4double eKinetic = theTrack.GetKineticEnergy();
71 const G4HadProjectile *incidentParticle = &theTrack;
72 G4ReactionProduct theNeutron( const_cast<G4ParticleDefinition *>(incidentParticle->GetDefinition() ) );
73 theNeutron.SetMomentum( incidentParticle->Get4Momentum().vect() );
74 theNeutron.SetKineticEnergy( eKinetic );
75
76 // Prepare target
77 G4ReactionProduct theTarget;
78 G4Nucleus aNucleus;
79 G4double eps = 0.0001;
80 if (targetMass < 500*MeV) targetMass =
81 (G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps) )) /
83 G4ThreeVector neutronVelocity = 1./G4Neutron::Neutron()->GetPDGMass()*theNeutron.GetMomentum();
84 G4double temperature = theTrack.GetMaterial()->GetTemperature();
85 theTarget = aNucleus.GetBiasedThermalNucleus(targetMass, neutronVelocity, temperature);
87
88 // Put neutron in nucleus rest system
89 theNeutron.Lorentz(theNeutron, theTarget);
90 eKinetic = theNeutron.GetKineticEnergy();
91
92 // Sample the photons
93 G4ReactionProductVector * thePhotons = 0;
94 if ( HasFSData() && !G4ParticleHPManager::GetInstance()->GetUseOnlyPhotoEvaporation() )
95 {
96 //NDL has final state data
97 if ( hasExactMF6 ) {
98 theMF6FinalState.SetTarget(theTarget);
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 //NDL does not have final state data or forced to use PhotoEvaporation model
111 G4ThreeVector aCMSMomentum = theNeutron.GetMomentum()+theTarget.GetMomentum();
112 G4LorentzVector p4(aCMSMomentum, theTarget.GetTotalEnergy() + theNeutron.GetTotalEnergy());
113 G4Fragment nucleus(static_cast<G4int>(theBaseA+1), static_cast<G4int>(theBaseZ) ,p4);
114 G4PhotonEvaporation photonEvaporation;
115 // T. K. add
116 photonEvaporation.SetICM( TRUE );
117 G4FragmentVector* products = photonEvaporation.BreakItUp(nucleus);
118 G4FragmentVector::iterator it;
119 thePhotons = new G4ReactionProductVector;
120 for(it=products->begin(); it!=products->end(); it++)
121 {
123 // T. K. add
124 if ( (*it)->GetParticleDefinition() != 0 )
125 theOne->SetDefinition( (*it)->GetParticleDefinition() );
126 else
127 theOne->SetDefinition( G4Gamma::Gamma() ); // this definiion will be over writen
128
129 // T. K. comment out below line
130 //theOne->SetDefinition( G4Gamma::Gamma() );
132 if ( (*it)->GetMomentum().mag() > 10*MeV)
133 theOne->SetDefinition(theTable->GetIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0) );
134
135 if ( (*it)->GetExcitationEnergy() > 1.0e-2*eV) {
136 G4double ex = (*it)->GetExcitationEnergy();
138 aPhoton->SetDefinition( G4Gamma::Gamma() );
139 aPhoton->SetMomentum( (*it)->GetMomentum().vect().unit() * ex );
140 //aPhoton->SetTotalEnergy( ex ); //will be calculated from momentum
141 thePhotons->push_back(aPhoton);
142 }
143
144 theOne->SetMomentum( (*it)->GetMomentum().vect() * ( (*it)->GetMomentum().t() - (*it)->GetExcitationEnergy() ) / (*it)->GetMomentum().t() ) ;
145 thePhotons->push_back(theOne);
146 delete *it;
147 }
148 delete products;
149 }
150
151 // Add them to the final state
152 G4int nPhotons = 0;
153 nPhotons=thePhotons->size();
154
156 if ( ! G4ParticleHPManager::GetInstance()->GetDoNotAdjustFinalState() ) {
157//Make at least one photon
158//101203 TK
159 if ( nPhotons == 0 )
160 {
162 theOne->SetDefinition( G4Gamma::Gamma() );
163 // Bug #1745 DHW G4double theta = pi*G4UniformRand();
164 G4double costheta = 2.*G4UniformRand()-1.;
165 G4double theta = std::acos(costheta);
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);
171 nPhotons++; // 0 -> 1
172 }
173//One photon case: energy set to Q-value
174//101203 TK
175 //if ( nPhotons == 1 )
176 if ( nPhotons == 1 && thePhotons->operator[](0)->GetDefinition()->GetBaryonNumber() == 0 )
177 {
178 G4ThreeVector direction = thePhotons->operator[](0)->GetMomentum().unit();
179
181 - G4IonTable::GetIonTable()->GetIonMass(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0);
182
183 thePhotons->operator[](0)->SetMomentum( Q*direction );
184 }
185//
186 }
187
188 // back to lab system
189 for(i=0; i<nPhotons; i++)
190 {
191 thePhotons->operator[](i)->Lorentz(*(thePhotons->operator[](i)), -1*theTarget);
192 }
193
194 // Recoil, if only one gamma
195 //if (1==nPhotons)
196 if ( nPhotons == 1 && thePhotons->operator[](0)->GetDefinition()->GetBaryonNumber() == 0 )
197 {
200 ->GetIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0);
201 theOne->SetDefinition(aRecoil);
202 // Now energy;
203 // Can be done slightly better @
204 G4ThreeVector aMomentum = theTrack.Get4Momentum().vect()
205 +theTarget.GetMomentum()
206 -thePhotons->operator[](0)->GetMomentum();
207
208 //TKDB 140520
209 //G4ThreeVector theMomUnit = aMomentum.unit();
210 //G4double aKinEnergy = theTrack.GetKineticEnergy()
211 // +theTarget.GetKineticEnergy(); // gammas come from Q-value
212 //G4double theResMass = aRecoil->GetPDGMass();
213 //G4double theResE = aRecoil->GetPDGMass()+aKinEnergy;
214 //G4double theAbsMom = std::sqrt(theResE*theResE - theResMass*theResMass);
215 //G4ThreeVector theMomentum = theAbsMom*theMomUnit;
216 //theOne->SetMomentum(theMomentum);
217
218 theOne->SetMomentum(aMomentum);
219 theResult.Get()->AddSecondary(theOne, secID);
220 }
221
222 // Now fill in the gammas.
223 for(i=0; i<nPhotons; i++)
224 {
225 // back to lab system
227 theOne->SetDefinition(thePhotons->operator[](i)->GetDefinition());
228 theOne->SetMomentum(thePhotons->operator[](i)->GetMomentum());
229 theResult.Get()->AddSecondary(theOne, secID);
230 delete thePhotons->operator[](i);
231 }
232 delete thePhotons;
233
234//101203TK
235 G4bool residual = false;
237 ->GetIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0);
238 for ( std::size_t j = 0 ; j != theResult.Get()->GetNumberOfSecondaries() ; j++ )
239 {
240 if ( theResult.Get()->GetSecondary(j)->GetParticle()->GetDefinition() == aRecoil ) residual = true;
241 }
242
243 if ( residual == false )
244 {
245 G4int nNonZero = 0;
246 G4LorentzVector p_photons(0,0,0,0);
247 for ( std::size_t j = 0 ; j != theResult.Get()->GetNumberOfSecondaries() ; j++ )
248 {
249 p_photons += theResult.Get()->GetSecondary(j)->GetParticle()->Get4Momentum();
250 // To many 0 momentum photons -> Check PhotonDist
251 if ( theResult.Get()->GetSecondary(j)->GetParticle()->Get4Momentum().e() > 0 ) nNonZero++;
252 }
253
254 // Can we include kinetic energy here?
255 G4double deltaE = ( theTrack.Get4Momentum().e() + theTarget.GetTotalEnergy() )
256 - ( p_photons.e() + aRecoil->GetPDGMass() );
257
258//Add photons
259 if ( nPhotons - nNonZero > 0 )
260 {
261 //G4cout << "TKDB G4ParticleHPCaptureFS::ApplyYourself we will create additional " << nPhotons - nNonZero << " photons" << G4endl;
262 std::vector<G4double> vRand;
263 vRand.push_back( 0.0 );
264 for ( G4int j = 0 ; j != nPhotons - nNonZero - 1 ; j++ )
265 {
266 vRand.push_back( G4UniformRand() );
267 }
268 vRand.push_back( 1.0 );
269 std::sort( vRand.begin(), vRand.end() );
270
271 std::vector<G4double> vEPhoton;
272 for ( G4int j = 0 ; j < (G4int)vRand.size() - 1 ; j++ )
273 {
274 vEPhoton.push_back( deltaE * ( vRand[j+1] - vRand[j] ) );
275 }
276 std::sort( vEPhoton.begin(), vEPhoton.end() );
277
278 for ( G4int j = 0 ; j < nPhotons - nNonZero - 1 ; j++ )
279 {
280 //Isotopic in LAB OK?
281 // Bug # 1745 DHW G4double theta = pi*G4UniformRand();
282 G4double costheta = 2.*G4UniformRand()-1.;
283 G4double theta = std::acos(costheta);
285 G4double sinth = std::sin(theta);
286 G4double en = vEPhoton[j];
287 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*costheta);
288
289 p_photons += G4LorentzVector ( tempVector, tempVector.mag() );
291 theOne->SetDefinition( G4Gamma::Gamma() );
292 theOne->SetMomentum( tempVector );
293 theResult.Get()->AddSecondary(theOne, secID);
294 }
295
296// Add last photon
298 theOne->SetDefinition( G4Gamma::Gamma() );
299// For better momentum conservation
300 G4ThreeVector lastPhoton = -p_photons.vect().unit()*vEPhoton.back();
301 p_photons += G4LorentzVector( lastPhoton , lastPhoton.mag() );
302 theOne->SetMomentum( lastPhoton );
303 theResult.Get()->AddSecondary(theOne, secID);
304 }
305
306//Add residual
308 G4ThreeVector aMomentum = theTrack.Get4Momentum().vect() + theTarget.GetMomentum()
309 - p_photons.vect();
310 theOne->SetDefinition(aRecoil);
311 theOne->SetMomentum( aMomentum );
312 theResult.Get()->AddSecondary(theOne, secID);
313
314 }
315//101203TK END
316
317// clean up the primary neutron
319 return theResult.Get();
320 }
321
322#include <sstream>
324 {
325
326 //TK110430 BEGIN
327 std::stringstream ss;
328 ss << static_cast<G4int>(Z);
329 G4String sZ;
330 ss >> sZ;
331 ss.clear();
332 ss << static_cast<G4int>(A);
333 G4String sA;
334 ss >> sA;
335
336 ss.clear();
337 G4String sM;
338 if ( M > 0 )
339 {
340 ss << "m";
341 ss << M;
342 ss >> sM;
343 ss.clear();
344 }
345
346 G4String element_name = theNames.GetName( static_cast<G4int>(Z)-1 );
347 G4String filenameMF6 = dirName+"/FSMF6/"+sZ+"_"+sA+sM+"_"+element_name;
348 //std::ifstream dummyIFS(filenameMF6, std::ios::in);
349 //if ( dummyIFS.good() == true ) hasExactMF6=true;
350 std::istringstream theData(std::ios::in);
351 G4ParticleHPManager::GetInstance()->GetDataStream(filenameMF6,theData);
352
353 //TK110430 Only use MF6MT102 which has exactly same A and Z
354 //Even _nat_ do not select and there is no _nat_ case in ENDF-VII.0
355 if ( theData.good() == true ) {
356 hasExactMF6=true;
357 theMF6FinalState.Init(theData);
358 //theData.close();
359 return;
360 }
361 //TK110430 END
362
363
364 G4String tString = "/FS";
365 G4bool dbool;
366 G4ParticleHPDataUsed aFile = theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, dirName, tString, dbool);
367
368 G4String filename = aFile.GetName();
369 SetAZMs( A, Z, M, aFile );
370 //theBaseA = A;
371 //theBaseZ = G4int(Z+.5);
372 if(!dbool || ( Z<2.5 && ( std::abs(theBaseZ - Z)>0.0001 || std::abs(theBaseA - A)>0.0001)))
373 {
374 hasAnyData = false;
375 hasFSData = false;
376 hasXsec = false;
377 return;
378 }
379 //std::ifstream theData(filename, std::ios::in);
380 //std::istringstream theData(std::ios::in);
381 theData.clear();
384 if(hasFSData)
385 {
389 }
390 //theData.close();
391 }
static const G4double eps
std::vector< G4Fragment * > G4FragmentVector
Definition: G4Fragment.hh:64
@ stopAndKill
CLHEP::HepLorentzVector G4LorentzVector
#define M(row, col)
std::vector< G4ReactionProduct * > G4ReactionProductVector
static constexpr double twopi
Definition: G4SIunits.hh:56
static constexpr double eV
Definition: G4SIunits.hh:201
static constexpr double MeV
Definition: G4SIunits.hh:200
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
const G4double A[17]
#define TRUE
Definition: Globals.hh:27
#define G4UniformRand()
Definition: Randomize.hh:52
Hep3Vector unit() const
double mag() const
Hep3Vector vect() const
value_type & Get() const
Definition: G4Cache.hh:315
void Put(const value_type &val) const
Definition: G4Cache.hh:321
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4ParticleDefinition * GetDefinition() const
G4LorentzVector Get4Momentum() const
void SetMomentum(const G4ThreeVector &momentum)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:85
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)
Definition: G4IonTable.cc:522
static G4IonTable * GetIonTable()
Definition: G4IonTable.cc:170
G4double GetIonMass(G4int Z, G4int A, G4int nL=0, G4int lvl=0) const
Definition: G4IonTable.cc:1517
G4double GetTemperature() const
Definition: G4Material.hh:178
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
Definition: G4Nucleus.cc:118
G4ParticleHPPhotonDist theFinalStatePhotons
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)
G4ParticleHPEnAngCorrelation theMF6FinalState
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack)
void Init(std::istream &aDataFile)
void SetProjectileRP(G4ReactionProduct &aIncidentPart)
void SetTarget(G4ReactionProduct &aTarget)
G4ReactionProductVector * Sample(G4double anEnergy)
void SetAZMs(G4double anA, G4double aZ, G4int aM, G4ParticleHPDataUsed used)
G4Cache< G4HadFinalState * > theResult
static G4ParticleHPManager * GetInstance()
void GetDataStream(G4String, std::istringstream &iss)
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
void InitEnergies(std::istream &aDataFile)
G4ReactionProductVector * GetPhotons(G4double anEnergy)
void InitAngular(std::istream &aDataFile)
G4bool InitMean(std::istream &aDataFile)
virtual void SetICM(G4bool)
G4FragmentVector * BreakItUp(const G4Fragment &theNucleus)
static G4int GetModelID(const G4int modelIndex)
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetDefinitionAndUpdateE(const G4ParticleDefinition *aParticleDefinition)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(const G4double en)
static double Q[]