Geant4 11.2.2
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 () override=default
 
void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *) override
 
G4HadFinalStateApplyYourself (const G4HadProjectile &theTrack) override
 
G4ParticleHPFinalStateNew () override
 
 G4NeutronHPCaptureFS (G4NeutronHPCaptureFS &)=delete
 
G4NeutronHPCaptureFSoperator= (const G4NeutronHPCaptureFS &right)=delete
 
- Public Member Functions inherited from G4ParticleHPFinalState
 G4ParticleHPFinalState ()
 
virtual ~G4ParticleHPFinalState ()
 
void Init (G4double A, G4double Z, G4String &dirName, G4String &aFSType, G4ParticleDefinition *p)
 
G4bool HasXsec ()
 
G4bool HasFSData ()
 
G4bool HasAnyData ()
 
virtual G4double GetXsec (G4double)
 
virtual G4ParticleHPVectorGetXsec ()
 
void SetA_Z (G4double anA, G4double aZ, G4int aM=0)
 
G4double GetZ ()
 
G4double GetN ()
 
G4double GetA ()
 
G4int GetM ()
 
void SetAZMs (G4ParticleHPDataUsed used)
 
void SetAZMs (G4double anA, G4double aZ, G4int aM, G4ParticleHPDataUsed used)
 
void SetProjectile (G4ParticleDefinition *projectile)
 
G4ParticleHPFinalStateoperator= (const G4ParticleHPFinalState &right)=delete
 
 G4ParticleHPFinalState (const G4ParticleHPFinalState &)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from G4ParticleHPFinalState
void adjust_final_state (G4LorentzVector)
 
- Protected Attributes inherited from G4ParticleHPFinalState
G4ParticleDefinitiontheProjectile {nullptr}
 
G4ParticleHPManagerfManager
 
G4IonTableionTable
 
G4int theBaseA {0}
 
G4int theBaseZ {0}
 
G4int theBaseM {0}
 
G4int theNDLDataZ {0}
 
G4int theNDLDataA {0}
 
G4int theNDLDataM {0}
 
G4int secID {-1}
 
G4bool hasXsec {true}
 
G4bool hasFSData {true}
 
G4bool hasAnyData {true}
 
G4ParticleHPNames theNames
 
G4Cache< G4HadFinalState * > theResult
 

Detailed Description

Definition at line 43 of file G4NeutronHPCaptureFS.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPCaptureFS() [1/2]

G4NeutronHPCaptureFS::G4NeutronHPCaptureFS ( )

Definition at line 55 of file G4NeutronHPCaptureFS.cc.

56{
57 secID = G4PhysicsModelCatalog::GetModelID("model_NeutronHPCapture");
58 hasXsec = false;
59 hasExactMF6 = false;
60 targetMass = 0;
61}
static G4int GetModelID(const G4int modelIndex)

Referenced by New().

◆ ~G4NeutronHPCaptureFS()

G4NeutronHPCaptureFS::~G4NeutronHPCaptureFS ( )
overridedefault

◆ G4NeutronHPCaptureFS() [2/2]

G4NeutronHPCaptureFS::G4NeutronHPCaptureFS ( G4NeutronHPCaptureFS & )
delete

Member Function Documentation

◆ ApplyYourself()

G4HadFinalState * G4NeutronHPCaptureFS::ApplyYourself ( const G4HadProjectile & theTrack)
overridevirtual

Reimplemented from G4ParticleHPFinalState.

Definition at line 64 of file G4NeutronHPCaptureFS.cc.

65{
66 if (theResult.Get() == nullptr) theResult.Put(new G4HadFinalState);
67 theResult.Get()->Clear();
68
69 G4int i;
70
71 // prepare neutron
72 G4double eKinetic = theTrack.GetKineticEnergy();
73 const G4HadProjectile* incidentParticle = &theTrack;
74 G4ReactionProduct theNeutron(theTrack.GetDefinition());
75 theNeutron.SetMomentum(incidentParticle->Get4Momentum().vect());
76 theNeutron.SetKineticEnergy(eKinetic);
77
78 // Prepare target
79 G4ReactionProduct theTarget;
80 G4Nucleus aNucleus;
81 if (targetMass < 500 * MeV)
83 / CLHEP::neutron_mass_c2;
84 G4ThreeVector neutronVelocity = theNeutron.GetMomentum()/ CLHEP::neutron_mass_c2;
85 G4double temperature = theTrack.GetMaterial()->GetTemperature();
86 theTarget = aNucleus.GetBiasedThermalNucleus(targetMass, neutronVelocity, temperature);
88
89 // Put neutron in nucleus rest system
90 theNeutron.Lorentz(theNeutron, theTarget);
91 eKinetic = theNeutron.GetKineticEnergy();
92
93 // Sample the photons
94 G4ReactionProductVector* thePhotons = nullptr;
96 // NDL has final state data
97 if (hasExactMF6) {
98 theMF6FinalState.SetTarget(theTarget);
99 theMF6FinalState.SetProjectileRP(theNeutron);
100 thePhotons = theMF6FinalState.Sample(eKinetic);
101 }
102 else {
103 thePhotons = theFinalStatePhotons.GetPhotons(eKinetic);
104 }
105 if (thePhotons == nullptr) {
106 throw G4HadronicException(__FILE__, __LINE__,
107 "Final state data for photon is not properly allocated");
108 }
109 }
110 else {
111 // NDL does not have final state data or forced to use PhotoEvaporation model
112 G4ThreeVector aCMSMomentum = theNeutron.GetMomentum() + theTarget.GetMomentum();
113 G4LorentzVector p4(aCMSMomentum, theTarget.GetTotalEnergy() + theNeutron.GetTotalEnergy());
114 G4Fragment nucleus(theBaseA + 1, theBaseZ, p4);
115 G4PhotonEvaporation photonEvaporation;
116 // T. K. add
117 photonEvaporation.SetICM(true);
118 G4FragmentVector* products = photonEvaporation.BreakItUp(nucleus);
119 thePhotons = new G4ReactionProductVector;
120 for (auto it = products->cbegin(); it != products->cend(); ++it) {
121 auto theOne = new G4ReactionProduct;
122 // T. K. add
123 if ((*it)->GetParticleDefinition() != nullptr)
124 theOne->SetDefinition((*it)->GetParticleDefinition());
125 else
126 theOne->SetDefinition(G4Gamma::Gamma()); // this definiion will be over writen
127
128 // T. K. comment out below line
129 if ((*it)->GetMomentum().mag() > 10 * CLHEP::MeV)
130 theOne->SetDefinition(ionTable->GetIon(theBaseZ, theBaseA + 1, 0));
131
132 if ((*it)->GetExcitationEnergy() > 1.0e-2 * eV) {
133 G4double ex = (*it)->GetExcitationEnergy();
134 auto aPhoton = new G4ReactionProduct;
135 aPhoton->SetDefinition(G4Gamma::Gamma());
136 aPhoton->SetMomentum((*it)->GetMomentum().vect().unit() * ex);
137 // aPhoton->SetTotalEnergy( ex ); //will be calculated from momentum
138 thePhotons->push_back(aPhoton);
139 }
140
141 theOne->SetMomentum((*it)->GetMomentum().vect()
142 * ((*it)->GetMomentum().t() - (*it)->GetExcitationEnergy())
143 / (*it)->GetMomentum().t());
144 thePhotons->push_back(theOne);
145 delete *it;
146 }
147 delete products;
148 }
149
150 // Add them to the final state
151 G4int nPhotons = (G4int)thePhotons->size();
152
154 // Make at least one photon
155 // 101203 TK
156 if (nPhotons == 0) {
157 auto theOne = new G4ReactionProduct;
158 theOne->SetDefinition(G4Gamma::Gamma());
159 G4ThreeVector direction = G4RandomDirection();
160 theOne->SetMomentum(direction);
161 thePhotons->push_back(theOne);
162 ++nPhotons; // 0 -> 1
163 }
164 // One photon case: energy set to Q-value
165 // 101203 TK
166 if (nPhotons == 1 &&
167 (*thePhotons)[0]->GetDefinition()->GetBaryonNumber() == 0) {
168 G4ThreeVector direction = (*thePhotons)[0]->GetMomentum().unit();
169
171 + CLHEP::neutron_mass_c2
173 (*thePhotons)[0]->SetMomentum(Q * direction);
174 }
175 }
176
177 // back to lab system
178 for (i = 0; i < nPhotons; i++) {
179 (*thePhotons)[i]->Lorentz(*((*thePhotons)[i]), -1*theTarget);
180 }
181
182 // Recoil, if only one gamma
183 // if (1==nPhotons)
184 if (nPhotons == 1 && thePhotons->operator[](0)->GetDefinition()->GetBaryonNumber() == 0) {
185 auto theOne = new G4DynamicParticle;
187 theOne->SetDefinition(aRecoil);
188 // Now energy;
189 // Can be done slightly better @
190 G4ThreeVector aMomentum = theTrack.Get4Momentum().vect() + theTarget.GetMomentum()
191 - thePhotons->operator[](0)->GetMomentum();
192
193 theOne->SetMomentum(aMomentum);
194 theResult.Get()->AddSecondary(theOne, secID);
195 }
196
197 // Now fill in the gammas.
198 for (i = 0; i < nPhotons; ++i) {
199 // back to lab system
200 auto theOne = new G4DynamicParticle;
201 theOne->SetDefinition(thePhotons->operator[](i)->GetDefinition());
202 theOne->SetMomentum(thePhotons->operator[](i)->GetMomentum());
203 theResult.Get()->AddSecondary(theOne, secID);
204 delete thePhotons->operator[](i);
205 }
206 delete thePhotons;
207
208 // 101203TK
209 G4bool residual = false;
211 for (std::size_t j = 0; j != theResult.Get()->GetNumberOfSecondaries(); j++) {
212 if (theResult.Get()->GetSecondary(j)->GetParticle()->GetDefinition() == aRecoil)
213 residual = true;
214 }
215
216 if (!residual) {
217 G4int nNonZero = 0;
218 G4LorentzVector p_photons(0, 0, 0, 0);
219 for (std::size_t j = 0; j != theResult.Get()->GetNumberOfSecondaries(); ++j) {
220 p_photons += theResult.Get()->GetSecondary(j)->GetParticle()->Get4Momentum();
221 // To many 0 momentum photons -> Check PhotonDist
222 if (theResult.Get()->GetSecondary(j)->GetParticle()->Get4Momentum().e() > 0) nNonZero++;
223 }
224
225 // Can we include kinetic energy here?
226 G4double deltaE = (theTrack.Get4Momentum().e() + theTarget.GetTotalEnergy())
227 - (p_photons.e() + aRecoil->GetPDGMass());
228
229 // Add photons
230 if (nPhotons - nNonZero > 0) {
231 // G4cout << "TKDB G4NeutronHPCaptureFS::ApplyYourself we will create additional " <<
232 // nPhotons - nNonZero << " photons" << G4endl;
233 std::vector<G4double> vRand;
234 vRand.push_back(0.0);
235 for (G4int j = 0; j != nPhotons - nNonZero - 1; j++) {
236 vRand.push_back(G4UniformRand());
237 }
238 vRand.push_back(1.0);
239 std::sort(vRand.begin(), vRand.end());
240
241 std::vector<G4double> vEPhoton;
242 for (G4int j = 0; j < (G4int)vRand.size() - 1; j++) {
243 vEPhoton.push_back(deltaE * (vRand[j + 1] - vRand[j]));
244 }
245 std::sort(vEPhoton.begin(), vEPhoton.end());
246
247 for (G4int j = 0; j < nPhotons - nNonZero - 1; j++) {
248 // Isotopic in LAB OK?
249 // Bug # 1745 DHW G4double theta = pi*G4UniformRand();
250 G4ThreeVector tempVector = G4RandomDirection()*vEPhoton[j];
251
252 p_photons += G4LorentzVector(tempVector, tempVector.mag());
253 auto theOne = new G4DynamicParticle;
254 theOne->SetDefinition(G4Gamma::Gamma());
255 theOne->SetMomentum(tempVector);
256 theResult.Get()->AddSecondary(theOne, secID);
257 }
258
259 // Add last photon
260 auto theOne = new G4DynamicParticle;
261 theOne->SetDefinition(G4Gamma::Gamma());
262 // For better momentum conservation
263 G4ThreeVector lastPhoton = -p_photons.vect().unit() * vEPhoton.back();
264 p_photons += G4LorentzVector(lastPhoton, lastPhoton.mag());
265 theOne->SetMomentum(lastPhoton);
266 theResult.Get()->AddSecondary(theOne, secID);
267 }
268
269 // Add residual
270 auto theOne = new G4DynamicParticle;
271 G4ThreeVector aMomentum =
272 theTrack.Get4Momentum().vect() + theTarget.GetMomentum() - p_photons.vect();
273 theOne->SetDefinition(aRecoil);
274 theOne->SetMomentum(aMomentum);
275 theResult.Get()->AddSecondary(theOne, secID);
276 }
277 // 101203TK END
278
279 // clean up the primary neutron
281 return theResult.Get();
282}
std::vector< G4Fragment * > G4FragmentVector
Definition G4Fragment.hh:65
@ stopAndKill
CLHEP::HepLorentzVector G4LorentzVector
G4ThreeVector G4RandomDirection()
std::vector< G4ReactionProduct * > G4ReactionProductVector
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
#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
static G4Gamma * Gamma()
Definition G4Gamma.cc:81
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)
G4double GetIonMass(G4int Z, G4int A, G4int nL=0, G4int lvl=0) const
G4double GetTemperature() const
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
Definition G4Nucleus.cc:119
void SetProjectileRP(G4ReactionProduct &aIncidentPart)
void SetTarget(G4ReactionProduct &aTarget)
G4ReactionProductVector * Sample(G4double anEnergy)
G4ParticleHPManager * fManager
G4Cache< G4HadFinalState * > theResult
G4bool GetUseOnlyPhotoEvaporation() const
G4bool GetDoNotAdjustFinalState() const
G4ReactionProductVector * GetPhotons(G4double anEnergy)
void SetICM(G4bool) override
G4FragmentVector * BreakItUp(const G4Fragment &theNucleus)
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
void SetDefinitionAndUpdateE(const G4ParticleDefinition *aParticleDefinition)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)

◆ Init()

void G4NeutronHPCaptureFS::Init ( G4double A,
G4double Z,
G4int M,
G4String & dirName,
G4String & aFSType,
G4ParticleDefinition *  )
overridevirtual

Implements G4ParticleHPFinalState.

Definition at line 284 of file G4NeutronHPCaptureFS.cc.

287{
288 G4int Z = G4lrint(ZZ);
289 G4int A = G4lrint(AA);
290 // TK110430 BEGIN
291 std::stringstream ss;
292 ss << Z;
293 G4String sZ;
294 ss >> sZ;
295 ss.clear();
296 ss << A;
297 G4String sA;
298 ss >> sA;
299
300 ss.clear();
301 G4String sM;
302 if (M > 0) {
303 ss << "m";
304 ss << M;
305 ss >> sM;
306 ss.clear();
307 }
308
309 G4String element_name = theNames.GetName(Z - 1);
310 G4String filenameMF6 = dirName + "/FSMF6/" + sZ + "_" + sA + sM + "_" + element_name;
311
312 std::istringstream theData(std::ios::in);
313 G4ParticleHPManager::GetInstance()->GetDataStream(filenameMF6, theData);
314
315 // TK110430 Only use MF6MT102 which has exactly same A and Z
316 // Even _nat_ do not select and there is no _nat_ case in ENDF-VII.0
317 if (theData.good()) {
318 hasExactMF6 = true;
319 theMF6FinalState.Init(theData);
320 return;
321 }
322 // TK110430 END
323
324 G4String tString = "/FS";
325 G4bool dbool;
327 theNames.GetName(A, Z, M, dirName, tString, dbool);
328
329 G4String filename = aFile.GetName();
330 SetAZMs(A, Z, M, aFile);
331 if (!dbool || (Z <= 2 && (theBaseZ != Z || theBaseA != A))) {
332 hasAnyData = false;
333 hasFSData = false;
334 hasXsec = false;
335 return;
336 }
337 theData.clear();
339 hasFSData = theFinalStatePhotons.InitMean(theData);
340 if (hasFSData) {
341 targetMass = theFinalStatePhotons.GetTargetMass();
342 theFinalStatePhotons.InitAngular(theData);
343 theFinalStatePhotons.InitEnergies(theData);
344 }
345}
#define M(row, col)
const G4double A[17]
void SetAZMs(G4ParticleHPDataUsed used)
void GetDataStream(const G4String &, std::istringstream &iss)
static G4ParticleHPManager * GetInstance()
G4ParticleHPDataUsed GetName(G4int A, G4int Z, const G4String &base, const G4String &rest, G4bool &active)
void InitEnergies(std::istream &aDataFile)
void InitAngular(std::istream &aDataFile)
G4bool InitMean(std::istream &aDataFile)
int G4lrint(double ad)
Definition templates.hh:134

◆ New()

G4ParticleHPFinalState * G4NeutronHPCaptureFS::New ( )
inlineoverridevirtual

Implements G4ParticleHPFinalState.

Definition at line 52 of file G4NeutronHPCaptureFS.hh.

53 {
54 auto theNew = new G4NeutronHPCaptureFS;
55 return theNew;
56 }

◆ operator=()

G4NeutronHPCaptureFS & G4NeutronHPCaptureFS::operator= ( const G4NeutronHPCaptureFS & right)
delete

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