BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
scorer.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 "scorer.h"
20
21using namespace GMAD;
22
24{
25 clear();
27}
28
30{
31 name = "";
32 type = "";
33 particleName = "";
34 particlePDGID = 0;
35 minimumKineticEnergy = 0;
36 maximumKineticEnergy = 1e8; // 100 PeV - well beyond G4 physics for now
37 minimumTime = 0;
38 maximumTime = 0;
39 conversionFactorFile = "";
40 materialToInclude = "";
41 materialToExclude = "";
42 scoreWorldVolumeOnly = false;
43 scorePrimariesOnly = false;
44}
45
47{
48 publish("name", &Scorer::name);
49 publish("type", &Scorer::type);
50 publish("particleName", &Scorer::particleName);
51 publish("particlePDGID", &Scorer::particlePDGID);
52 publish("minimumKineticEnergy", &Scorer::minimumKineticEnergy);
53 publish("maximumKineticEnergy", &Scorer::maximumKineticEnergy);
54 publish("minimumTime", &Scorer::minimumTime);
55 publish("maximumTime", &Scorer::maximumTime);
56 publish("conversionFactorFile", &Scorer::conversionFactorFile);
57 publish("conversionFactorPath", &Scorer::conversionFactorPath);
58 publish("materialToInclude", &Scorer::materialToInclude);
59 publish("materialToExclude", &Scorer::materialToExclude);
60 publish("scoreWorldVolumeOnly", &Scorer::scoreWorldVolumeOnly);
61 publish("scorePrimariesOnly", &Scorer::scorePrimariesOnly);
62}
63
64void Scorer::print()const
65{
66 std::cout << "scorer: "
67 << "name " << name << std::endl
68 << "type " << type << std::endl
69 << "particleName " << particleName << std::endl
70 << "particlePDGID " << particlePDGID << std::endl
71 << "minimumKineticEnergy " << minimumKineticEnergy << std::endl
72 << "maximumKineticEnergy " << maximumKineticEnergy << std::endl
73 << "minimumTime " << minimumTime << std::endl
74 << "maximumTime " << maximumTime << std::endl
75 << "conversionFactorFile " << conversionFactorFile << std::endl
76 << "conversionFactorPath " << conversionFactorPath << std::endl
77 << "materialToInclude " << materialToInclude << std::endl
78 << "materialToExclude " << materialToExclude << std::endl
79 << "scoreWorldVolumeOnly " << scoreWorldVolumeOnly << std::endl
80 << "scorePrimariesOnly" << scorePrimariesOnly << std::endl;
81}
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
std::string name
Name.
Definition: scorer.h:39
void clear()
Reset.
Definition: scorer.cc:29
Scorer()
Constructor.
Definition: scorer.cc:23
void PublishMembers()
publish members
Definition: scorer.cc:46
int particlePDGID
PDG ID code for particle.
Definition: scorer.h:42
void print() const
Print some properties.
Definition: scorer.cc:64
std::string type
Type of the scorer, ie forumula.
Definition: scorer.h:40
std::string particleName
Particle name as a string.
Definition: scorer.h:41
Parser namespace for GMAD language. Combination of Geant4 and MAD.