Import Geant4 9.6.0 source tree
This commit is contained in:
@@ -23,18 +23,18 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file field/field03/src/F03DetectorMessenger.cc
|
||||
/// \brief Implementation of the F03DetectorMessenger class
|
||||
//
|
||||
// $Id: F03DetectorMessenger.cc,v 1.5 2006-06-29 17:19:26 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "F03DetectorMessenger.hh"
|
||||
|
||||
#include "F03DetectorConstruction.hh"
|
||||
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
@@ -43,63 +43,73 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
F03DetectorMessenger::F03DetectorMessenger(F03DetectorConstruction * F03Det)
|
||||
:F03Detector(F03Det)
|
||||
F03DetectorMessenger::F03DetectorMessenger(F03DetectorConstruction * det)
|
||||
: G4UImessenger(),
|
||||
fDetector(det),
|
||||
fDetDir(0),
|
||||
fAbsMaterCmd(0),
|
||||
fAbsThickCmd(0),
|
||||
fAbsRadCmd(0),
|
||||
fAbsZposCmd(0),
|
||||
fWorldMaterCmd(0),
|
||||
fWorldZCmd(0),
|
||||
fWorldRCmd(0),
|
||||
fUpdateCmd(0)
|
||||
{
|
||||
F03detDir = new G4UIdirectory("/calor/");
|
||||
F03detDir->SetGuidance("F03 detector control.");
|
||||
fDetDir = new G4UIdirectory("/calor/");
|
||||
fDetDir->SetGuidance("F03 detector control.");
|
||||
|
||||
AbsMaterCmd = new G4UIcmdWithAString("/calor/setAbsMat",this);
|
||||
AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
|
||||
AbsMaterCmd->SetParameterName("choice",true);
|
||||
AbsMaterCmd->SetDefaultValue("Lead");
|
||||
AbsMaterCmd->AvailableForStates(G4State_Idle);
|
||||
fAbsMaterCmd = new G4UIcmdWithAString("/calor/setAbsMat",this);
|
||||
fAbsMaterCmd->SetGuidance("Select Material of the Absorber.");
|
||||
fAbsMaterCmd->SetParameterName("choice",true);
|
||||
fAbsMaterCmd->SetDefaultValue("Lead");
|
||||
fAbsMaterCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
WorldMaterCmd = new G4UIcmdWithAString("/calor/setWorldMat",this);
|
||||
WorldMaterCmd->SetGuidance("Select Material of the World.");
|
||||
WorldMaterCmd->SetParameterName("wchoice",true);
|
||||
WorldMaterCmd->SetDefaultValue("Air");
|
||||
WorldMaterCmd->AvailableForStates(G4State_Idle);
|
||||
fWorldMaterCmd = new G4UIcmdWithAString("/calor/setWorldMat",this);
|
||||
fWorldMaterCmd->SetGuidance("Select Material of the World.");
|
||||
fWorldMaterCmd->SetParameterName("wchoice",true);
|
||||
fWorldMaterCmd->SetDefaultValue("Air");
|
||||
fWorldMaterCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsThick",this);
|
||||
AbsThickCmd->SetGuidance("Set Thickness of the Absorber");
|
||||
AbsThickCmd->SetParameterName("SizeZ",false,false);
|
||||
AbsThickCmd->SetDefaultUnit("mm");
|
||||
AbsThickCmd->SetRange("SizeZ>0.");
|
||||
AbsThickCmd->AvailableForStates(G4State_Idle);
|
||||
fAbsThickCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsThick",this);
|
||||
fAbsThickCmd->SetGuidance("Set Thickness of the Absorber");
|
||||
fAbsThickCmd->SetParameterName("SizeZ",false,false);
|
||||
fAbsThickCmd->SetDefaultUnit("mm");
|
||||
fAbsThickCmd->SetRange("SizeZ>0.");
|
||||
fAbsThickCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
AbsRadCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsRad",this);
|
||||
AbsRadCmd->SetGuidance("Set radius of the Absorber");
|
||||
AbsRadCmd->SetParameterName("SizeR",false,false);
|
||||
AbsRadCmd->SetDefaultUnit("mm");
|
||||
AbsRadCmd->SetRange("SizeR>0.");
|
||||
AbsRadCmd->AvailableForStates(G4State_Idle);
|
||||
fAbsRadCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsRad",this);
|
||||
fAbsRadCmd->SetGuidance("Set radius of the Absorber");
|
||||
fAbsRadCmd->SetParameterName("SizeR",false,false);
|
||||
fAbsRadCmd->SetDefaultUnit("mm");
|
||||
fAbsRadCmd->SetRange("SizeR>0.");
|
||||
fAbsRadCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
AbsZposCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsZpos",this);
|
||||
AbsZposCmd->SetGuidance("Set Z pos. of the Absorber");
|
||||
AbsZposCmd->SetParameterName("Zpos",false,false);
|
||||
AbsZposCmd->SetDefaultUnit("mm");
|
||||
AbsZposCmd->AvailableForStates(G4State_Idle);
|
||||
fAbsZposCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsZpos",this);
|
||||
fAbsZposCmd->SetGuidance("Set Z pos. of the Absorber");
|
||||
fAbsZposCmd->SetParameterName("Zpos",false,false);
|
||||
fAbsZposCmd->SetDefaultUnit("mm");
|
||||
fAbsZposCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
WorldZCmd = new G4UIcmdWithADoubleAndUnit("/calor/setWorldZ",this);
|
||||
WorldZCmd->SetGuidance("Set Z size of the World");
|
||||
WorldZCmd->SetParameterName("WSizeZ",false,false);
|
||||
WorldZCmd->SetDefaultUnit("mm");
|
||||
WorldZCmd->SetRange("WSizeZ>0.");
|
||||
WorldZCmd->AvailableForStates(G4State_Idle);
|
||||
fWorldZCmd = new G4UIcmdWithADoubleAndUnit("/calor/setWorldZ",this);
|
||||
fWorldZCmd->SetGuidance("Set Z size of the World");
|
||||
fWorldZCmd->SetParameterName("WSizeZ",false,false);
|
||||
fWorldZCmd->SetDefaultUnit("mm");
|
||||
fWorldZCmd->SetRange("WSizeZ>0.");
|
||||
fWorldZCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
WorldRCmd = new G4UIcmdWithADoubleAndUnit("/calor/setWorldR",this);
|
||||
WorldRCmd->SetGuidance("Set R size of the World");
|
||||
WorldRCmd->SetParameterName("WSizeR",false,false);
|
||||
WorldRCmd->SetDefaultUnit("mm");
|
||||
WorldRCmd->SetRange("WSizeR>0.");
|
||||
WorldRCmd->AvailableForStates(G4State_Idle);
|
||||
fWorldRCmd = new G4UIcmdWithADoubleAndUnit("/calor/setWorldR",this);
|
||||
fWorldRCmd->SetGuidance("Set R size of the World");
|
||||
fWorldRCmd->SetParameterName("WSizeR",false,false);
|
||||
fWorldRCmd->SetDefaultUnit("mm");
|
||||
fWorldRCmd->SetRange("WSizeR>0.");
|
||||
fWorldRCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
UpdateCmd = new G4UIcmdWithoutParameter("/calor/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("/calor/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);
|
||||
|
||||
}
|
||||
|
||||
@@ -107,44 +117,44 @@ F03DetectorMessenger::F03DetectorMessenger(F03DetectorConstruction * F03Det)
|
||||
|
||||
F03DetectorMessenger::~F03DetectorMessenger()
|
||||
{
|
||||
delete AbsMaterCmd;
|
||||
delete AbsThickCmd;
|
||||
delete AbsRadCmd;
|
||||
delete AbsZposCmd;
|
||||
delete WorldMaterCmd;
|
||||
delete WorldZCmd;
|
||||
delete WorldRCmd;
|
||||
delete UpdateCmd;
|
||||
delete F03detDir;
|
||||
delete fAbsMaterCmd;
|
||||
delete fAbsThickCmd;
|
||||
delete fAbsRadCmd;
|
||||
delete fAbsZposCmd;
|
||||
delete fWorldMaterCmd;
|
||||
delete fWorldZCmd;
|
||||
delete fWorldRCmd;
|
||||
delete fUpdateCmd;
|
||||
delete fDetDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void F03DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
if( command == AbsMaterCmd )
|
||||
{ F03Detector->SetAbsorberMaterial(newValue);}
|
||||
if ( command == fAbsMaterCmd )
|
||||
{ fDetector->SetAbsorberMaterial(newValue);}
|
||||
|
||||
if( command == WorldMaterCmd )
|
||||
{ F03Detector->SetWorldMaterial(newValue);}
|
||||
if ( command == fWorldMaterCmd )
|
||||
{ fDetector->SetWorldMaterial(newValue);}
|
||||
|
||||
if( command == AbsThickCmd )
|
||||
{ F03Detector->SetAbsorberThickness(AbsThickCmd->GetNewDoubleValue(newValue));}
|
||||
if ( command == fAbsThickCmd )
|
||||
{ fDetector->SetAbsorberThickness(fAbsThickCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == AbsRadCmd )
|
||||
{ F03Detector->SetAbsorberRadius(AbsRadCmd->GetNewDoubleValue(newValue));}
|
||||
if ( command == fAbsRadCmd )
|
||||
{ fDetector->SetAbsorberRadius(fAbsRadCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == AbsZposCmd )
|
||||
{ F03Detector->SetAbsorberZpos(AbsZposCmd->GetNewDoubleValue(newValue));}
|
||||
if ( command == fAbsZposCmd )
|
||||
{ fDetector->SetAbsorberZpos(fAbsZposCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == WorldZCmd )
|
||||
{ F03Detector->SetWorldSizeZ(WorldZCmd->GetNewDoubleValue(newValue));}
|
||||
if ( command == fWorldZCmd )
|
||||
{ fDetector->SetWorldSizeZ(fWorldZCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == WorldRCmd )
|
||||
{ F03Detector->SetWorldSizeR(WorldRCmd->GetNewDoubleValue(newValue));}
|
||||
if ( command == fWorldRCmd )
|
||||
{ fDetector->SetWorldSizeR(fWorldRCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == UpdateCmd )
|
||||
{ F03Detector->UpdateGeometry(); }
|
||||
if ( command == fUpdateCmd )
|
||||
{ fDetector->UpdateGeometry(); }
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user