BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSPhysicsLaserPhotoDetachment.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 "BDSLaserPhotoDetachment.hh"
19#include "BDSPhysicsLaserPhotoDetachment.hh"
20
21#include "globals.hh" // geant4 types / globals
22#include "G4AutoDelete.hh"
23#include "G4Electron.hh"
24#include "G4GenericIon.hh"
25#include "G4Hydrogen.hh"
26#include "G4IonTable.hh"
27#include "G4ParticleDefinition.hh"
28#include "G4ProcessManager.hh"
29#include "G4Version.hh"
30
31BDSPhysicsLaserPhotoDetachment::BDSPhysicsLaserPhotoDetachment():
32 G4VPhysicsConstructor("BDSPhysicsLaserPhotoDetachment")
33{;}
34
35BDSPhysicsLaserPhotoDetachment::~BDSPhysicsLaserPhotoDetachment()
36{;}
37
38void BDSPhysicsLaserPhotoDetachment::ConstructParticle()
39{
40 G4Electron::ElectronDefinition();
41 G4GenericIon::Definition();
42 G4Hydrogen::Definition();
43}
44
45void BDSPhysicsLaserPhotoDetachment::ConstructProcess()
46{
47 if (Activated())
48 {return;}
49
50 BDSLaserPhotoDetachment* laserPhotoDetachment = new BDSLaserPhotoDetachment();
51 G4AutoDelete::Register(laserPhotoDetachment);
52#if G4VERSION_NUMBER > 1029
53 auto aParticleIterator = GetParticleIterator();
54#endif
55 aParticleIterator->reset();
56 G4String name = laserPhotoDetachment->GetProcessName();
57 while ((*aParticleIterator)())
58 {
59 G4ParticleDefinition* particle = aParticleIterator->value();
60 G4double atomic = particle->GetAtomicNumber();
61
62 if (G4IonTable::IsIon(particle)&&atomic==1)
63 {
64 G4ProcessManager* pmanager = particle->GetProcessManager();
65 pmanager->AddDiscreteProcess(laserPhotoDetachment);
66 }
67 }
68
70}
Laser excitation of ion.
G4bool Activated() const
Get whether this instance has been activated.
void SetActivated()
Flag this instance as activated for later querying.