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

#include <G4ParticleHPFissionFS.hh>

+ Inheritance diagram for G4ParticleHPFissionFS:

Public Member Functions

 G4ParticleHPFissionFS ()
 
 ~G4ParticleHPFissionFS ()
 
void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)
 
G4HadFinalStateApplyYourself (const G4HadProjectile &theTrack)
 
G4ParticleHPFinalStateNew ()
 
- Public Member Functions inherited from G4ParticleHPFinalState
 G4ParticleHPFinalState ()
 
virtual ~G4ParticleHPFinalState ()
 
void Init (G4double A, G4double Z, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)
 
virtual void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)=0
 
virtual G4HadFinalStateApplyYourself (const G4HadProjectile &)
 
virtual G4ParticleHPFinalStateNew ()=0
 
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 (G4double anA, G4double aZ, G4int aM, G4ParticleHPDataUsed used)
 
void SetProjectile (G4ParticleDefinition *projectile)
 

Additional Inherited Members

- Protected Member Functions inherited from G4ParticleHPFinalState
void adjust_final_state (G4LorentzVector)
 
G4bool DoNotAdjustFinalState ()
 
- Protected Attributes inherited from G4ParticleHPFinalState
G4bool hasXsec
 
G4bool hasFSData
 
G4bool hasAnyData
 
G4ParticleHPNames theNames
 
G4Cache< G4HadFinalState * > theResult
 
G4ParticleDefinitiontheProjectile
 
G4double theBaseA
 
G4double theBaseZ
 
G4int theBaseM
 
G4int theNDLDataZ
 
G4int theNDLDataA
 
G4int theNDLDataM
 

Detailed Description

Definition at line 46 of file G4ParticleHPFissionFS.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPFissionFS()

G4ParticleHPFissionFS::G4ParticleHPFissionFS ( )
inline

Definition at line 50 of file G4ParticleHPFissionFS.hh.

50{ hasXsec = false; produceFissionFragments = false; }

Referenced by New().

◆ ~G4ParticleHPFissionFS()

G4ParticleHPFissionFS::~G4ParticleHPFissionFS ( )
inline

Definition at line 51 of file G4ParticleHPFissionFS.hh.

51{}

Member Function Documentation

◆ ApplyYourself()

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

Reimplemented from G4ParticleHPFinalState.

Definition at line 64 of file G4ParticleHPFissionFS.cc.

65 {
66
67 //Because it may change by UI command
69
70 //G4cout << "G4ParticleHPFissionFS::ApplyYourself " << G4endl;
71// prepare neutron
72
73 if ( theResult.Get() == NULL ) theResult.Put( new G4HadFinalState );
74 theResult.Get()->Clear();
75 G4double eKinetic = theTrack.GetKineticEnergy();
76 const G4HadProjectile *incidentParticle = &theTrack;
77 G4ReactionProduct theNeutron( const_cast<G4ParticleDefinition *>(incidentParticle->GetDefinition()) );
78 theNeutron.SetMomentum( incidentParticle->Get4Momentum().vect() );
79 theNeutron.SetKineticEnergy( eKinetic );
80
81// prepare target
82 G4Nucleus aNucleus;
83 G4ReactionProduct theTarget;
84 G4double targetMass = theFS.GetMass();
85 G4ThreeVector neuVelo = (1./incidentParticle->GetDefinition()->GetPDGMass())*theNeutron.GetMomentum();
86 theTarget = aNucleus.GetBiasedThermalNucleus( targetMass, neuVelo, theTrack.GetMaterial()->GetTemperature());
87 theTarget.SetDefinition( G4IonTable::GetIonTable()->GetIon( G4int(theBaseZ), G4int(theBaseA) , 0.0 ) ); //TESTPHP
88// set neutron and target in the FS classes
89 theFS.SetNeutronRP(theNeutron);
90 theFS.SetTarget(theTarget);
91 theFC.SetNeutronRP(theNeutron);
92 theFC.SetTarget(theTarget);
93 theSC.SetNeutronRP(theNeutron);
94 theSC.SetTarget(theTarget);
95 theTC.SetNeutronRP(theNeutron);
96 theTC.SetTarget(theTarget);
97 theLC.SetNeutronRP(theNeutron);
98 theLC.SetTarget(theTarget);
99
100
101 theFF.SetNeutronRP(theNeutron);
102 theFF.SetTarget(theTarget);
103
104//TKWORK 120531
105//G4cout << theTarget.GetDefinition() << G4endl; this should be NULL
106//G4cout << "Z = " << theBaseZ << ", A = " << theBaseA << ", M = " << theBaseM << G4endl;
107// theNDLDataZ,A,M should be filled in each FS (theFS, theFC, theSC, theTC, theLC and theFF)
108////G4cout << "Z = " << theNDLDataZ << ", A = " << theNDLDataA << ", M = " << theNDLDataM << G4endl;
109
110// boost to target rest system and decide on channel.
111 theNeutron.Lorentz(theNeutron, -1*theTarget);
112
113// dice the photons
114
115 G4DynamicParticleVector * thePhotons;
116 thePhotons = theFS.GetPhotons();
117
118// select the FS in charge
119
120 eKinetic = theNeutron.GetKineticEnergy();
121 G4double xSec[4];
122 xSec[0] = theFC.GetXsec(eKinetic);
123 xSec[1] = xSec[0]+theSC.GetXsec(eKinetic);
124 xSec[2] = xSec[1]+theTC.GetXsec(eKinetic);
125 xSec[3] = xSec[2]+theLC.GetXsec(eKinetic);
126 G4int it;
127 unsigned int i=0;
128 G4double random = G4UniformRand();
129 if(xSec[3]==0)
130 {
131 it=-1;
132 }
133 else
134 {
135 for(i=0; i<4; i++)
136 {
137 it =i;
138 if(random<xSec[i]/xSec[3]) break;
139 }
140 }
141
142// dice neutron multiplicities, energies and momenta in Lab. @@
143// no energy conservation on an event-to-event basis. we rely on the data to be ok. @@
144// also for mean, we rely on the consistancy of the data. @@
145
146 G4int Prompt=0, delayed=0, all=0;
147 G4DynamicParticleVector * theNeutrons = 0;
148 switch(it) // check logic, and ask, if partials can be assumed to correspond to individual particles @@@
149 {
150 case 0:
151 theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 0);
152 if(Prompt==0&&delayed==0) Prompt=all;
153 theNeutrons = theFC.ApplyYourself(Prompt); // delayed always in FS
154 // take 'U' into account explicitly (see 5.4) in the sampling of energy @@@@
155 break;
156 case 1:
157 theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 1);
158 if(Prompt==0&&delayed==0) Prompt=all;
159 theNeutrons = theSC.ApplyYourself(Prompt); // delayed always in FS, off done in FSFissionFS
160 break;
161 case 2:
162 theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 2);
163 if(Prompt==0&&delayed==0) Prompt=all;
164 theNeutrons = theTC.ApplyYourself(Prompt); // delayed always in FS
165 break;
166 case 3:
167 theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 3);
168 if(Prompt==0&&delayed==0) Prompt=all;
169 theNeutrons = theLC.ApplyYourself(Prompt); // delayed always in FS
170 break;
171 default:
172 break;
173 }
174
175// dice delayed neutrons and photons, and fallback
176// for Prompt in case channel had no FS data; add all paricles to FS.
177
178 //TKWORK120531
179 if ( produceFissionFragments ) delayed=0;
180
181 G4double * theDecayConstants;
182
183 if( theNeutrons != 0)
184 {
185 theDecayConstants = new G4double[delayed];
186 //
187 //110527TKDB Unused codes, Detected by gcc4.6 compiler
188 //G4int nPhotons = 0;
189 //if(thePhotons!=0) nPhotons = thePhotons->size();
190 for(i=0; i<theNeutrons->size(); i++)
191 {
192 theResult.Get()->AddSecondary(theNeutrons->operator[](i));
193 }
194 delete theNeutrons;
195
196 G4DynamicParticleVector * theDelayed = 0;
197// G4cout << "delayed" << G4endl;
198 theDelayed = theFS.ApplyYourself(0, delayed, theDecayConstants);
199 for(i=0; i<theDelayed->size(); i++)
200 {
201 G4double time = -G4Log(G4UniformRand())/theDecayConstants[i];
202 time += theTrack.GetGlobalTime();
203 theResult.Get()->AddSecondary(theDelayed->operator[](i));
205 }
206 delete theDelayed;
207 }
208 else
209 {
210// cout << " all = "<<all<<G4endl;
211 theFS.SampleNeutronMult(all, Prompt, delayed, eKinetic, 0);
212 theDecayConstants = new G4double[delayed];
213 if(Prompt==0&&delayed==0) Prompt=all;
214 theNeutrons = theFS.ApplyYourself(Prompt, delayed, theDecayConstants);
215 //110527TKDB Unused codes, Detected by gcc4.6 compiler
216 //G4int nPhotons = 0;
217 //if(thePhotons!=0) nPhotons = thePhotons->size();
218 G4int i0;
219 for(i0=0; i0<Prompt; i0++)
220 {
221 theResult.Get()->AddSecondary(theNeutrons->operator[](i0));
222 }
223
224//G4cout << "delayed" << G4endl;
225 for(i0=Prompt; i0<Prompt+delayed; i0++)
226 {
227 // Protect against the very rare case of division by zero
228 G4double time = 0.0;
229 if ( theDecayConstants[i0-Prompt] > 1.0e-30 ) {
230 time = -G4Log(G4UniformRand())/theDecayConstants[i0-Prompt];
231 } else {
233 ed << " theDecayConstants[i0-Prompt]=" << theDecayConstants[i0-Prompt]
234 << " -> cannot sample the time : set it to 0.0 !" << G4endl;
235 G4Exception( "G4ParticleHPFissionFS::ApplyYourself ", "HAD_FISSIONHP_001", JustWarning, ed );
236 }
237
238 time += theTrack.GetGlobalTime();
239 theResult.Get()->AddSecondary(theNeutrons->operator[](i0));
241 }
242 delete theNeutrons;
243 }
244 delete [] theDecayConstants;
245// cout << "all delayed "<<delayed<<G4endl;
246 unsigned int nPhotons = 0;
247 if(thePhotons!=0)
248 {
249 nPhotons = thePhotons->size();
250 for(i=0; i<nPhotons; i++)
251 {
252 theResult.Get()->AddSecondary(thePhotons->operator[](i));
253 }
254 delete thePhotons;
255 }
256
257// finally deal with local energy depositions.
258// G4cout <<"Number of secondaries = "<<theResult.GetNumberOfSecondaries()<< G4endl;
259// G4cout <<"Number of photons = "<<nPhotons<<G4endl;
260// G4cout <<"Number of Prompt = "<<Prompt<<G4endl;
261// G4cout <<"Number of delayed = "<<delayed<<G4endl;
262
263 G4ParticleHPFissionERelease * theERelease = theFS.GetEnergyRelease();
264 G4double eDepByFragments = theERelease->GetFragmentKinetic();
265 //theResult.SetLocalEnergyDeposit(eDepByFragments);
266 if ( !produceFissionFragments ) theResult.Get()->SetLocalEnergyDeposit(eDepByFragments);
267// cout << "local energy deposit" << eDepByFragments<<G4endl;
268// clean up the primary neutron
270 //G4cout << "Prompt = " << Prompt << ", Delayed = " << delayed << ", All= " << all << G4endl;
271 //G4cout << "local energy deposit " << eDepByFragments/MeV << "MeV " << G4endl;
272
273 //TKWORK120531
274 if ( produceFissionFragments )
275 {
276 G4int fragA_Z=0;
277 G4int fragA_A=0;
278 G4int fragA_M=0;
279 // System is traget rest!
280 theFF.GetAFissionFragment(eKinetic,fragA_Z,fragA_A,fragA_M);
281 G4int fragB_Z=(G4int)theBaseZ-fragA_Z;
282 G4int fragB_A=(G4int)theBaseA-fragA_A-Prompt;
283 //fragA_M ignored
284 //G4int fragB_M=theBaseM-fragA_M;
285 //G4cout << fragA_Z << " " << fragA_A << " " << fragA_M << G4endl;
286 //G4cout << fragB_Z << " " << fragB_A << G4endl;
287
289 //Excitation energy is not taken into account
290 G4ParticleDefinition* pdA = pt->GetIon( fragA_Z , fragA_A , 0.0 );
291 G4ParticleDefinition* pdB = pt->GetIon( fragB_Z , fragB_A , 0.0 );
292
293 //Isotropic Distribution
294 G4double phi = twopi*G4UniformRand();
295 // Bug #1745 DHW G4double theta = pi*G4UniformRand();
296 G4double costheta = 2.*G4UniformRand()-1.;
297 G4double theta = std::acos(costheta);
298 G4double sinth = std::sin(theta);
299 G4ThreeVector direction(sinth*std::cos(phi), sinth*std::sin(phi), costheta);
300
301 // Just use ENDF value for this
302 G4double ER = eDepByFragments;
303 G4double ma = pdA->GetPDGMass();
304 G4double mb = pdB->GetPDGMass();
305 G4double EA = ER / ( 1 + ma/mb);
306 G4double EB = ER - EA;
307 G4DynamicParticle* dpA = new G4DynamicParticle( pdA , direction , EA);
308 G4DynamicParticle* dpB = new G4DynamicParticle( pdB , -direction , EB);
309 theResult.Get()->AddSecondary(dpA);
310 theResult.Get()->AddSecondary(dpB);
311 }
312 //TKWORK 120531 END
313
314 return theResult.Get();
315 }
std::vector< G4DynamicParticle * > G4DynamicParticleVector
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
@ stopAndKill
G4double G4Log(G4double x)
Definition: G4Log.hh:226
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
#define G4UniformRand()
Definition: Randomize.hh:52
Hep3Vector vect() const
value_type & Get() const
Definition: G4Cache.hh:315
void Put(const value_type &val) const
Definition: G4Cache.hh:321
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
std::size_t GetNumberOfSecondaries() const
G4HadSecondary * GetSecondary(size_t i)
void SetLocalEnergyDeposit(G4double aE)
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetGlobalTime() const
void SetTime(G4double aT)
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:522
static G4IonTable * GetIonTable()
Definition: G4IonTable.cc:170
G4double GetTemperature() const
Definition: G4Material.hh:180
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
Definition: G4Nucleus.cc:113
G4DynamicParticleVector * ApplyYourself(G4int nNeutrons)
void GetAFissionFragment(G4double, G4int &, G4int &, G4int &)
G4DynamicParticleVector * ApplyYourself(G4int Prompt, G4int delayed, G4double *decayconst)
void SampleNeutronMult(G4int &all, G4int &Prompt, G4int &delayed, G4double energy, G4int off)
G4ParticleHPFissionERelease * GetEnergyRelease()
void SetNeutronRP(const G4ReactionProduct &aNeutron)
void SetTarget(const G4ReactionProduct &aTarget)
G4DynamicParticleVector * GetPhotons()
G4Cache< G4HadFinalState * > theResult
virtual G4double GetXsec(G4double anEnergy)
void SetTarget(const G4ReactionProduct &aTarget)
void SetNeutronRP(const G4ReactionProduct &aNeutron)
G4DynamicParticleVector * ApplyYourself(G4int NNeutrons)
static G4ParticleHPManager * GetInstance()
G4DynamicParticleVector * ApplyYourself(G4int NNeutrons)
G4DynamicParticleVector * ApplyYourself(G4int NNeutrons)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)

◆ Init()

void G4ParticleHPFissionFS::Init ( G4double  A,
G4double  Z,
G4int  M,
G4String dirName,
G4String aFSType,
G4ParticleDefinition projectile 
)
virtual

Implements G4ParticleHPFinalState.

Definition at line 43 of file G4ParticleHPFissionFS.cc.

44 {
45 //G4cout << "G4ParticleHPFissionFS::Init " << A << " " << Z << " " << M << G4endl;
46 theFS.Init(A, Z, M, dirName, aFSType, projectile);
47 theFC.Init(A, Z, M, dirName, aFSType, projectile);
48 theSC.Init(A, Z, M, dirName, aFSType, projectile);
49 theTC.Init(A, Z, M, dirName, aFSType, projectile);
50 theLC.Init(A, Z, M, dirName, aFSType, projectile);
51
52 theFF.Init(A, Z, M, dirName, aFSType, projectile);
53 if ( G4ParticleHPManager::GetInstance()->GetProduceFissionFragments() && theFF.HasFSData() )
54 {
55 G4cout << "Fission fragment production is now activated in HP package for "
56 << "Z = " << (G4int)Z
57 << ", A = " << (G4int)A
58 //<< "M = " << M
59 << G4endl;
60 G4cout << "As currently modeled this option precludes production of delayed neutrons from fission fragments." << G4endl;
61 produceFissionFragments = true;
62 }
63 }
double A(double temperature)
G4GLOB_DLL std::ostream G4cout
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)

◆ New()

G4ParticleHPFinalState * G4ParticleHPFissionFS::New ( )
inlinevirtual

Implements G4ParticleHPFinalState.

Definition at line 54 of file G4ParticleHPFissionFS.hh.


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