Import Geant4 10.7.0 source tree

This commit is contained in:
Gabriele Cosmo
2020-12-04 12:30:43 +01:00
parent 67ba86d073
commit dab42d2018
3770 changed files with 226369 additions and 286486 deletions
@@ -45,7 +45,9 @@
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4ios.hh"
#include "BrachyAnalysisManager.hh"
#include "G4SystemOfUnits.hh"
#include "globals.hh"
BrachyRunAction::BrachyRunAction()
{}
@@ -55,13 +57,33 @@ BrachyRunAction::~BrachyRunAction()
void BrachyRunAction::BeginOfRunAction(const G4Run* aRun)
{
G4cout << "### Run " << aRun -> GetRunID() << " start." << G4endl;
G4cout << "### Run " << aRun -> GetRunID() << " start." << G4endl;
auto analysisManager = G4AnalysisManager::Instance();
G4bool fileOpen = analysisManager -> OpenFile("primary.root");
if (! fileOpen) {
G4cerr << "\n---> The ROOT output file has not been opened "
<< analysisManager->GetFileName() << G4endl;
}
G4cout << "Using " << analysisManager->GetType() << G4endl;
analysisManager -> SetVerboseLevel(1);
// Create histogram with the energy spectrum of the photons emitted by the
// radionucldie
analysisManager-> CreateH1("h10","energy spectrum", 800, 0., 800.);
}
void BrachyRunAction::EndOfRunAction(const G4Run* aRun)
{
G4cout << "number of events = " << aRun->GetNumberOfEvent() << G4endl;
G4cout << "number of events = " << aRun->GetNumberOfEvent() << G4endl;
// save histograms in primary.root
auto analysisManager = G4AnalysisManager::Instance();
analysisManager -> Write();
analysisManager -> CloseFile();
}