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) 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 "BDSDebug.hh"
19#include "BDSPhysicsIonisation.hh"
20
21#include "G4AntiProton.hh"
22#include "G4AutoDelete.hh"
23#include "G4eIonisation.hh"
24#include "G4Electron.hh"
25#include "G4GenericIon.hh"
26#include "G4hIonisation.hh"
27#include "G4ionIonisation.hh"
28#include "G4KaonMinus.hh"
29#include "G4KaonPlus.hh"
30#include "G4MuIonisation.hh"
31#include "G4MuonMinus.hh"
32#include "G4MuonPlus.hh"
33#include "G4PhysicsListHelper.hh"
34#include "G4PionMinus.hh"
35#include "G4PionPlus.hh"
36#include "G4Positron.hh"
37#include "G4Proton.hh"
38
39
40BDSPhysicsIonisation::BDSPhysicsIonisation():
41 G4VPhysicsConstructor("BDSPhysicsIonisation")
42{;}
43
44BDSPhysicsIonisation::~BDSPhysicsIonisation()
45{;}
46
48{
49 G4Electron::Electron();
50 G4Positron::Positron();
51 G4MuonMinus::MuonMinus();
52 G4MuonPlus::MuonPlus();
53 G4Proton::Proton();
54 G4AntiProton::AntiProton();
55 G4PionMinus::PionMinus();
56 G4PionPlus::PionPlus();
57 G4KaonMinus::KaonMinus();
58 G4KaonPlus::KaonPlus();
59 G4GenericIon::GenericIon();
60}
61
63{
64 if (Activated())
65 {return;}
66
67 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
68
69 // e+-
70 auto eIonisation = new G4eIonisation();
71 G4AutoDelete::Register(eIonisation);
72 ph->RegisterProcess(eIonisation, G4Electron::Electron());
73 ph->RegisterProcess(eIonisation, G4Positron::Positron());
74
75 // mu+-
76 auto muIonisation = new G4MuIonisation();
77 G4AutoDelete::Register(muIonisation);
78 ph->RegisterProcess(muIonisation, G4MuonPlus::MuonPlus());
79 ph->RegisterProcess(muIonisation, G4MuonMinus::MuonMinus());
80
81 // p pbar, pi+-, k+-
82 auto hIonisation = new G4hIonisation();
83 G4AutoDelete::Register(hIonisation);
84 ph->RegisterProcess(hIonisation, G4Proton::Proton());
85 ph->RegisterProcess(hIonisation, G4AntiProton::AntiProton());
86 ph->RegisterProcess(hIonisation, G4PionMinus::PionMinus());
87 ph->RegisterProcess(hIonisation, G4PionPlus::PionPlus());
88 ph->RegisterProcess(hIonisation, G4KaonMinus::KaonMinus());
89 ph->RegisterProcess(hIonisation, G4KaonPlus::KaonPlus());
90
91 // ions
92 G4GenericIon::GenericIon();
93 auto ionIonisation = new G4ionIonisation();
94 G4AutoDelete::Register(ionIonisation);
95 ph->RegisterProcess(ionIonisation, G4GenericIon::GenericIon());
96
98}
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.