Import Geant4 10.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2018-12-07 15:15:39 +01:00
parent 6aa23be517
commit db49709b53
11370 changed files with 187480 additions and 160142 deletions
@@ -45,55 +45,45 @@ G4ThreadLocal EMField* DetectorConstruction::fField = nullptr;
DetectorConstruction::DetectorConstruction()
:fDefaultMaterial(NULL),fCollimatorMaterial(NULL),fBoiteMaterial(NULL),
fCathodeMaterial(NULL),fVerreMaterial(NULL),fVerre2Material(NULL),
fKgmMaterial(NULL),fBoite2Material(NULL),fBoite3Material(NULL),
fNucleusMaterial1(NULL),fCytoplasmMaterial1(NULL),
fNucleusMaterial2(NULL),fCytoplasmMaterial2(NULL),
fNucleusMaterial3(NULL),fCytoplasmMaterial3(NULL),
fPhysiWorld(NULL),fLogicWorld(NULL),fSolidWorld(NULL),
fPhysiVol(NULL),fLogicVol(NULL),fSolidVol(NULL),
fPhysiBoite(NULL),fLogicBoite(NULL),fSolidBoite(NULL),
fPhysiYoke1(NULL),fLogicYoke1(NULL),fSolidYoke1(NULL),
fPhysi1Gap(NULL),fLogic1Gap(NULL),fSolid1Gap(NULL),
fPhysi2Gap(NULL),fLogic2Gap(NULL),fSolid2Gap(NULL),
fPhysi3Gap(NULL),fLogic3Gap(NULL),fSolid3Gap(NULL),
fPhysiYoke2(NULL),fLogicYoke2(NULL),fSolidYoke2(NULL),
fPhysi4Gap(NULL),fLogic4Gap(NULL),fSolid4Gap(NULL),
fPhysi5Gap(NULL),fLogic5Gap(NULL),fSolid5Gap(NULL),
fPhysiBoiteIso(NULL),fLogicBoiteIso(NULL),fSolidBoiteIso(NULL),
fPhysiCathode(NULL),fLogicCathode(NULL),fSolidCathode(NULL),
fPhysiIso(NULL),fLogicIso(NULL),fSolidIso(NULL),
fPhysiVerre(NULL),fLogicVerre(NULL),fSolidVerre(NULL),
fPhysiBoite2(NULL),fLogicBoite2(NULL),fSolidBoite2(NULL),
fPhysiBoite3(NULL),fLogicBoite3(NULL),fSolidBoite3(NULL),
fPhysiKgm(NULL),fLogicKgm(NULL),fSolidKgm(NULL),
fPhysiVerre2(NULL),fLogicVerre2(NULL),fSolidVerre2(NULL),
fPhysiPhantom(NULL),fLogicPhantom(NULL),fSolidPhantom(NULL)
:fDefaultMaterial(nullptr),fCollimatorMaterial(nullptr),fBoiteMaterial(nullptr),
fCathodeMaterial(nullptr),fVerreMaterial(nullptr),fVerre2Material(nullptr),
fKgmMaterial(nullptr),fBoite2Material(nullptr),fBoite3Material(nullptr),
fNucleusMaterial1(nullptr),fCytoplasmMaterial1(nullptr),
fNucleusMaterial2(nullptr),fCytoplasmMaterial2(nullptr),
fNucleusMaterial3(nullptr),fCytoplasmMaterial3(nullptr),
fPhysiWorld(nullptr),fLogicWorld(nullptr),fSolidWorld(nullptr),
fPhysiVol(nullptr),fLogicVol(nullptr),fSolidVol(nullptr),
fPhysiBoite(nullptr),fLogicBoite(nullptr),fSolidBoite(nullptr),
fPhysiYoke1(nullptr),fLogicYoke1(nullptr),fSolidYoke1(nullptr),
fPhysi1Gap(nullptr),fLogic1Gap(nullptr),fSolid1Gap(nullptr),
fPhysi2Gap(nullptr),fLogic2Gap(nullptr),fSolid2Gap(nullptr),
fPhysi3Gap(nullptr),fLogic3Gap(nullptr),fSolid3Gap(nullptr),
fPhysiYoke2(nullptr),fLogicYoke2(nullptr),fSolidYoke2(nullptr),
fPhysi4Gap(nullptr),fLogic4Gap(nullptr),fSolid4Gap(nullptr),
fPhysi5Gap(nullptr),fLogic5Gap(nullptr),fSolid5Gap(nullptr),
fPhysiBoiteIso(nullptr),fLogicBoiteIso(nullptr),fSolidBoiteIso(nullptr),
fPhysiCathode(nullptr),fLogicCathode(nullptr),fSolidCathode(nullptr),
fPhysiIso(nullptr),fLogicIso(nullptr),fSolidIso(nullptr),
fPhysiVerre(nullptr),fLogicVerre(nullptr),fSolidVerre(nullptr),
fPhysiBoite2(nullptr),fLogicBoite2(nullptr),fSolidBoite2(nullptr),
fPhysiBoite3(nullptr),fLogicBoite3(nullptr),fSolidBoite3(nullptr),
fPhysiKgm(nullptr),fLogicKgm(nullptr),fSolidKgm(nullptr),
fPhysiVerre2(nullptr),fLogicVerre2(nullptr),fSolidVerre2(nullptr),
fPhysiPhantom(nullptr),fLogicPhantom(nullptr),fSolidPhantom(nullptr)
{
fWorldSizeXY=fWorldSizeZ=0;
DefineMaterials();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
DetectorConstruction::~DetectorConstruction()
{
delete fDefaultMaterial;
delete fCollimatorMaterial;
delete fBoiteMaterial;
delete fCathodeMaterial;
delete fVerreMaterial;
delete fVerre2Material;
delete fKgmMaterial;
delete fBoite2Material;
delete fBoite3Material;
delete fNucleusMaterial1;
delete fCytoplasmMaterial1;
delete fNucleusMaterial2;
delete fCytoplasmMaterial2;
delete fNucleusMaterial3;
delete fCytoplasmMaterial3;
if(fField) {
delete fField;
fField = nullptr;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -101,7 +91,7 @@ DetectorConstruction::~DetectorConstruction()
G4VPhysicalVolume* DetectorConstruction::Construct()
{
DefineMaterials();
if(fPhysiWorld) { return fPhysiWorld; }
return ConstructLine();
}
@@ -109,7 +99,6 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
void DetectorConstruction::DefineMaterials()
{
G4String name, symbol;
G4double density;
@@ -328,7 +317,7 @@ G4VPhysicalVolume* DetectorConstruction::ConstructLine()
G4ThreeVector(), //at (0,0,0)
"World", //its name
fLogicWorld, //its logical volume
NULL, //its mother volume
nullptr, //its mother volume
false, //no boolean operation
0); //copy number
@@ -644,36 +633,6 @@ G4VPhysicalVolume* DetectorConstruction::ConstructLine()
G4cout << " ==========> Voxel size Y (um)=" << fMyCellParameterisation->GetPixelSizeY()/um << G4endl;
G4cout << " ==========> Voxel size Z (um)=" << fMyCellParameterisation->GetPixelSizeZ()/um << G4endl;
G4cout << G4endl;
// USER LIMITS ON STEP LENGTH
/*
fLogicWorld->SetUserLimits(new G4UserLimits(100*mm));
fLogicVol->SetUserLimits(new G4UserLimits(100*mm));
fLogicBoite->SetUserLimits(new G4UserLimits(10*mm));
*/
/*
logicPhantom->SetUserLimits (new G4UserLimits(0.5*micrometer));
logic1Gap->SetUserLimits (new G4UserLimits(5*micrometer));
logic2Gap->SetUserLimits (new G4UserLimits(5*micrometer));
logic3Gap->SetUserLimits (new G4UserLimits(5*micrometer));
logic4Gap->SetUserLimits (new G4UserLimits(5*micrometer));
logic5Gap->SetUserLimits (new G4UserLimits(5*micrometer));
logicBoiteIso->SetUserLimits (new G4UserLimits(200.*micrometer));
logicCathode->SetUserLimits (new G4UserLimits(100.*micrometer));
logicIso->SetUserLimits (new G4UserLimits(100.*micrometer));
logicVerre->SetUserLimits (new G4UserLimits(0.02*micrometer));
logicBoite2->SetUserLimits (new G4UserLimits(10*micrometer));
logicBoite3->SetUserLimits (new G4UserLimits(0.2*micrometer));
logicKgm->SetUserLimits (new G4UserLimits(1*micrometer));
logicVerre2->SetUserLimits (new G4UserLimits(10*micrometer));
*/
// Relaxed
fLogicWorld->SetUserLimits(new G4UserLimits(10*mm));
fLogicVol->SetUserLimits(new G4UserLimits(10*mm));
fLogicBoite->SetUserLimits(new G4UserLimits(1*mm));
// VISUALISATION ATTRIBUTES (for phantom, see in Parameterisation class)
@@ -735,7 +694,7 @@ G4VPhysicalVolume* DetectorConstruction::ConstructLine()
void DetectorConstruction::ConstructSDandField()
{
if(!fField) fField = new EMField();
if(!fField) { fField = new EMField(); }
G4EqMagElectricField* fEquation = new G4EqMagElectricField(fField);
G4MagIntegratorStepper* fStepper = new G4ClassicalRK4 (fEquation,8);
@@ -36,7 +36,7 @@
#include "PhysicsListMessenger.hh"
#include "G4SystemOfUnits.hh"
#include "G4StepLimiter.hh"
#include "StepMax.hh"
#include "G4EmStandardPhysics.hh"
#include "G4EmStandardPhysics_option1.hh"
@@ -164,20 +164,17 @@ void PhysicsList::AddPhysicsList(const G4String& name)
void PhysicsList::AddStepMax()
{
// Step limitation seen as a process
fStepMaxProcess = new G4StepLimiter();
StepMax* stepMaxProcess = new StepMax(fMessenger);
auto particleIterator=GetParticleIterator();
particleIterator->reset();
while ((*particleIterator)()){
G4ParticleDefinition* particle = particleIterator->value();
G4ParticleDefinition* particle = particleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (fStepMaxProcess->IsApplicable(*particle) && pmanager)
if (stepMaxProcess->IsApplicable(*particle))
{
pmanager ->AddDiscreteProcess(fStepMaxProcess);
pmanager ->AddDiscreteProcess(stepMaxProcess);
}
}
}
@@ -23,33 +23,41 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// This example is provided by the Geant4-DNA collaboration
// Any report or published results obtained using the Geant4-DNA software
// shall cite the following Geant4-DNA collaboration publication:
// Med. Phys. 37 (2010) 4692-4708
// The Geant4-DNA web site is available at http://geant4-dna.org
//
// If you use this example, please cite the following publication:
// Rad. Prot. Dos. 133 (2009) 2-11
/// \file electromagnetic/TestEm5/src/PhysicsListMessenger.cc
/// \brief Implementation of the PhysicsListMessenger class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysicsListMessenger.hh"
#include "PhysicsList.hh"
#include "G4SystemOfUnits.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "PhysicsList.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
:fPhysicsList(pPhys)
:G4UImessenger(),fPhysicsList(pPhys),fMaxChargedStep(1*CLHEP::mm)
{
fPhysDir = new G4UIdirectory("/microbeam/phys/");
fPhysDir = new G4UIdirectory("/testem/phys/");
fPhysDir->SetGuidance("physics list commands");
fListCmd = new G4UIcmdWithAString("/microbeam/phys/addPhysics",this);
fListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this);
fListCmd->SetGuidance("Add modula physics list.");
fListCmd->SetParameterName("PList",false);
fListCmd->AvailableForStates(G4State_PreInit);
fListCmd->AvailableForStates(G4State_PreInit);
fListCmd->SetToBeBroadcasted(false);
fStepMaxCmd = new G4UIcmdWithADoubleAndUnit("/testem/stepMax",this);
fStepMaxCmd->SetGuidance("Set max allowed step length");
fStepMaxCmd->SetParameterName("mxStep",false);
fStepMaxCmd->SetRange("mxStep>0.");
fStepMaxCmd->SetUnitCategory("Length");
fStepMaxCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -57,15 +65,18 @@ PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
PhysicsListMessenger::~PhysicsListMessenger()
{
delete fListCmd;
delete fPhysDir;
delete fPhysDir;
delete fStepMaxCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsListMessenger::SetNewValue(G4UIcommand* command,
G4String newValue)
{
void PhysicsListMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if( command == fListCmd )
{ fPhysicsList->AddPhysicsList(newValue);}
{ fPhysicsList->AddPhysicsList(newValue); }
if (command == fStepMaxCmd)
{ fMaxChargedStep = fStepMaxCmd->GetNewDoubleValue(newValue); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+106
View File
@@ -0,0 +1,106 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "StepMax.hh"
#include "PhysicsListMessenger.hh"
#include "G4VPhysicalVolume.hh"
#include "G4TransportationProcessType.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StepMax::StepMax(PhysicsListMessenger* mess)
: G4VEmProcess("UserMaxStep", fGeneral),fMessenger(mess),
fMaxChargedStep(DBL_MAX),isInitialised(false)
{
SetProcessSubType(static_cast<G4int>(STEP_LIMITER));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StepMax::~StepMax()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool StepMax::IsApplicable(const G4ParticleDefinition& part)
{
return (part.GetPDGCharge() != 0. && !part.IsShortLived());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void StepMax::PreparePhysicsTable(const G4ParticleDefinition&)
{
if(isInitialised) {
isInitialised = false;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void StepMax::BuildPhysicsTable(const G4ParticleDefinition&)
{
if(!isInitialised) {
fMaxChargedStep = fMessenger->GetMaxChargedStep();
isInitialised = true;
if(fMaxChargedStep < DBL_MAX) {
G4cout << GetProcessName() << ": SubType= " << GetProcessSubType()
<< " Step limit(mm)= " << fMaxChargedStep << G4endl;
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void StepMax::InitialiseProcess(const G4ParticleDefinition*)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double
StepMax::PostStepGetPhysicalInteractionLength(const G4Track&,
G4double,
G4ForceCondition* condition)
{
// condition is set to "Not Forced"
*condition = NotForced;
return fMaxChargedStep;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VParticleChange* StepMax::PostStepDoIt(const G4Track& aTrack, const G4Step&)
{
// do nothing
aParticleChange.Initialize(aTrack);
return &aParticleChange;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......