BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
region.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 "region.h"
19
20using namespace GMAD;
21
23{
24 clear();
26}
27
29{
30 // In case these aren't explictly set, these are set to a sensible
31 // default of 1mm (SI units here) - the Geant4 default. All are copied
32 // to a region definition in BDSDetectorConstruction.
33 defaultRangeCut = 0.0;
34 prodCutPhotons = 0.0;
35 prodCutElectrons = 0.0;
36 prodCutPositrons = 0.0;
37 prodCutProtons = 0.0;
38}
39
41{
42 publish("name", &Region::name);
43 publish("defaultRangeCut", &Region::defaultRangeCut);
44 publish("prodCutPhotons", &Region::prodCutPhotons);
45 publish("prodCutElectrons",&Region::prodCutElectrons);
46 publish("prodCutPositrons",&Region::prodCutPositrons);
47 publish("prodCutProtons", &Region::prodCutProtons);
48}
49
50void Region::print()const
51{
52 std::cout << "region: "
53 << name << " "
54 << defaultRangeCut << " "
55 << prodCutPhotons << " "
56 << prodCutElectrons << " "
57 << prodCutPositrons << " "
58 << prodCutProtons
59 << std::endl;
60}
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
void clear()
reset
Definition region.cc:28
std::string name
name
Definition region.h:37
void print() const
print some properties
Definition region.cc:50
void PublishMembers()
publish members
Definition region.cc:40
Region()
constructor
Definition region.cc:22
Parser namespace for GMAD language. Combination of Geant4 and MAD.