QwGeant4
QweakSimDetectorMessenger Class Reference

Scans the input file for /QweakSim/xyz commands. More...

#include <QweakSimDetectorMessenger.hh>

Inherits G4UImessenger.

+ Collaboration diagram for QweakSimDetectorMessenger:

Public Member Functions

 QweakSimDetectorMessenger (QweakSimDetectorConstruction *)
 
 ~QweakSimDetectorMessenger ()
 
void SetNewValue (G4UIcommand *, G4String)
 

Private Attributes

QweakSimDetectorConstructionmyDetector
 
G4UIdirectory * QweakSimDir
 
G4UIdirectory * VisibilityDir
 
G4UIcmdWithABool * DumpGeometry_Cmd
 
G4UIcmdWithoutParameter * UpdateCmd
 
G4UIcmdWithoutParameter * ShowHallFloor_Cmd
 
G4UIcmdWithoutParameter * HideHallFloor_Cmd
 

Detailed Description

Scans the input file for /QweakSim/xyz commands.

Up to now it is not used. Placeholder for a long explaination

Definition at line 62 of file QweakSimDetectorMessenger.hh.

Constructor & Destructor Documentation

QweakSimDetectorMessenger::QweakSimDetectorMessenger ( QweakSimDetectorConstruction theDetector)

Definition at line 45 of file QweakSimDetectorMessenger.cc.

References DumpGeometry_Cmd, HideHallFloor_Cmd, QweakSimDir, ShowHallFloor_Cmd, UpdateCmd, and VisibilityDir.

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 }
QweakSimDetectorConstruction * myDetector
G4UIcmdWithoutParameter * UpdateCmd
G4UIcmdWithoutParameter * HideHallFloor_Cmd
G4UIcmdWithoutParameter * ShowHallFloor_Cmd
QweakSimDetectorMessenger::~QweakSimDetectorMessenger ( )

Definition at line 84 of file QweakSimDetectorMessenger.cc.

References DumpGeometry_Cmd, HideHallFloor_Cmd, QweakSimDir, ShowHallFloor_Cmd, UpdateCmd, and VisibilityDir.

85 {
86  if (UpdateCmd) delete UpdateCmd;
87  if (QweakSimDir) delete QweakSimDir;
88  if (VisibilityDir) delete VisibilityDir;
92 
93 }
G4UIcmdWithoutParameter * UpdateCmd
G4UIcmdWithoutParameter * HideHallFloor_Cmd
G4UIcmdWithoutParameter * ShowHallFloor_Cmd

Member Function Documentation

void QweakSimDetectorMessenger::SetNewValue ( G4UIcommand *  command,
G4String  newValue 
)

Definition at line 97 of file QweakSimDetectorMessenger.cc.

References QweakSimDetectorConstruction::DumpGeometry(), DumpGeometry_Cmd, QweakSimDetectorConstruction::HideHallFloor(), HideHallFloor_Cmd, myDetector, QweakSimDetectorConstruction::ShowHallFloor(), ShowHallFloor_Cmd, UpdateCmd, and QweakSimDetectorConstruction::UpdateGeometry().

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 }
QweakSimDetectorConstruction * myDetector
G4UIcmdWithoutParameter * UpdateCmd
G4UIcmdWithoutParameter * HideHallFloor_Cmd
void DumpGeometry(G4bool surfchk=false, G4VPhysicalVolume *aVolume=0, G4int depth=0)
G4UIcmdWithoutParameter * ShowHallFloor_Cmd

+ Here is the call graph for this function:

Field Documentation

G4UIcmdWithABool* QweakSimDetectorMessenger::DumpGeometry_Cmd
private
G4UIcmdWithoutParameter* QweakSimDetectorMessenger::HideHallFloor_Cmd
private
QweakSimDetectorConstruction* QweakSimDetectorMessenger::myDetector
private

Definition at line 71 of file QweakSimDetectorMessenger.hh.

Referenced by SetNewValue().

G4UIdirectory* QweakSimDetectorMessenger::QweakSimDir
private
G4UIcmdWithoutParameter* QweakSimDetectorMessenger::ShowHallFloor_Cmd
private
G4UIcmdWithoutParameter* QweakSimDetectorMessenger::UpdateCmd
private
G4UIdirectory* QweakSimDetectorMessenger::VisibilityDir
private

The documentation for this class was generated from the following files: