BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
atom.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 "atom.h"
19
20using namespace GMAD;
21
23{
24 clear();
26}
27
29{
30 name = "";
31 A = 0.0;
32 Z = 0.0;
33 symbol = "";
34}
35
37{
38 publish("name", &Atom::name);
39 publish("A", &Atom::A);
40 publish("Z", &Atom::Z);
41 publish("symbol", &Atom::symbol);
42}
43
44void Atom::print()const
45{
46 std::cout << "atom: " << name << " "
47 << "A= " << A << "g/mole "
48 << "Z= " << Z << " "
49 << "symbol= " << symbol << " "
50 << std::endl;
51}
void publish(const std::string &name, T C::*mp)
Make pointer to member from class C and type T with accessible with a name.
Definition published.h:93
Parser namespace for GMAD language. Combination of Geant4 and MAD.
double A
g*mol^-1
Definition atom.h:39
void print() const
printout
Definition atom.cc:44
void clear()
reset
Definition atom.cc:28
Atom()
constructor
Definition atom.cc:22
std::string name
name
Definition atom.h:37
void PublishMembers()
publish members so these can be looked up from parser
Definition atom.cc:36