Geant4  10.03.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: RMC01DetectorMessenger.cc 71233 2013-06-12 13:16:05Z gcosmo $
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 : G4UImessenger(),
54  fTheDetector(GeneralDet),
55  fGeneralDir(0),
56  fDetDir(0),
57  fSetSensitiveVolumeHeightCmd(0),
58  fSetSensitiveVolumeRadiusCmd(0),
59  fSetShieldingThicknessCmd(0)
60 {
61 
62  fGeneralDir= new G4UIdirectory("/RMC01/");
63  fGeneralDir->SetGuidance(
64  "Control of the Geant4 Reverse Monte Carlo example1");
65 
66 
67 
68  fDetDir = new G4UIdirectory("/RMC01/geometry/");
69  fDetDir->SetGuidance("Geometry control");
70 
71 
72  fSetSensitiveVolumeHeightCmd = new G4UIcmdWithADoubleAndUnit(
73  "/RMC01/geometry/SetSensitiveVolumeHeight",this);
74  fSetSensitiveVolumeHeightCmd->SetGuidance(
75  "Set the height of the sensitive cylinder");
76  fSetSensitiveVolumeHeightCmd->AvailableForStates(G4State_PreInit);
77 
78  fSetSensitiveVolumeRadiusCmd = new G4UIcmdWithADoubleAndUnit(
79  "/RMC01/geometry/SetSensitiveVolumeRadius",this);
80  fSetSensitiveVolumeRadiusCmd->SetGuidance(
81  "Set the radius of the sensitive cylinder");
82  fSetSensitiveVolumeRadiusCmd->AvailableForStates(G4State_PreInit);
83 
84  fSetShieldingThicknessCmd = new G4UIcmdWithADoubleAndUnit(
85  "/RMC01/geometry/SetShieldingThickness",this);
86  fSetShieldingThicknessCmd->SetGuidance(
87  "Set the thickness of the Aluminum Shielding sphere");
88  fSetShieldingThicknessCmd->AvailableForStates(G4State_PreInit);
89 
90 }
91 
92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
93 
95 {
96  if (fGeneralDir ) delete fGeneralDir;
97  if (fDetDir) delete fDetDir;
98  if (fSetSensitiveVolumeHeightCmd) delete fSetSensitiveVolumeHeightCmd;
99  if (fSetSensitiveVolumeRadiusCmd) delete fSetSensitiveVolumeRadiusCmd;
100  if (fSetShieldingThicknessCmd) delete fSetShieldingThicknessCmd;
101 
102 }
103 
104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
105 
107  G4String newValue)
108 { if( command == fSetSensitiveVolumeHeightCmd ){
109  fTheDetector->SetSensitiveVolumeHeight(
110  fSetSensitiveVolumeHeightCmd->GetNewDoubleValue(newValue));
111  }
112 
113  else if( command == fSetSensitiveVolumeRadiusCmd ){
114  fTheDetector->SetSensitiveVolumeRadius(
115  fSetSensitiveVolumeRadiusCmd->GetNewDoubleValue(newValue));
116  }
117 
118  else if( command == fSetShieldingThicknessCmd ){
119  fTheDetector->SetShieldingThickness(
120  fSetShieldingThicknessCmd->GetNewDoubleValue(newValue));
121  }
122 }
123 
124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4double GetNewDoubleValue(const char *paramString)
Definition of the RMC01DetectorConstruction class.
RMC01DetectorMessenger(RMC01DetectorConstruction *)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
virtual void SetNewValue(G4UIcommand *, G4String)
Definition of the RMC01DetectorMessenger class.