MollerPrimaryGeneratorMessenger Class Reference

#include <MollerPrimaryGeneratorMessenger.hh>

Collaboration diagram for MollerPrimaryGeneratorMessenger:
Collaboration graph
[legend]

Public Member Functions

 MollerPrimaryGeneratorMessenger (MollerPrimaryGenAction *)
virtual ~MollerPrimaryGeneratorMessenger ()
void SetNewValue (G4UIcommand *, G4String)
G4String GetCurrentValue (G4UIcommand *command)

Private Attributes

MollerPrimaryGenActionMollerAction
G4UIdirectory * gunDir
G4UIcmdWithAnInteger * GenCmd
G4UIcmdWithABool * seedCmd

Detailed Description

Definition at line 16 of file MollerPrimaryGeneratorMessenger.hh.


Constructor & Destructor Documentation

MollerPrimaryGeneratorMessenger::MollerPrimaryGeneratorMessenger ( MollerPrimaryGenAction MollerGun  ) 

Definition at line 12 of file MollerPrimaryGeneratorMessenger.cc.

References GenCmd, gunDir, and seedCmd.

00014 :MollerAction(MollerGun)
00015 {
00016   gunDir = new G4UIdirectory("/moller/gun/");
00017   gunDir->SetGuidance("PrimaryGenerator control");
00018 
00019   GenCmd = new G4UIcmdWithAnInteger("/moller/gun/gen",this);
00020   GenCmd->SetGuidance("Choose which generator to use.");
00021   GenCmd->SetGuidance("  Choice : 0. Moller electrons (Dustin) [default]");
00022   GenCmd->SetGuidance("           1. Elastic ep electrons (Dustin)");
00023   GenCmd->SetGuidance("           2. Inelastic ep electrons (Dustin)");
00024   GenCmd->SetGuidance("           3. Optics rays electrons (Moller scattering)");
00025   GenCmd->SetGuidance("           4. Optics rays electrons (Mott scattering)");
00026   GenCmd->SetParameterName("gen",true);
00027   GenCmd->SetDefaultValue(0);
00028   GenCmd->SetRange("gen>=0 && gen<=4");
00029   GenCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
00030 
00031   seedCmd = new G4UIcmdWithABool("/moller/gun/setConstSeed",this);
00032   seedCmd->SetGuidance("Set whether to set the random seed to a constant.");
00033   seedCmd->SetParameterName("fSetSeedConst",true);
00034   seedCmd->SetDefaultValue(false);
00035   //  seedCmd->AvailableForStates(G4State_PreInit);
00036 
00037 }

MollerPrimaryGeneratorMessenger::~MollerPrimaryGeneratorMessenger (  )  [virtual]

Definition at line 41 of file MollerPrimaryGeneratorMessenger.cc.

References GenCmd, gunDir, and seedCmd.

00042 {
00043   delete GenCmd;
00044   delete seedCmd;
00045   delete gunDir;
00046 }


Member Function Documentation

G4String MollerPrimaryGeneratorMessenger::GetCurrentValue ( G4UIcommand *  command  ) 

Definition at line 59 of file MollerPrimaryGeneratorMessenger.cc.

References GenCmd, MollerPrimaryGenAction::GetGenerator(), and MollerAction.

00060 {
00061   G4String cv;
00062   
00063   if( command==GenCmd )
00064     { cv = GenCmd->ConvertToString(MollerAction->GetGenerator()); }
00065   
00066   return cv;
00067 }

Here is the call graph for this function:

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

Definition at line 50 of file MollerPrimaryGeneratorMessenger.cc.

References GenCmd, MollerAction, seedCmd, MollerPrimaryGenAction::SetGenerator(), and MollerPrimaryGenAction::setSeedValue().

00052 { 
00053   if( command == GenCmd )
00054     { MollerAction->SetGenerator(GenCmd->GetNewIntValue(newValue));}
00055   else if( command == seedCmd )
00056     { MollerAction->setSeedValue(seedCmd->GetNewBoolValue(newValue));}
00057 }

Here is the call graph for this function:


Field Documentation

G4UIcmdWithAnInteger* MollerPrimaryGeneratorMessenger::GenCmd [private]
G4UIdirectory* MollerPrimaryGeneratorMessenger::gunDir [private]

Definition at line 26 of file MollerPrimaryGeneratorMessenger.hh.

Referenced by GetCurrentValue(), and SetNewValue().

G4UIcmdWithABool* MollerPrimaryGeneratorMessenger::seedCmd [private]

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

Generated on 16 Jun 2013 for mollersim by  doxygen 1.6.1