Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RMC01DetectorMessenger.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 //
28 //
29 // $Id$
30 //
32 // Class Name: RMC01DetectorMessenger
33 // Author: L. Desorgher
34 // Organisation: SpaceIT GmbH
35 // Contract: ESA contract 21435/08/NL/AT
36 // Customer: ESA/ESTEC
38 
39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41 
43 
45 #include "G4UIdirectory.hh"
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50 
52  RMC01DetectorConstruction* GeneralDet)
53 :fTheDetector(GeneralDet)
54 {
55 
56  fGeneralDir= new G4UIdirectory("/RMC01/");
57  fGeneralDir->SetGuidance("Control of the Geant4 Reverse Monte Carlo example1");
58 
59 
60 
61  fDetDir = new G4UIdirectory("/RMC01/geometry/");
62  fDetDir->SetGuidance("Geometry control");
63 
64 
65  fSetSensitiveVolumeHeightCmd = new G4UIcmdWithADoubleAndUnit(
66  "/RMC01/geometry/SetSensitiveVolumeHeight",this);
67  fSetSensitiveVolumeHeightCmd->SetGuidance(
68  "Set the height of the sensitive cylinder");
69  fSetSensitiveVolumeHeightCmd->AvailableForStates(G4State_PreInit);
70 
71  fSetSensitiveVolumeRadiusCmd = new G4UIcmdWithADoubleAndUnit(
72  "/RMC01/geometry/SetSensitiveVolumeRadius",this);
73  fSetSensitiveVolumeRadiusCmd->SetGuidance(
74  "Set the radius of the sensitive cylinder");
75  fSetSensitiveVolumeRadiusCmd->AvailableForStates(G4State_PreInit);
76 
77  fSetShieldingThicknessCmd = new G4UIcmdWithADoubleAndUnit(
78  "/RMC01/geometry/SetShieldingThickness",this);
79  fSetShieldingThicknessCmd->SetGuidance(
80  "Set the thickness of the Aluminum Shielding sphere");
81  fSetShieldingThicknessCmd->AvailableForStates(G4State_PreInit);
82 
83 }
84 
85 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
86 
88 {
89  if (fGeneralDir ) delete fGeneralDir;
90  if (fDetDir) delete fDetDir;
91  if (fSetSensitiveVolumeHeightCmd) delete fSetSensitiveVolumeHeightCmd;
92  if (fSetSensitiveVolumeRadiusCmd) delete fSetSensitiveVolumeRadiusCmd;
93  if (fSetShieldingThicknessCmd) delete fSetShieldingThicknessCmd;
94 
95 }
96 
97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
98 
100  G4String newValue)
101 { if( command == fSetSensitiveVolumeHeightCmd ){
102  fTheDetector->SetSensitiveVolumeHeight(
103  fSetSensitiveVolumeHeightCmd->GetNewDoubleValue(newValue));
104  }
105 
106  else if( command == fSetSensitiveVolumeRadiusCmd ){
107  fTheDetector->SetSensitiveVolumeRadius(
108  fSetSensitiveVolumeRadiusCmd->GetNewDoubleValue(newValue));
109  }
110 
111  else if( command == fSetShieldingThicknessCmd ){
112  fTheDetector->SetShieldingThickness(
113  fSetShieldingThicknessCmd->GetNewDoubleValue(newValue));
114  }
115 }
116 
117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......