Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RemSimDetectorMessenger.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // Code developed by:
28 // S.Guatelli
29 //
30 // *********************************
31 // * *
32 // * RemSimDetectorMessenger.cc *
33 // * *
34 // *********************************
35 //
36 //
37 // $Id$
38 //
39 //
40 
43 #include "G4UIdirectory.hh"
44 #include "G4UIcmdWithAString.hh"
46 
48 {
49  vehicleDir = new G4UIdirectory("/configuration/");
50  vehicleDir -> SetGuidance("geometry control.");
51 
52  vehicleCmd = new G4UIcmdWithAString("/configuration/choose",this);
53  vehicleCmd -> SetGuidance("Assign the geometrical set-up to G4RunManager.");
54  vehicleCmd -> SetParameterName("choice",true);
55  vehicleCmd -> SetCandidates("vehicle moon");
56  vehicleCmd -> AvailableForStates(G4State_Idle);
57 
58  shieldingCmd = new G4UIcmdWithAString("/configuration/AddShielding",this);
59  shieldingCmd -> SetGuidance("Add shielding layer in vehicle configuration.");
60  shieldingCmd -> SetParameterName("choice",true);
61  shieldingCmd -> SetCandidates("On Off");
62  shieldingCmd -> AvailableForStates(G4State_Idle);
63 
64  SPECmd = new G4UIcmdWithAString("/configuration/AddSPE",this);
65  SPECmd -> SetGuidance("Add SPE shelter in vehicle configuration.");
66  SPECmd -> SetParameterName("choice",true);
67  SPECmd -> SetCandidates("On Off");
68  SPECmd -> AvailableForStates(G4State_Idle);
69 
70  roofCmd = new G4UIcmdWithAString("/configuration/AddRoof",this);
71  roofCmd -> SetGuidance("Add the Roof to the moon habitat.");
72  roofCmd -> SetParameterName("choice",true);
73  roofCmd -> SetCandidates("On Off");
74  roofCmd -> AvailableForStates(G4State_Idle);
75 
76 
77  // Fix the parameters of the shielding: material and thickness
78  shieldingDir = new G4UIdirectory("/shielding/");
79  shieldingDir -> SetGuidance("shielding control.");
80 
81  thicknessCmd = new G4UIcmdWithADoubleAndUnit("/shielding/thickness",this);
82  thicknessCmd -> SetGuidance("Set the thickness of the shielding.");
83  thicknessCmd -> SetParameterName("Size",true);
84  thicknessCmd -> SetRange("Size>=0.");
85  thicknessCmd -> SetUnitCategory("Length");
86  thicknessCmd -> AvailableForStates(G4State_Idle);
87 
88  roofDir = new G4UIdirectory("/roof/");
89  roofDir -> SetGuidance("Roof control.");
90  thicknessRoofCmd = new G4UIcmdWithADoubleAndUnit("/roof/thickness",this);
91  thicknessRoofCmd -> SetGuidance("Set the thickness of the Roof.");
92  thicknessRoofCmd -> SetParameterName("Size",true);
93  thicknessRoofCmd -> SetRange("Size>=0.");
94  thicknessRoofCmd -> SetUnitCategory("Length");
95  thicknessRoofCmd -> AvailableForStates(G4State_Idle);
96 }
97 
99 {
100  delete thicknessRoofCmd;
101  delete roofDir;
102  delete thicknessCmd;
103  delete shieldingDir;
104  delete roofCmd;
105  delete SPECmd;
106  delete shieldingCmd;
107  delete vehicleCmd;
108  delete vehicleDir;
109 }
110 
112 {
113  if(command == vehicleCmd)
114  detector -> ChooseConfiguration(newValue);
115 
116  if(command == shieldingCmd)
117  detector -> AddShielding(newValue);
118 
119  if(command == SPECmd)
120  detector -> AddShelterSPE(newValue);
121 
122  if(command == roofCmd)
123  detector -> AddHabitatRoof(newValue);
124 
125  if(command == thicknessCmd)
126  detector -> ChangeShieldingThickness
127  (thicknessCmd -> GetNewDoubleValue(newValue));
128 
129  if(command == thicknessRoofCmd)
130  detector -> ChangeRoofThickness
131  (thicknessRoofCmd -> GetNewDoubleValue(newValue));
132 }
133