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