DetectorMessenger Class Reference

#include <DetectorMessenger.hh>

List of all members.

Public Member Functions

 DetectorMessenger (DetectorConstruction *)
 ~DetectorMessenger ()
void SetNewValue (G4UIcommand *, G4String)

Private Attributes

DetectorConstructionDetector
G4UIdirectory * g4simDir
G4UIdirectory * detDir
G4UIcmdWithAString * ResetMagCmd
G4UIcmdWithAString * ReloadGeoCmd
G4UIcmdWithoutParameter * UpdateCmd

Detailed Description

Definition at line 19 of file DetectorMessenger.hh.


Constructor & Destructor Documentation

DetectorMessenger::DetectorMessenger ( DetectorConstruction Det  ) 

Definition at line 15 of file DetectorMessenger.cc.

References detDir, g4simDir, ReloadGeoCmd, ResetMagCmd, and UpdateCmd.

00017 :Detector(Det)
00018 { 
00019   g4simDir = new G4UIdirectory("/g4sim/");
00020   g4simDir->SetGuidance("UI commands of this example");
00021   
00022   detDir = new G4UIdirectory("/g4sim/det/");
00023   detDir->SetGuidance("detector control");
00024 
00025   ResetMagCmd = new G4UIcmdWithAString("/g4sim/det/ResetMag",this);
00026   ResetMagCmd->SetGuidance("Reset magnetic field according to given file.");
00027   ResetMagCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
00028 
00029   ReloadGeoCmd = new G4UIcmdWithAString("/g4sim/det/ReloadGeo",this);
00030   ReloadGeoCmd->SetGuidance("Reload geometry according to given file.");
00031   ReloadGeoCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
00032        
00033   UpdateCmd = new G4UIcmdWithoutParameter("/g4sim/det/update",this);
00034   UpdateCmd->SetGuidance("Update calorimeter geometry.");
00035   UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
00036   UpdateCmd->SetGuidance("if you changed geometrical value(s).");
00037   UpdateCmd->AvailableForStates(G4State_Idle);
00038 }

DetectorMessenger::~DetectorMessenger (  ) 

Definition at line 40 of file DetectorMessenger.cc.

References detDir, g4simDir, ReloadGeoCmd, ResetMagCmd, and UpdateCmd.

00041 {
00042   delete g4simDir;
00043   delete detDir;
00044   delete ResetMagCmd;
00045   delete ReloadGeoCmd;
00046   delete UpdateCmd;
00047 }


Member Function Documentation

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

Definition at line 49 of file DetectorMessenger.cc.

References Detector, DetectorConstruction::ReloadGeo(), ReloadGeoCmd, DetectorConstruction::ResetMag(), ResetMagCmd, UpdateCmd, and DetectorConstruction::UpdateGeometry().

00050 { 
00051   if( command == UpdateCmd ) { Detector->UpdateGeometry(); }
00052   if( command == ResetMagCmd ) { Detector->ResetMag(newValue); }
00053   if( command == ReloadGeoCmd ) { Detector->ReloadGeo(newValue); }
00054 }


Member Data Documentation

G4UIdirectory* DetectorMessenger::detDir [private]

Definition at line 31 of file DetectorMessenger.hh.

Referenced by DetectorMessenger(), and ~DetectorMessenger().

Definition at line 28 of file DetectorMessenger.hh.

Referenced by SetNewValue().

G4UIdirectory* DetectorMessenger::g4simDir [private]

Definition at line 30 of file DetectorMessenger.hh.

Referenced by DetectorMessenger(), and ~DetectorMessenger().

G4UIcmdWithAString* DetectorMessenger::ReloadGeoCmd [private]

Definition at line 33 of file DetectorMessenger.hh.

Referenced by DetectorMessenger(), SetNewValue(), and ~DetectorMessenger().

G4UIcmdWithAString* DetectorMessenger::ResetMagCmd [private]

Definition at line 32 of file DetectorMessenger.hh.

Referenced by DetectorMessenger(), SetNewValue(), and ~DetectorMessenger().

G4UIcmdWithoutParameter* DetectorMessenger::UpdateCmd [private]

Definition at line 34 of file DetectorMessenger.hh.

Referenced by DetectorMessenger(), SetNewValue(), and ~DetectorMessenger().


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

Generated on 15 Jun 2016 for g4sim by  doxygen 1.6.1