Environment: Windows 10; Geant4 11.2.2
I am trying to add some physics and make tritium decay, so I made the following changes in the main program:
auto phy = new QBBC;
phy->RegisterPhysics(new FixTritiumPhysics());
phy->RegisterPhysics(new G4DecayPhysics());
phy->RegisterPhysics(new G4RadioactiveDecayPhysics());
runManager->SetUserInitialization(phy);
in which, the FixTritiumPhysics
was obtained from this website: Triton decay with rdecay01 example - Getting Started - Geant4 Forum
class FixTritiumPhysics : public G4VPhysicsConstructor
{
public:
FixTritiumPhysics() {}
~FixTritiumPhysics() {}
protected:
void ConstructParticle() override {}
void ConstructProcess() override
{
// Make tritium unstable, so it can be decayed
G4ParticleDefinition* tr = G4Triton::Definition();
tr->SetPDGStable(false);
// Remove G4Decay process, which requires a registered decay table
G4VProcess* decay = 0;
G4ProcessManager* pman = tr->GetProcessManager();
G4ProcessVector* pvec = pman->GetAtRestProcessVector();
for (G4int i = 0; i < pvec->size() && decay == 0; i++) {
if ((*pvec)[i]->GetProcessName() == "Decay") decay = (*pvec)[i];
}
if (decay) pman->RemoveProcess(decay);
// Attach RDM, which is a rest-discrete process
#if G4VERSION_NUMBER < 1060 /* See G4RadioactiveDecayPhysics.cc */
decay = new G4RadioactiveDecay();
#else
decay = new G4RadioactiveDecayBase();
#endif
tr->GetProcessManager()->AddProcess(decay, 1000, -1, 1000);
}
};
So, when I run the tritium decay by /gun/ion 1 3
, the tritium can indeed decay and produce electrons.
But when I try to run by Co-60 or other ion, it won’t decay.
/gun/ion 27 60
Co60: 1 Emean = 0 eV ( 0 eV --> 0 eV ) mean life = 7.61 y
Total time of life (full chain): mean = 0 ps half-life = 0 ps ( 0 ps --> 0 ps )
Total visible energy (full chain) : mean = 0 eV ( 0 eV --> 0 eV )
Activity of Co60 = 0 Bq/g (0 Ci/g)
I noticed the following in the original post:
The version number check above is needed if you build against older versions of G4. It would be nice if G4Triton had a regular “particle decay table” attached to it, in which case just the first three lines of the function would be needed.
So how can I attach the “particle decay table” or revise the code to make the triton and other ions could decay?