QwGeant4
QweakSimGeometryMessenger Class Reference

Scans the input file for /GDML/ commands. More...

#include <QweakSimGeometryMessenger.hh>

Inherits G4UImessenger.

+ Collaboration diagram for QweakSimGeometryMessenger:

Public Member Functions

 QweakSimGeometryMessenger (QweakSimGeometry *)
 
 ~QweakSimGeometryMessenger ()
 
void SetNewValue (G4UIcommand *, G4String)
 
void SetNewValue (G4UIcommand *, G4int)
 

Private Attributes

QweakSimGeometrytheGeometry
 
G4UIdirectory * theGeometryDir
 
G4UIcmdWithAString * theReadCommand
 
G4UIcmdWithAString * theWriteCommand
 
G4UIcmdWithAnInteger * theDepthCommand
 
G4UIcmdWithABool * theModuleCommand
 

Detailed Description

Scans the input file for /GDML/ commands.

Placeholder for a long explaination

Definition at line 45 of file QweakSimGeometryMessenger.hh.

Constructor & Destructor Documentation

QweakSimGeometryMessenger::QweakSimGeometryMessenger ( QweakSimGeometry aGeometry)

Definition at line 27 of file QweakSimGeometryMessenger.cc.

References theDepthCommand, theGeometryDir, theModuleCommand, theReadCommand, and theWriteCommand.

28  : theGeometry(aGeometry)
29 {
30  G4cout << G4endl << "###### Calling QweakSimGeometryMessenger::QweakSimGeometryMessenger() " << G4endl << G4endl;
31 
32  theGeometryDir = new G4UIdirectory( "/GDML/" );
33  theGeometryDir->SetGuidance("GDML geometry control.");
34 
35  theReadCommand = new G4UIcmdWithAString("/GDML/Read", this);
36  theReadCommand->SetGuidance("Read geometry from GDML file with given name");
37  theReadCommand->SetParameterName("FileRead", false);
38  theReadCommand->SetDefaultValue("GMDL/qweak.gdml");
39  theReadCommand->AvailableForStates(G4State_PreInit);
40 
41  theWriteCommand = new G4UIcmdWithAString("/GDML/Write", this);
42  theWriteCommand->SetGuidance("Write geometry to GDML file with given name");
43  theWriteCommand->SetParameterName("FileWrite", false);
44  theWriteCommand->SetDefaultValue("GDML/qweak_out.gdml");
45  theWriteCommand->AvailableForStates(G4State_Idle);
46 
47  theDepthCommand = new G4UIcmdWithAnInteger("/GDML/WriteDepth", this);
48  theDepthCommand->SetGuidance("Split GDML output in automatic modules");
49  theDepthCommand->SetParameterName("WriteDepth", false);
50  theDepthCommand->SetDefaultValue(2);
51  theDepthCommand->AvailableForStates(G4State_Idle);
52 
53  theModuleCommand = new G4UIcmdWithABool("/GDML/WriteModule", this);
54  theModuleCommand->SetGuidance("Split GDML output in user modules");
55  theModuleCommand->SetParameterName("WriteModule", false);
56  theModuleCommand->SetDefaultValue(false);
57  theModuleCommand->AvailableForStates(G4State_Idle);
58 
59  G4cout << G4endl << "###### Leaving QweakSimGeometryMessenger::QweakSimGeometryMessenger() " << G4endl << G4endl;
60 }
G4UIcmdWithAnInteger * theDepthCommand
QweakSimGeometryMessenger::~QweakSimGeometryMessenger ( )

Definition at line 64 of file QweakSimGeometryMessenger.cc.

References theDepthCommand, theGeometryDir, theModuleCommand, theReadCommand, and theWriteCommand.

65 {
66  G4cout << G4endl << "###### Calling QweakSimGeometryMessenger::~QweakSimGeometryMessenger() " << G4endl << G4endl;
67 
68  if (theReadCommand) delete theReadCommand;
69  if (theWriteCommand) delete theWriteCommand;
70  if (theDepthCommand) delete theDepthCommand;
72  if (theGeometryDir) delete theGeometryDir;
73 
74  G4cout << G4endl << "###### Leaving QweakSimGeometryMessenger::~QweakSimGeometryMessenger() " << G4endl << G4endl;
75 }
G4UIcmdWithAnInteger * theDepthCommand

Member Function Documentation

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

Definition at line 79 of file QweakSimGeometryMessenger.cc.

References QweakSimGeometry::SetReadFile(), QweakSimGeometry::SetWriteFile(), QweakSimGeometry::SetWriteModuleDepth(), QweakSimGeometry::SetWriteModuleUser(), theDepthCommand, theGeometry, theModuleCommand, theReadCommand, theWriteCommand, and QweakSimGeometry::Write().

80 {
81  if (command == theReadCommand)
82  {
83  theGeometry->SetReadFile(newValue);
84 // theGeometry->Read();
85  }
86  if (command == theWriteCommand)
87  {
88  theGeometry->SetWriteFile(newValue);
89  theGeometry->Write();
90  }
91  if (command == theDepthCommand)
92  {
93  theGeometry->SetWriteModuleDepth(theDepthCommand->GetNewIntValue(newValue));
94  }
95  if (command == theModuleCommand)
96  {
97  theGeometry->SetWriteModuleUser(theModuleCommand->GetNewBoolValue(newValue));
98  }
99 }
void SetWriteModuleUser(const G4bool &flag)
void SetReadFile(const G4String &file)
void SetWriteFile(const G4String &file)
void SetWriteModuleDepth(const G4int &depth)
G4UIcmdWithAnInteger * theDepthCommand

+ Here is the call graph for this function:

void QweakSimGeometryMessenger::SetNewValue ( G4UIcommand *  ,
G4int   
)

Field Documentation

G4UIcmdWithAnInteger* QweakSimGeometryMessenger::theDepthCommand
private
QweakSimGeometry* QweakSimGeometryMessenger::theGeometry
private

Definition at line 58 of file QweakSimGeometryMessenger.hh.

Referenced by SetNewValue().

G4UIdirectory* QweakSimGeometryMessenger::theGeometryDir
private
G4UIcmdWithABool* QweakSimGeometryMessenger::theModuleCommand
private
G4UIcmdWithAString* QweakSimGeometryMessenger::theReadCommand
private
G4UIcmdWithAString* QweakSimGeometryMessenger::theWriteCommand
private

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