Import Geant4 11.0.0 source tree
This commit is contained in:
committed by
Ben Morgan
parent
6399a014b6
commit
80e2389dd8
+31
-27
@@ -24,47 +24,51 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1ActionInitialization.cc
|
||||
/// \brief Implementation of the B1ActionInitialization class
|
||||
/// \file ActionInitialization.cc
|
||||
/// \brief Implementation of the B1::ActionInitialization class
|
||||
|
||||
#include "B1ActionInitialization.hh"
|
||||
#include "B1PrimaryGeneratorAction.hh"
|
||||
#include "B1RunAction.hh"
|
||||
#include "B1EventAction.hh"
|
||||
#include "B1SteppingAction.hh"
|
||||
#include "ActionInitialization.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
#include "RunAction.hh"
|
||||
#include "EventAction.hh"
|
||||
#include "SteppingAction.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1ActionInitialization::B1ActionInitialization()
|
||||
: G4VUserActionInitialization()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1ActionInitialization::~B1ActionInitialization()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1ActionInitialization::BuildForMaster() const
|
||||
namespace B1
|
||||
{
|
||||
B1RunAction* runAction = new B1RunAction;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ActionInitialization::ActionInitialization()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ActionInitialization::~ActionInitialization()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ActionInitialization::BuildForMaster() const
|
||||
{
|
||||
RunAction* runAction = new RunAction;
|
||||
SetUserAction(runAction);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1ActionInitialization::Build() const
|
||||
void ActionInitialization::Build() const
|
||||
{
|
||||
SetUserAction(new B1PrimaryGeneratorAction);
|
||||
SetUserAction(new PrimaryGeneratorAction);
|
||||
|
||||
B1RunAction* runAction = new B1RunAction;
|
||||
RunAction* runAction = new RunAction;
|
||||
SetUserAction(runAction);
|
||||
|
||||
B1EventAction* eventAction = new B1EventAction(runAction);
|
||||
EventAction* eventAction = new EventAction(runAction);
|
||||
SetUserAction(eventAction);
|
||||
|
||||
SetUserAction(new B1SteppingAction(eventAction));
|
||||
SetUserAction(new SteppingAction(eventAction));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
+15
-12
@@ -24,10 +24,10 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1DetectorConstruction.cc
|
||||
/// \brief Implementation of the B1DetectorConstruction class
|
||||
/// \file DetectorConstruction.cc
|
||||
/// \brief Implementation of the B1::DetectorConstruction class
|
||||
|
||||
#include "B1DetectorConstruction.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4NistManager.hh"
|
||||
@@ -40,21 +40,22 @@
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1DetectorConstruction::B1DetectorConstruction()
|
||||
: G4VUserDetectorConstruction(),
|
||||
fScoringVolume(nullptr)
|
||||
{ }
|
||||
namespace B1
|
||||
{
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1DetectorConstruction::~B1DetectorConstruction()
|
||||
{ }
|
||||
DetectorConstruction::DetectorConstruction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VPhysicalVolume* B1DetectorConstruction::Construct()
|
||||
DetectorConstruction::~DetectorConstruction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
{
|
||||
// Get nist material manager
|
||||
G4NistManager* nist = G4NistManager::Instance();
|
||||
@@ -185,3 +186,5 @@ G4VPhysicalVolume* B1DetectorConstruction::Construct()
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
@@ -24,41 +24,44 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1EventAction.cc
|
||||
/// \brief Implementation of the B1EventAction class
|
||||
/// \file EventAction.cc
|
||||
/// \brief Implementation of the B1::EventAction class
|
||||
|
||||
#include "B1EventAction.hh"
|
||||
#include "B1RunAction.hh"
|
||||
#include "EventAction.hh"
|
||||
#include "RunAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
namespace B1
|
||||
{
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1EventAction::B1EventAction(B1RunAction* runAction)
|
||||
: G4UserEventAction(),
|
||||
fRunAction(runAction),
|
||||
fEdep(0.)
|
||||
EventAction::EventAction(RunAction* runAction)
|
||||
: fRunAction(runAction)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1EventAction::~B1EventAction()
|
||||
EventAction::~EventAction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1EventAction::BeginOfEventAction(const G4Event*)
|
||||
void EventAction::BeginOfEventAction(const G4Event*)
|
||||
{
|
||||
fEdep = 0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1EventAction::EndOfEventAction(const G4Event*)
|
||||
void EventAction::EndOfEventAction(const G4Event*)
|
||||
{
|
||||
// accumulate statistics in run action
|
||||
fRunAction->AddEdep(fEdep);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
+13
-10
@@ -24,10 +24,10 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1PrimaryGeneratorAction.cc
|
||||
/// \brief Implementation of the B1PrimaryGeneratorAction class
|
||||
/// \file PrimaryGeneratorAction.cc
|
||||
/// \brief Implementation of the B1::PrimaryGeneratorAction class
|
||||
|
||||
#include "B1PrimaryGeneratorAction.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
@@ -39,12 +39,12 @@
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
namespace B1
|
||||
{
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1PrimaryGeneratorAction::B1PrimaryGeneratorAction()
|
||||
: G4VUserPrimaryGeneratorAction(),
|
||||
fParticleGun(nullptr),
|
||||
fEnvelopeBox(nullptr)
|
||||
PrimaryGeneratorAction::PrimaryGeneratorAction()
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
fParticleGun = new G4ParticleGun(n_particle);
|
||||
@@ -61,14 +61,14 @@ B1PrimaryGeneratorAction::B1PrimaryGeneratorAction()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1PrimaryGeneratorAction::~B1PrimaryGeneratorAction()
|
||||
PrimaryGeneratorAction::~PrimaryGeneratorAction()
|
||||
{
|
||||
delete fParticleGun;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
//this function is called at the begining of ecah event
|
||||
//
|
||||
@@ -96,7 +96,7 @@ void B1PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
msg << "Envelope volume of box shape not found.\n";
|
||||
msg << "Perhaps you have changed geometry.\n";
|
||||
msg << "The gun will be place at the center.";
|
||||
G4Exception("B1PrimaryGeneratorAction::GeneratePrimaries()",
|
||||
G4Exception("PrimaryGeneratorAction::GeneratePrimaries()",
|
||||
"MyCode0002",JustWarning,msg);
|
||||
}
|
||||
|
||||
@@ -112,3 +112,6 @@ void B1PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -24,13 +24,13 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1RunAction.cc
|
||||
/// \brief Implementation of the B1RunAction class
|
||||
/// \file RunAction.cc
|
||||
/// \brief Implementation of the B1::RunAction class
|
||||
|
||||
#include "B1RunAction.hh"
|
||||
#include "B1PrimaryGeneratorAction.hh"
|
||||
#include "B1DetectorConstruction.hh"
|
||||
// #include "B1Run.hh"
|
||||
#include "RunAction.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
// #include "Run.hh"
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4Run.hh"
|
||||
@@ -40,12 +40,12 @@
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
namespace B1
|
||||
{
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1RunAction::B1RunAction()
|
||||
: G4UserRunAction(),
|
||||
fEdep(0.),
|
||||
fEdep2(0.)
|
||||
RunAction::RunAction()
|
||||
{
|
||||
// add new units for dose
|
||||
//
|
||||
@@ -67,12 +67,12 @@ B1RunAction::B1RunAction()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1RunAction::~B1RunAction()
|
||||
RunAction::~RunAction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1RunAction::BeginOfRunAction(const G4Run*)
|
||||
void RunAction::BeginOfRunAction(const G4Run*)
|
||||
{
|
||||
// inform the runManager to save random number seed
|
||||
G4RunManager::GetRunManager()->SetRandomNumberStore(false);
|
||||
@@ -85,7 +85,7 @@ void B1RunAction::BeginOfRunAction(const G4Run*)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1RunAction::EndOfRunAction(const G4Run* run)
|
||||
void RunAction::EndOfRunAction(const G4Run* run)
|
||||
{
|
||||
G4int nofEvents = run->GetNumberOfEvent();
|
||||
if (nofEvents == 0) return;
|
||||
@@ -102,18 +102,18 @@ void B1RunAction::EndOfRunAction(const G4Run* run)
|
||||
G4double rms = edep2 - edep*edep/nofEvents;
|
||||
if (rms > 0.) rms = std::sqrt(rms); else rms = 0.;
|
||||
|
||||
const B1DetectorConstruction* detectorConstruction
|
||||
= static_cast<const B1DetectorConstruction*>
|
||||
const DetectorConstruction* detConstruction
|
||||
= static_cast<const DetectorConstruction*>
|
||||
(G4RunManager::GetRunManager()->GetUserDetectorConstruction());
|
||||
G4double mass = detectorConstruction->GetScoringVolume()->GetMass();
|
||||
G4double mass = detConstruction->GetScoringVolume()->GetMass();
|
||||
G4double dose = edep/mass;
|
||||
G4double rmsDose = rms/mass;
|
||||
|
||||
// Run conditions
|
||||
// note: There is no primary generator action object for "master"
|
||||
// run manager for multi-threaded mode.
|
||||
const B1PrimaryGeneratorAction* generatorAction
|
||||
= static_cast<const B1PrimaryGeneratorAction*>
|
||||
const PrimaryGeneratorAction* generatorAction
|
||||
= static_cast<const PrimaryGeneratorAction*>
|
||||
(G4RunManager::GetRunManager()->GetUserPrimaryGeneratorAction());
|
||||
G4String runCondition;
|
||||
if (generatorAction)
|
||||
@@ -152,12 +152,12 @@ void B1RunAction::EndOfRunAction(const G4Run* run)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1RunAction::AddEdep(G4double edep)
|
||||
void RunAction::AddEdep(G4double edep)
|
||||
{
|
||||
fEdep += edep;
|
||||
fEdep2 += edep*edep;
|
||||
}
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
+16
-14
@@ -24,40 +24,41 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file B1SteppingAction.cc
|
||||
/// \brief Implementation of the B1SteppingAction class
|
||||
/// \file SteppingAction.cc
|
||||
/// \brief Implementation of the B1::SteppingAction class
|
||||
|
||||
#include "B1SteppingAction.hh"
|
||||
#include "B1EventAction.hh"
|
||||
#include "B1DetectorConstruction.hh"
|
||||
#include "SteppingAction.hh"
|
||||
#include "EventAction.hh"
|
||||
#include "DetectorConstruction.hh"
|
||||
|
||||
#include "G4Step.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
|
||||
namespace B1
|
||||
{
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1SteppingAction::B1SteppingAction(B1EventAction* eventAction)
|
||||
: G4UserSteppingAction(),
|
||||
fEventAction(eventAction),
|
||||
fScoringVolume(nullptr)
|
||||
SteppingAction::SteppingAction(EventAction* eventAction)
|
||||
: fEventAction(eventAction)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1SteppingAction::~B1SteppingAction()
|
||||
SteppingAction::~SteppingAction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1SteppingAction::UserSteppingAction(const G4Step* step)
|
||||
void SteppingAction::UserSteppingAction(const G4Step* step)
|
||||
{
|
||||
if (!fScoringVolume) {
|
||||
const B1DetectorConstruction* detectorConstruction
|
||||
= static_cast<const B1DetectorConstruction*>
|
||||
const DetectorConstruction* detConstruction
|
||||
= static_cast<const DetectorConstruction*>
|
||||
(G4RunManager::GetRunManager()->GetUserDetectorConstruction());
|
||||
fScoringVolume = detectorConstruction->GetScoringVolume();
|
||||
fScoringVolume = detConstruction->GetScoringVolume();
|
||||
}
|
||||
|
||||
// get volume of the current step
|
||||
@@ -75,3 +76,4 @@ void B1SteppingAction::UserSteppingAction(const G4Step* step)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user