BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
physicsbiasing.h
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#ifndef PHYSICSBIASING_H
19#define PHYSICSBIASING_H
20
21#include <string>
22#include <list>
23#include <vector>
24#if __cplusplus >= 201703L
25#include <variant>
26#endif
27#include "published.h"
28
29
30namespace GMAD
31{
32 class Array;
33}
34
35namespace GMAD
36{
37 enum class PhysicsBiasingType {ALL=1,PRIMARY=2,SECONDARY=3};
38
44 class PhysicsBiasing : public Published<PhysicsBiasing> {
45
46 public:
47 std::string name;
49 std::string particle;
51 std::string process;
52 std::vector<std::string> processList;
54 std::vector<double> factor;
56 std::vector<PhysicsBiasingType> flag;
57
61 void PublishMembers();
63 void clear();
65 void print()const;
66
68 void set_value(const std::string& property, double value, bool bExit = true);
70 void set_value(const std::string& property, Array* value, bool bExit = true);
72 void set_value(const std::string& property, std::string value, bool bExit = true);
74#if __cplusplus >= 201703L
75 std::list<std::variant<bool, int, double, std::string>> get_value_array(const std::string &);
76#endif
77 };
78
79}
80
81#endif
Representation of arrays used in tokens.
Definition array.h:39
Physics biasing class for parser.
std::vector< double > factor
factors corresponding to process
void set_value(const std::string &property, double value, bool bExit=true)
set methods by property name, numeric values
PhysicsBiasing()
constructor
void print() const
print some properties
std::vector< PhysicsBiasingType > flag
flag which particles are biased
std::string particle
particle name
void PublishMembers()
publish members
std::list< std::variant< bool, int, double, std::string > > get_value_array(const std::string &)
Get method for lists.
std::string process
geant4 process: single string, but can have multiple processes separated with a space
Class that provides introspection to its members.
Definition published.h:48
Parser namespace for GMAD language. Combination of Geant4 and MAD.