Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
@@ -23,8 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: DetectorMessenger.cc,v 1.4 2006-06-29 16:55:32 gunter Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file electromagnetic/TestEm5/src/DetectorMessenger.cc
/// \brief Implementation of the DetectorMessenger class
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -41,70 +43,70 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
:Detector(Det)
:fDetector(Det)
{
testemDir = new G4UIdirectory("/testem/");
testemDir->SetGuidance("UI commands specific to this example.");
fTestemDir = new G4UIdirectory("/testem/");
fTestemDir->SetGuidance("UI commands specific to this example.");
detDir = new G4UIdirectory("/testem/det/");
detDir->SetGuidance("detector construction commands");
fDetDir = new G4UIdirectory("/testem/det/");
fDetDir->SetGuidance("detector construction commands");
AbsMaterCmd = new G4UIcmdWithAString("/testem/det/setAbsMat",this);
AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
AbsMaterCmd->SetParameterName("choice",false);
AbsMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fAbsMaterCmd = new G4UIcmdWithAString("/testem/det/setAbsMat",this);
fAbsMaterCmd->SetGuidance("Select Material of the Absorber.");
fAbsMaterCmd->SetParameterName("choice",false);
fAbsMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
WorldMaterCmd = new G4UIcmdWithAString("/testem/det/setWorldMat",this);
WorldMaterCmd->SetGuidance("Select Material of the World.");
WorldMaterCmd->SetParameterName("wchoice",false);
WorldMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fWorldMaterCmd = new G4UIcmdWithAString("/testem/det/setWorldMat",this);
fWorldMaterCmd->SetGuidance("Select Material of the World.");
fWorldMaterCmd->SetParameterName("wchoice",false);
fWorldMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setAbsThick",this);
AbsThickCmd->SetGuidance("Set Thickness of the Absorber");
AbsThickCmd->SetParameterName("SizeZ",false);
AbsThickCmd->SetRange("SizeZ>0.");
AbsThickCmd->SetUnitCategory("Length");
AbsThickCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fAbsThickCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setAbsThick",this);
fAbsThickCmd->SetGuidance("Set Thickness of the Absorber");
fAbsThickCmd->SetParameterName("SizeZ",false);
fAbsThickCmd->SetRange("SizeZ>0.");
fAbsThickCmd->SetUnitCategory("Length");
fAbsThickCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
AbsSizYZCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setAbsYZ",this);
AbsSizYZCmd->SetGuidance("Set sizeYZ of the Absorber");
AbsSizYZCmd->SetParameterName("SizeYZ",false);
AbsSizYZCmd->SetRange("SizeYZ>0.");
AbsSizYZCmd->SetUnitCategory("Length");
AbsSizYZCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fAbsSizYZCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setAbsYZ",this);
fAbsSizYZCmd->SetGuidance("Set sizeYZ of the Absorber");
fAbsSizYZCmd->SetParameterName("SizeYZ",false);
fAbsSizYZCmd->SetRange("SizeYZ>0.");
fAbsSizYZCmd->SetUnitCategory("Length");
fAbsSizYZCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
AbsXposCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setAbsXpos",this);
AbsXposCmd->SetGuidance("Set X pos. of the Absorber");
AbsXposCmd->SetParameterName("Xpos",false);
AbsXposCmd->SetUnitCategory("Length");
AbsXposCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fAbsXposCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setAbsXpos",this);
fAbsXposCmd->SetGuidance("Set X pos. of the Absorber");
fAbsXposCmd->SetParameterName("Xpos",false);
fAbsXposCmd->SetUnitCategory("Length");
fAbsXposCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
WorldXCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setWorldX",this);
WorldXCmd->SetGuidance("Set X size of the World");
WorldXCmd->SetParameterName("WSizeX",false);
WorldXCmd->SetRange("WSizeX>0.");
WorldXCmd->SetUnitCategory("Length");
WorldXCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fWorldXCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setWorldX",this);
fWorldXCmd->SetGuidance("Set X size of the World");
fWorldXCmd->SetParameterName("WSizeX",false);
fWorldXCmd->SetRange("WSizeX>0.");
fWorldXCmd->SetUnitCategory("Length");
fWorldXCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
WorldYZCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setWorldYZ",this);
WorldYZCmd->SetGuidance("Set sizeYZ of the World");
WorldYZCmd->SetParameterName("WSizeYZ",false);
WorldYZCmd->SetRange("WSizeYZ>0.");
WorldYZCmd->SetUnitCategory("Length");
WorldYZCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fWorldYZCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setWorldYZ",this);
fWorldYZCmd->SetGuidance("Set sizeYZ of the World");
fWorldYZCmd->SetParameterName("WSizeYZ",false);
fWorldYZCmd->SetRange("WSizeYZ>0.");
fWorldYZCmd->SetUnitCategory("Length");
fWorldYZCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
UpdateCmd = new G4UIcmdWithoutParameter("/testem/det/update",this);
UpdateCmd->SetGuidance("Update calorimeter geometry.");
UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
UpdateCmd->SetGuidance("if you changed geometrical value(s).");
UpdateCmd->AvailableForStates(G4State_Idle);
fUpdateCmd = new G4UIcmdWithoutParameter("/testem/det/update",this);
fUpdateCmd->SetGuidance("Update calorimeter geometry.");
fUpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
fUpdateCmd->SetGuidance("if you changed geometrical value(s).");
fUpdateCmd->AvailableForStates(G4State_Idle);
MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setField",this);
MagFieldCmd->SetGuidance("Define magnetic field.");
MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
MagFieldCmd->SetParameterName("Bz",false);
MagFieldCmd->SetUnitCategory("Magnetic flux density");
MagFieldCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fMagFieldCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setField",this);
fMagFieldCmd->SetGuidance("Define magnetic field.");
fMagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
fMagFieldCmd->SetParameterName("Bz",false);
fMagFieldCmd->SetUnitCategory("Magnetic flux density");
fMagFieldCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
}
@@ -112,49 +114,49 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
DetectorMessenger::~DetectorMessenger()
{
delete AbsMaterCmd;
delete AbsThickCmd;
delete AbsSizYZCmd;
delete AbsXposCmd;
delete WorldMaterCmd;
delete WorldXCmd;
delete WorldYZCmd;
delete UpdateCmd;
delete MagFieldCmd;
delete detDir;
delete testemDir;
delete fAbsMaterCmd;
delete fAbsThickCmd;
delete fAbsSizYZCmd;
delete fAbsXposCmd;
delete fWorldMaterCmd;
delete fWorldXCmd;
delete fWorldYZCmd;
delete fUpdateCmd;
delete fMagFieldCmd;
delete fDetDir;
delete fTestemDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
if ( command == AbsMaterCmd )
{Detector->SetAbsorberMaterial(newValue);}
if ( command == fAbsMaterCmd )
{fDetector->SetAbsorberMaterial(newValue);}
if ( command == WorldMaterCmd )
{Detector->SetWorldMaterial(newValue);}
if ( command == fWorldMaterCmd )
{fDetector->SetWorldMaterial(newValue);}
if ( command == AbsThickCmd )
{Detector->SetAbsorberThickness(AbsThickCmd->GetNewDoubleValue(newValue));}
if ( command == fAbsThickCmd )
{fDetector->SetAbsorberThickness(fAbsThickCmd->GetNewDoubleValue(newValue));}
if ( command == AbsSizYZCmd )
{Detector->SetAbsorberSizeYZ(AbsSizYZCmd->GetNewDoubleValue(newValue));}
if ( command == fAbsSizYZCmd )
{fDetector->SetAbsorberSizeYZ(fAbsSizYZCmd->GetNewDoubleValue(newValue));}
if ( command == AbsXposCmd )
{Detector->SetAbsorberXpos(AbsXposCmd->GetNewDoubleValue(newValue));}
if ( command == fAbsXposCmd )
{fDetector->SetAbsorberXpos(fAbsXposCmd->GetNewDoubleValue(newValue));}
if ( command == WorldXCmd )
{Detector->SetWorldSizeX(WorldXCmd->GetNewDoubleValue(newValue));}
if ( command == fWorldXCmd )
{fDetector->SetWorldSizeX(fWorldXCmd->GetNewDoubleValue(newValue));}
if ( command == WorldYZCmd )
{Detector->SetWorldSizeYZ(WorldYZCmd->GetNewDoubleValue(newValue));}
if ( command == fWorldYZCmd )
{fDetector->SetWorldSizeYZ(fWorldYZCmd->GetNewDoubleValue(newValue));}
if ( command == UpdateCmd )
{Detector->UpdateGeometry(); }
if ( command == fUpdateCmd )
{fDetector->UpdateGeometry(); }
if( command == MagFieldCmd )
{Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
if( command == fMagFieldCmd )
{fDetector->SetMagField(fMagFieldCmd->GetNewDoubleValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......