Geant4 examples
Public Member Functions | Private Attributes
ExG4DetectorConstruction02Messenger Class Reference

Messenger class that defines commands for ExG4DetectorConstruction02. More...

#include <Doxymodules_common.h>

Inheritance diagram for ExG4DetectorConstruction02Messenger:
G4UImessenger

List of all members.

Public Member Functions

 ExG4DetectorConstruction02Messenger (ExG4DetectorConstruction02 *)
virtual ~ExG4DetectorConstruction02Messenger ()
virtual void SetNewValue (G4UIcommand *command, G4String newValue)

Private Attributes

ExG4DetectorConstruction02fDetectorConstruction
G4UIdirectoryfTopDirectory
G4UIdirectoryfDirectory
G4UIcmdWithAStringfSetBoxMaterialCmd
G4UIcmdWithAStringfSetWorldMaterialCmd
G4UIcmdWith3VectorAndUnitfSetBoxDimensionsCmd
G4UIcmdWithADoublefSetWorldSizeFactorCmd

Detailed Description

Messenger class that defines commands for ExG4DetectorConstruction02.

It implements commands:

Definition at line 32 of file Doxymodules_common.h.


Constructor & Destructor Documentation

ExG4DetectorConstruction02Messenger::ExG4DetectorConstruction02Messenger ( ExG4DetectorConstruction02 detectorConstruction)

Definition at line 41 of file ExG4DetectorConstruction02Messenger.cc.

 : G4UImessenger(),
   fDetectorConstruction(detectorConstruction),
   fTopDirectory(0),
   fDirectory(0),
   fSetBoxMaterialCmd(0),
   fSetWorldMaterialCmd(0),
   fSetBoxDimensionsCmd(0),
   fSetWorldSizeFactorCmd(0)
   
{ 
  fTopDirectory = new G4UIdirectory("/ExG4/");
  fTopDirectory->SetGuidance("UI commands of common example classes");
  
  fDirectory = new G4UIdirectory("/ExG4/det/");
  fDirectory->SetGuidance("Detector control");
       
  fSetBoxMaterialCmd 
    = new G4UIcmdWithAString("/ExG4/det/setBoxMaterial",this);
  fSetBoxMaterialCmd->SetGuidance("Select material of the box.");
  fSetBoxMaterialCmd->SetParameterName("BoxMaterial", false);
  fSetBoxMaterialCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
       
  fSetWorldMaterialCmd 
    = new G4UIcmdWithAString("/ExG4/det/setWorldMaterial",this);
  fSetWorldMaterialCmd->SetGuidance("Select material of the world.");
  fSetWorldMaterialCmd->SetParameterName("WorldMaterial", false);
  fSetWorldMaterialCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
       
  fSetBoxDimensionsCmd 
    = new G4UIcmdWith3VectorAndUnit("/ExG4/det/setBoxDimensions",this);
  fSetBoxDimensionsCmd->SetGuidance("Set box dimensions (in half lentgh).");
  fSetBoxDimensionsCmd->SetParameterName(
                          "BoxDimensionsHx", "BoxDimensionsHy","BoxDimensionsHz", 
                          false);
  //fSetBoxDimensionsCmd->SetUnitCategory("Length");  
  fSetBoxDimensionsCmd->AvailableForStates(G4State_PreInit);

  fSetWorldSizeFactorCmd 
    = new G4UIcmdWithADouble("/ExG4/det/setWorldSizeFactor",this);
  fSetWorldSizeFactorCmd->SetGuidance(
    "Set the multiplication factor from box dimensions to world dimensions.");
  fSetWorldSizeFactorCmd->SetParameterName("WorldSizeFactor", false);
  fSetWorldSizeFactorCmd->SetRange("WorldSizeFactor >= 1");
  fSetWorldSizeFactorCmd->AvailableForStates(G4State_PreInit);
}
ExG4DetectorConstruction02Messenger::~ExG4DetectorConstruction02Messenger ( ) [virtual]

Member Function Documentation

void ExG4DetectorConstruction02Messenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
) [virtual]

Reimplemented from G4UImessenger.

Definition at line 103 of file ExG4DetectorConstruction02Messenger.cc.

{ 
  if( command == fSetBoxMaterialCmd ) { 
    fDetectorConstruction->SetBoxMaterial(newValue);
  }
  else if( command == fSetWorldMaterialCmd ) { 
    fDetectorConstruction->SetWorldMaterial(newValue);
  }
  else if( command == fSetBoxDimensionsCmd ) { 
    G4ThreeVector newDimensions 
      = fSetBoxDimensionsCmd->GetNew3VectorValue(newValue);
    fDetectorConstruction
      ->SetBoxDimensions(
          newDimensions.x(), newDimensions.y(), newDimensions.z());
  }
  else if ( command == fSetWorldSizeFactorCmd ) { 
    fDetectorConstruction
      ->SetWorldSizeFactor(fSetWorldSizeFactorCmd->GetNewDoubleValue(newValue));
  }
}

Member Data Documentation

Definition at line 62 of file ExG4DetectorConstruction02Messenger.hh.

Definition at line 63 of file ExG4DetectorConstruction02Messenger.hh.

Definition at line 64 of file ExG4DetectorConstruction02Messenger.hh.

Definition at line 65 of file ExG4DetectorConstruction02Messenger.hh.

Definition at line 66 of file ExG4DetectorConstruction02Messenger.hh.

Definition at line 67 of file ExG4DetectorConstruction02Messenger.hh.

Definition at line 68 of file ExG4DetectorConstruction02Messenger.hh.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines