Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ParticleHPInelasticBaseFS Class Referenceabstract

#include <G4ParticleHPInelasticBaseFS.hh>

Inheritance diagram for G4ParticleHPInelasticBaseFS:
Collaboration diagram for G4ParticleHPInelasticBaseFS:

Public Member Functions

 G4ParticleHPInelasticBaseFS ()
 
virtual ~G4ParticleHPInelasticBaseFS ()
 
void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &bit, G4ParticleDefinition *)
 
void BaseApply (const G4HadProjectile &theTrack, G4ParticleDefinition **theDefs, G4int nDef)
 
void InitGammas (G4double AR, G4double ZR)
 
virtual G4HadFinalStateApplyYourself (const G4HadProjectile &theTrack)=0
 
virtual G4ParticleHPFinalStateNew ()=0
 
virtual G4double GetXsec (G4double anEnergy)
 
virtual G4ParticleHPVectorGetXsec ()
 
- Public Member Functions inherited from G4ParticleHPFinalState
 G4ParticleHPFinalState ()
 
virtual ~G4ParticleHPFinalState ()
 
void Init (G4double A, G4double Z, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)
 
G4bool HasXsec ()
 
G4bool HasFSData ()
 
G4bool HasAnyData ()
 
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)
 

Protected Attributes

G4ParticleHPVectortheXsection
 
G4ParticleHPEnergyDistributiontheEnergyDistribution
 
G4ParticleHPAngulartheAngularDistribution
 
G4ParticleHPEnAngCorrelationtheEnergyAngData
 
G4ParticleHPPhotonDisttheFinalStatePhotons
 
G4double theNuclearMassDifference
 
G4ParticleHPDeExGammas theGammas
 
G4String gammaPath
 
- Protected Attributes inherited from G4ParticleHPFinalState
G4bool hasXsec
 
G4bool hasFSData
 
G4bool hasAnyData
 
G4ParticleHPNames theNames
 
G4Cache< G4HadFinalState * > theResult
 
G4double theBaseA
 
G4double theBaseZ
 
G4int theBaseM
 
G4int theNDLDataZ
 
G4int theNDLDataA
 
G4int theNDLDataM
 
G4ParticleDefinitiontheProjectile
 

Additional Inherited Members

- Protected Member Functions inherited from G4ParticleHPFinalState
void adjust_final_state (G4LorentzVector)
 
G4bool DoNotAdjustFinalState ()
 

Detailed Description

Definition at line 43 of file G4ParticleHPInelasticBaseFS.hh.

Constructor & Destructor Documentation

G4ParticleHPInelasticBaseFS::G4ParticleHPInelasticBaseFS ( )
inline

Definition at line 47 of file G4ParticleHPInelasticBaseFS.hh.

48  {
49  hasXsec = true;
51 
54  theEnergyAngData = 0;
56 
58 
59  }
G4ParticleHPEnAngCorrelation * theEnergyAngData
G4ParticleHPEnergyDistribution * theEnergyDistribution
G4ParticleHPPhotonDist * theFinalStatePhotons
G4ParticleHPAngular * theAngularDistribution
virtual G4ParticleHPInelasticBaseFS::~G4ParticleHPInelasticBaseFS ( )
inlinevirtual

Definition at line 60 of file G4ParticleHPInelasticBaseFS.hh.

61  {
62  delete theXsection;
65  if(theEnergyAngData!=0) delete theEnergyAngData;
67  }
G4ParticleHPEnAngCorrelation * theEnergyAngData
G4ParticleHPEnergyDistribution * theEnergyDistribution
G4ParticleHPPhotonDist * theFinalStatePhotons
G4ParticleHPAngular * theAngularDistribution

Member Function Documentation

void G4ParticleHPInelasticBaseFS::BaseApply ( const G4HadProjectile theTrack,
G4ParticleDefinition **  theDefs,
G4int  nDef 
)

Definition at line 182 of file G4ParticleHPInelasticBaseFS.cc.

185 {
186 
187 // prepare neutron
188  if ( theResult.Get() == NULL ) theResult.Put( new G4HadFinalState );
189  theResult.Get()->Clear();
190  G4double eKinetic = theTrack.GetKineticEnergy();
191  const G4HadProjectile *hadProjectile = &theTrack;
192  G4ReactionProduct incidReactionProduct( const_cast<G4ParticleDefinition *>(hadProjectile->GetDefinition()) );
193  incidReactionProduct.SetMomentum( hadProjectile->Get4Momentum().vect() );
194  incidReactionProduct.SetKineticEnergy( eKinetic );
195 
196 // prepare target
197  G4double targetMass;
198  G4double eps = 0.0001;
199  targetMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps))) /
200  //theProjectile->GetPDGMass();
202 
203  //give priority to ENDF vales for target mass
204  if(theEnergyAngData!=0)
205  { targetMass = theEnergyAngData->GetTargetMass(); }
207  { targetMass = theAngularDistribution->GetTargetMass(); }
208 
209 //080731a
210 //110512 TKDB ENDF-VII.0 21Sc45 has trouble in MF4MT22 (n,np) targetMass is not properly recorded.
211 //if ( targetMass == 0 ) G4cout << "080731a It looks like something wrong value in G4NDL, please update the latest version. If you use the latest, then please report this problem to Geant4 Hyper news." << G4endl;
212  if ( targetMass == 0 )
213  {
214  //G4cout << "TKDB targetMass = 0; ENDF-VII.0 21Sc45 has trouble in MF4MT22 (n,np) targetMass is not properly recorded. This could be a similar situation." << G4endl;
215  //targetMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps))) / theProjectile->GetPDGMass();
216  targetMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps))) / G4Neutron::Neutron()->GetPDGMass();
217  }
218 
219  G4Nucleus aNucleus;
220  G4ReactionProduct theTarget;
221  //G4ThreeVector neuVelo = (1./hadProjectile->GetDefinition()->GetPDGMass())*incidReactionProduct.GetMomentum();
222  //theTarget = aNucleus.GetBiasedThermalNucleus( targetMass, neuVelo, theTrack.GetMaterial()->GetTemperature());
223  //G4Nucleus::GetBiasedThermalNucleus requests normalization of mass and velocity in neutron mass
224  G4ThreeVector neuVelo = (1./G4Neutron::Neutron()->GetPDGMass())*incidReactionProduct.GetMomentum();
225  theTarget = aNucleus.GetBiasedThermalNucleus( targetMass, neuVelo, theTrack.GetMaterial()->GetTemperature());
226 
227  theTarget.SetDefinition( G4IonTable::GetIonTable()->GetIon( G4int(theBaseZ), G4int(theBaseA) , 0.0 ) );
228 
229 // prepare energy in target rest frame
230  G4ReactionProduct boosted;
231  boosted.Lorentz(incidReactionProduct, theTarget);
232  eKinetic = boosted.GetKineticEnergy();
233  G4double orgMomentum = boosted.GetMomentum().mag();
234 
235 // Take N-body phase-space distribution, if no other data present.
236  if(!HasFSData()) // adding the residual is trivial here @@@
237  {
238  G4ParticleHPNBodyPhaseSpace thePhaseSpaceDistribution;
239  G4double aPhaseMass=0;
240  G4int ii;
241  for(ii=0; ii<nDef; ii++)
242  {
243  aPhaseMass+=theDefs[ii]->GetPDGMass();
244  }
245  thePhaseSpaceDistribution.Init(aPhaseMass, nDef);
246  thePhaseSpaceDistribution.SetProjectileRP(&incidReactionProduct);
247  thePhaseSpaceDistribution.SetTarget(&theTarget);
248  for(ii=0; ii<nDef; ii++)
249  {
250  G4double massCode = 1000.*std::abs(theDefs[ii]->GetPDGCharge());
251  massCode += theDefs[ii]->GetBaryonNumber();
252  G4double dummy = 0;
253  G4ReactionProduct * aSec = thePhaseSpaceDistribution.Sample(eKinetic, massCode, dummy);
254  aSec->Lorentz(*aSec, -1.*theTarget);
255  G4DynamicParticle * aPart = new G4DynamicParticle();
256  aPart->SetDefinition(aSec->GetDefinition());
257  aPart->SetMomentum(aSec->GetMomentum());
258  delete aSec;
259  theResult.Get()->AddSecondary(aPart);
260 #ifdef G4PHPDEBUG
261  if( getenv("G4ParticleHPDebug")) G4cout << this << " G4ParticleHPInelasticBaseFS::BaseApply NoFSData add secondary " << aPart->GetParticleDefinition()->GetParticleName() << " E= " << aPart->GetKineticEnergy() << " NSECO " << theResult.Get()->GetNumberOfSecondaries() << G4endl;
262 #endif
263  }
265  //TK120607
266  //Final momentum check should be done before return
268  G4LorentzVector targ_4p_lab ( theTarget.GetMomentum() , std::sqrt( targ_pd->GetPDGMass()*targ_pd->GetPDGMass() + theTarget.GetMomentum().mag2() ) );
269  G4LorentzVector proj_4p_lab = theTrack.Get4Momentum();
270  G4LorentzVector init_4p_lab = proj_4p_lab + targ_4p_lab;
271  adjust_final_state ( init_4p_lab );
272 
273  return;
274  }
275 
276 // set target and neutron in the relevant exit channel
277  if(theAngularDistribution!=0)
278  {
279  theAngularDistribution->SetTarget(theTarget);
280  theAngularDistribution->SetProjectileRP(incidReactionProduct);
281  }
282  else if(theEnergyAngData!=0)
283  {
284  theEnergyAngData->SetTarget(theTarget);
285  theEnergyAngData->SetProjectileRP(incidReactionProduct);
286  }
287 
288  G4ReactionProductVector * tmpHadrons = 0;
289 #ifdef G4PHPDEBUG
290  //To avoid compilation error around line 532.
291  G4int ii(0);
292 #endif
293  G4int dummy;
294  unsigned int i;
295 
296  if(theEnergyAngData != 0)
297  {
298  tmpHadrons = theEnergyAngData->Sample(eKinetic);
299 
300  if ( !getenv( "G4PHP_DO_NOT_ADJUST_FINAL_STATE" ) ) {
301  //141017 Fix BEGIN
302  //Adjust A and Z in the case of miss much between selected data and target nucleus
303  if ( tmpHadrons != NULL ) {
304  G4int sumA = 0;
305  G4int sumZ = 0;
306  G4int maxA = 0;
307  G4int jAtMaxA = 0;
308  for ( G4int j = 0 ; j != (G4int)tmpHadrons->size() ; j++ ) {
309  if ( tmpHadrons->at(j)->GetDefinition()->GetBaryonNumber() > maxA ) {
310  maxA = tmpHadrons->at(j)->GetDefinition()->GetBaryonNumber();
311  jAtMaxA = j;
312  }
313  sumA += tmpHadrons->at(j)->GetDefinition()->GetBaryonNumber();
314  sumZ += G4int( tmpHadrons->at(j)->GetDefinition()->GetPDGCharge() + eps );
315  }
316  G4int dA = (G4int)theBaseA + hadProjectile->GetDefinition()->GetBaryonNumber() - sumA;
317  G4int dZ = (G4int)theBaseZ + G4int( hadProjectile->GetDefinition()->GetPDGCharge() + eps ) - sumZ;
318  if ( dA < 0 || dZ < 0 ) {
319  G4int newA = tmpHadrons->at(jAtMaxA)->GetDefinition()->GetBaryonNumber() + dA ;
320  G4int newZ = G4int( tmpHadrons->at(jAtMaxA)->GetDefinition()->GetPDGCharge() + eps ) + dZ;
321  G4ParticleDefinition* pd = G4IonTable::GetIonTable()->GetIon ( newZ , newA );
322  tmpHadrons->at( jAtMaxA )->SetDefinition( pd );
323  }
324  }
325  //141017 Fix END
326  }
327  }
328  else if(theAngularDistribution!= 0)
329  {
330  G4bool * Done = new G4bool[nDef];
331  G4int i0;
332  for(i0=0; i0<nDef; i0++) Done[i0] = false;
333 
334 //Following lines are commented out to fix coverity defeat 58622
335 // if(tmpHadrons == 0)
336 // {
337  tmpHadrons = new G4ReactionProductVector;
338 // }
339 // else
340 // {
341 // for(i=0; i<tmpHadrons->size(); i++)
342 // {
343 // for(ii=0; ii<nDef; ii++)
344 // if(!Done[ii] && tmpHadrons->operator[](i)->GetDefinition() == theDefs[ii])
345 // Done[ii] = true;
346 // }
347 #ifdef G4PHPDEBUG
348 // if( getenv("G4ParticleHPDebug")) G4cout << " G4ParticleHPInelasticBaseFS::BaseApply secondary previously added " << tmpHadrons->operator[](i)->GetDefinition()->GetParticleName() << " E= " << tmpHadrons->operator[](i)->GetKineticEnergy() << G4endl;
349 #endif
350 // }
351  G4ReactionProduct * aHadron;
352  G4double localMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps)));
353  G4ThreeVector bufferedDirection(0,0,0);
354  for(i0=0; i0<nDef; i0++)
355  {
356  if(!Done[i0])
357  {
358  aHadron = new G4ReactionProduct;
359  if(theEnergyDistribution!=0)
360  {
361  aHadron->SetDefinition(theDefs[i0]);
362  aHadron->SetKineticEnergy(theEnergyDistribution->Sample(eKinetic, dummy));
363  }
364  else if(nDef == 1)
365  {
366  aHadron->SetDefinition(theDefs[i0]);
367  aHadron->SetKineticEnergy(eKinetic);
368  }
369  else if(nDef == 2)
370  {
371  aHadron->SetDefinition(theDefs[i0]);
372  aHadron->SetKineticEnergy(50*CLHEP::MeV);
373  }
374  else
375  {
376  throw G4HadronicException(__FILE__, __LINE__, "No energy distribution to sample from in InelasticBaseFS::BaseApply");
377  }
379  if(theEnergyDistribution==0 && nDef == 2)
380  {
381  if(i0==0)
382  {
383  G4double mass1 = theDefs[0]->GetPDGMass();
384  G4double mass2 = theDefs[1]->GetPDGMass();
385  G4double massn = theProjectile->GetPDGMass();
386  G4int z1 = static_cast<G4int>(theBaseZ+eps-theDefs[0]->GetPDGCharge()-theDefs[1]->GetPDGCharge());
387  G4int a1 = static_cast<G4int>(theBaseA+eps)-theDefs[0]->GetBaryonNumber()-theDefs[1]->GetBaryonNumber();
388  G4double concreteMass = G4NucleiProperties::GetNuclearMass(a1, z1);
389  G4double availableEnergy = eKinetic+massn+localMass-mass1-mass2-concreteMass;
390  // available kinetic energy in CMS (non relativistic)
391  G4double emin = availableEnergy+mass1+mass2 - std::sqrt((mass1+mass2)*(mass1+mass2)+orgMomentum*orgMomentum);
392  G4double p1=std::sqrt(2.*mass2*emin);
393  bufferedDirection = p1*aHadron->GetMomentum().unit();
394 #ifdef G4PHPDEBUG
395  if(getenv("G4ParticleHPDebug")) // @@@@@ verify the nucleon counting...
396  {
397  G4cout << "G4ParticleHPInelasticBaseFS "<<z1<<" "<<theBaseZ<<" "<<a1<<" "<<theBaseA<<" "<<availableEnergy<<" "
398  << emin<<G4endl;
399  }
400 #endif
401  }
402  else
403  {
404  bufferedDirection = -bufferedDirection;
405  }
406  // boost from cms to lab
407 #ifdef G4PHPDEBUG
408  if(getenv("G4ParticleHPDebug"))
409  {
410  G4cout << " G4ParticleHPInelasticBaseFS "<<bufferedDirection.mag2()<<G4endl;
411  }
412 #endif
413  aHadron->SetTotalEnergy( std::sqrt(aHadron->GetMass()*aHadron->GetMass()
414  +bufferedDirection.mag2()) );
415  aHadron->SetMomentum(bufferedDirection);
416  aHadron->Lorentz(*aHadron, -1.*(theTarget+incidReactionProduct));
417 #ifdef G4PHPDEBUG
418  if(getenv("G4ParticleHPDebug"))
419  {
420  G4cout << " G4ParticleHPInelasticBaseFS "<<aHadron->GetTotalEnergy()<<" "<<aHadron->GetMomentum()<<G4endl;
421  }
422 #endif
423  }
424  tmpHadrons->push_back(aHadron);
425 #ifdef G4PHPDEBUG
426  if( getenv("G4ParticleHPDebug")) G4cout << " G4ParticleHPInelasticBaseFS::BaseApply FSData add secondary " << aHadron->GetDefinition()->GetParticleName() << " E= " << aHadron->GetKineticEnergy() << G4endl;
427 #endif
428  }
429  }
430  delete [] Done;
431  }
432  else
433  {
434  throw G4HadronicException(__FILE__, __LINE__, "No data to create the neutrons in NInelasticFS");
435  }
436 
437  G4ReactionProductVector * thePhotons = 0;
438  if(theFinalStatePhotons!=0)
439  {
440  // the photon distributions are in the Nucleus rest frame.
441  G4ReactionProduct boosted_tmp;
442  boosted_tmp.Lorentz(incidReactionProduct, theTarget);
443  G4double anEnergy = boosted_tmp.GetKineticEnergy();
444  thePhotons = theFinalStatePhotons->GetPhotons(anEnergy);
445  if(thePhotons!=0)
446  {
447  for(i=0; i<thePhotons->size(); i++)
448  {
449  // back to lab
450  thePhotons->operator[](i)->Lorentz(*(thePhotons->operator[](i)), -1.*theTarget);
451  }
452  }
453  }
454  else if(theEnergyAngData!=0)
455  {
456 
457  // PA130927: do not create photons to adjust binding energy
458  G4bool bAdjustPhotons = true;
459 #ifdef PHP_AS_HP
460  bAdjustPhotons = true;
461 #else
462  if ( getenv( "G4PHP_DO_NOT_ADJUST_FINAL_STATE" ) ) bAdjustPhotons = false;
463 #endif
464 
465  if( bAdjustPhotons ) {
466  G4double theGammaEnergy = theEnergyAngData->GetTotalMeanEnergy();
467  G4double anEnergy = boosted.GetKineticEnergy();
468  theGammaEnergy = anEnergy-theGammaEnergy;
469  theGammaEnergy += theNuclearMassDifference;
470  G4double eBindProducts = 0;
471  G4double eBindN = 0;
472  G4double eBindP = 0;
477  G4int ia=0;
478  for(i=0; i<tmpHadrons->size(); i++)
479  {
480  if(tmpHadrons->operator[](i)->GetDefinition() == G4Neutron::Neutron())
481  {
482  eBindProducts+=eBindN;
483  }
484  else if(tmpHadrons->operator[](i)->GetDefinition() == G4Proton::Proton())
485  {
486  eBindProducts+=eBindP;
487  }
488  else if(tmpHadrons->operator[](i)->GetDefinition() == G4Deuteron::Deuteron())
489  {
490  eBindProducts+=eBindD;
491  }
492  else if(tmpHadrons->operator[](i)->GetDefinition() == G4Triton::Triton())
493  {
494  eBindProducts+=eBindT;
495  }
496  else if(tmpHadrons->operator[](i)->GetDefinition() == G4He3::He3())
497  {
498  eBindProducts+=eBindHe3;
499  }
500  else if(tmpHadrons->operator[](i)->GetDefinition() == G4Alpha::Alpha())
501  {
502  eBindProducts+=eBindA;
503  ia++;
504  }
505  }
506 
507  theGammaEnergy += eBindProducts;
508 
509 #ifdef G4PHPDEBUG
510  if( getenv("G4ParticleHPDebug")) G4cout << " G4ParticleHPInelasticBaseFS::BaseApply gamma Energy " << theGammaEnergy << " eBindProducts " << eBindProducts << G4endl;
511 #endif
512 
513  //101111
514  //Special treatment for Be9 + n -> 2n + Be8 -> 2n + a + a
515  if ( (G4int)(theBaseZ+eps) == 4 && (G4int)(theBaseA+eps) == 9 )
516  {
517  // This only valid for G4NDL3.13,,,
518  if ( std::abs( theNuclearMassDifference -
521  && ia == 2 )
522  {
523  theGammaEnergy -= (2*eBindA);
524  }
525  }
526 
527  G4ReactionProductVector * theOtherPhotons = 0;
528  G4int iLevel;
529  while(theGammaEnergy>=theGammas.GetLevelEnergy(0)) // Loop checking, 11.05.2015, T. Koi
530  {
531  for(iLevel=theGammas.GetNumberOfLevels()-1; iLevel>=0; iLevel--)
532  {
533  if(theGammas.GetLevelEnergy(iLevel)<theGammaEnergy) break;
534  }
535  if(iLevel==0||iLevel==theGammas.GetNumberOfLevels()-1)
536  {
537  theOtherPhotons = theGammas.GetDecayGammas(iLevel);
538 #ifdef G4PHPDEBUG
539  if( getenv("G4ParticleHPDebug")) G4cout << " G4ParticleHPInelasticBaseFS::BaseApply adding gamma from level " << iLevel << theOtherPhotons->operator[](ii)->GetKineticEnergy() << G4endl;
540 #endif
541  }
542  else
543  {
544  G4double random = G4UniformRand();
545  G4double eLow = theGammas.GetLevelEnergy(iLevel);
546  G4double eHigh = theGammas.GetLevelEnergy(iLevel+1);
547  if(random > (eHigh-eLow)/(theGammaEnergy-eLow)) iLevel++;
548  theOtherPhotons = theGammas.GetDecayGammas(iLevel);
549  }
550  if(thePhotons==0) thePhotons = new G4ReactionProductVector;
551  if(theOtherPhotons != 0)
552  {
553  for(unsigned int iii=0; iii<theOtherPhotons->size(); iii++)
554  {
555  thePhotons->push_back(theOtherPhotons->operator[](iii));
556 #ifdef G4PHPDEBUG
557  if( getenv("G4ParticleHPDebug"))
558  G4cout << iii << " G4ParticleHPInelasticBaseFS::BaseApply adding gamma " << theOtherPhotons->operator[](iii)->GetKineticEnergy() << G4endl;
559 #endif
560  }
561  delete theOtherPhotons;
562  }
563  theGammaEnergy -= theGammas.GetLevelEnergy(iLevel);
564  if(iLevel == -1) break;
565  }
566  }
567  }
568 
569  // fill the result
570  unsigned int nSecondaries = tmpHadrons->size();
571  unsigned int nPhotons = 0;
572  if(thePhotons!=0) { nPhotons = thePhotons->size(); }
573  nSecondaries += nPhotons;
574  G4DynamicParticle * theSec;
575 #ifdef G4PHPDEBUG
576  if( getenv("G4ParticleHPDebug")) G4cout << " G4ParticleHPInelasticBaseFS::BaseApply N hadrons " << nSecondaries-nPhotons << G4endl;
577 #endif
578 
579  for(i=0; i<nSecondaries-nPhotons; i++)
580  {
581  theSec = new G4DynamicParticle;
582  theSec->SetDefinition(tmpHadrons->operator[](i)->GetDefinition());
583  theSec->SetMomentum(tmpHadrons->operator[](i)->GetMomentum());
584  theResult.Get()->AddSecondary(theSec);
585 #ifdef G4PHPDEBUG
586  if( getenv("G4ParticleHPDebug")) G4cout << this << " G4ParticleHPInelasticBaseFS::BaseApply add secondary2 " << theSec->GetParticleDefinition()->GetParticleName() << " E= " << theSec->GetKineticEnergy() << " NSECO " << theResult.Get()->GetNumberOfSecondaries() << G4endl;
587 #endif
588  if( getenv("G4PHPTEST") ) G4cout << " InelasticBaseFS COS THETA " << std::cos(theSec->GetMomentum().theta()) << " " << (theSec->GetMomentum().theta()) << " " << theSec->GetMomentum() << " E "<< theSec->GetKineticEnergy() << " " << theSec->GetDefinition()->GetParticleName() << G4endl; //GDEB
589  delete tmpHadrons->operator[](i);
590  }
591 #ifdef G4PHPDEBUG
592  if( getenv("G4ParticleHPDebug")) G4cout << " G4ParticleHPInelasticBaseFS::BaseApply N photons " << nPhotons << G4endl;
593 #endif
594  if(thePhotons != 0)
595  {
596  for(i=0; i<nPhotons; i++)
597  {
598  theSec = new G4DynamicParticle;
599  theSec->SetDefinition(thePhotons->operator[](i)->GetDefinition());
600  theSec->SetMomentum(thePhotons->operator[](i)->GetMomentum());
601  theResult.Get()->AddSecondary(theSec);
602 #ifdef G4PHPDEBUG
603  if( getenv("G4ParticleHPDebug")) G4cout << this << " G4ParticleHPInelasticBaseFS::BaseApply add secondary3 " << theSec->GetParticleDefinition()->GetParticleName() << " E= " << theSec->GetKineticEnergy() << " NSECO " << theResult.Get()->GetNumberOfSecondaries() << G4endl;
604 #endif
605  delete thePhotons->operator[](i);
606  }
607  }
608 
609 // some garbage collection
610  delete thePhotons;
611  delete tmpHadrons;
612 
613 //080721
614  G4ParticleDefinition* targ_pd = G4IonTable::GetIonTable()->GetIon ( (G4int)theBaseZ , (G4int)theBaseA , 0.0 );
615  G4LorentzVector targ_4p_lab ( theTarget.GetMomentum() , std::sqrt( targ_pd->GetPDGMass()*targ_pd->GetPDGMass() + theTarget.GetMomentum().mag2() ) );
616  G4LorentzVector proj_4p_lab = theTrack.Get4Momentum();
617  G4LorentzVector init_4p_lab = proj_4p_lab + targ_4p_lab;
618  adjust_final_state ( init_4p_lab );
619 
620 // clean up the primary neutron
622 }
G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass)
G4ReactionProductVector * GetDecayGammas(G4int aLevel)
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4Cache< G4HadFinalState * > theResult
void SetMomentum(const G4ThreeVector &momentum)
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
G4double GetKineticEnergy() const
static constexpr double keV
void SetKineticEnergy(const G4double en)
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetProjectileRP(G4ReactionProduct &aIncidentPart)
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:503
value_type & Get() const
Definition: G4Cache.hh:282
G4ParticleHPEnAngCorrelation * theEnergyAngData
static const G4double eps
G4ParticleDefinition * GetDefinition() const
int G4int
Definition: G4Types.hh:78
G4double Sample(G4double anEnergy, G4int &it)
G4ReactionProductVector * Sample(G4double anEnergy)
const G4String & GetParticleName() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetProjectileRP(const G4ReactionProduct &anIncidentParticleRP)
G4ParticleDefinition * theProjectile
void Init(G4double aMass, G4int aCount)
void SetStatusChange(G4HadFinalStateStatus aS)
std::vector< G4ReactionProduct * > G4ReactionProductVector
void SetTarget(const G4ReactionProduct &aTarget)
void adjust_final_state(G4LorentzVector)
const G4ParticleDefinition * GetDefinition() const
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
Definition: G4Nucleus.cc:113
Hep3Vector vect() const
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
void SampleAndUpdate(G4ReactionProduct &anIncidentParticle)
const G4ParticleDefinition * GetDefinition() const
bool G4bool
Definition: G4Types.hh:79
G4double GetKineticEnergy() const
void SetTotalEnergy(const G4double en)
static constexpr double MeV
static G4Triton * Triton()
Definition: G4Triton.cc:95
static G4Proton * Proton()
Definition: G4Proton.cc:93
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
const G4ParticleDefinition * GetParticleDefinition() const
const G4LorentzVector & Get4Momentum() const
void SetProjectileRP(G4ReactionProduct *aIncidentParticleRP)
static G4Deuteron * Deuteron()
Definition: G4Deuteron.cc:94
static G4IonTable * GetIonTable()
Definition: G4IonTable.hh:78
double theta() const
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
void SetTarget(G4ReactionProduct *aTarget)
G4double GetPDGMass() const
static G4double GetBindingEnergy(const G4int A, const G4int Z)
G4ParticleHPEnergyDistribution * theEnergyDistribution
Hep3Vector unit() const
void SetTarget(G4ReactionProduct &aTarget)
double mag2() const
G4ReactionProductVector * GetPhotons(G4double anEnergy)
G4ThreeVector GetMomentum() const
G4double GetTemperature() const
Definition: G4Material.hh:182
#define G4endl
Definition: G4ios.hh:61
const G4Material * GetMaterial() const
static G4Alpha * Alpha()
Definition: G4Alpha.cc:89
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
double G4double
Definition: G4Types.hh:76
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4ParticleHPPhotonDist * theFinalStatePhotons
G4double GetPDGCharge() const
static G4He3 * He3()
Definition: G4He3.cc:94
double mag() const
void Put(const value_type &val) const
Definition: G4Cache.hh:286
G4double GetLevelEnergy(G4int aLevel)
G4double GetMass() const
G4int GetNumberOfSecondaries() const
G4ParticleHPAngular * theAngularDistribution
G4ThreeVector GetMomentum() const

Here is the caller graph for this function:

virtual G4double G4ParticleHPInelasticBaseFS::GetXsec ( G4double  anEnergy)
inlinevirtual

Reimplemented from G4ParticleHPFinalState.

Definition at line 75 of file G4ParticleHPInelasticBaseFS.hh.

76  {
77  return std::max(0., theXsection->GetY(anEnergy));
78  }
G4double GetY(G4double x)
T max(const T t1, const T t2)
brief Return the largest of the two arguments

Here is the call graph for this function:

virtual G4ParticleHPVector* G4ParticleHPInelasticBaseFS::GetXsec ( )
inlinevirtual

Reimplemented from G4ParticleHPFinalState.

Definition at line 79 of file G4ParticleHPInelasticBaseFS.hh.

79 { return theXsection; }
void G4ParticleHPInelasticBaseFS::Init ( G4double  A,
G4double  Z,
G4int  M,
G4String dirName,
G4String bit,
G4ParticleDefinition  
)
virtual

Implements G4ParticleHPFinalState.

Reimplemented in G4ParticleHPN2AInelasticFS, G4ParticleHPN2PInelasticFS, G4ParticleHPN3AInelasticFS, G4ParticleHPNAInelasticFS, G4ParticleHPND2AInelasticFS, G4ParticleHPNDInelasticFS, G4ParticleHPNHe3InelasticFS, G4ParticleHPNPAInelasticFS, G4ParticleHPNPInelasticFS, G4ParticleHPNT2AInelasticFS, G4ParticleHPNTInelasticFS, G4ParticleHPNXInelasticFS, G4ParticleHPPAInelasticFS, G4ParticleHPPDInelasticFS, G4ParticleHPPTInelasticFS, and G4ParticleHPT2AInelasticFS.

Definition at line 74 of file G4ParticleHPInelasticBaseFS.cc.

75 {
76  gammaPath = "/Inelastic/Gammas/";
77  if(!getenv("G4NEUTRONHPDATA"))
78  throw G4HadronicException(__FILE__, __LINE__, "Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files where Inelastic/Gammas data is found.");
79  G4String tBase = getenv("G4NEUTRONHPDATA");
80  gammaPath = tBase+gammaPath;
81  G4String tString = dirName;
82  G4bool dbool;
83  G4ParticleHPDataUsed aFile = theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M,tString, bit, dbool);
84  G4String filename = aFile.GetName();
85 #ifdef G4PHPDEBUG
86  if( getenv("G4ParticleHPDebug") ) G4cout << " G4ParticleHPInelasticBaseFS::Init FILE " << filename << G4endl;
87 #endif
88  SetAZMs( A, Z, M, aFile);
89  //theBaseA = aFile.GetA();
90  //theBaseZ = aFile.GetZ();
91  // theNDLDataA = (int)aFile.GetA();
92  // theNDLDataZ = aFile.GetZ();
93  //if(!dbool || ( Z<2.5 && ( std::abs(theBaseZ - Z)>0.0001 || std::abs(theBaseA - A)>0.0001)))
94  if ( !dbool || ( Z<2.5 && ( std::abs(theNDLDataZ - Z)>0.0001 || std::abs(theNDLDataA - A)>0.0001)) )
95  {
96 #ifdef G4PHPDEBUG
97  if(getenv("G4ParticleHPDebug_NamesLogging")) G4cout << "Skipped = "<< filename <<" "<<A<<" "<<Z<<G4endl;
98 #endif
99  hasAnyData = false;
100  hasFSData = false;
101  hasXsec = false;
102  return;
103  }
104  // theBaseA = A;
105  // theBaseZ = G4int(Z+.5);
106  //std::ifstream theData(filename, std::ios::in);
107  //130205 For compressed data files
108  std::istringstream theData(std::ios::in);
109  G4ParticleHPManager::GetInstance()->GetDataStream(filename,theData);
110  //130205 END
111  if(!theData) //"!" is a operator of ios
112  {
113  hasAnyData = false;
114  hasFSData = false;
115  hasXsec = false;
116  // theData.close();
117  return; // no data for exactly this isotope and FS
118  }
119  // here we go
120  G4int infoType, dataType, dummy=INT_MAX;
121  hasFSData = false;
122  while (theData >> infoType) // Loop checking, 11.05.2015, T. Koi
123  {
124  theData >> dataType;
125 
126  if(dummy==INT_MAX) theData >> dummy >> dummy;
127  if(dataType==3)
128  {
129  G4int total;
130  theData >> total;
131  theXsection->Init(theData, total, CLHEP::eV);
132  }
133  else if(dataType==4)
134  {
136  theAngularDistribution->Init(theData);
137  hasFSData = true;
138  }
139  else if(dataType==5)
140  {
142  theEnergyDistribution->Init(theData);
143  hasFSData = true;
144  }
145  else if(dataType==6)
146  {
148  //- G4cout << this << " BaseFS theEnergyAngData " << theEnergyAngData << G4endl; //GDEB
149  theEnergyAngData->Init(theData);
150  hasFSData = true;
151  }
152  else if(dataType==12)
153  {
155  theFinalStatePhotons->InitMean(theData);
156  hasFSData = true;
157  }
158  else if(dataType==13)
159  {
162  hasFSData = true;
163  }
164  else if(dataType==14)
165  {
167  hasFSData = true;
168  }
169  else if(dataType==15)
170  {
172  hasFSData = true;
173  }
174  else
175  {
176  throw G4HadronicException(__FILE__, __LINE__, "Data-type unknown to G4ParticleHPInelasticBaseFS");
177  }
178  }
179  // theData.close();
180 }
static G4ParticleHPManager * GetInstance()
void SetAZMs(G4double anA, G4double aZ, G4int aM, G4ParticleHPDataUsed used)
void GetDataStream(G4String, std::istringstream &iss)
G4ParticleHPEnAngCorrelation * theEnergyAngData
int G4int
Definition: G4Types.hh:78
void InitPartials(std::istream &aDataFile)
G4ParticleDefinition * theProjectile
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
G4bool InitMean(std::istream &aDataFile)
bool G4bool
Definition: G4Types.hh:79
static constexpr double eV
#define INT_MAX
Definition: templates.hh:111
G4double total(Particle const *const p1, Particle const *const p2)
G4ParticleHPEnergyDistribution * theEnergyDistribution
#define G4endl
Definition: G4ios.hh:61
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
void InitEnergies(std::istream &aDataFile)
G4ParticleHPPhotonDist * theFinalStatePhotons
void Init(std::istream &aDataFile)
void InitAngular(std::istream &aDataFile)
G4ParticleHPAngular * theAngularDistribution
void Init(std::istream &aDataFile)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4ParticleHPInelasticBaseFS::InitGammas ( G4double  AR,
G4double  ZR 
)

Definition at line 48 of file G4ParticleHPInelasticBaseFS.cc.

49 {
50  // char the[100] = {""};
51  // std::ostrstream ost(the, 100, std::ios::out);
52  // ost <<gammaPath<<"z"<<ZR<<".a"<<AR;
53  // G4String * aName = new G4String(the);
54  // std::ifstream from(*aName, std::ios::in);
55 
56  std::ostringstream ost;
57  ost <<gammaPath<<"z"<<ZR<<".a"<<AR;
58  G4String aName = ost.str();
59  std::ifstream from(aName, std::ios::in);
60 
61  if(!from) return; // no data found for this isotope
62  // std::ifstream theGammaData(*aName, std::ios::in);
63  std::ifstream theGammaData(aName, std::ios::in);
64 
65  G4double eps = 0.001;
67  G4NucleiProperties::GetBindingEnergy(static_cast<G4int>(AR+eps),static_cast<G4int>(ZR+eps)) -
68  G4NucleiProperties::GetBindingEnergy(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps));
69  theGammas.Init(theGammaData);
70  // delete aName;
71 
72 }
static const G4double eps
void Init(std::istream &aDataFile)
static G4double GetBindingEnergy(const G4int A, const G4int Z)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

G4String G4ParticleHPInelasticBaseFS::gammaPath
protected

Definition at line 91 of file G4ParticleHPInelasticBaseFS.hh.

G4ParticleHPAngular* G4ParticleHPInelasticBaseFS::theAngularDistribution
protected

Definition at line 85 of file G4ParticleHPInelasticBaseFS.hh.

G4ParticleHPEnAngCorrelation* G4ParticleHPInelasticBaseFS::theEnergyAngData
protected

Definition at line 86 of file G4ParticleHPInelasticBaseFS.hh.

G4ParticleHPEnergyDistribution* G4ParticleHPInelasticBaseFS::theEnergyDistribution
protected

Definition at line 84 of file G4ParticleHPInelasticBaseFS.hh.

G4ParticleHPPhotonDist* G4ParticleHPInelasticBaseFS::theFinalStatePhotons
protected

Definition at line 88 of file G4ParticleHPInelasticBaseFS.hh.

G4ParticleHPDeExGammas G4ParticleHPInelasticBaseFS::theGammas
protected

Definition at line 90 of file G4ParticleHPInelasticBaseFS.hh.

G4double G4ParticleHPInelasticBaseFS::theNuclearMassDifference
protected

Definition at line 89 of file G4ParticleHPInelasticBaseFS.hh.

G4ParticleHPVector* G4ParticleHPInelasticBaseFS::theXsection
protected

Definition at line 83 of file G4ParticleHPInelasticBaseFS.hh.


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