Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NeutronHPCaptureFS Class Reference

#include <G4NeutronHPCaptureFS.hh>

+ Inheritance diagram for G4NeutronHPCaptureFS:

Public Member Functions

 G4NeutronHPCaptureFS ()
 
 ~G4NeutronHPCaptureFS ()
 
void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType)
 
G4HadFinalStateApplyYourself (const G4HadProjectile &theTrack)
 
G4NeutronHPFinalStateNew ()
 
- Public Member Functions inherited from G4NeutronHPFinalState
 G4NeutronHPFinalState ()
 
virtual ~G4NeutronHPFinalState ()
 
void Init (G4double A, G4double Z, G4String &dirName, G4String &aFSType)
 
virtual void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType)=0
 
virtual G4HadFinalStateApplyYourself (const G4HadProjectile &)
 
virtual G4NeutronHPFinalStateNew ()=0
 
G4bool HasXsec ()
 
G4bool HasFSData ()
 
G4bool HasAnyData ()
 
virtual G4double GetXsec (G4double)
 
virtual G4NeutronHPVectorGetXsec ()
 
void SetA_Z (G4double anA, G4double aZ, G4int aM=0)
 
G4double GetZ ()
 
G4double GetN ()
 
G4int GetM ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4NeutronHPFinalState
void SetAZMs (G4double anA, G4double aZ, G4int aM, G4NeutronHPDataUsed used)
 
void adjust_final_state (G4LorentzVector)
 
- Protected Attributes inherited from G4NeutronHPFinalState
G4bool hasXsec
 
G4bool hasFSData
 
G4bool hasAnyData
 
G4NeutronHPNames theNames
 
G4HadFinalState theResult
 
G4double theBaseA
 
G4double theBaseZ
 
G4int theBaseM
 
G4int theNDLDataZ
 
G4int theNDLDataA
 
G4int theNDLDataM
 

Detailed Description

Definition at line 41 of file G4NeutronHPCaptureFS.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPCaptureFS()

G4NeutronHPCaptureFS::G4NeutronHPCaptureFS ( )
inline

Definition at line 45 of file G4NeutronHPCaptureFS.hh.

46 {
47 hasXsec = false;
48 hasExactMF6 = false;
49 targetMass = 0;
50 }

Referenced by New().

◆ ~G4NeutronHPCaptureFS()

G4NeutronHPCaptureFS::~G4NeutronHPCaptureFS ( )
inline

Definition at line 52 of file G4NeutronHPCaptureFS.hh.

53 {
54 }

Member Function Documentation

◆ ApplyYourself()

G4HadFinalState * G4NeutronHPCaptureFS::ApplyYourself ( const G4HadProjectile theTrack)
virtual

Reimplemented from G4NeutronHPFinalState.

Definition at line 47 of file G4NeutronHPCaptureFS.cc.

48 {
49
50 G4int i;
52// prepare neutron
53 G4double eKinetic = theTrack.GetKineticEnergy();
54 const G4HadProjectile *incidentParticle = &theTrack;
55 G4ReactionProduct theNeutron( const_cast<G4ParticleDefinition *>(incidentParticle->GetDefinition()) );
56 theNeutron.SetMomentum( incidentParticle->Get4Momentum().vect() );
57 theNeutron.SetKineticEnergy( eKinetic );
58
59// prepare target
60 G4ReactionProduct theTarget;
61 G4Nucleus aNucleus;
62 G4double eps = 0.0001;
63 if(targetMass<500*MeV)
64 targetMass = ( G4NucleiProperties::GetNuclearMass( static_cast<G4int>(theBaseA+eps) , static_cast<G4int>(theBaseZ+eps) )) /
66 G4ThreeVector neutronVelocity = 1./G4Neutron::Neutron()->GetPDGMass()*theNeutron.GetMomentum();
67 G4double temperature = theTrack.GetMaterial()->GetTemperature();
68 theTarget = aNucleus.GetBiasedThermalNucleus(targetMass, neutronVelocity, temperature);
69
70// go to nucleus rest system
71 theNeutron.Lorentz(theNeutron, -1*theTarget);
72 eKinetic = theNeutron.GetKineticEnergy();
73
74// dice the photons
75
76 G4ReactionProductVector * thePhotons = 0;
77 if ( HasFSData() && !getenv ( "G4NEUTRONHP_USE_ONLY_PHOTONEVAPORATION" ) )
78 {
79 //TK110430
80 if ( hasExactMF6 )
81 {
82 theMF6FinalState.SetTarget(theTarget);
83 theMF6FinalState.SetNeutron(theNeutron);
84 thePhotons = theMF6FinalState.Sample( eKinetic );
85 }
86 else
87 thePhotons = theFinalStatePhotons.GetPhotons(eKinetic);
88 }
89 else
90 {
91 G4ThreeVector aCMSMomentum = theNeutron.GetMomentum()+theTarget.GetMomentum();
92 G4LorentzVector p4(aCMSMomentum, theTarget.GetTotalEnergy() + theNeutron.GetTotalEnergy());
93 G4Fragment nucleus(static_cast<G4int>(theBaseA+1), static_cast<G4int>(theBaseZ) ,p4);
94 G4PhotonEvaporation photonEvaporation;
95 // T. K. add
96 photonEvaporation.SetICM( TRUE );
97 G4FragmentVector* products = photonEvaporation.BreakItUp(nucleus);
98 G4FragmentVector::iterator it;
99 thePhotons = new G4ReactionProductVector;
100 for(it=products->begin(); it!=products->end(); it++)
101 {
103 // T. K. add
104 if ( (*it)->GetParticleDefinition() != 0 )
105 theOne->SetDefinition( (*it)->GetParticleDefinition() );
106 else
107 theOne->SetDefinition( G4Gamma::Gamma() ); // this definiion will be over writen
108
109 // T. K. comment out below line
110 //theOne->SetDefinition( G4Gamma::Gamma() );
112 if( (*it)->GetMomentum().mag() > 10*MeV ) theOne->SetDefinition( theTable->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ)) );
113
114 //if ( (*i)->GetExcitationEnergy() > 0 )
115 if ( (*it)->GetExcitationEnergy() > 1.0e-2*eV )
116 {
117 G4double ex = (*it)->GetExcitationEnergy();
119 aPhoton->SetDefinition( G4Gamma::Gamma() );
120 aPhoton->SetMomentum( (*it)->GetMomentum().vect().unit() * ex );
121 //aPhoton->SetTotalEnergy( ex ); //will be calculated from momentum
122 thePhotons->push_back(aPhoton);
123 }
124
125 theOne->SetMomentum( (*it)->GetMomentum().vect() * ( (*it)->GetMomentum().t() - (*it)->GetExcitationEnergy() ) / (*it)->GetMomentum().t() ) ;
126 //theOne->SetTotalEnergy( (*i)->GetMomentum().t() - (*i)->GetExcitationEnergy() ); //will be calculated from momentum
127 thePhotons->push_back(theOne);
128 delete *it;
129 }
130 delete products;
131 }
132
133
134
135// add them to the final state
136
137 G4int nPhotons = 0;
138 if(thePhotons!=0) nPhotons=thePhotons->size();
139
140
141 //110527TKDB Unused codes, Detected by gcc4.6 compiler
142 //G4int nParticles = nPhotons;
143 //if(1==nPhotons) nParticles = 2;
144
145//Make at least one photon
146//101203 TK
147 if ( nPhotons == 0 )
148 {
150 theOne->SetDefinition( G4Gamma::Gamma() );
151 G4double theta = pi*G4UniformRand();
152 G4double phi = twopi*G4UniformRand();
153 G4double sinth = std::sin(theta);
154 G4ThreeVector direction( sinth*std::cos(phi), sinth*std::sin(phi), std::cos(theta) );
155 theOne->SetMomentum( direction ) ;
156 thePhotons->push_back(theOne);
157 nPhotons++; // 0 -> 1
158 }
159//One photon case: energy set to Q-value
160//101203 TK
161 //if ( nPhotons == 1 )
162 if ( nPhotons == 1 && thePhotons->operator[](0)->GetDefinition()->GetBaryonNumber() == 0 )
163 {
164 G4ThreeVector direction = thePhotons->operator[](0)->GetMomentum().unit();
166 - G4ParticleTable::GetParticleTable()->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ))->GetPDGMass();
167 thePhotons->operator[](0)->SetMomentum( Q*direction );
168 }
169//
170
171 // back to lab system
172 for(i=0; i<nPhotons; i++)
173 {
174 thePhotons->operator[](i)->Lorentz(*(thePhotons->operator[](i)), theTarget);
175 }
176
177 // Recoil, if only one gamma
178 //if (1==nPhotons)
179 if ( nPhotons == 1 && thePhotons->operator[](0)->GetDefinition()->GetBaryonNumber() == 0 )
180 {
183 ->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ));
184 theOne->SetDefinition(aRecoil);
185 // Now energy;
186 // Can be done slightly better @
187 G4ThreeVector aMomentum = theTrack.Get4Momentum().vect()
188 +theTarget.GetMomentum()
189 -thePhotons->operator[](0)->GetMomentum();
190
191 G4ThreeVector theMomUnit = aMomentum.unit();
192 G4double aKinEnergy = theTrack.GetKineticEnergy()
193 +theTarget.GetKineticEnergy(); // gammas come from Q-value
194 G4double theResMass = aRecoil->GetPDGMass();
195 G4double theResE = aRecoil->GetPDGMass()+aKinEnergy;
196 G4double theAbsMom = std::sqrt(theResE*theResE - theResMass*theResMass);
197 G4ThreeVector theMomentum = theAbsMom*theMomUnit;
198 theOne->SetMomentum(theMomentum);
199 theResult.AddSecondary(theOne);
200 }
201
202 // Now fill in the gammas.
203 for(i=0; i<nPhotons; i++)
204 {
205 // back to lab system
207 theOne->SetDefinition(thePhotons->operator[](i)->GetDefinition());
208 theOne->SetMomentum(thePhotons->operator[](i)->GetMomentum());
209 theResult.AddSecondary(theOne);
210 delete thePhotons->operator[](i);
211 }
212 delete thePhotons;
213
214//101203TK
215 G4bool residual = false;
217 ->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ));
218 for ( G4int j = 0 ; j != theResult.GetNumberOfSecondaries() ; j++ )
219 {
220 if ( theResult.GetSecondary(j)->GetParticle()->GetDefinition() == aRecoil ) residual = true;
221 }
222
223 if ( residual == false )
224 {
225 //G4ParticleDefinition * aRecoil = G4ParticleTable::GetParticleTable()
226 // ->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ));
227 G4int nNonZero = 0;
228 G4LorentzVector p_photons(0,0,0,0);
229 for ( G4int j = 0 ; j != theResult.GetNumberOfSecondaries() ; j++ )
230 {
231 p_photons += theResult.GetSecondary(j)->GetParticle()->Get4Momentum();
232 // To many 0 momentum photons -> Check PhotonDist
233 if ( theResult.GetSecondary(j)->GetParticle()->Get4Momentum().e() > 0 ) nNonZero++;
234 }
235
236 // Can we include kinetic energy here?
237 G4double deltaE = ( theTrack.Get4Momentum().e() + theTarget.GetTotalEnergy() )
238 - ( p_photons.e() + aRecoil->GetPDGMass() );
239
240//Add photons
241 if ( nPhotons - nNonZero > 0 )
242 {
243 //G4cout << "TKDB G4NeutronHPCaptureFS::ApplyYourself we will create additional " << nPhotons - nNonZero << " photons" << G4endl;
244 std::vector<G4double> vRand;
245 vRand.push_back( 0.0 );
246 for ( G4int j = 0 ; j != nPhotons - nNonZero - 1 ; j++ )
247 {
248 vRand.push_back( G4UniformRand() );
249 }
250 vRand.push_back( 1.0 );
251 std::sort( vRand.begin(), vRand.end() );
252
253 std::vector<G4double> vEPhoton;
254 for ( G4int j = 0 ; j < (G4int)vRand.size() - 1 ; j++ )
255 {
256 vEPhoton.push_back( deltaE * ( vRand[j+1] - vRand[j] ) );
257 }
258 std::sort( vEPhoton.begin(), vEPhoton.end() );
259
260 for ( G4int j = 0 ; j < nPhotons - nNonZero - 1 ; j++ )
261 {
262 //Isotopic in LAB OK?
263 G4double theta = pi*G4UniformRand();
264 G4double phi = twopi*G4UniformRand();
265 G4double sinth = std::sin(theta);
266 G4double en = vEPhoton[j];
267 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
268
269 p_photons += G4LorentzVector ( tempVector, tempVector.mag() );
271 theOne->SetDefinition( G4Gamma::Gamma() );
272 theOne->SetMomentum( tempVector );
273 theResult.AddSecondary(theOne);
274 }
275
276// Add last photon
278 theOne->SetDefinition( G4Gamma::Gamma() );
279// For better momentum conservation
280 G4ThreeVector lastPhoton = -p_photons.vect().unit()*vEPhoton.back();
281 p_photons += G4LorentzVector( lastPhoton , lastPhoton.mag() );
282 theOne->SetMomentum( lastPhoton );
283 theResult.AddSecondary(theOne);
284 }
285
286//Add residual
288 G4ThreeVector aMomentum = theTrack.Get4Momentum().vect() + theTarget.GetMomentum()
289 - p_photons.vect();
290 theOne->SetDefinition(aRecoil);
291 theOne->SetMomentum( aMomentum );
292 theResult.AddSecondary(theOne);
293
294 }
295//101203TK END
296
297// clean up the primary neutron
299 return &theResult;
300 }
std::vector< G4Fragment * > G4FragmentVector
Definition: G4Fragment.hh:65
@ stopAndKill
CLHEP::HepLorentzVector G4LorentzVector
std::vector< G4ReactionProduct * > G4ReactionProductVector
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
#define G4UniformRand()
Definition: Randomize.hh:53
Hep3Vector unit() const
double mag() const
Hep3Vector vect() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4ParticleDefinition * GetDefinition() const
G4LorentzVector Get4Momentum() const
void SetMomentum(const G4ThreeVector &momentum)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void SetStatusChange(G4HadFinalStateStatus aS)
G4int GetNumberOfSecondaries() const
void AddSecondary(G4DynamicParticle *aP)
G4HadSecondary * GetSecondary(size_t i)
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4DynamicParticle * GetParticle()
G4double GetTemperature() const
Definition: G4Material.hh:181
void SetNeutron(G4ReactionProduct &aNeutron)
void SetTarget(G4ReactionProduct &aTarget)
G4ReactionProductVector * Sample(G4double anEnergy)
G4ReactionProductVector * GetPhotons(G4double anEnergy)
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
Definition: G4Nucleus.cc:108
G4ParticleDefinition * FindIon(G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)
static G4ParticleTable * GetParticleTable()
virtual G4FragmentVector * BreakItUp(const G4Fragment &nucleus)
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 SetDefinition(G4ParticleDefinition *aParticleDefinition)
#define TRUE
Definition: globals.hh:55
const G4double pi

◆ Init()

void G4NeutronHPCaptureFS::Init ( G4double  A,
G4double  Z,
G4int  M,
G4String dirName,
G4String aFSType 
)
virtual

Implements G4NeutronHPFinalState.

Definition at line 303 of file G4NeutronHPCaptureFS.cc.

304 {
305
306 //TK110430 BEGIN
307 std::stringstream ss;
308 ss << static_cast<G4int>(Z);
309 G4String sZ;
310 ss >> sZ;
311 ss.clear();
312 ss << static_cast<G4int>(A);
313 G4String sA;
314 ss >> sA;
315
316 ss.clear();
317 G4String sM;
318 if ( M > 0 )
319 {
320 ss << "m";
321 ss << M;
322 ss >> sM;
323 ss.clear();
324 }
325
326 G4String element_name = theNames.GetName( static_cast<G4int>(Z)-1 );
327 G4String filenameMF6 = dirName+"/FSMF6/"+sZ+"_"+sA+sM+"_"+element_name;
328 std::ifstream dummyIFS(filenameMF6, std::ios::in);
329 if ( dummyIFS.good() == true ) hasExactMF6=true;
330
331 //TK110430 Just for checking
332 //ENDF-VII.0 no case (check done at 110430
333 /*
334 if ( hasExactMF6 == true )
335 {
336 G4String filename = dirName+"FS/"+sZ+"_"+sA+"_"+element_name;
337 std::ifstream dummyIFS(filename, std::ios::in);
338 if ( dummyIFS.good() == true )
339 {
340 G4cout << "TKDB Capture Both FS and FSMF6 are exist for Z = " << sZ << ", A = " << sA << G4endl;;
341 }
342 }
343 */
344
345 //TK110430 Only use MF6MT102 which has exactly same A and Z
346 //Even _nat_ do not select and there is no _nat_ case in ENDF-VII.0
347 if ( hasExactMF6 == true )
348 {
349 std::ifstream theData(filenameMF6, std::ios::in);
350 theMF6FinalState.Init(theData);
351 theData.close();
352 return;
353 }
354 //TK110430 END
355
356
357 G4String tString = "/FS";
358 G4bool dbool;
359 G4NeutronHPDataUsed aFile = theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, dirName, tString, dbool);
360
361 G4String filename = aFile.GetName();
362 SetAZMs( A, Z, M, aFile );
363 //theBaseA = A;
364 //theBaseZ = G4int(Z+.5);
365 if(!dbool || ( Z<2.5 && ( std::abs(theBaseZ - Z)>0.0001 || std::abs(theBaseA - A)>0.0001)))
366 {
367 hasAnyData = false;
368 hasFSData = false;
369 hasXsec = false;
370 return;
371 }
372 std::ifstream theData(filename, std::ios::in);
373
374 hasFSData = theFinalStatePhotons.InitMean(theData);
375 if(hasFSData)
376 {
377 targetMass = theFinalStatePhotons.GetTargetMass();
378 theFinalStatePhotons.InitAngular(theData);
379 theFinalStatePhotons.InitEnergies(theData);
380 }
381 theData.close();
382 }
void Init(std::ifstream &aDataFile)
void SetAZMs(G4double anA, G4double aZ, G4int aM, G4NeutronHPDataUsed used)
G4NeutronHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
G4bool InitMean(std::ifstream &aDataFile)
void InitEnergies(std::ifstream &aDataFile)
void InitAngular(std::ifstream &aDataFile)

◆ New()

G4NeutronHPFinalState * G4NeutronHPCaptureFS::New ( )
inlinevirtual

Implements G4NeutronHPFinalState.

Definition at line 58 of file G4NeutronHPCaptureFS.hh.


The documentation for this class was generated from the following files: