BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSPhysicsIonisation.cc
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2024.
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 "BDSDebug.hh"
20#include "BDSPhysicsIonisation.hh"
21
22#include "G4AntiProton.hh"
23#include "G4AutoDelete.hh"
24#include "G4eIonisation.hh"
25#include "G4Electron.hh"
26#include "G4GenericIon.hh"
27#include "G4hIonisation.hh"
28#include "G4ionIonisation.hh"
29#include "G4KaonMinus.hh"
30#include "G4KaonPlus.hh"
31#include "G4MuIonisation.hh"
32#include "G4MuonMinus.hh"
33#include "G4MuonPlus.hh"
34#include "G4PhysicsListHelper.hh"
35#include "G4PionMinus.hh"
36#include "G4PionPlus.hh"
37#include "G4Positron.hh"
38#include "G4Proton.hh"
39
40
41BDSPhysicsIonisation::BDSPhysicsIonisation():
42 G4VPhysicsConstructor("BDSPhysicsIonisation")
43{;}
44
45BDSPhysicsIonisation::~BDSPhysicsIonisation()
46{;}
47
49{
50 G4Electron::Electron();
51 G4Positron::Positron();
52 G4MuonMinus::MuonMinus();
53 G4MuonPlus::MuonPlus();
54 G4Proton::Proton();
55 G4AntiProton::AntiProton();
56 G4PionMinus::PionMinus();
57 G4PionPlus::PionPlus();
58 G4KaonMinus::KaonMinus();
59 G4KaonPlus::KaonPlus();
60 G4GenericIon::GenericIon();
61}
62
64{
65 if (Activated())
66 {return;}
67
68 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
69
70 // e+-
71 auto eIonisation = new G4eIonisation();
72 G4AutoDelete::Register(eIonisation);
73 ph->RegisterProcess(eIonisation, G4Electron::Electron());
74 ph->RegisterProcess(eIonisation, G4Positron::Positron());
75
76 // mu+-
77 auto muIonisation = new G4MuIonisation();
78 G4AutoDelete::Register(muIonisation);
79 ph->RegisterProcess(muIonisation, G4MuonPlus::MuonPlus());
80 ph->RegisterProcess(muIonisation, G4MuonMinus::MuonMinus());
81
82 // p pbar, pi+-, k+-
83 auto hIonisation = new G4hIonisation();
84 G4AutoDelete::Register(hIonisation);
85 ph->RegisterProcess(hIonisation, G4Proton::Proton());
86 ph->RegisterProcess(hIonisation, G4AntiProton::AntiProton());
87 ph->RegisterProcess(hIonisation, G4PionMinus::PionMinus());
88 ph->RegisterProcess(hIonisation, G4PionPlus::PionPlus());
89 ph->RegisterProcess(hIonisation, G4KaonMinus::KaonMinus());
90 ph->RegisterProcess(hIonisation, G4KaonPlus::KaonPlus());
91
92 // ions
93 G4GenericIon::GenericIon();
94 auto ionIonisation = new G4ionIonisation();
95 G4AutoDelete::Register(ionIonisation);
96 ph->RegisterProcess(ionIonisation, G4GenericIon::GenericIon());
97
99}
virtual void ConstructParticle()
Construct all leptons, photons (inc optical), and pion +- just in case.
virtual void ConstructProcess()
Construct and attach the processes to the relevant particles.
G4bool Activated() const
Get whether this instance has been activated.
void SetActivated()
Flag this instance as activated for later querying.