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