QwGeant4
QweakSimDetectorMessenger.cc
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // ---------------------------
4 // | Doxygen File Information |
5 // ---------------------------
6 //
7 /**
8 
9  \file QweakSimDetectorMessenger.cc
10 
11  $Revision: 1.3 $
12  $Date: 2006/05/05 21:28:11 $
13 
14  \author Klaus Hans Grimm
15 
16 */
17 //=============================================================================
18 
19 //=============================================================================
20 // -----------------------
21 // | CVS File Information |
22 // -----------------------
23 //
24 // Last Update: $Author: grimm $
25 // Update Date: $Date: 2006/05/05 21:28:11 $
26 // CVS/RCS Revision: $Revision: 1.3 $
27 // Status: $State: Exp $
28 //
29 // ===================================
30 // CVS Revision Log at end of file !!
31 // ===================================
32 //
33 //============================================================================
34 
35 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
36 
38 
39 // user includes
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
46 :myDetector(theDetector)
47 {
48 
49  QweakSimDir = NULL;
50  UpdateCmd = NULL;
51 
52 
53 
54  QweakSimDir = new G4UIdirectory("/HallC/");
55  QweakSimDir->SetGuidance("UI commands specific to this example.");
56 
57  VisibilityDir = new G4UIdirectory("/HallC/Visibility/");
58  VisibilityDir -> SetGuidance("Hall Visibility Control.");
59 
60  UpdateCmd = new G4UIcmdWithoutParameter("/HallC/GeometryUpdate",this);
61  UpdateCmd->SetGuidance("Update Qweak geometry.");
62  UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
63  UpdateCmd->SetGuidance("if you changed geometrical value(s).");
64  UpdateCmd->AvailableForStates(G4State_Idle);
65 
66  DumpGeometry_Cmd = new G4UIcmdWithABool("/HallC/DumpGeometry",this);
67  DumpGeometry_Cmd->SetGuidance("Dump geometry tree, with optional overlap check.");
68  DumpGeometry_Cmd->SetParameterName("check_overlap",true);
69  DumpGeometry_Cmd->SetDefaultValue("false");
70  DumpGeometry_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
71 
72  ShowHallFloor_Cmd = new G4UIcmdWithoutParameter("/HallC/Visibility/ShowHallFloor",this);
73  ShowHallFloor_Cmd->SetGuidance("Make the Hall Floor visible");
74  ShowHallFloor_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
75 
76  HideHallFloor_Cmd = new G4UIcmdWithoutParameter("/HallC/Visibility/HideHallFloor",this);
77  HideHallFloor_Cmd->SetGuidance("Make the Hall Floor invisible");
78  HideHallFloor_Cmd->AvailableForStates(G4State_PreInit,G4State_Idle);
79 
80 }
81 
82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83 
85 {
86  if (UpdateCmd) delete UpdateCmd;
87  if (QweakSimDir) delete QweakSimDir;
88  if (VisibilityDir) delete VisibilityDir;
92 
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96 
97 void QweakSimDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
98 {
99 
100  if( command == UpdateCmd )
101  {
102  G4cout << "#### Messenger: Updating geometry " << G4endl;
103 
105  }
106 
107 // if( command == HallFloorMat_Cmd )
108 // {
109 // G4cout << "#### Messenger: Setting Floor Material to " << newValue << G4endl;
110 //
111 // myDetector->SetHallFloorMaterial(newValue);
112 // }
113 
114  if( command == DumpGeometry_Cmd )
115  {
116  G4cout << "#### Messenger: Dump Geometry " << G4endl;
117 
118  myDetector->DumpGeometry(DumpGeometry_Cmd->GetNewBoolValue(newValue));
119  }
120 
121  if( command == ShowHallFloor_Cmd )
122  {
123  G4cout << "#### Messenger: Show Hall Floor " << G4endl;
124 
126  }
127 
128  if( command == HideHallFloor_Cmd )
129  {
130  G4cout << "#### Messenger: Hide Hall Floor " << G4endl;
131 
133  }
134 
135 
136 
137 
138 
139 }
140 
141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
142 
143 //=======================================================
144 // -----------------------
145 // | CVS File Information |
146 // -----------------------
147 //
148 // $Revisions$
149 // $Log: QweakSimDetectorMessenger.cc,v $
150 // Revision 1.3 2006/05/05 21:28:11 grimm
151 // Added /HallC/Visibility/ShowHallFloor and /HallC/Visibility/HideHallFloor
152 //
153 // Revision 1.2 2005/12/27 19:07:48 grimm
154 // - Redesign of Doxygen header containing CVS info like revision and date
155 // - Added CVS revision log at the end of file
156 //
157 //
158 
QweakSimDetectorConstruction * myDetector
main class of QweakSim. All experiment components are are placed here.
G4UIcmdWithoutParameter * UpdateCmd
G4UIcmdWithoutParameter * HideHallFloor_Cmd
void SetNewValue(G4UIcommand *, G4String)
void DumpGeometry(G4bool surfchk=false, G4VPhysicalVolume *aVolume=0, G4int depth=0)
QweakSimDetectorMessenger(QweakSimDetectorConstruction *)
G4UIcmdWithoutParameter * ShowHallFloor_Cmd