Monte Carlo LYSO
Geant4 simulation for the LYSO calorimeter prototype
Functions
summary.hh File Reference

Declaration of the function MC_summary() (and the auxiliary function extract_value()) More...

#include <iostream>
#include <fstream>
#include <ctime>
#include <cstdlib>
#include <string>
#include <unistd.h>
#include "globals.hh"
Include dependency graph for summary.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

G4String extract_value (const G4String &line, const G4String &keyword)
 Auxiliary function called by MC_summary() to extract settings from the macro files used for the Monte Carlo. More...
 
void MC_summary (G4String macrofile, G4int seed, G4double duration, const G4String &output_filename)
 Writes the summary of the Monte Carlo to a text file, updating it at the end of every simulation. More...
 

Detailed Description

Declaration of the function MC_summary() (and the auxiliary function extract_value())

Definition in file summary.hh.

Function Documentation

◆ extract_value()

G4String extract_value ( const G4String &  line,
const G4String &  keyword 
)

Auxiliary function called by MC_summary() to extract settings from the macro files used for the Monte Carlo.

Parameters
lineThe line from the macro file
keywordThe string representing the command in the macro files, after which the setting is taken
Returns
The extracted value

Definition at line 13 of file summary.cc.

◆ MC_summary()

void MC_summary ( G4String  macrofile,
G4int  seed,
G4double  duration,
const G4String &  output_filename 
)

Writes the summary of the Monte Carlo to a text file, updating it at the end of every simulation.

The summary includes:

  • Monte Carlo ID (the seed of the run), date, username and duration;
  • Settings related to the primary generator;
  • Settings related to the construction.
Parameters
macrofileThe name of the run macro file
seedThe seed of the simulation
durationThe duration (in seconds) of the simulation
output_filenameThe name of the text output file

Definition at line 32 of file summary.cc.