File indexing completed on 2025-02-23 09:22:31
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #include "ExGflashMessenger.hh"
0034
0035 #include "ExGflashDetectorConstruction.hh"
0036
0037 #include "G4UIcmdWith3Vector.hh"
0038 #include "G4UIcmdWithADoubleAndUnit.hh"
0039 #include "G4UIcmdWithAString.hh"
0040 #include "G4UIcmdWithAnInteger.hh"
0041 #include "G4UIcmdWithoutParameter.hh"
0042 #include "G4UIdirectory.hh"
0043
0044
0045
0046 ExGflashMessenger::ExGflashMessenger(ExGflashDetectorConstruction* Det) : fDetector(Det)
0047 {
0048 fExGflashDir = new G4UIdirectory("/exgflash/");
0049 fExGflashDir->SetGuidance(" Gflash example commands.");
0050
0051 fVerbose = new G4UIcmdWithAnInteger("/exgflash/verbose", this);
0052 fVerbose->SetGuidance("set exglash verbosity");
0053 fVerbose->SetGuidance("0- silent, 1 - on exit, 2 - run , 3 - event");
0054 fVerbose->SetParameterName("ver", false);
0055 fVerbose->SetRange("ver >= 0");
0056 fVerbose->AvailableForStates(G4State_PreInit, G4State_Idle);
0057 fVerbose->SetToBeBroadcasted(false);
0058
0059 fDetDir = new G4UIdirectory("/exgflash/det/");
0060 fDetDir->SetGuidance("detector construction commands");
0061
0062 fMaterCmd = new G4UIcmdWithAString("/exgflash/det/setMat", this);
0063 fMaterCmd->SetGuidance("Select Material.");
0064 fMaterCmd->SetParameterName("material", false);
0065 fMaterCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0066 fMaterCmd->SetToBeBroadcasted(false);
0067
0068 fLBinCmd = new G4UIcmdWith3Vector("/exgflash/det/setLbin", this);
0069 fLBinCmd->SetGuidance("set longitudinal bining");
0070 fLBinCmd->SetGuidance("nb of bins; bin thickness (in radl)");
0071
0072 fLBinCmd->SetParameterName("nLtot", "dLradl", " ", true);
0073 fLBinCmd->SetRange("nLtot>=1 && dLradl>0");
0074 fLBinCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0075 fLBinCmd->SetToBeBroadcasted(false);
0076
0077 fRBinCmd = new G4UIcmdWith3Vector("/exgflash/det/setRbin", this);
0078 fRBinCmd->SetGuidance("set radial bining");
0079 fRBinCmd->SetGuidance("nb of bins; bin thickness (in radl)");
0080 fRBinCmd->SetParameterName("nRtot", "dRradl", " ", true);
0081 fRBinCmd->SetRange("nRtot>=1 && dRradl>0");
0082 fRBinCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0083 fRBinCmd->SetToBeBroadcasted(false);
0084 }
0085
0086
0087
0088 ExGflashMessenger::~ExGflashMessenger()
0089 {
0090 delete fRBinCmd;
0091 delete fLBinCmd;
0092 delete fMaterCmd;
0093 delete fDetDir;
0094 delete fVerbose;
0095 delete fExGflashDir;
0096 }
0097
0098
0099
0100 void ExGflashMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0101 {
0102 if (command == fMaterCmd) {
0103 fDetector->SetMaterial(newValue);
0104 }
0105
0106 if (command == fVerbose) {
0107 fDetector->SetVerbose(fVerbose->GetNewIntValue(newValue));
0108 }
0109
0110 if (command == fLBinCmd) {
0111 fDetector->SetLBining(fLBinCmd->GetNew3VectorValue(newValue));
0112 }
0113
0114 if (command == fRBinCmd) {
0115 fDetector->SetRBining(fRBinCmd->GetNew3VectorValue(newValue));
0116 }
0117 }
0118
0119