Import Geant4 10.6.2 source tree

This commit is contained in:
Gabriele Cosmo
2020-05-29 14:54:29 +02:00
parent 8c87fe78c4
commit c02c370437
448 changed files with 23779 additions and 31516 deletions
+1 -1
View File
@@ -167,7 +167,7 @@ endif
banner:
@$(ECHO) "*************************************************************"
@$(ECHO) " Installation Geant4 version geant4-10-06-patch-01 "
@$(ECHO) " Installation Geant4 version geant4-10-06-patch-02 "
@$(ECHO) " Copyright (C) 1994-2020 Geant4 Collaboration "
@$(ECHO) "*************************************************************"
+1 -1
View File
@@ -67,7 +67,7 @@ endif()
#
if (GEANT4_USE_FREETYPE)
install(DIRECTORY fonts/
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/fonts
DESTINATION ${CMAKE_INSTALL_DATADIR}/fonts
PATTERN ".svn" EXCLUDE
)
endif()
+1 -1
View File
@@ -43,7 +43,7 @@ install(DIRECTORY include/
# We also need to install the tools license
#
install(FILES tools.license
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}
DESTINATION ${CMAKE_INSTALL_DATADIR}
)
#------------------------------------------------------------------------------
+5 -1
View File
@@ -16,11 +16,15 @@ committal in the source repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
21-May-2020 G.Lima (geom-specific-V10-05-23)
- Fix constructor signatures in G4UExtrudedSolid wrapper.
There were missing const and reference qualifiers in non-POD parameters.
17-January-2020 E.Tcherniaev (geom-specific-V10-05-22)
- Implemented G4Tet::SetVertices(), it addresses request made
at Geant4 Technical Forum.
14-January-2020 Gabriele Cosmo
14-January-2020 G.Cosmo
- Added protection in G4VFacet header for double definition of global
symbols from Windows Kits code.
@@ -62,16 +62,16 @@ class G4UExtrudedSolid : public G4UAdapter<vecgeom::UnplacedExtruded>
public: // with description
G4UExtrudedSolid(const G4String& pName,
std::vector<G4TwoVector> polygon,
std::vector<ZSection> zsections);
G4UExtrudedSolid(const G4String& pName,
const std::vector<G4TwoVector>& polygon,
const std::vector<ZSection>& zsections);
// General constructor
G4UExtrudedSolid(const G4String& pName,
std::vector<G4TwoVector> polygon,
G4double halfZ,
G4TwoVector off1, G4double scale1,
G4TwoVector off2, G4double scale2);
G4UExtrudedSolid(const G4String& pName,
const std::vector<G4TwoVector>& polygon,
G4double halfZ,
const G4TwoVector& off1, G4double scale1,
const G4TwoVector& off2, G4double scale2);
// Special constructor for solid with 2 z-sections
~G4UExtrudedSolid();
@@ -44,8 +44,8 @@
// Constructors
//
G4UExtrudedSolid::G4UExtrudedSolid(const G4String& name,
std::vector<G4TwoVector> polygon,
std::vector<ZSection> zsections)
const std::vector<G4TwoVector>& polygon,
const std::vector<ZSection>& zsections)
: Base_t(name) // General constructor
{
unsigned int nVertices = polygon.size();
@@ -73,10 +73,10 @@ G4UExtrudedSolid::G4UExtrudedSolid(const G4String& name,
G4UExtrudedSolid::G4UExtrudedSolid(const G4String& name,
std::vector<G4TwoVector> polygon,
const std::vector<G4TwoVector>& polygon,
G4double halfZ,
G4TwoVector off1, G4double scale1,
G4TwoVector off2, G4double scale2)
const G4TwoVector& off1, G4double scale1,
const G4TwoVector& off2, G4double scale2)
: Base_t(name) // Special constructor for 2 sections
{
unsigned int nVertices = polygon.size();
+6
View File
@@ -16,6 +16,12 @@ commit in the repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 29, 2020 Gabriele Cosmo (global-V10-05-29)
- Updated tag IDs for release 10.6.p02.
March 31, 2020 Ben Morgan (global-V10-05-28)
- G4UnitsTable - add inheriting constructors for std::vector
December 03, 2019 Gabriele Cosmo (global-V10-05-27)
- Updated tag IDs for release 10.6.p01.
@@ -25,7 +25,7 @@
//
//
//
//
//
// -----------------------------------------------------------------
//
// ------------------- class G4UnitsTable -----------------
@@ -63,9 +63,10 @@ class G4UnitDefinition;
class G4UnitsTable : public std::vector<G4UnitsCategory*>
{
public:
using std::vector<G4UnitsCategory*>::vector;
G4UnitsTable();
~G4UnitsTable();
~G4UnitsTable();
public:
void Synchronize();
G4bool Contains(const G4UnitDefinition*,const G4String&);
@@ -82,25 +83,25 @@ class G4UnitDefinition
G4UnitDefinition(const G4String& name, const G4String& symbol,
const G4String& category, G4double value);
public: // without description
~G4UnitDefinition();
G4bool operator==(const G4UnitDefinition&) const;
G4bool operator!=(const G4UnitDefinition&) const;
public: // with description
inline const G4String& GetName() const;
inline const G4String& GetSymbol() const;
inline G4double GetValue() const;
void PrintDefinition();
static void BuildUnitsTable();
static void BuildUnitsTable();
static void PrintUnitsTable();
static void ClearUnitsTable();
static G4UnitsTable& GetUnitsTable();
static G4bool IsUnitDefined(const G4String&);
@@ -111,13 +112,13 @@ class G4UnitDefinition
G4UnitDefinition(const G4UnitDefinition&);
G4UnitDefinition& operator=(const G4UnitDefinition&);
private:
G4String Name; // SI name
G4String SymbolName; // SI symbol
G4double Value; // value in the internal system of units
static G4ThreadLocal G4UnitsTable *pUnitsTable; // table of Units
static G4ThreadLocal G4bool unitsTableDestroyed;
@@ -143,7 +144,7 @@ class G4UnitsCategory
~G4UnitsCategory();
G4bool operator==(const G4UnitsCategory&) const;
G4bool operator!=(const G4UnitsCategory&) const;
public: // without description
inline const G4String& GetName() const;
@@ -158,7 +159,7 @@ class G4UnitsCategory
G4UnitsCategory(const G4UnitsCategory&);
G4UnitsCategory& operator=(const G4UnitsCategory&);
private:
G4String Name; // dimensional family: Length,Volume,Energy
@@ -180,16 +181,16 @@ class G4BestUnit
// In practice it builds an object VU = (newValue, newUnit)
~G4BestUnit();
public: // without description
inline G4double* GetValue();
inline const G4String& GetCategory() const;
inline size_t GetIndexOfCategory() const;
operator G4String () const; // Conversion to best string.
public: // with description
public: // with description
friend std::ostream& operator<<(std::ostream&,G4BestUnit VU);
// Default format to print the objet VU above.
@@ -40,11 +40,11 @@
// |--> patch number
#ifndef G4VERSION_NUMBER
#define G4VERSION_NUMBER 1061
#define G4VERSION_NUMBER 1062
#endif
#ifndef G4VERSION_TAG
#define G4VERSION_TAG "$Name: geant4-10-06-patch-01 $"
#define G4VERSION_TAG "$Name: geant4-10-06-patch-02 $"
#endif
// as variables
@@ -53,10 +53,10 @@
#include "G4String.hh"
#ifdef G4MULTITHREADED
static const G4String G4Version = "$Name: geant4-10-06-patch-01 [MT]$";
static const G4String G4Version = "$Name: geant4-10-06-patch-02 [MT]$";
#else
static const G4String G4Version = "$Name: geant4-10-06-patch-01 $";
static const G4String G4Version = "$Name: geant4-10-06-patch-02 $";
#endif
static const G4String G4Date = "(14-February-2020)";
static const G4String G4Date = "(29-May-2020)";
#endif
+3
View File
@@ -16,6 +16,9 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
19 February, 2020 M. Asai (intercoms-V10-05-10)
- Accept null string as an alias value. Addressing bug report #2208.
26 November, 2019 G. Cosmo (intercoms-V10-05-09)
- Fixed more cases of implicit type conversions from size_t to G4int.
+2 -3
View File
@@ -424,11 +424,10 @@ void G4UIcontrolMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
command->ResetFailure();
if(std::getenv(newValue))
{
G4String st = "/control/alias ";
st += newValue;
G4String st = newValue;
st += " ";
st += std::getenv(newValue);
UI->ApplyCommand(st);
UI->SetAlias(st.c_str());
}
else
{
@@ -13,6 +13,10 @@ introduced in the code and keeptrack of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
13-May-2020, M. Asai (phys-ctor-limiters-V10-05-01)
- G4GenericBiasingPhysics.cc : add missing code for parallel geometries
for all neutral / charged particles.
15-Nov-2019, G. Cosmo (phys-ctor-limiters-V10-05-00)
- Fixed cases of implicit type conversions from size_t to G4int.
@@ -565,9 +565,45 @@ void G4GenericBiasingPhysics::AssociateParallelGeometries()
}
// -- parallel geometries for all charged particles:
// -- parallel geometries for all neutral / charged particles:
particleIterator->reset();
G4bool islAllNeutral = false;
for(auto isln : fAllNeutralParallelGeometriesISL)
{ islAllNeutral |= isln; }
G4bool islAllCharged = false;
for(auto islc : fAllChargedParallelGeometriesISL)
{ islAllCharged |= islc; }
while((*particleIterator)())
{
G4ParticleDefinition* particle = particleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if(particle->GetPDGCharge() == 0.)
{
// Neutral particle
if(particle->IsShortLived() && !islAllNeutral) continue;
G4ParallelGeometriesLimiterProcess* limiter = G4BiasingHelper::AddLimiterProcess(pmanager);
G4int j = 0;
for(G4String wNameN : fParallelGeometriesForCharged)
{
if(!(particle->IsShortLived()) || fAllNeutralParallelGeometriesISL[j])
{ limiter->AddParallelWorld(wNameN); }
j++;
}
}
else
{
// charged
if(particle->IsShortLived() && !islAllCharged) continue;
G4ParallelGeometriesLimiterProcess* limiter = G4BiasingHelper::AddLimiterProcess(pmanager);
G4int j = 0;
for(G4String wNameC : fParallelGeometriesForCharged)
{
if(!(particle->IsShortLived()) || fAllChargedParallelGeometriesISL[j])
{ limiter->AddParallelWorld(wNameC); }
j++;
}
}
}
}
@@ -16,6 +16,9 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
28 April 19: V.Ivanchenko (emutils-V10-05-24)
- G4LossTableBuilder - fixed #2230 (typo in the code)
13 January 19: V.Ivanchenko (emutils-V10-05-23)
- G4EmParameters, G4EmParametersMessenger - added new parameter
to enable read of e+e- production table from file (CMS request)
@@ -91,11 +91,11 @@ G4LossTableBuilder::G4LossTableBuilder(G4bool master) : isMaster(master)
theFlag = new std::vector<G4bool>;
} else {
isMaster = false;
}
#ifdef G4MULTITHREADED
}
G4MUTEXUNLOCK(&ltbMutex);
}
G4MUTEXUNLOCK(&ltbMutex);
#endif
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -14,6 +14,11 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
25 May 2020 Alberto Ribon (hadr-deex-V10-05-22)
- G4DeexPrecoParameters : changed the parameter fMaxLifeTime
from 1000 sec to 1 microsec, to correct the treatment of isomers.
This fix the bug #2226 reported by NA61/SHINE.
25 November 2019 Vladimir Ivanchenko (hadr-deex-V10-05-21)
- G4PhotonEvaporation - fixed Coverity problem
@@ -67,7 +67,7 @@ void G4DeexPrecoParameters::SetDefaults()
fPrecoHighEnergy = 30*CLHEP::MeV;
fPhenoFactor = 1.0;
fMinExcitation = 10*CLHEP::eV;
fMaxLifeTime = 1000*CLHEP::second;
fMaxLifeTime = 1.0*CLHEP::microsecond;
fMinExPerNucleounForMF = 200*CLHEP::GeV;
fMinZForPreco = 3;
fMinAForPreco = 5;
+13 -5
View File
@@ -1,4 +1,4 @@
# -----------------------------------------------------------
---------------------------------------------------------------------
==================================================
Geant4 - an Object-Oriented Toolkit for Simulation
@@ -14,11 +14,19 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
5 February 2020 Alberto Ribon (hadr-lend-V10-05-02)
30 March 2020 Dennis Wright (hadr-lend-V10-05-03)
---------------------------------------------------
- MCGIDI_energy : (applied patch from Tech-X made by Ben Morgan on
6 January 2020 on the master) remove inclusion of amp_math on Windows
as it is not required.
- fix of bug report #2174:
Create class G4LENDGammaModel to sample GND gamma-nuclear reactions
Create class G4LENDGammaCrossSection to sample GND gamma-nuclear reactions
add documentation to MCGIDI_outputChannel.cc
rewrite T. Koi's version of G4LENDInelastic.cc to take care of large
baryon number violations
06 January 2020 Ben Morgan (hadr-lend-V10-05-02)
------------------------------------------------
- Patch from Tech-X:
Remove inclusion of amp_math on Windows as it is not required
29 May 2019 Dennis Wright (hadr-lend-V10-05-01)
-------------------------------------------------
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
////////////////////////////////////////////////////////////////////////////////
// //
// File: G4LENDGammaCrossSection.hh //
// Date: 30 March 2020 //
// Author: Dennis H. Wright //
// //
// Description: cross sections for inelastic scattering of gammas from //
// nuclei including gamma-induced fission. This cross section //
// is very similar to G4LENDCombinedCrossSection except that //
// does not sample elastic or capture reactions since there are //
// no such data for gammas in GND. //
// //
////////////////////////////////////////////////////////////////////////////////
#ifndef G4LENDGammaCrossSection_h
#define G4LENDGammaCrossSection_h 1
#include "G4LENDCrossSection.hh"
class G4LENDInelasticCrossSection;
class G4LENDFissionCrossSection;
class G4HadProjectile;
class G4LENDGammaCrossSection : public G4LENDCrossSection
{
public:
G4LENDGammaCrossSection(G4ParticleDefinition* pd);
~G4LENDGammaCrossSection(){;};
void BuildPhysicsTable(const G4ParticleDefinition&);
G4double GetIsoCrossSection(const G4DynamicParticle*, G4int /*Z*/,
G4int /*A*/, const G4Isotope*,
const G4Element*, const G4Material*);
G4int SelectChannel(const G4DynamicParticle*, G4int /*Z*/,
G4int /*A*/, const G4Isotope*, const G4Element*,
const G4Material*);
private:
G4LENDInelasticCrossSection* inelasticXS;
G4LENDFissionCrossSection* fissionXS;
};
#endif
@@ -0,0 +1,71 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
////////////////////////////////////////////////////////////////////////////////
// //
// File: G4LENDGammaModel.hh //
// Date: 30 March 2020 //
// Author: Dennis H. Wright //
// //
// Description: model for inelastic scattering of gammas from nuclei //
// including gamma-induced fission. This model is very similar //
// to G4LENDCombinedModel except that it does not sample //
// elastic or capture reactions since there are no such data //
// for gammas in GND. //
// //
////////////////////////////////////////////////////////////////////////////////
#ifndef G4LENDGammaModel_h
#define G4LENDGammaModel_h 1
#include "G4LENDModel.hh"
class G4LENDGammaCrossSection;
class G4LENDInelastic;
class G4LENDFission;
class G4LENDGammaModel : public G4LENDModel
{
public:
G4LENDGammaModel(G4ParticleDefinition* pd);
~G4LENDGammaModel(){;};
void BuildPhysicsTable(const G4ParticleDefinition&);
G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& aTargetNucleus);
G4bool HasData(const G4DynamicParticle*, G4int iZ, G4int iA, G4int iM,
const G4Isotope*, const G4Element*, const G4Material*);
private:
G4LENDGammaCrossSection* crossSection;
G4LENDInelastic* inelastic;
G4LENDFission* fission;
G4LENDModel* channels[2];
};
#endif
@@ -60,7 +60,9 @@ GEANT4_DEFINE_MODULE(NAME G4had_lend
G4LENDCaptureCrossSection.hh
G4LENDCrossSection.hh
G4LENDCombinedCrossSection.hh
G4LENDGammaCrossSection.hh
G4LENDCombinedModel.hh
G4LENDGammaModel.hh
G4LENDElastic.hh
G4LENDElasticCrossSection.hh
G4LENDFission.hh
@@ -102,7 +104,9 @@ GEANT4_DEFINE_MODULE(NAME G4had_lend
G4LENDCapture.cc
G4LENDCaptureCrossSection.cc
G4LENDCombinedCrossSection.cc
G4LENDGammaCrossSection.cc
G4LENDCombinedModel.cc
G4LENDGammaModel.cc
G4LENDCrossSection.cc
G4LENDElastic.cc
G4LENDElasticCrossSection.cc
@@ -0,0 +1,99 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
////////////////////////////////////////////////////////////////////////////////
// //
// File: G4LENDGammaCrossSection.cc //
// Date: 30 March 2020 //
// Author: Dennis H. Wright //
// //
// Description: cross sections for inelastic scattering of gammas from //
// nuclei including gamma-induced fission. This cross section //
// is very similar to G4LENDCombinedCrossSection except that //
// does not sample elastic or capture reactions since there are //
// no such data for gammas in GND. //
// //
////////////////////////////////////////////////////////////////////////////////
#include "G4LENDGammaCrossSection.hh"
#include "G4LENDInelasticCrossSection.hh"
#include "G4LENDFissionCrossSection.hh"
#include "Randomize.hh"
G4LENDGammaCrossSection::G4LENDGammaCrossSection(G4ParticleDefinition* pd)
:G4LENDCrossSection("LENDGammaCrossSection")
{
proj = pd;
inelasticXS = new G4LENDInelasticCrossSection(pd);
fissionXS = new G4LENDFissionCrossSection(pd);
}
void G4LENDGammaCrossSection::BuildPhysicsTable(const G4ParticleDefinition& pd)
{
inelasticXS->BuildPhysicsTable(pd);
fissionXS->BuildPhysicsTable(pd);
create_used_target_map();
}
G4double
G4LENDGammaCrossSection::GetIsoCrossSection(const G4DynamicParticle* dp,
G4int iZ, G4int iA,
const G4Isotope* isotope,
const G4Element*,
const G4Material* material)
{
G4double XS = 0.0;
XS += inelasticXS->GetIsoCrossSection(dp, iZ, iA, isotope, NULL, material);
XS += fissionXS->GetIsoCrossSection(dp, iZ, iA, isotope, NULL, material);
//G4cout << "G4LENDGammaCrossSection::GetIsoCrossSection "
// << XS/CLHEP::barn << " [barn]" << G4endl;
return XS;
}
G4int G4LENDGammaCrossSection::SelectChannel(const G4DynamicParticle* dp,
G4int iZ, G4int iA,
const G4Isotope* isotope,
const G4Element*,
const G4Material* material)
{
G4int ichannel = -1;
G4double XSs[2];
XSs[0] = inelasticXS->GetIsoCrossSection(dp, iZ, iA, isotope, nullptr, material);
XSs[1] = XSs[0] + fissionXS->GetIsoCrossSection(dp, iZ, iA, isotope, nullptr, material);
G4double total = XSs[1];
G4double random = G4UniformRand();
for (G4int i = 0; i < 2; i++) {
if (random*total <= XSs[i]) {
ichannel = i;
break;
}
}
return ichannel;
}
@@ -0,0 +1,87 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
////////////////////////////////////////////////////////////////////////////////
// //
// File: G4LENDGammaModel.cc //
// Date: 30 March 2020 //
// Author: Dennis H. Wright //
// //
// Description: model for inelastic scattering of gammas from nuclei //
// including gamma-induced fission. This model is very similar //
// to G4LENDCombinedModel except that it does not sample //
// elastic or capture reactions since there are no such data //
// for gammas in GND. //
// //
////////////////////////////////////////////////////////////////////////////////
#include "G4LENDGammaModel.hh"
#include "G4LENDGammaCrossSection.hh"
#include "G4LENDInelastic.hh"
#include "G4LENDFission.hh"
#include "G4DynamicParticle.hh"
G4LENDGammaModel::G4LENDGammaModel(G4ParticleDefinition* pd)
:G4LENDModel("LENDGammaModel") {
proj = pd;
crossSection = new G4LENDGammaCrossSection(pd);
inelastic = new G4LENDInelastic(pd);
fission = new G4LENDFission(pd);
channels[0] = inelastic;
channels[1] = fission;
}
void G4LENDGammaModel::BuildPhysicsTable(const G4ParticleDefinition& projectile) {
crossSection->BuildPhysicsTable(projectile);
create_used_target_map();
}
G4bool G4LENDGammaModel::HasData(const G4DynamicParticle*, G4int iZ, G4int iA,
G4int iM, const G4Isotope*, const G4Element*,
const G4Material*)
{
G4bool result = false;
if (get_target_from_map(lend_manager->GetNucleusEncoding(iZ, iA, iM) ) != nullptr) result = true;
return result;
}
G4HadFinalState* G4LENDGammaModel::ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& aTarg)
{
G4LENDModel* channel = nullptr;
G4int iZ = aTarg.GetZ_asInt();
G4int iA = aTarg.GetA_asInt();
//To pass kinetic energy, need to generate dynamic particle
G4DynamicParticle* dp = new G4DynamicParticle(proj, G4ThreeVector(0.,0.,1.),
aTrack.GetKineticEnergy() );
G4int ichannel = crossSection->SelectChannel(dp, iZ, iA, aTarg.GetIsotope(),
nullptr, aTrack.GetMaterial() );
delete dp;
channel = channels[ichannel];
return channel->ApplyYourself(aTrack, aTarg);
}
@@ -23,166 +23,244 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#include "G4LENDInelastic.hh"
////////////////////////////////////////////////////////////////////////////////
// //
// File: G4LENDInelastic.cc //
// Date: 24 March 2020 //
// Author: Dennis Wright //
// //
// Description: model for inelastic scattering of neutrons, light ions and //
// gammas at energies of order 20 MeV and lower. //
// This model uses GIDI particle data which are stored mostly //
// in spectrum mode. In this mode, spectra are reproduced //
// for each possible particle type which can result from a //
// given interaction. Unlike Geant4, this is done without //
// consideration of event-by-event conservation rules. //
// Indeed, forcing such conservation on GIDI output products //
// introduces correlations and distortions in the resulting //
// spectra which are not present in the data. //
// //
// In order to use GIDI data within the Geant4 framework, a //
// minimal event-by-event baryon number conservation is //
// enforced which allows deviations of up to 1 GeV without //
// giving warnings. Neither charge, nor energy, nor momentum //
// conservation is enforced. Under this scheme, light //
// fragment (n, p, d, t, alpha) spectra are well reproduced //
// after a large number of events. Charge and energy //
// conservation also approach their event-by-event values in //
// this limit. The mass, charge and energy distributions of //
// large fragments, however, are not expected to reproduce the //
// data very well. This is a result of forcing the crude //
// baryon number conservation and ensuring that the light //
// fragment spectra are correct. //
// //
////////////////////////////////////////////////////////////////////////////////
#include "G4LENDInelastic.hh"
#include "G4SystemOfUnits.hh"
#include "G4Nucleus.hh"
#include "G4IonTable.hh"
#include <algorithm>
#include <random>
G4HadFinalState * G4LENDInelastic::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& aTarg )
G4HadFinalState* G4LENDInelastic::ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& aTarg)
{
//return preco->ApplyYourself( aTrack, aTarg );
G4ThreeVector projMom = aTrack.Get4Momentum().vect();
G4double temp = aTrack.GetMaterial()->GetTemperature();
G4ThreeVector proj_p = aTrack.Get4Momentum().vect();
G4int iZ = aTarg.GetZ_asInt();
G4int iA = aTarg.GetA_asInt();
G4int iM = 0;
if (aTarg.GetIsotope() != nullptr) iM = aTarg.GetIsotope()->Getm();
G4double temp = aTrack.GetMaterial()->GetTemperature();
G4double ke = aTrack.GetKineticEnergy();
//G4int iZ = int ( aTarg.GetZ() );
//G4int iA = int ( aTarg.GetN() );
//migrate to integer A and Z (GetN_asInt returns number of neutrons in the nucleus since this)
G4int iZ = aTarg.GetZ_asInt();
G4int iA = aTarg.GetA_asInt();
//G4int iM = aTarg.GetM_asInt();
G4int iM = 0;
if ( aTarg.GetIsotope() != NULL ) {
iM = aTarg.GetIsotope()->Getm();
}
//G4cout << "target: Z = " << iZ << " N = " << iA << G4endl;
G4HadFinalState* theResult = &theParticleChange;
theResult->Clear();
G4double ke = aTrack.GetKineticEnergy();
//G4cout << "projectile: KE = " << ke/MeV << " [MeV]" << G4endl;
G4GIDI_target* aGIDITarget =
get_target_from_map(lend_manager->GetNucleusEncoding(iZ, iA, iM) );
if (aGIDITarget == nullptr) {
// G4cout << " No target found " << G4endl;
theParticleChange.Clear();
theParticleChange.SetStatusChange(isAlive);
theParticleChange.SetEnergyChange(aTrack.GetKineticEnergy());
theParticleChange.SetMomentumChange(aTrack.Get4Momentum().vect().unit());
return &theParticleChange;
}
// return returnUnchanged(aTrack, theResult);
G4HadFinalState* theResult = &theParticleChange;
theResult->Clear();
// Get GIDI final state products for givern target and projectile
G4int loop(0);
G4int loopMax = 1000;
std::vector<G4GIDI_Product>* products;
do {
products = aGIDITarget->getOthersFinalState(ke*MeV, temp, MyRNG, NULL);
loop++;
} while (products == nullptr && loop < loopMax);
G4GIDI_target* aTarget = get_target_from_map( lend_manager->GetNucleusEncoding( iZ , iA , iM ) );
if ( aTarget == NULL ) return returnUnchanged( aTrack , theResult );
// G4LENDInelastic accepts all light fragments and gammas from GIDI (A < 5)
// and removes any heavy fragments which cause large baryon number violation.
// Charge and energy non-conservation still occur, but over a large number
// of events, this improves on average.
std::vector<G4GIDI_Product>* products;
for ( G4int i = 0 ; i != 1024 ; i++ ) {
products = aTarget->getOthersFinalState( ke*MeV, temp, MyRNG, NULL );
if ( products != NULL ) break;
}
//return preco->ApplyYourself( aTrack, aTarg );
if (loop > loopMax - 1) {
// G4cout << " too many loops, return intial state " << G4endl;
G4int iTotZ = iZ + aTrack.GetDefinition()->GetAtomicNumber();
G4int iTotA = iA + aTrack.GetDefinition()->GetAtomicMass();
theParticleChange.Clear();
theParticleChange.SetStatusChange(isAlive);
theParticleChange.SetEnergyChange(aTrack.GetKineticEnergy());
theParticleChange.SetMomentumChange(aTrack.Get4Momentum().vect().unit());
return &theParticleChange;
if ( products != NULL )
{
//G4cout << "Using LENDModel" << G4endl;
// if (aTrack.GetDefinition() == G4Proton::Proton() ||
// aTrack.GetDefinition() == G4Neutron::Neutron() ) {
// theResult = preco->ApplyYourself(aTrack, aTarg);
// } else {
// theResult = returnUnchanged(aTrack, theResult);
// }
G4ThreeVector psum(0);
G4bool needResidual = true;
int totN = 0;
int totZ = 0;
for ( G4int j = 0; j < int( products->size() ); j++ )
{
} else {
G4int iTotZ = iZ + aTrack.GetDefinition()->GetAtomicNumber();
G4int iTotA = iA + aTrack.GetDefinition()->GetAtomicMass();
G4int jZ = (*products)[j].Z;
G4int jA = (*products)[j].A;
G4int jm = (*products)[j].m;
//TK
//We need coordination LEND *products)[j].m and G4IonTable(Z,A,m)
//Excitation energy of isomer level is might (probably) different each other.
//
//G4cout << "ZA = " << 1000 * (*products)[j].Z + (*products)[j].A << " EK = "
// << (*products)[j].kineticEnergy
// << " px " << (*products)[j].px
// << " py " << (*products)[j].py
// << " pz " << (*products)[j].pz
// << G4endl;
iTotZ -= jZ;
iTotA -= jA;
G4DynamicParticle* theSec = new G4DynamicParticle;
if ( jA == 1 && jZ == 1 )
{
theSec->SetDefinition( G4Proton::Proton() );
totN += 1;
totZ += 1;
}
else if ( jA == 1 && jZ == 0 )
{
theSec->SetDefinition( G4Neutron::Neutron() );
totN += 1;
}
else if ( jZ > 0 )
{
if ( jA != 0 )
{
theSec->SetDefinition( G4IonTable::GetIonTable()->GetIon( jZ , jA , jm ) );
totN += jA;
totZ += jZ;
}
else
{
theSec->SetDefinition( G4IonTable::GetIonTable()->GetIon( jZ , iA+aTrack.GetDefinition()->GetAtomicMass()-totN , jm ) );
iTotZ -= jZ;
iTotA -= iA+aTrack.GetDefinition()->GetAtomicMass()-totN;
needResidual=false;
}
}
else
{
theSec->SetDefinition( G4Gamma::Gamma() );
}
G4ThreeVector p( (*products)[j].px*MeV , (*products)[j].py*MeV , (*products)[j].pz*MeV );
psum += p;
if ( p.mag() == 0 ) p = proj_p - psum;
theSec->SetMomentum( p );
theResult->AddSecondary( theSec );
}
if ( !( iTotZ == 0 && iTotA == 0 ) ) {
if ( iTotZ >= 0 && iTotA > 0 ) {
if ( needResidual ) {
G4DynamicParticle* residual = new G4DynamicParticle;
if ( iTotZ > 0 ) {
residual->SetDefinition( G4IonTable::GetIonTable()->GetIon( iTotZ , iTotA ) );
} else if ( iTotA == 1 ) {
residual->SetDefinition( G4Neutron::Neutron() );
} else {
//G4cout << "Charge or Baryon Number Error #3 iTotZ = " << iTotZ << ", iTotA = " << iTotA << G4endl;
;
}
residual->SetMomentum( proj_p - psum );
theResult->AddSecondary( residual );
} else {
//G4cout << "Charge or Baryon Number Error #1 iTotZ = " << iTotZ << ", iTotA = " << iTotA << G4endl;
;
}
} else {
if ( needResidual ) {
//G4cout << "Charge or Baryon Number Error #2 iTotZ = " << iTotZ << ", iTotA = " << iTotA << G4endl;
;
}
}
}
}
else {
//G4cout << "Using PreCompoundModel" << G4endl;
if ( aTrack.GetDefinition() == G4Proton::Proton() ||
aTrack.GetDefinition() == G4Neutron::Neutron() ) {
theResult = preco->ApplyYourself( aTrack, aTarg );
// Loop over GIDI products and separate light from heavy fragments
G4int GZtot(0);
G4int GAtot(0);
G4int productA(0);
G4int productZ(0);
std::vector<G4int> lightProductIndex;
std::vector<G4int> heavyProductIndex;
for (G4int i = 0; i < int( products->size() ); i++ ) {
productA = (*products)[i].A;
if (productA < 5) {
lightProductIndex.push_back(i);
GZtot += (*products)[i].Z;
GAtot += productA;
} else {
return theResult;
heavyProductIndex.push_back(i);
}
}
delete products;
}
theResult->SetStatusChange( stopAndKill );
// Randomize order of heavies to correct somewhat for sampling bias
// std::random_shuffle(heavyProductIndex.begin(), heavyProductIndex.end() );
// std::cout << " Heavy product index before shuffle : " ;
// for (G4int i = 0; i < int(heavyProductIndex.size() ); i++) std::cout << heavyProductIndex[i] << ", " ;
// std::cout << std::endl;
return theResult;
auto rng = std::default_random_engine {};
std::shuffle(heavyProductIndex.begin(), heavyProductIndex.end(), rng);
// std::cout << " Heavy product index after shuffle : " ;
// for (G4int i = 0; i < int(heavyProductIndex.size() ); i++) std::cout << heavyProductIndex[i] << ", " ;
// std::cout << std::endl;
std::vector<G4int> savedHeavyIndex;
G4int itest(0);
for (G4int i = 0; i < int(heavyProductIndex.size() ); i++) {
itest = heavyProductIndex[i];
productA = (*products)[itest].A;
productZ = (*products)[itest].Z;
if ((GAtot + productA <= iTotA) && (GZtot + productZ <= iTotZ) ) {
savedHeavyIndex.push_back(itest);
GZtot += productZ;
GAtot += productA;
}
}
/*
G4cout << " saved light products = ";
for (G4int k = 0; k < int(lightProductIndex.size() ); k++ ) {
itest = lightProductIndex[k];
G4cout << "(" << (*products)[itest].Z << ", " << (*products)[itest].A << "), ";
}
G4cout << G4endl;
G4cout << " saved heavy products = ";
for (G4int k = 0; k < int(savedHeavyIndex.size() ); k++ ) {
itest = savedHeavyIndex[k];
G4cout << "(" << (*products)[itest].Z << ", " << (*products)[itest].A << "), ";
}
G4cout << G4endl;
*/
// Now convert saved products to Geant4 particles
// Note that, at least for heavy fragments, GIDI masses and Geant4 masses
// have slightly different values.
G4DynamicParticle* theSec = nullptr;
G4ThreeVector Psum;
for (G4int i = 0; i < int(lightProductIndex.size() ); i++) {
itest = lightProductIndex[i];
productZ = (*products)[itest].Z;
productA = (*products)[itest].A;
theSec = new G4DynamicParticle();
if (productA == 1 && productZ == 0) {
theSec->SetDefinition(G4Neutron::Neutron() );
} else if (productA == 1 && productZ == 1) {
theSec->SetDefinition(G4Proton::Proton() );
} else if (productA == 2 && productZ == 1) {
theSec->SetDefinition(G4Deuteron::Deuteron() );
} else if (productA == 3 && productZ == 1) {
theSec->SetDefinition(G4Triton::Triton() );
} else if (productA == 4 && productZ == 2) {
theSec->SetDefinition(G4Alpha::Alpha() );
} else {
theSec->SetDefinition(G4Gamma::Gamma() );
}
G4ThreeVector momentum((*products)[itest].px*MeV,
(*products)[itest].py*MeV,
(*products)[itest].pz*MeV );
Psum += momentum;
theSec->SetMomentum(momentum);
// theResult->AddSecondary(theSec);
theParticleChange.AddSecondary(theSec);
}
G4int productM(0);
for (G4int i = 0; i < int(savedHeavyIndex.size() ); i++) {
itest = savedHeavyIndex[i];
productZ = (*products)[itest].Z;
productA = (*products)[itest].A;
productM = (*products)[itest].m;
theSec = new G4DynamicParticle();
theSec->SetDefinition(G4IonTable::GetIonTable()->GetIon(productZ,
productA,
productM) );
G4ThreeVector momentum((*products)[itest].px*MeV,
(*products)[itest].py*MeV,
(*products)[itest].pz*MeV );
Psum += momentum;
theSec->SetMomentum(momentum);
// theResult->AddSecondary(theSec);
theParticleChange.AddSecondary(theSec);
}
// Create heavy fragment if necessary to try to balance A, Z
// Note: this step is only required to prevent warnings at the process level
// where "catastrophic" non-conservation tolerances are set to 1 GeV.
// The residual generated will not necessarily be the one that would
// occur in the actual reaction.
if (iTotA - GAtot > 1) {
theSec = new G4DynamicParticle();
if (iTotZ == GZtot) {
// Special case when a nucleus of only neutrons is requested
// Violate charge conservation and set Z = 1
// G4cout << " Z = 1, A = "<< iTotA - GAtot << " created " << G4endl;
theSec->SetDefinition(G4IonTable::GetIonTable()->GetIon(1, iTotA-GAtot, 0) );
} else {
theSec->SetDefinition(G4IonTable::GetIonTable()->GetIon(iTotZ-GZtot, iTotA-GAtot, 0) );
}
theSec->SetMomentum(projMom - Psum);
// theResult->AddSecondary(theSec);
theParticleChange.AddSecondary(theSec);
}
} // loop OK
delete products;
// theResult->SetStatusChange( stopAndKill );
theParticleChange.SetStatusChange( stopAndKill );
// return theResult;
return &theParticleChange;
}
@@ -205,122 +205,156 @@ double MCGIDI_outputChannel_getFinalQ( statusMessageReporting *smr, MCGIDI_outpu
/*
************************************************************
*/
int MCGIDI_outputChannel_sampleProductsAtE( statusMessageReporting *smr, MCGIDI_outputChannel *outputChannel, MCGIDI_quantitiesLookupModes &modes,
MCGIDI_decaySamplingInfo *decaySamplingInfo, MCGIDI_sampledProductsDatas *productDatas, double *masses_ ) {
int MCGIDI_outputChannel_sampleProductsAtE(statusMessageReporting* smr,
MCGIDI_outputChannel* outputChannel,
MCGIDI_quantitiesLookupModes &modes,
MCGIDI_decaySamplingInfo* decaySamplingInfo,
MCGIDI_sampledProductsDatas* productDatas,
double *masses_ )
{
int i1;
int multiplicity(0);
int secondTwoBody = 0, isDecayChannel = ( outputChannel->reaction == NULL );
double e_in = modes.getProjectileEnergy( );
MCGIDI_product *product;
double phi, p, masses[3];
MCGIDI_distribution *distribution;
MCGIDI_sampledProductsData productData[2];
int i1, multiplicity, secondTwoBody = 0, isDecayChannel = ( outputChannel->reaction == NULL );
double e_in = modes.getProjectileEnergy( );
MCGIDI_product *product;
double phi, p, masses[3];
MCGIDI_distribution *distribution;
MCGIDI_sampledProductsData productData[2];
if (isDecayChannel) {
masses[0] = masses_[0]; /* More work may be needed here. */
masses[1] = masses_[1];
} else {
masses[0] = MCGIDI_reaction_getProjectileMass_MeV( smr, outputChannel->reaction );
masses[1] = MCGIDI_reaction_getTargetMass_MeV( smr, outputChannel->reaction );
}
if( isDecayChannel ) {
masses[0] = masses_[0]; /* More work may be needed here. */
masses[1] = masses_[1]; }
else {
masses[0] = MCGIDI_reaction_getProjectileMass_MeV( smr, outputChannel->reaction );
masses[1] = MCGIDI_reaction_getTargetMass_MeV( smr, outputChannel->reaction );
}
// Loop over all possible final state particles reachable from initial state
// List of these particles (products) was read in from GIDI
// Note: all particles satifying the sampling criteria are included in the
// final state, regardless of charge, energy or baryon number conservation
for (i1 = 0; i1 < outputChannel->numberOfProducts; i1++) {
product = &(outputChannel->products[i1]);
if (product->decayChannel.genre != MCGIDI_channelGenre_undefined_e ) {
if( MCGIDI_outputChannel_sampleProductsAtE(smr, &(product->decayChannel),
modes, decaySamplingInfo,
productDatas, masses ) < 0 ) return( -1 );
} else {
distribution = &(product->distribution);
if( distribution->type == MCGIDI_distributionType_none_e ) continue;
for( i1 = 0; i1 < outputChannel->numberOfProducts; i1++ ) {
product = &(outputChannel->products[i1]);
if( product->decayChannel.genre != MCGIDI_channelGenre_undefined_e ) {
if( MCGIDI_outputChannel_sampleProductsAtE( smr, &(product->decayChannel), modes, decaySamplingInfo, productDatas, masses ) < 0 ) return( -1 ); }
else {
distribution = &(product->distribution);
if( distribution->type == MCGIDI_distributionType_none_e ) continue;
if( !secondTwoBody ) {
if( ( multiplicity = product->multiplicity ) == 0 ) multiplicity = MCGIDI_product_sampleMultiplicity( smr, product, e_in,
decaySamplingInfo->rng( decaySamplingInfo->rngState ) );
while( multiplicity > 0 ) {
if (!secondTwoBody) {
// Sample multiplicity of final state particle at kinetic energy of projectile
// The multiplicity stored in GIDI is a real number whose fractional part is
// compared to a random number to decide what integer value is returned
if ((multiplicity = product->multiplicity) == 0) multiplicity =
MCGIDI_product_sampleMultiplicity(smr, product, e_in,
decaySamplingInfo->rng( decaySamplingInfo->rngState ) );
while (multiplicity > 0) {
multiplicity--;
decaySamplingInfo->pop = product->pop;
decaySamplingInfo->mu = 0;
decaySamplingInfo->Ep = 0;
productData[0].isVelocity = decaySamplingInfo->isVelocity;
productData[0].pop = product->pop;
productData[0].delayedNeutronIndex = product->delayedNeutronIndex;
productData[0].delayedNeutronRate = product->delayedNeutronRate;
productData[0].birthTimeSec = 0;
if( product->delayedNeutronRate > 0 ) {
productData[0].birthTimeSec = -G4Log( decaySamplingInfo->rng( decaySamplingInfo->rngState ) ) / product->delayedNeutronRate;
}
multiplicity--;
decaySamplingInfo->pop = product->pop;
decaySamplingInfo->mu = 0;
decaySamplingInfo->Ep = 0;
productData[0].isVelocity = decaySamplingInfo->isVelocity;
productData[0].pop = product->pop;
productData[0].delayedNeutronIndex = product->delayedNeutronIndex;
productData[0].delayedNeutronRate = product->delayedNeutronRate;
productData[0].birthTimeSec = 0;
if (product->delayedNeutronRate > 0) {
productData[0].birthTimeSec =
-G4Log( decaySamplingInfo->rng( decaySamplingInfo->rngState ) ) / product->delayedNeutronRate;
}
switch( outputChannel->genre ) {
case MCGIDI_channelGenre_twoBody_e :
secondTwoBody = 1;
MCGIDI_angular_sampleMu( smr, distribution->angular, modes, decaySamplingInfo );
if( smr_isOk( smr ) ) {
phi = 2. * M_PI * decaySamplingInfo->rng( decaySamplingInfo->rngState );
MCGIDI_kinetics_2BodyReaction( smr, distribution->angular, e_in, decaySamplingInfo->mu, phi, productData );
if( !smr_isOk( smr ) ) return( -1 );
productData[1].pop = product[1].pop;
productData[1].delayedNeutronIndex = product[1].delayedNeutronIndex;
productData[1].delayedNeutronRate = product->delayedNeutronRate;
productData[1].birthTimeSec = 0;
MCGIDI_sampledProducts_addProduct( smr, productDatas, productData );
if( !smr_isOk( smr ) ) return( -1 );
MCGIDI_sampledProducts_addProduct( smr, productDatas, &(productData[1]) );
if( !smr_isOk( smr ) ) return( -1 );
}
break;
case MCGIDI_channelGenre_uncorrelated_e :
case MCGIDI_channelGenre_sumOfRemaining_e :
masses[2] = MCGIDI_product_getMass_MeV( smr, product );
switch( distribution->type ) {
case MCGIDI_distributionType_uncorrelated_e :
MCGIDI_uncorrelated_sampleDistribution( smr, distribution, modes, decaySamplingInfo );
break;
case MCGIDI_distributionType_energyAngular_e :
MCGIDI_energyAngular_sampleDistribution( smr, distribution, modes, decaySamplingInfo );
break;
case MCGIDI_distributionType_KalbachMann_e :
MCGIDI_KalbachMann_sampleEp( smr, distribution->KalbachMann, modes, decaySamplingInfo );
break;
case MCGIDI_distributionType_angularEnergy_e :
MCGIDI_angularEnergy_sampleDistribution( smr, distribution->angularEnergy, modes, decaySamplingInfo );
break;
default :
printf( "Unknown spectral data form product name = %s, channel genre = %d\n", product->pop->name, outputChannel->genre );
break;
}
break;
case MCGIDI_channelGenre_undefined_e :
printf( "Channel is undefined\n" );
break;
case MCGIDI_channelGenre_twoBodyDecay_e :
printf( "Channel is twoBodyDecay\n" );
break;
case MCGIDI_channelGenre_uncorrelatedDecay_e :
printf( "Channel is uncorrelatedDecay\n" );
break;
default :
printf( "Unsupported channel genre = %d\n", outputChannel->genre );
break;
}
if( !smr_isOk( smr ) ) return( -1 );
if( !secondTwoBody ) {
if( decaySamplingInfo->frame == xDataTOM_frame_centerOfMass ) {
if( MCGIDI_kinetics_COM2Lab( smr, modes, decaySamplingInfo, masses ) != 0 ) return( -1 );
}
productData[0].kineticEnergy = decaySamplingInfo->Ep;
p = std::sqrt( decaySamplingInfo->Ep * ( decaySamplingInfo->Ep + 2. * product->pop->mass_MeV ) );
if( productData[0].isVelocity ) p *= MCGIDI_speedOfLight_cm_sec / std::sqrt( p * p + product->pop->mass_MeV * product->pop->mass_MeV );
productData[0].pz_vz = p * decaySamplingInfo->mu;
p = std::sqrt( 1. - decaySamplingInfo->mu * decaySamplingInfo->mu ) * p;
phi = 2. * M_PI * decaySamplingInfo->rng( decaySamplingInfo->rngState );
productData[0].px_vx = p * std::sin( phi );
productData[0].py_vy = p * std::cos( phi );
MCGIDI_sampledProducts_addProduct( smr, productDatas, productData );
if( !smr_isOk( smr ) ) return( -1 );
}
} // Loop checking, 11.06.2015, T. Koi
switch( outputChannel->genre ) {
case MCGIDI_channelGenre_twoBody_e :
secondTwoBody = 1;
MCGIDI_angular_sampleMu( smr, distribution->angular, modes, decaySamplingInfo );
if (smr_isOk(smr) ) {
phi = 2. * M_PI * decaySamplingInfo->rng( decaySamplingInfo->rngState );
MCGIDI_kinetics_2BodyReaction( smr, distribution->angular, e_in, decaySamplingInfo->mu, phi, productData );
if (!smr_isOk(smr) ) return( -1 );
productData[1].pop = product[1].pop;
productData[1].delayedNeutronIndex = product[1].delayedNeutronIndex;
productData[1].delayedNeutronRate = product->delayedNeutronRate;
productData[1].birthTimeSec = 0;
MCGIDI_sampledProducts_addProduct( smr, productDatas, productData );
if( !smr_isOk( smr ) ) return( -1 );
MCGIDI_sampledProducts_addProduct( smr, productDatas, &(productData[1]) );
if( !smr_isOk( smr ) ) return( -1 );
}
}
}
return( productDatas->numberOfProducts );
break;
case MCGIDI_channelGenre_uncorrelated_e :
case MCGIDI_channelGenre_sumOfRemaining_e :
// Get mass of final state particle, then get its distribution
// masses[0] and masses[1] are incident and target masses
masses[2] = MCGIDI_product_getMass_MeV( smr, product );
switch( distribution->type ) {
case MCGIDI_distributionType_uncorrelated_e :
MCGIDI_uncorrelated_sampleDistribution( smr, distribution, modes, decaySamplingInfo );
break;
case MCGIDI_distributionType_energyAngular_e :
MCGIDI_energyAngular_sampleDistribution( smr, distribution, modes, decaySamplingInfo );
break;
case MCGIDI_distributionType_KalbachMann_e :
MCGIDI_KalbachMann_sampleEp( smr, distribution->KalbachMann, modes, decaySamplingInfo );
break;
case MCGIDI_distributionType_angularEnergy_e :
MCGIDI_angularEnergy_sampleDistribution( smr, distribution->angularEnergy, modes, decaySamplingInfo );
break;
default :
printf( "Unknown spectral data form product name = %s, channel genre = %d\n", product->pop->name, outputChannel->genre );
break;
}
break;
case MCGIDI_channelGenre_undefined_e :
printf( "Channel is undefined\n" );
break;
case MCGIDI_channelGenre_twoBodyDecay_e :
printf( "Channel is twoBodyDecay\n" );
break;
case MCGIDI_channelGenre_uncorrelatedDecay_e :
printf( "Channel is uncorrelatedDecay\n" );
break;
default :
printf( "Unsupported channel genre = %d\n", outputChannel->genre );
break;
}
if (!smr_isOk(smr) ) return( -1 );
if (!secondTwoBody) {
if (decaySamplingInfo->frame == xDataTOM_frame_centerOfMass) {
if (MCGIDI_kinetics_COM2Lab( smr, modes, decaySamplingInfo, masses) != 0 ) return( -1 );
}
// Assign kinematics to final state product
productData[0].kineticEnergy = decaySamplingInfo->Ep;
p = std::sqrt( decaySamplingInfo->Ep * ( decaySamplingInfo->Ep + 2. * product->pop->mass_MeV ) );
if (productData[0].isVelocity) p *= MCGIDI_speedOfLight_cm_sec / std::sqrt( p * p + product->pop->mass_MeV * product->pop->mass_MeV );
productData[0].pz_vz = p * decaySamplingInfo->mu;
p = std::sqrt( 1. - decaySamplingInfo->mu * decaySamplingInfo->mu ) * p;
phi = 2. * M_PI * decaySamplingInfo->rng( decaySamplingInfo->rngState );
productData[0].px_vx = p * std::sin( phi );
productData[0].py_vy = p * std::cos( phi );
MCGIDI_sampledProducts_addProduct( smr, productDatas, productData );
if (!smr_isOk(smr) ) return( -1 );
}
} // while multiplicity
} // if !secondTwoBody
} // if decay channel genre
} // loop over possible final state products
return( productDatas->numberOfProducts );
}
#if defined __cplusplus
@@ -14,6 +14,36 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
05 May 2020 Gunter Folger (hadr-hpp-V10-05-10)
-------------------------------------------------
- fix for clang10: Correct copy ctor in G4ParticleHPDataPoint.hh
using default implementation
18 February 2020 Dennis Wright
----------------------------------------------------
- fix (from Artem Zontikov) bug 1838:
G4ParticleHPInelasticBaseFS.cc,
lines 412-413, 599-600: use QI[0]-QI[it] for excitation
line 442: add particle definition protection to iLevel calculation
13 February 2020 Dennis Wright
----------------------------------------------------
- fix (from Artem Zontikov) bug 1824:
change line 166 of G4ParticleHPInelasticBaseFS.cc to
theFinalStatePhotons->InitPartials(theData, theXsection);
change line 182 of G4ParticleHPInelasticCompFS.cc to
theFinalStatePhotons[it]->InitPartials(theData, theXsection[50]);
remove line delete [] theReactionXsec; in ~G4ParticleHPPhotonDist() as memory
allocation does not take place in this class
15 January 2020 Dennis Wright
---------------------------------------------------
- G4ParticleHPThermalScvattering::create_E_isoAng_from_energy :
add fatal exception for case when pointers panEPM_T_EL or panEPM_T_EH
are null. This fixes Coverity bugs 82418 and 82419.
4 December 2019 Alberto Ribon (hadr-hpp-V10-05-09)
----------------------------------------------------
- G4ParticleHPContAngularPar : set protection against unphysical interpolation
@@ -39,14 +39,7 @@ class G4ParticleHPDataPoint
G4ParticleHPDataPoint(){energy = 0; xSec = 0;}
G4ParticleHPDataPoint(G4double e, G4double x){ energy = e; xSec = x;}
void operator= (const G4ParticleHPDataPoint & aSet)
{
if(&aSet!=this)
{
energy = aSet.GetEnergy();
xSec = aSet.GetXsection();
}
}
G4ParticleHPDataPoint & operator= (const G4ParticleHPDataPoint & aSet) = default;
// ~G4ParticleHPDataPoint(){}
@@ -104,7 +104,7 @@ public:
if(0 == theData.size()%10 && 0!=theData.size())
{
if(0 == theUpper) theUpper = new G4ParticleHPHash();
theUpper->SetData(theData.size()-1, x, y);
theUpper->SetData( static_cast<G4int>(theData.size())-1, x, y);
}
}
@@ -100,7 +100,8 @@ public:
delete [] energy;
delete [] theYield;
delete [] thePartialXsec;
delete [] theReactionXsec;
// delete [] theReactionXsec;
// DHW: not created in this class
delete [] isPrimary;
delete [] theShells;
delete [] theGammas;
@@ -163,7 +163,7 @@ void G4ParticleHPInelasticBaseFS::Init (G4double A, G4double Z, G4int M, G4Strin
else if(dataType==13)
{
theFinalStatePhotons = new G4ParticleHPPhotonDist;
theFinalStatePhotons->InitPartials(theData);
theFinalStatePhotons->InitPartials(theData, theXsection);
hasFSData = true;
}
else if(dataType==14)
@@ -179,7 +179,7 @@ void G4ParticleHPInelasticCompFS::Init (G4double A, G4double Z, G4int M, G4Strin
else if(dataType==13)
{
theFinalStatePhotons[it] = new G4ParticleHPPhotonDist;
theFinalStatePhotons[it]->InitPartials(theData);
theFinalStatePhotons[it]->InitPartials(theData, theXsection[50]);
}
else if(dataType==14)
{
@@ -406,48 +406,48 @@ void G4ParticleHPInelasticCompFS::CompositeApply(const G4HadProjectile& theTrack
G4double dqi = QI[it];
if ( dqi < 0 || 849 < dqi ) useQI = true; //Former libraies does not have values of this range
if ( useQI )
{
// QI introudced since G4NDL3.15
G4double QM=(incidReactionProduct.GetMass()+targetMass)-(aHadron.GetMass()+residualMass);
eExcitation = QM-QI[it];
if(eExcitation<20*CLHEP::keV){eExcitation=0;}
if (useQI) {
// QI introudced since G4NDL3.15
// G4double QM=(incidReactionProduct.GetMass()+targetMass)-(aHadron.GetMass()+residualMass);
// eExcitation = QM-QI[it];
eExcitation = QI[0] - QI[it]; // Bug fix #1838
if(eExcitation < 20*CLHEP::keV) eExcitation = 0;
//Re-evluate iLevel based on this eExcitation
iLevel = 0;
G4bool find = false;
G4int imaxEx = 0;
G4double level_tolerance = 1.0*CLHEP::keV;
// Re-evluate iLevel based on this eExcitation
iLevel = 0;
G4bool find = false;
G4int imaxEx = 0;
G4double level_tolerance = 1.0*CLHEP::keV;
while( theGammas.GetLevel(iLevel+1) != 0 ) // Loop checking, 11.05.2015, T. Koi
{
G4double maxEx = 0.0;
if ( maxEx < theGammas.GetLevel(iLevel)->GetLevelEnergy() )
{
maxEx = theGammas.GetLevel(iLevel)->GetLevelEnergy();
imaxEx = iLevel;
while( theGammas.GetLevel(iLevel+1) != 0 ) { // Loop checking, 11.05.2015, T. Koi
G4double maxEx = 0.0;
if (maxEx < theGammas.GetLevel(iLevel)->GetLevelEnergy() ) {
maxEx = theGammas.GetLevel(iLevel)->GetLevelEnergy();
imaxEx = iLevel;
}
// Fix bug 1789 DHW - first if-branch added because gamma data come from ENSDF
// and do not necessarily match the excitations used in ENDF-B.VII
// Compromise solution: use 1 keV tolerance suggested by T. Koi
if (std::abs(eExcitation - theGammas.GetLevel(iLevel)->GetLevelEnergy() ) < level_tolerance) {
find = true;
break;
} else if (eExcitation < theGammas.GetLevel(iLevel)->GetLevelEnergy() ) {
find = true;
iLevel--;
// very small eExcitation, iLevel becomes -1, this is protected below
if (theTrack.GetDefinition() == aDefinition) { // this line added as part of fix #1838
if (iLevel == -1) iLevel = 0;
}
break;
}
iLevel++;
}
// Fix bug 1789 DHW - first if-branch added because gamma data come from ENSDF
// and do not necessarily match the excitations used in ENDF-B.VII
// Compromise solution: use 1 keV tolerance suggested by T. Koi
if (std::abs(eExcitation - theGammas.GetLevel(iLevel)->GetLevelEnergy() ) < level_tolerance) {
find = true;
break;
} else if (eExcitation < theGammas.GetLevel(iLevel)->GetLevelEnergy() ) {
find = true;
iLevel--;
// very small eExcitation, iLevel becomes -1, this is protected below.
if ( iLevel == -1 ) iLevel = 0; // But cause energy trouble.
break;
}
iLevel++;
}
// In case, cannot find proper level, then use the maximum level.
if ( !find ) iLevel = imaxEx;
// If proper level cannot be found, use the maximum level
if (!find) iLevel = imaxEx;
}
//110610TK END
if(std::getenv("G4ParticleHPDebug") && eKinetic-eExcitation < 0)
{
@@ -596,8 +596,9 @@ void G4ParticleHPInelasticCompFS::CompositeApply(const G4HadProjectile& theTrack
{
// In this case, hadron should be isotropic in CM
// Next 12 lines are Emilio's replacement
G4double QM=(incidReactionProduct.GetMass()+targetMass)-(aHadron.GetMass()+residualMass);
G4double eExcitation = QM-QI[it];
// G4double QM=(incidReactionProduct.GetMass()+targetMass)-(aHadron.GetMass()+residualMass);
// G4double eExcitation = QM-QI[it];
G4double eExcitation = QI[0] - QI[it]; // Fix of bug #1838
if(eExcitation<20*CLHEP::keV){eExcitation=0;}
two_body_reaction(&incidReactionProduct,&theTarget,&aHadron,eExcitation);
if(thePhotons==0 && eExcitation>0){
@@ -805,74 +805,74 @@ G4double G4ParticleHPThermalScattering::get_linear_interpolated ( G4double x , s
E_isoAng G4ParticleHPThermalScattering::create_E_isoAng_from_energy ( G4double energy , std::vector< E_isoAng* >* vEPM )
E_isoAng
G4ParticleHPThermalScattering::create_E_isoAng_from_energy(G4double energy,
std::vector<E_isoAng*>* vEPM)
{
E_isoAng anEPM_T_E;
std::vector<E_isoAng*>::iterator iv;
std::vector< E_isoAng* >::iterator iv;
std::vector< G4double > v_e;
std::vector<G4double> v_e;
v_e.clear();
for ( iv = vEPM->begin() ; iv != vEPM->end() ; iv++ )
v_e.push_back ( (*iv)->energy );
for (iv = vEPM->begin(); iv != vEPM->end(); iv++)
v_e.push_back( (*iv)->energy );
std::pair < G4double , G4double > energyLH = find_LH ( energy , &v_e );
std::pair<G4double, G4double> energyLH = find_LH(energy, &v_e);
//G4cout << " " << energy/eV << " " << energyLH.first/eV << " " << energyLH.second/eV << G4endl;
E_isoAng* panEPM_T_EL=0;
E_isoAng* panEPM_T_EH=0;
E_isoAng* panEPM_T_EL = 0;
E_isoAng* panEPM_T_EH = 0;
if ( energyLH.first != 0.0 && energyLH.second != 0.0 )
{
for ( iv = vEPM->begin() ; iv != vEPM->end() ; iv++ )
{
if ( energyLH.first == (*iv)->energy ) {
panEPM_T_EL = *iv;
iv++;
panEPM_T_EH = *iv;
break;
}
}
}
else if ( energyLH.first == 0.0 )
{
panEPM_T_EL = (*vEPM)[0];
panEPM_T_EH = (*vEPM)[1];
}
else if ( energyLH.second == 0.0 )
{
panEPM_T_EH = (*vEPM).back();
iv = vEPM->end();
iv--;
iv--;
panEPM_T_EL = *iv;
if (energyLH.first != 0.0 && energyLH.second != 0.0) {
for (iv = vEPM->begin(); iv != vEPM->end(); iv++) {
if (energyLH.first == (*iv)->energy) {
panEPM_T_EL = *iv;
iv++;
panEPM_T_EH = *iv;
break;
}
}
} else if (energyLH.first == 0.0) {
panEPM_T_EL = (*vEPM)[0];
panEPM_T_EH = (*vEPM)[1];
} else if (energyLH.second == 0.0) {
panEPM_T_EH = (*vEPM).back();
iv = vEPM->end();
iv--;
iv--;
panEPM_T_EL = *iv;
}
//checking isoAng has proper values or not
// Inelastic/FS, the first and last entries of *vEPM has all zero values.
if ( ! ( check_E_isoAng (panEPM_T_EL) ) ) panEPM_T_EL= panEPM_T_EH;
if ( ! ( check_E_isoAng (panEPM_T_EH) ) ) panEPM_T_EH= panEPM_T_EL;
if (panEPM_T_EL != 0 && panEPM_T_EH != 0) {
//checking isoAng has proper values or not
// Inelastic/FS, the first and last entries of *vEPM has all zero values.
if ( !(check_E_isoAng(panEPM_T_EL) ) ) panEPM_T_EL = panEPM_T_EH;
if ( !(check_E_isoAng(panEPM_T_EH) ) ) panEPM_T_EH = panEPM_T_EL;
if ( panEPM_T_EL->n == panEPM_T_EH->n )
{
anEPM_T_E.energy = energy;
anEPM_T_E.n = panEPM_T_EL->n;
if (panEPM_T_EL->n == panEPM_T_EH->n) {
anEPM_T_E.energy = energy;
anEPM_T_E.n = panEPM_T_EL->n;
for ( G4int i=0 ; i < panEPM_T_EL->n ; i++ )
{
for (G4int i=0; i < panEPM_T_EL->n; i++) {
G4double angle;
angle = get_linear_interpolated ( energy , std::pair< G4double , G4double > ( energyLH.first , panEPM_T_EL->isoAngle[ i ] )
, std::pair< G4double , G4double > ( energyLH.second , panEPM_T_EH->isoAngle[ i ] ) );
anEPM_T_E.isoAngle.push_back( angle );
}
}
else
{
G4Exception("G4ParticleHPThermalScattering::create_E_isoAng_from_energy",
"NotSupported", JustWarning,
"G4ParticleHPThermalScattering does not support yet EL->n != EH->n.");
}
angle = get_linear_interpolated(energy, std::pair<G4double,G4double>(energyLH.first, panEPM_T_EL->isoAngle[i] ),
std::pair<G4double,G4double>(energyLH.second, panEPM_T_EH->isoAngle[i] ) );
anEPM_T_E.isoAngle.push_back(angle);
}
} else {
G4Exception("G4ParticleHPThermalScattering::create_E_isoAng_from_energy",
"NotSupported", JustWarning,
"G4ParticleHPThermalScattering does not support yet EL->n != EH->n.");
}
} else {
G4Exception("G4ParticleHPThermalScattering::create_E_isoAng_from_energy",
"HAD_THERM_000", FatalException,
"Pointer panEPM_T_EL or panEPM_T_EH is zero");
}
return anEPM_T_E;
}
@@ -14,6 +14,11 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
26-Apr-2020 V. Ivanchenko (had-hadronization-V10-05-05)
- G4QGSMFragmentation, G4LundStringFragmentation - fixed Coverity warnings
if fragmentation at low energy is not possible always return flag
"false"; initialise with nullptr and not NULL
19-Nov-2019 A. Ribon (had-hadronization-V10-05-04)
- G4ExcitedStringDecay : protection in the sampling of resonance masses
against values below threshold.
@@ -787,14 +787,10 @@ Diquark_AntiDiquark_belowThreshold_lastSplitting(G4FragmentingString * & string,
{
G4double StringMass = string->Mass();
G4int cClusterInterrupt = 0;
G4bool isOK = false;
G4int cClusterInterrupt = 0;
do
{
if (cClusterInterrupt++ >= ClusterLoopInterrupt)
{
return false;
}
G4int LeftQuark1= string->GetLeftParton()->GetPDGEncoding()/1000;
G4int LeftQuark2=(string->GetLeftParton()->GetPDGEncoding()/100)%10;
@@ -805,24 +801,27 @@ Diquark_AntiDiquark_belowThreshold_lastSplitting(G4FragmentingString * & string,
{
LeftHadron =hadronizer->Build(FindParticle( LeftQuark1),
FindParticle(RightQuark1));
RightHadron=hadronizer->Build(FindParticle( LeftQuark2),
FindParticle(RightQuark2));
} else
{
LeftHadron =hadronizer->Build(FindParticle( LeftQuark1),
FindParticle(RightQuark2));
RightHadron=hadronizer->Build(FindParticle( LeftQuark2),
FindParticle(RightQuark1));
}
RightHadron= (LeftHadron == nullptr) ? nullptr :
hadronizer->Build(FindParticle( LeftQuark2),
FindParticle(RightQuark2));
} else
{
LeftHadron =hadronizer->Build(FindParticle( LeftQuark1),
FindParticle(RightQuark2));
RightHadron=(LeftHadron == nullptr) ? nullptr :
hadronizer->Build(FindParticle( LeftQuark2),
FindParticle(RightQuark1));
}
if ( (LeftHadron == NULL) || (RightHadron == NULL) ) continue;
//... repeat procedure, if mass of cluster is too low to produce hadrons
//... ClusterMassCut = 0.15*GeV model parameter
}
while ((StringMass <= LeftHadron->GetPDGMass() + RightHadron->GetPDGMass()));
return true;
isOK = (LeftHadron != nullptr) && (RightHadron != nullptr);
if(isOK) { isOK = (StringMass > LeftHadron->GetPDGMass() + RightHadron->GetPDGMass()); }
++cClusterInterrupt;
//... repeat procedure, if mass of cluster is too low to produce hadrons
//... ClusterMassCut = 0.15*GeV model parameter
}
while (isOK == false || cClusterInterrupt < ClusterLoopInterrupt);
/* Loop checking, 07.08.2015, A.Ribon */
return isOK;
}
//----------------------------------------------------------------------------------------
@@ -615,22 +615,18 @@ G4bool G4QGSMFragmentation::SplitLast(G4FragmentingString * string,
<<string->GetRightParton()->GetParticleName()<<G4endl;
#endif
G4int cClusterInterrupt = 0;
G4ParticleDefinition *LeftHadron = nullptr;
G4ParticleDefinition *RightHadron = nullptr;
const G4int maxNumberOfLoops = 1000;
G4int loopCounter = 0;
G4bool isOK = false;
G4double LeftHadronMass(0.); G4double RightHadronMass(0.);
do
{
if (cClusterInterrupt++ >= ClusterLoopInterrupt)
{
return false;
}
LeftHadronMass = -MaxMass; RightHadronMass = -MaxMass;
G4ParticleDefinition * quark = NULL;
G4ParticleDefinition * quark = nullptr;
string->SetLeftPartonStable(); // to query quark contents..
if (string->DecayIsQuark() && string->StableIsQuark() )
@@ -663,20 +659,25 @@ G4bool G4QGSMFragmentation::SplitLast(G4FragmentingString * string,
LeftHadron=hadronizer->BuildLowSpin(QuarkPair.first, string->GetLeftParton());
}
if ( LeftHadron == NULL ) continue;
if ( LeftHadron != nullptr ) {
RightHadron = hadronizer->BuildLowSpin(string->GetRightParton(), quark);
RightHadron = hadronizer->BuildLowSpin(string->GetRightParton(), quark);
if ( RightHadron != nullptr ) {
if ( RightHadron == NULL ) continue;
LeftHadronMass = LeftHadron->GetPDGMass();
RightHadronMass = RightHadron->GetPDGMass();
} while ( ( ResidualMass <= LeftHadronMass + RightHadronMass )
&& ++loopCounter < maxNumberOfLoops ); /* Loop checking, 07.08.2015, A.Ribon */
if ( loopCounter >= maxNumberOfLoops ) {
return false;
LeftHadronMass = LeftHadron->GetPDGMass();
RightHadronMass = RightHadron->GetPDGMass();
isOK = (ResidualMass > LeftHadronMass + RightHadronMass);
}
}
++loopCounter;
if ( loopCounter >= maxNumberOfLoops ) {
return false;
}
//... repeat procedure, if mass of cluster is too low to produce hadrons
//... ClusterMassCut = 0.15*GeV model parameter
}
while (isOK == false);
/* Loop checking, 07.08.2015, A.Ribon */
//... compute hadron momenta and energies
G4LorentzVector LeftMom, RightMom;
@@ -14,6 +14,13 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
19 February 2020 Alberto Ribon radioactive_decay-V10-05-12
----------------------------------------------------------
- G4RadioactiveDecayBase.cc , G4RadioactiveDecay.cc , G4Radioactivation.cc :
use G4VERBOSE consistently;
for G4Radioactivation, forgotten change of verbosity from 0 to 1
at line 844.
12 February 2020 Alberto Ribon radioactive_decay-V10-05-11
----------------------------------------------------------
- G4RadioactiveDecayBase.cc , G4RadioactiveDecay.cc : forgotten change of
@@ -818,7 +818,7 @@ G4Radioactivation::DecayIt(const G4Track& theTrack, const G4Step&)
// Now check if particle is valid for RDM
if (!(IsApplicable(*theParticleDef) ) ) {
// Particle is not an ion or is outside the nucleuslimits for decay
#ifdef G4VERBOSE
if (GetVerboseLevel() > 1) {
G4cout << "G4RadioactiveDecay::DecayIt : "
<< theParticleDef->GetParticleName()
@@ -826,6 +826,7 @@ G4Radioactivation::DecayIt(const G4Track& theTrack, const G4Step&)
<< " Set particle change accordingly. "
<< G4endl;
}
#endif
fParticleChangeForRadDecay.SetNumberOfSecondaries(0);
// Kill the parent particle
@@ -840,14 +841,15 @@ G4Radioactivation::DecayIt(const G4Track& theTrack, const G4Step&)
if (theDecayTable == 0 || theDecayTable->entries() == 0) {
// No data in the decay table. Set particle change parameters
// to indicate this.
if (GetVerboseLevel() > 0) {
#ifdef G4VERBOSE
if (GetVerboseLevel() > 1) {
G4cout << "G4RadioactiveDecay::DecayIt : "
<< "decay table not defined for "
<< theParticleDef->GetParticleName()
<< ". Set particle change accordingly. "
<< G4endl;
}
#endif
fParticleChangeForRadDecay.SetNumberOfSecondaries(0);
// Kill the parent particle.
@@ -1696,14 +1696,14 @@ G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4Step&)
// Now check if particle is valid for RDM
if (!(IsApplicable(*theParticleDef) ) ) {
// Particle is not an ion or is outside the nucleuslimits for decay
#ifdef G4VERBOSE
if (GetVerboseLevel() > 1) {
G4cout << " G4RadioactiveDecay::DecayIt : "
<< theParticleDef->GetParticleName()
<< " is not a valid nucleus for the RDM. "<< G4endl;
G4cout << " Set particle change accordingly. " << G4endl;
}
#endif
fParticleChangeForRadDecay.SetNumberOfSecondaries(0);
// Kill the parent particle
@@ -1717,11 +1717,13 @@ G4RadioactiveDecay::DecayIt(const G4Track& theTrack, const G4Step&)
if (theDecayTable == 0 || theDecayTable->entries() == 0) {
// No data in the decay table. Set particle change parameters
// to indicate this.
#ifdef G4VERBOSE
if (GetVerboseLevel() > 1) {
G4cout <<" G4RadioactiveDecay::DecayIt : decay table not defined for ";
G4cout << theParticleDef->GetParticleName() << G4endl;
G4cout << " Set particle change to indicate this. " << G4endl;
}
#endif
fParticleChangeForRadDecay.SetNumberOfSecondaries(0);
// Kill the parent particle.
@@ -952,7 +952,7 @@ G4RadioactiveDecayBase::DecayIt(const G4Track& theTrack, const G4Step&)
// Now check if particle is valid for RDM
if (!(IsApplicable(*theParticleDef) ) ) {
// Particle is not an ion or is outside the nucleuslimits for decay
#ifdef G4VERBOSE
if (GetVerboseLevel() > 1) {
G4cout << "G4RadioactiveDecay::DecayIt : "
<< theParticleDef->GetParticleName()
@@ -960,6 +960,7 @@ G4RadioactiveDecayBase::DecayIt(const G4Track& theTrack, const G4Step&)
<< " Set particle change accordingly. "
<< G4endl;
}
#endif
fParticleChangeForRadDecay.SetNumberOfSecondaries(0);
// Kill the parent particle
@@ -974,6 +975,7 @@ G4RadioactiveDecayBase::DecayIt(const G4Track& theTrack, const G4Step&)
if (theDecayTable == 0 || theDecayTable->entries() == 0) {
// No data in the decay table. Set particle change parameters
// to indicate this.
#ifdef G4VERBOSE
if (GetVerboseLevel() > 1) {
G4cout << "G4RadioactiveDecay::DecayIt : "
<< "decay table not defined for "
@@ -981,6 +983,7 @@ G4RadioactiveDecayBase::DecayIt(const G4Track& theTrack, const G4Step&)
<< ". Set particle change accordingly. "
<< G4endl;
}
#endif
fParticleChangeForRadDecay.SetNumberOfSecondaries(0);
// Kill the parent particle.