Import Geant4 11.1.0 source tree
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file ActionInitialization.cc
|
||||
/// \file B1/src/ActionInitialization.cc
|
||||
/// \brief Implementation of the B1::ActionInitialization class
|
||||
|
||||
#include "ActionInitialization.hh"
|
||||
@@ -38,19 +38,9 @@ namespace B1
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ActionInitialization::ActionInitialization()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ActionInitialization::~ActionInitialization()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ActionInitialization::BuildForMaster() const
|
||||
{
|
||||
RunAction* runAction = new RunAction;
|
||||
auto runAction = new RunAction;
|
||||
SetUserAction(runAction);
|
||||
}
|
||||
|
||||
@@ -60,10 +50,10 @@ void ActionInitialization::Build() const
|
||||
{
|
||||
SetUserAction(new PrimaryGeneratorAction);
|
||||
|
||||
RunAction* runAction = new RunAction;
|
||||
auto runAction = new RunAction;
|
||||
SetUserAction(runAction);
|
||||
|
||||
EventAction* eventAction = new EventAction(runAction);
|
||||
auto eventAction = new EventAction(runAction);
|
||||
SetUserAction(eventAction);
|
||||
|
||||
SetUserAction(new SteppingAction(eventAction));
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file DetectorConstruction.cc
|
||||
/// \file B1/src/DetectorConstruction.cc
|
||||
/// \brief Implementation of the B1::DetectorConstruction class
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
@@ -45,16 +45,6 @@ namespace B1
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorConstruction::DetectorConstruction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorConstruction::~DetectorConstruction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
{
|
||||
// Get nist material manager
|
||||
@@ -76,45 +66,40 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
G4double world_sizeZ = 1.2*env_sizeZ;
|
||||
G4Material* world_mat = nist->FindOrBuildMaterial("G4_AIR");
|
||||
|
||||
G4Box* solidWorld =
|
||||
new G4Box("World", //its name
|
||||
0.5*world_sizeXY, 0.5*world_sizeXY, 0.5*world_sizeZ); //its size
|
||||
auto solidWorld = new G4Box("World", // its name
|
||||
0.5 * world_sizeXY, 0.5 * world_sizeXY, 0.5 * world_sizeZ); // its size
|
||||
|
||||
G4LogicalVolume* logicWorld =
|
||||
new G4LogicalVolume(solidWorld, //its solid
|
||||
world_mat, //its material
|
||||
"World"); //its name
|
||||
auto logicWorld = new G4LogicalVolume(solidWorld, // its solid
|
||||
world_mat, // its material
|
||||
"World"); // its name
|
||||
|
||||
G4VPhysicalVolume* physWorld =
|
||||
new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
logicWorld, //its logical volume
|
||||
"World", //its name
|
||||
0, //its mother volume
|
||||
false, //no boolean operation
|
||||
0, //copy number
|
||||
checkOverlaps); //overlaps checking
|
||||
auto physWorld = new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
logicWorld, // its logical volume
|
||||
"World", // its name
|
||||
nullptr, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
|
||||
//
|
||||
// Envelope
|
||||
//
|
||||
G4Box* solidEnv =
|
||||
new G4Box("Envelope", //its name
|
||||
0.5*env_sizeXY, 0.5*env_sizeXY, 0.5*env_sizeZ); //its size
|
||||
auto solidEnv = new G4Box("Envelope", // its name
|
||||
0.5 * env_sizeXY, 0.5 * env_sizeXY, 0.5 * env_sizeZ); // its size
|
||||
|
||||
G4LogicalVolume* logicEnv =
|
||||
new G4LogicalVolume(solidEnv, //its solid
|
||||
env_mat, //its material
|
||||
"Envelope"); //its name
|
||||
auto logicEnv = new G4LogicalVolume(solidEnv, // its solid
|
||||
env_mat, // its material
|
||||
"Envelope"); // its name
|
||||
|
||||
new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
logicEnv, //its logical volume
|
||||
"Envelope", //its name
|
||||
logicWorld, //its mother volume
|
||||
false, //no boolean operation
|
||||
0, //copy number
|
||||
checkOverlaps); //overlaps checking
|
||||
new G4PVPlacement(nullptr, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
logicEnv, // its logical volume
|
||||
"Envelope", // its name
|
||||
logicWorld, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
|
||||
//
|
||||
// Shape 1
|
||||
@@ -127,24 +112,21 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
G4double shape1_rminb = 0.*cm, shape1_rmaxb = 4.*cm;
|
||||
G4double shape1_hz = 3.*cm;
|
||||
G4double shape1_phimin = 0.*deg, shape1_phimax = 360.*deg;
|
||||
G4Cons* solidShape1 =
|
||||
new G4Cons("Shape1",
|
||||
shape1_rmina, shape1_rmaxa, shape1_rminb, shape1_rmaxb, shape1_hz,
|
||||
shape1_phimin, shape1_phimax);
|
||||
auto solidShape1 = new G4Cons("Shape1", shape1_rmina, shape1_rmaxa, shape1_rminb, shape1_rmaxb,
|
||||
shape1_hz, shape1_phimin, shape1_phimax);
|
||||
|
||||
G4LogicalVolume* logicShape1 =
|
||||
new G4LogicalVolume(solidShape1, //its solid
|
||||
shape1_mat, //its material
|
||||
"Shape1"); //its name
|
||||
auto logicShape1 = new G4LogicalVolume(solidShape1, // its solid
|
||||
shape1_mat, // its material
|
||||
"Shape1"); // its name
|
||||
|
||||
new G4PVPlacement(0, //no rotation
|
||||
pos1, //at position
|
||||
logicShape1, //its logical volume
|
||||
"Shape1", //its name
|
||||
logicEnv, //its mother volume
|
||||
false, //no boolean operation
|
||||
0, //copy number
|
||||
checkOverlaps); //overlaps checking
|
||||
new G4PVPlacement(nullptr, // no rotation
|
||||
pos1, // at position
|
||||
logicShape1, // its logical volume
|
||||
"Shape1", // its name
|
||||
logicEnv, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
|
||||
//
|
||||
// Shape 2
|
||||
@@ -156,24 +138,22 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
|
||||
G4double shape2_dxa = 12*cm, shape2_dxb = 12*cm;
|
||||
G4double shape2_dya = 10*cm, shape2_dyb = 16*cm;
|
||||
G4double shape2_dz = 6*cm;
|
||||
G4Trd* solidShape2 =
|
||||
new G4Trd("Shape2", //its name
|
||||
0.5*shape2_dxa, 0.5*shape2_dxb,
|
||||
0.5*shape2_dya, 0.5*shape2_dyb, 0.5*shape2_dz); //its size
|
||||
auto solidShape2 = new G4Trd("Shape2", // its name
|
||||
0.5 * shape2_dxa, 0.5 * shape2_dxb, 0.5 * shape2_dya, 0.5 * shape2_dyb,
|
||||
0.5 * shape2_dz); // its size
|
||||
|
||||
G4LogicalVolume* logicShape2 =
|
||||
new G4LogicalVolume(solidShape2, //its solid
|
||||
shape2_mat, //its material
|
||||
"Shape2"); //its name
|
||||
auto logicShape2 = new G4LogicalVolume(solidShape2, // its solid
|
||||
shape2_mat, // its material
|
||||
"Shape2"); // its name
|
||||
|
||||
new G4PVPlacement(0, //no rotation
|
||||
pos2, //at position
|
||||
logicShape2, //its logical volume
|
||||
"Shape2", //its name
|
||||
logicEnv, //its mother volume
|
||||
false, //no boolean operation
|
||||
0, //copy number
|
||||
checkOverlaps); //overlaps checking
|
||||
new G4PVPlacement(nullptr, // no rotation
|
||||
pos2, // at position
|
||||
logicShape2, // its logical volume
|
||||
"Shape2", // its name
|
||||
logicEnv, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
|
||||
// Set Shape2 as scoring volume
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file EventAction.cc
|
||||
/// \file B1/src/EventAction.cc
|
||||
/// \brief Implementation of the B1::EventAction class
|
||||
|
||||
#include "EventAction.hh"
|
||||
@@ -44,11 +44,6 @@ EventAction::EventAction(RunAction* runAction)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EventAction::~EventAction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void EventAction::BeginOfEventAction(const G4Event*)
|
||||
{
|
||||
fEdep = 0.;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file PrimaryGeneratorAction.cc
|
||||
/// \file B1/src/PrimaryGeneratorAction.cc
|
||||
/// \brief Implementation of the B1::PrimaryGeneratorAction class
|
||||
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file RunAction.cc
|
||||
/// \file B1/src/RunAction.cc
|
||||
/// \brief Implementation of the B1::RunAction class
|
||||
|
||||
#include "RunAction.hh"
|
||||
@@ -67,11 +67,6 @@ RunAction::RunAction()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
RunAction::~RunAction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void RunAction::BeginOfRunAction(const G4Run*)
|
||||
{
|
||||
// inform the runManager to save random number seed
|
||||
@@ -102,9 +97,8 @@ void RunAction::EndOfRunAction(const G4Run* run)
|
||||
G4double rms = edep2 - edep*edep/nofEvents;
|
||||
if (rms > 0.) rms = std::sqrt(rms); else rms = 0.;
|
||||
|
||||
const DetectorConstruction* detConstruction
|
||||
= static_cast<const DetectorConstruction*>
|
||||
(G4RunManager::GetRunManager()->GetUserDetectorConstruction());
|
||||
const auto detConstruction = static_cast<const DetectorConstruction*>(
|
||||
G4RunManager::GetRunManager()->GetUserDetectorConstruction());
|
||||
G4double mass = detConstruction->GetScoringVolume()->GetMass();
|
||||
G4double dose = edep/mass;
|
||||
G4double rmsDose = rms/mass;
|
||||
@@ -112,9 +106,8 @@ void RunAction::EndOfRunAction(const G4Run* run)
|
||||
// Run conditions
|
||||
// note: There is no primary generator action object for "master"
|
||||
// run manager for multi-threaded mode.
|
||||
const PrimaryGeneratorAction* generatorAction
|
||||
= static_cast<const PrimaryGeneratorAction*>
|
||||
(G4RunManager::GetRunManager()->GetUserPrimaryGeneratorAction());
|
||||
const auto generatorAction = static_cast<const PrimaryGeneratorAction*>(
|
||||
G4RunManager::GetRunManager()->GetUserPrimaryGeneratorAction());
|
||||
G4String runCondition;
|
||||
if (generatorAction)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/// \file SteppingAction.cc
|
||||
/// \file B1/src/SteppingAction.cc
|
||||
/// \brief Implementation of the B1::SteppingAction class
|
||||
|
||||
#include "SteppingAction.hh"
|
||||
@@ -47,17 +47,11 @@ SteppingAction::SteppingAction(EventAction* eventAction)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
SteppingAction::~SteppingAction()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void SteppingAction::UserSteppingAction(const G4Step* step)
|
||||
{
|
||||
if (!fScoringVolume) {
|
||||
const DetectorConstruction* detConstruction
|
||||
= static_cast<const DetectorConstruction*>
|
||||
(G4RunManager::GetRunManager()->GetUserDetectorConstruction());
|
||||
const auto detConstruction = static_cast<const DetectorConstruction*>(
|
||||
G4RunManager::GetRunManager()->GetUserDetectorConstruction());
|
||||
fScoringVolume = detConstruction->GetScoringVolume();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user