Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
/// \brief Implementation of the DetectorMessenger class
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: DetectorMessenger.cc 77256 2013-11-22 10:10:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -46,12 +46,22 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorMessenger::DetectorMessenger( DetectorConstruction* Det)
|
||||
:Detector(Det)
|
||||
: G4UImessenger(),
|
||||
fDetector(Det),
|
||||
fN03Dir(0),
|
||||
fDetDir(0),
|
||||
fAbsMaterCmd(0),
|
||||
fGapMaterCmd(0),
|
||||
fAbsThickCmd(0),
|
||||
fGapThickCmd(0),
|
||||
fSizeYZCmd(0),
|
||||
fNbLayersCmd(0)
|
||||
{
|
||||
fN03Dir = new G4UIdirectory("/N03/");
|
||||
fN03Dir->SetGuidance("UI commands of this example");
|
||||
|
||||
fDetDir = new G4UIdirectory("/N03/det/");
|
||||
G4bool broadcast = false;
|
||||
fDetDir = new G4UIdirectory("/N03/det/",broadcast);
|
||||
fDetDir->SetGuidance("detector control");
|
||||
|
||||
fAbsMaterCmd = new G4UIcmdWithAString("/N03/det/setAbsMat",this);
|
||||
@@ -91,11 +101,6 @@ DetectorMessenger::DetectorMessenger( DetectorConstruction* Det)
|
||||
fNbLayersCmd->SetRange("NbLayers>0 && NbLayers<500");
|
||||
fNbLayersCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
fUpdateCmd = new G4UIcmdWithoutParameter("/N03/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);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -105,7 +110,7 @@ DetectorMessenger::~DetectorMessenger()
|
||||
delete fNbLayersCmd;
|
||||
delete fAbsMaterCmd; delete fGapMaterCmd;
|
||||
delete fAbsThickCmd; delete fGapThickCmd;
|
||||
delete fSizeYZCmd; delete fUpdateCmd;
|
||||
delete fSizeYZCmd;
|
||||
delete fDetDir;
|
||||
delete fN03Dir;
|
||||
}
|
||||
@@ -115,26 +120,23 @@ DetectorMessenger::~DetectorMessenger()
|
||||
void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
if( command == fAbsMaterCmd )
|
||||
{ Detector->SetAbsorberMaterial(newValue);}
|
||||
{ fDetector->SetAbsorberMaterial(newValue);}
|
||||
|
||||
if( command == fGapMaterCmd )
|
||||
{ Detector->SetGapMaterial(newValue);}
|
||||
{ fDetector->SetGapMaterial(newValue);}
|
||||
|
||||
if( command == fAbsThickCmd )
|
||||
{ Detector->SetAbsorberThickness(fAbsThickCmd
|
||||
{ fDetector->SetAbsorberThickness(fAbsThickCmd
|
||||
->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == fGapThickCmd )
|
||||
{ Detector->SetGapThickness(fGapThickCmd->GetNewDoubleValue(newValue));}
|
||||
{ fDetector->SetGapThickness(fGapThickCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == fSizeYZCmd )
|
||||
{ Detector->SetCalorSizeYZ(fSizeYZCmd->GetNewDoubleValue(newValue));}
|
||||
{ fDetector->SetCalorSizeYZ(fSizeYZCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == fNbLayersCmd )
|
||||
{ Detector->SetNbOfLayers(fNbLayersCmd->GetNewIntValue(newValue));}
|
||||
|
||||
if( command == fUpdateCmd )
|
||||
{ Detector->UpdateGeometry(); }
|
||||
{ fDetector->SetNbOfLayers(fNbLayersCmd->GetNewIntValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
Reference in New Issue
Block a user