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