Warning, file /geant4/examples/advanced/underground_physics/src/DMXDetectorMessenger.cc was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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
0034
0035
0036
0037
0038
0039
0040
0041
0042 #include "DMXDetectorMessenger.hh"
0043
0044 #include "DMXDetectorConstruction.hh"
0045
0046 #include "globals.hh"
0047 #include "G4UIdirectory.hh"
0048 #include "G4UIcmdWithADoubleAndUnit.hh"
0049 #include "G4UIcmdWithoutParameter.hh"
0050
0051 #include "G4RunManager.hh"
0052
0053
0054 DMXDetectorMessenger::DMXDetectorMessenger
0055 (DMXDetectorConstruction* DC):detectorConstruction(DC) {
0056
0057 RoomEKineCutCmd = new G4UIcmdWithADoubleAndUnit("/dmx/RoomMinEnergyCut",this);
0058 RoomEKineCutCmd->SetGuidance("Minimum Charged particle cut in ROOM");
0059 RoomEKineCutCmd->SetParameterName("ECut",false,false);
0060 RoomEKineCutCmd->SetRange("ECut>=250.0*eV");
0061 RoomEKineCutCmd->SetDefaultUnit("eV");
0062 RoomEKineCutCmd->SetUnitCategory("Energy");
0063 RoomEKineCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0064
0065 EKineCutCmd = new G4UIcmdWithADoubleAndUnit("/dmx/MinEnergyCut",this);
0066 EKineCutCmd->SetGuidance("Minimum Charged particle cut inside detector");
0067 EKineCutCmd->SetParameterName("ECut",false,false);
0068 EKineCutCmd->SetRange("ECut>=250.0*eV");
0069 EKineCutCmd->SetDefaultUnit("eV");
0070 EKineCutCmd->SetUnitCategory("Energy");
0071 EKineCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0072
0073 RoomTimeCutCmd = new G4UIcmdWithADoubleAndUnit("/dmx/RoomTimeCut",this);
0074 RoomTimeCutCmd->SetGuidance("Set Time Cut (for neutrons) inside ROOM");
0075 RoomTimeCutCmd->SetParameterName("RTCut",false,false);
0076 RoomTimeCutCmd->SetRange("RTCut>0.");
0077 RoomTimeCutCmd->SetDefaultUnit("ns");
0078 RoomTimeCutCmd->SetUnitCategory("Time");
0079 RoomTimeCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0080
0081 TimeCutCmd = new G4UIcmdWithADoubleAndUnit("/dmx/TimeCut",this);
0082 TimeCutCmd->SetGuidance("Set Time Cut (for neutrons) inside detector");
0083 TimeCutCmd->SetParameterName("TCut",false,false);
0084 TimeCutCmd->SetRange("TCut>0.");
0085 TimeCutCmd->SetDefaultUnit("ns");
0086 TimeCutCmd->SetUnitCategory("Time");
0087 TimeCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0088
0089 }
0090
0091
0092
0093 DMXDetectorMessenger::~DMXDetectorMessenger()
0094 {
0095 delete EKineCutCmd;
0096 delete RoomEKineCutCmd;
0097 delete RoomTimeCutCmd;
0098 delete TimeCutCmd;
0099 }
0100
0101
0102
0103 void DMXDetectorMessenger::SetNewValue(G4UIcommand* command,
0104 G4String newValue)
0105 {
0106
0107 if(command == EKineCutCmd)
0108 detectorConstruction->
0109 SetEnergyCut(EKineCutCmd->GetNewDoubleValue(newValue));
0110
0111 if(command == RoomEKineCutCmd)
0112 detectorConstruction->
0113 SetEnergyCut(RoomEKineCutCmd->GetNewDoubleValue(newValue));
0114
0115 if(command == TimeCutCmd)
0116 detectorConstruction->
0117 SetTimeCut(TimeCutCmd->GetNewDoubleValue(newValue));
0118
0119 if(command == RoomTimeCutCmd)
0120 detectorConstruction->
0121 SetRoomTimeCut(RoomTimeCutCmd->GetNewDoubleValue(newValue));
0122
0123
0124 G4RunManager::GetRunManager()->PhysicsHasBeenModified();
0125 G4RunManager::GetRunManager()->GeometryHasBeenModified();
0126
0127
0128 }
0129
0130
0131