BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSIonDefinition.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
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#ifndef BDSIONDEFINITION_H
20#define BDSIONDEFINITION_H
21
22#include "globals.hh"
23
24#include <ostream>
25
33{
34public:
35 explicit BDSIonDefinition(const G4String& definition);
36 BDSIonDefinition(G4int aIn,
37 G4int zIn,
38 G4double qIn);
40
42 inline G4int A() const {return a;}
43 inline G4int Z() const {return z;}
44 inline G4double Charge() const {return charge;}
45 inline G4double ExcitationEnergy() const {return energy;}
46 inline G4bool OverrideCharge() const {return overrideCharge;}
47 inline G4int NElectrons() const {return nElectrons;}
49
51 friend std::ostream& operator<< (std::ostream& out, BDSIonDefinition const& io);
52
53private:
55 BDSIonDefinition() = delete;
56
58 void Parse(const G4String& definition);
59
60 G4int a;
61 G4int z;
62 G4double charge;
63 G4double energy;
65 G4int nElectrons;
66};
67
68#endif
Class to parse an ion particle definition.
G4int nElectrons
Inferred number of bound electrons if any.
G4int NElectrons() const
Accessor.
G4int A() const
Accessor.
G4bool overrideCharge
Whether to specify the charge.
G4double energy
Excitation energy. G4units.
G4double ExcitationEnergy() const
Accessor.
void Parse(const G4String &definition)
Parse the definition.
G4bool OverrideCharge() const
Accessor.
friend std::ostream & operator<<(std::ostream &out, BDSIonDefinition const &io)
Output streamer.
G4int Z() const
Accessor.
G4double Charge() const
Accessor.
BDSIonDefinition()=delete
No default constructor.
G4double charge
In units of eplus.