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
@@ -32,6 +32,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "DetectorConstruction.hh"
#include "DetectorMessenger.hh"
#include "G4NistManager.hh"
@@ -49,11 +50,11 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::DetectorConstruction()
: G4VUserDetectorConstruction(),
fDetectorMessenger(nullptr)
: G4VUserDetectorConstruction()
, fDetectorMessenger(nullptr)
{
fExpHall_x = fExpHall_y = fExpHall_z = 10.0*m;
fTank_x = fTank_y = fTank_z = 1.0*m;
fExpHall_x = fExpHall_y = fExpHall_z = 10.0 * m;
fTank_x = fTank_y = fTank_z = 1.0 * m;
fTank = nullptr;
@@ -78,8 +79,11 @@ DetectorConstruction::DetectorConstruction()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::~DetectorConstruction()
{
DetectorConstruction::~DetectorConstruction() {
delete fTankMPT;
delete fWorldMPT;
delete fSurfaceMPT;
delete fSurface;
delete fDetectorMessenger;
}
@@ -88,7 +92,7 @@ DetectorConstruction::~DetectorConstruction()
G4VPhysicalVolume* DetectorConstruction::Construct()
{
fTankMaterial->SetMaterialPropertiesTable(fTankMPT);
fTankMaterial->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
fTankMaterial->GetIonisation()->SetBirksConstant(0.126 * mm / MeV);
fWorldMaterial->SetMaterialPropertiesTable(fWorldMPT);
@@ -96,39 +100,39 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
// The experimental Hall
G4Box* world_box = new G4Box("World", fExpHall_x, fExpHall_y, fExpHall_z);
fWorld_LV
= new G4LogicalVolume(world_box, fWorldMaterial, "World", 0, 0, 0);
fWorld_LV = new G4LogicalVolume(world_box, fWorldMaterial, "World", 0, 0, 0);
G4VPhysicalVolume* world_PV
= new G4PVPlacement(0, G4ThreeVector(), fWorld_LV, "World", 0, false, 0);
G4VPhysicalVolume* world_PV =
new G4PVPlacement(0, G4ThreeVector(), fWorld_LV, "World", 0, false, 0);
// The tank
G4Box* tank_box = new G4Box("Tank", fTank_x, fTank_y, fTank_z);
fTank_LV
= new G4LogicalVolume(tank_box, fTankMaterial, "Tank", 0, 0, 0);
fTank_LV = new G4LogicalVolume(tank_box, fTankMaterial, "Tank", 0, 0, 0);
fTank
= new G4PVPlacement(0, G4ThreeVector(), fTank_LV, "Tank",
fWorld_LV, false, 0);
fTank = new G4PVPlacement(0, G4ThreeVector(), fTank_LV, "Tank", fWorld_LV,
false, 0);
// ------------- Surface --------------
G4LogicalBorderSurface* surface =
new G4LogicalBorderSurface("Surface",
fTank, world_PV, fSurface);
new G4LogicalBorderSurface("Surface", fTank, world_PV, fSurface);
G4OpticalSurface* opticalSurface = dynamic_cast <G4OpticalSurface*>
(surface->GetSurface(fTank,world_PV)->GetSurfaceProperty());
G4OpticalSurface* opticalSurface = dynamic_cast<G4OpticalSurface*>(
surface->GetSurface(fTank, world_PV)->GetSurfaceProperty());
G4cout << "****** opticalSurface->DumpInfo:" << G4endl;
if (opticalSurface) { opticalSurface->DumpInfo(); }
if(opticalSurface)
{
opticalSurface->DumpInfo();
}
G4cout << "****** end of opticalSurface->DumpInfo" << G4endl;
return world_PV;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetSurfaceSigmaAlpha(G4double v) {
void DetectorConstruction::SetSurfaceSigmaAlpha(G4double v)
{
fSurface->SetSigmaAlpha(v);
G4RunManager::GetRunManager()->GeometryHasBeenModified();
@@ -137,91 +141,101 @@ void DetectorConstruction::SetSurfaceSigmaAlpha(G4double v) {
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetSurfacePolish(G4double v) {
void DetectorConstruction::SetSurfacePolish(G4double v)
{
fSurface->SetPolish(v);
G4RunManager::GetRunManager()->GeometryHasBeenModified();
G4cout << "Surface polish set to: " << fSurface->GetPolish()
<< G4endl;
G4cout << "Surface polish set to: " << fSurface->GetPolish() << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::AddTankMPV(const char* c,
G4MaterialPropertyVector* mpv) {
fTankMPT->AddProperty(c, mpv);
void DetectorConstruction::AddTankMPV(const G4String& prop,
G4MaterialPropertyVector* mpv)
{
fTankMPT->AddProperty(prop, mpv);
G4cout << "The MPT for the box is now: " << G4endl;
fTankMPT->DumpTable();
G4cout << "............." << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::AddWorldMPV(const char* c,
G4MaterialPropertyVector* mpv) {
fWorldMPT->AddProperty(c, mpv);
void DetectorConstruction::AddWorldMPV(const G4String& prop,
G4MaterialPropertyVector* mpv)
{
fWorldMPT->AddProperty(prop, mpv);
G4cout << "The MPT for the world is now: " << G4endl;
fWorldMPT->DumpTable();
G4cout << "............." << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::AddSurfaceMPV(const char* c,
G4MaterialPropertyVector* mpv) {
fSurfaceMPT->AddProperty(c, mpv);
void DetectorConstruction::AddSurfaceMPV(const G4String& prop,
G4MaterialPropertyVector* mpv)
{
fSurfaceMPT->AddProperty(prop, mpv);
G4cout << "The MPT for the surface is now: " << G4endl;
fSurfaceMPT->DumpTable();
G4cout << "............." << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::AddTankMPC(const char* c, G4double v) {
fTankMPT->AddConstProperty(c, v);
void DetectorConstruction::AddTankMPC(const G4String& prop, G4double v)
{
fTankMPT->AddConstProperty(prop, v);
G4cout << "The MPT for the box is now: " << G4endl;
fTankMPT->DumpTable();
G4cout << "............." << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::AddWorldMPC(const char* c, G4double v) {
fWorldMPT->AddConstProperty(c, v);
void DetectorConstruction::AddWorldMPC(const G4String& prop, G4double v)
{
fWorldMPT->AddConstProperty(prop, v);
G4cout << "The MPT for the world is now: " << G4endl;
fWorldMPT->DumpTable();
G4cout << "............." << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::AddSurfaceMPC(const char* c, G4double v) {
fSurfaceMPT->AddConstProperty(c, v);
void DetectorConstruction::AddSurfaceMPC(const G4String& prop, G4double v)
{
fSurfaceMPT->AddConstProperty(prop, v);
G4cout << "The MPT for the surface is now: " << G4endl;
fSurfaceMPT->DumpTable();
G4cout << "............." << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetWorldMaterial(const G4String& mat) {
void DetectorConstruction::SetWorldMaterial(const G4String& mat)
{
G4Material* pmat = G4NistManager::Instance()->FindOrBuildMaterial(mat);
if (pmat && fWorldMaterial != pmat) {
if(pmat && fWorldMaterial != pmat)
{
fWorldMaterial = pmat;
if (fWorld_LV) {
if(fWorld_LV)
{
fWorld_LV->SetMaterial(fWorldMaterial);
fWorldMaterial->SetMaterialPropertiesTable(fWorldMPT);
}
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
G4cout << "World material set to " << fWorldMaterial->GetName()
<< G4endl;
G4cout << "World material set to " << fWorldMaterial->GetName() << G4endl;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetTankMaterial(const G4String& mat) {
void DetectorConstruction::SetTankMaterial(const G4String& mat)
{
G4Material* pmat = G4NistManager::Instance()->FindOrBuildMaterial(mat);
if (pmat && fTankMaterial != pmat) {
if(pmat && fTankMaterial != pmat)
{
fTankMaterial = pmat;
if (fTank_LV) {
if(fTank_LV)
{
fTank_LV->SetMaterial(fTankMaterial);
fTankMaterial->SetMaterialPropertiesTable(fTankMPT);
fTankMaterial->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
fTankMaterial->GetIonisation()->SetBirksConstant(0.126 * mm / MeV);
}
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
G4cout << "Tank material set to " << fTankMaterial->GetName()
<< G4endl;
G4cout << "Tank material set to " << fTankMaterial->GetName() << G4endl;
}
}