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) Royal Holloway,
3University of London 2001 - 2023.
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 "atom.h"
20
21using namespace GMAD;
22
24{
25 clear();
27}
28
30{
31 name = "";
32 A = 0.0;
33 Z = 0.0;
34 symbol = "";
35}
36
38{
39 publish("name", &Atom::name);
40 publish("A", &Atom::A);
41 publish("Z", &Atom::Z);
42 publish("symbol", &Atom::symbol);
43}
44
45void Atom::print()const
46{
47 std::cout << "atom: " << name << " "
48 << "A= " << A << "g/mole "
49 << "Z= " << Z << " "
50 << "symbol= " << symbol << " "
51 << std::endl;
52}
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:92
Parser namespace for GMAD language. Combination of Geant4 and MAD.
double A
g*mol^-1
Definition: atom.h:40
void print() const
printout
Definition: atom.cc:45
void clear()
reset
Definition: atom.cc:29
Atom()
constructor
Definition: atom.cc:23
std::string name
name
Definition: atom.h:38
void PublishMembers()
publish members so these can be looked up from parser
Definition: atom.cc:37