43 static bool EGS_TRACK_SCORING_LOCAL inputSet =
false;
46 EGS_AusgabObject(Name,f), m_pts(0), m_start(0), m_stop(1024), m_lastCase(-1),
47 m_nScore(0), m_bufSize(16), m_score(false), m_didScore(false),
48 m_score_photons(true), m_score_electrons(true), m_score_positrons(true), m_fnExtra(
""), m_include_time(false) {
49 otype =
"EGS_TrackScoring";
52 EGS_TrackScoring::~EGS_TrackScoring() {
91 description +=
"======================================================\n";
105 sprintf(buf,
"%lld\n",
m_stop);
115 void EGS_TrackScoring::reportResults() {
117 egsInformation(
"======================================================\n");
127 static void setInputs() {
130 setBaseAusgabObjectInputs();
132 ausBlockInput->getSingleInput(
"library")->setValues({
"egs_track_scoring"});
135 ausBlockInput->addSingleInput(
"score photons",
false,
"Score photons? Default is yes.", {
"yes",
"no"});
136 ausBlockInput->addSingleInput(
"score electrons",
false,
"Score the electrons? Default is yes.", {
"yes",
"no"});
137 ausBlockInput->addSingleInput(
"score positrons",
false,
"Score positrons? Default is yes.", {
"yes",
"no"});
138 ausBlockInput->addSingleInput(
"start scoring",
false,
"The history at which to start recording tracks. Defaults to 0.");
139 ausBlockInput->addSingleInput(
"stop scoring",
false,
"The history at which to stop recording tracks. Defaults to 1024.");
140 ausBlockInput->addSingleInput(
"buffer size",
false,
"The number of tracks to save in a buffer before writing out to a file. Defaults to 1024.");
141 ausBlockInput->addSingleInput(
"file name addition",
false,
"A string that is appended to the input file name for the .ptracks file");
144 EGS_TRACK_SCORING_EXPORT
string getExample() {
148 # Example of egs_track_scoring
149 :start ausgab object:
150 library = egs_track_scoring
153 score electrons = yes
154 score positrons = yes
162 EGS_TRACK_SCORING_EXPORT shared_ptr<EGS_BlockInput> getInputs() {
166 return ausBlockInput;
171 const static char *func =
"createAusgabObject(track_scoring)";
177 vector<string> sc_options;
178 sc_options.push_back(
"no");
179 sc_options.push_back(
"yes");
180 bool scph = input->
getInput(
"score photons",sc_options,
true);
181 bool scel = input->
getInput(
"score electrons",sc_options,
true);
182 bool scpo = input->
getInput(
"score positrons",sc_options,
true);
183 if (!scph && !scel && !scpo) {
191 bool incltime = input->
getInput(
"include time index",sc_options,1,&found);
194 bool autoDetectDynamic =
false;
196 autoDetectDynamic =
true;
199 EGS_I64 first = 0, last = 1024;
200 input->
getInput(
"start scoring",first);
201 input->
getInput(
"stop scoring",last);
203 input->
getInput(
"buffer size",bufSize);
205 input->
getInput(
"file name addition",fnExtra);
207 result->setScorePhotons(scph);
208 result->setScoreElectrons(scel);
209 result->setScorePositrons(scpo);
210 result->setIncludeTime(incltime);
211 result->setAutoDetectDynamic(autoDetectDynamic);
212 result->setFirstEvent(first);
213 result->setLastEvent(last);
214 result->setBufferSize(bufSize);
215 result->setFileNameExtra(fnExtra);
Base class for advanced EGSnrc C++ applications.
const string & getOutputFile() const
Returns the base name of the output file(s)
const string & getAppDir() const
Returns the absolute path to the user code directory.
virtual void setApplication(EGS_Application *App)
Set the application this object belongs to.
string description
A short ausgab object description.
EGS_Application * app
The application this object belongs to.
void setName(EGS_Input *inp)
Set the name of the object from the information provided by inp.
string name
The object name.
A class that stores all the tracks in a simulation.
void reportResults(bool with_header=true)
Report results from the track scoring process so far.
A track scoring object: header.
EGS_I64 m_start
Minimum event index for which to score tracks.
bool m_score_electrons
Score electron tracks?
bool m_include_time
include time index in tracks file?
string m_fnExtra
String to append to output file name.
bool m_autoDetectDynamic
Option for autodetecting whether to include time indices.
EGS_I64 m_stop
Maximum event index for which to score tracks.
int m_bufSize
The track container size.
EGS_ParticleTrackContainer * m_pts
The particle track container.
bool m_score_photons
Score photon tracks?
EGS_I64 m_nScore
Number of events for which tracks were scored.
bool m_score_positrons
Score positron tracks?
Global egspp functions header file.
EGS_RADIATIVE_SPLITTING_EXPORT EGS_AusgabObject * createAusgabObject(EGS_Input *input, EGS_ObjectFactory *f)
A track scoring ausgab object.
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
bool egsIsAbsolutePath(const string &path)
Does the string path represent an absolute path name?
string egsJoinPath(const string &first, const string &second)
Join two path variables (or a path and a file name) using the platform specific directory separator a...
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.