#include <MollerTargetMessenger.hh>
Public Member Functions | |
MollerTargetMessenger (MollerTarget *) | |
~MollerTargetMessenger () | |
void | SetNewValue (G4UIcommand *, G4String) |
Private Attributes | |
MollerTarget * | myTarget |
G4UIdirectory * | TargetDir |
G4UIcmdWithAString * | TargMatCmd |
G4UIcmdWithAString * | TargCellMatCmd |
G4UIcmdWithADoubleAndUnit * | TargZPosCmd |
G4UIcmdWithADoubleAndUnit * | TargLengthCmd |
Definition at line 49 of file MollerTargetMessenger.hh.
MollerTargetMessenger::MollerTargetMessenger | ( | MollerTarget * | myTar | ) |
Definition at line 18 of file MollerTargetMessenger.cc.
References TargCellMatCmd, TargetDir, TargLengthCmd, TargMatCmd, and TargZPosCmd.
Referenced by MollerTarget::MollerTarget().
00019 :myTarget(myTar) 00020 { 00021 TargetDir = new G4UIdirectory("/moller/target/"); 00022 TargetDir -> SetGuidance("target control."); 00023 00024 TargZPosCmd = new G4UIcmdWithADoubleAndUnit("/moller/target/setCenterPositionInZ",this); 00025 TargZPosCmd->SetGuidance("Set the Z position of the target center"); 00026 TargZPosCmd->SetParameterName("Size",true); 00027 //TargZPosCmd->SetRange("Size>=0."); 00028 TargZPosCmd->SetUnitCategory("Length"); 00029 TargZPosCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00030 00031 TargMatCmd = new G4UIcmdWithAString("/moller/target/setTargetMaterial",this); 00032 TargMatCmd->SetGuidance("Select Material of the Target."); 00033 TargMatCmd->SetParameterName("choice",false); 00034 TargMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00035 00036 TargCellMatCmd = new G4UIcmdWithAString("/moller/target/setTargetCellMaterial",this); 00037 TargCellMatCmd->SetGuidance("Select Material of the Target Cell."); 00038 TargCellMatCmd->SetParameterName("choice",false); 00039 TargCellMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00040 00041 TargLengthCmd = new G4UIcmdWithADoubleAndUnit("/moller/target/setTargetLength",this); 00042 TargLengthCmd->SetGuidance("Set the Target Length."); 00043 TargLengthCmd->SetParameterName("fTargetLength",true, true); 00044 TargLengthCmd->SetDefaultValue(150.); 00045 TargLengthCmd->SetUnitCategory("Length"); 00046 TargLengthCmd->SetDefaultUnit("cm"); 00047 TargLengthCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00048 }
MollerTargetMessenger::~MollerTargetMessenger | ( | ) |
Definition at line 52 of file MollerTargetMessenger.cc.
References TargCellMatCmd, TargetDir, TargMatCmd, and TargZPosCmd.
00053 { 00054 delete TargZPosCmd; 00055 delete TargMatCmd; 00056 delete TargCellMatCmd; 00057 delete TargetDir; 00058 }
void MollerTargetMessenger::SetNewValue | ( | G4UIcommand * | command, | |
G4String | newValue | |||
) |
Definition at line 62 of file MollerTargetMessenger.cc.
References myTarget, MollerTarget::SetTargetCellMaterial(), MollerTarget::SetTargetCenterPositionInZ(), MollerTarget::SetTargetLength(), MollerTarget::SetTargetMaterial(), TargCellMatCmd, TargLengthCmd, TargMatCmd, and TargZPosCmd.
00063 { 00064 G4cout << "#### Calling MollerTargetMessenger::SetNewValue() " << newValue << G4endl; 00065 00066 if( command == TargZPosCmd ) 00067 { 00068 G4cout << "#### Messenger: Setting Target Z position to " << newValue << G4endl; 00069 myTarget->SetTargetCenterPositionInZ(TargZPosCmd->GetNewDoubleValue(newValue)); 00070 } 00071 00072 if( command == TargMatCmd ) 00073 { 00074 G4cout << "#### Messenger: Setting Target Material to " << newValue << G4endl; 00075 myTarget->SetTargetMaterial(newValue); 00076 } 00077 00078 00079 if( command == TargCellMatCmd ) 00080 { 00081 G4cout << "#### Messenger: Setting Target Cell Material to " << newValue << G4endl; 00082 myTarget->SetTargetCellMaterial(newValue); 00083 } 00084 00085 if (command == TargLengthCmd) 00086 { 00087 G4cout << "#### Messenger: Setting Target Length to " << newValue << G4endl; 00088 myTarget->SetTargetLength(TargLengthCmd->GetNewDoubleValue(newValue)); } 00089 00090 G4cout << "#### Leaving MollerTargetMessenger::SetNewValue() " << newValue << G4endl; 00091 }
MollerTarget* MollerTargetMessenger::myTarget [private] |
Definition at line 58 of file MollerTargetMessenger.hh.
Referenced by SetNewValue().
G4UIcmdWithAString* MollerTargetMessenger::TargCellMatCmd [private] |
Definition at line 61 of file MollerTargetMessenger.hh.
Referenced by MollerTargetMessenger(), SetNewValue(), and ~MollerTargetMessenger().
G4UIdirectory* MollerTargetMessenger::TargetDir [private] |
Definition at line 59 of file MollerTargetMessenger.hh.
Referenced by MollerTargetMessenger(), and ~MollerTargetMessenger().
G4UIcmdWithADoubleAndUnit* MollerTargetMessenger::TargLengthCmd [private] |
Definition at line 63 of file MollerTargetMessenger.hh.
Referenced by MollerTargetMessenger(), and SetNewValue().
G4UIcmdWithAString* MollerTargetMessenger::TargMatCmd [private] |
Definition at line 60 of file MollerTargetMessenger.hh.
Referenced by MollerTargetMessenger(), SetNewValue(), and ~MollerTargetMessenger().
G4UIcmdWithADoubleAndUnit* MollerTargetMessenger::TargZPosCmd [private] |
Definition at line 62 of file MollerTargetMessenger.hh.
Referenced by MollerTargetMessenger(), SetNewValue(), and ~MollerTargetMessenger().