BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSPhysicsRadioactivation.cc
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#include "G4Version.hh"
19#if G4VERSION_NUMBER > 1039
20#include "BDSPhysicsRadioactivation.hh"
21
22#include "G4GenericIon.hh"
23#include "G4EmParameters.hh"
24#include "G4LossTableManager.hh"
25#include "G4NuclideTable.hh"
26#include "G4ParticleDefinition.hh"
27#include "G4PhysicsListHelper.hh"
28#include "G4Radioactivation.hh"
29#include "G4Types.hh"
30#include "G4UAtomicDeexcitation.hh"
31#include "G4VAtomDeexcitation.hh"
32
33BDSPhysicsRadioactivation::BDSPhysicsRadioactivation(G4bool atomicRearrangementIn):
34 G4VPhysicsConstructor("BDSPhysicsRadioactivation"),
35 atomicRearrangement(atomicRearrangementIn)
36{;}
37
38BDSPhysicsRadioactivation::~BDSPhysicsRadioactivation()
39{;}
40
41void BDSPhysicsRadioactivation::ConstructParticle()
42{
43 G4GenericIon::GenericIon();
44}
45
46void BDSPhysicsRadioactivation::ConstructProcess()
47{
48 if (Activated())
49 {return;}
50
51 G4Radioactivation* ra = new G4Radioactivation();
52 //G4AutoDelete::Register(ra); // this cause a double deletion error somehow
53
54 // atomic rearrangement
55 ra->SetARM(atomicRearrangement);
56
57 // initialise atomic deexcitation
58 G4LossTableManager* man = G4LossTableManager::Instance();
59 G4VAtomDeexcitation* ad = man->AtomDeexcitation();
60 if (!ad)
61 {
62 G4EmParameters::Instance()->SetAuger(true);
63 ad = new G4UAtomicDeexcitation();
64 ad->InitialiseAtomicDeexcitation();
65 man->SetAtomDeexcitation(ad);
66 }
67
68 G4PhysicsListHelper::GetPhysicsListHelper()->RegisterProcess(ra, G4GenericIon::GenericIon());
69
71}
72
73#endif
G4bool Activated() const
Get whether this instance has been activated.
void SetActivated()
Flag this instance as activated for later querying.