Geant4  10.02.p03
RE01PrimaryGeneratorMessenger Class Reference

#include <RE01PrimaryGeneratorMessenger.hh>

Inheritance diagram for RE01PrimaryGeneratorMessenger:
Collaboration diagram for RE01PrimaryGeneratorMessenger:

Public Member Functions

 RE01PrimaryGeneratorMessenger (RE01PrimaryGeneratorAction *mpga)
 
virtual ~RE01PrimaryGeneratorMessenger ()
 
virtual void SetNewValue (G4UIcommand *command, G4String newValues)
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Private Attributes

RE01PrimaryGeneratorActionfMyAction
 
G4UIdirectoryfMydetDirectory
 
G4UIcmdWithAStringfGenCmd
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 42 of file RE01PrimaryGeneratorMessenger.hh.

Constructor & Destructor Documentation

◆ RE01PrimaryGeneratorMessenger()

RE01PrimaryGeneratorMessenger::RE01PrimaryGeneratorMessenger ( RE01PrimaryGeneratorAction mpga)

Definition at line 40 of file RE01PrimaryGeneratorMessenger.cc.

41  :G4UImessenger(),fMyAction(mpga),
43 {
44  fMydetDirectory = new G4UIdirectory("/mydet/");
45  fMydetDirectory->SetGuidance("RE01 detector control commands.");
46 
47  fGenCmd = new G4UIcmdWithAString("/mydet/generator",this);
48  fGenCmd->SetGuidance("Select primary generator.");
49  fGenCmd->SetGuidance(" Available generators : PYTHIA, particleGun");
50  fGenCmd->SetParameterName("generator",true);
51  fGenCmd->SetDefaultValue("PYTHIA");
52  fGenCmd->SetCandidates("PYTHIA particleGun");
53 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
RE01PrimaryGeneratorAction * fMyAction
void SetDefaultValue(const char *defVal)
void SetCandidates(const char *candidateList)

◆ ~RE01PrimaryGeneratorMessenger()

RE01PrimaryGeneratorMessenger::~RE01PrimaryGeneratorMessenger ( )
virtual

Definition at line 56 of file RE01PrimaryGeneratorMessenger.cc.

57 {
58  delete fGenCmd;
59  delete fMydetDirectory;
60 }
Here is the call graph for this function:

Member Function Documentation

◆ GetCurrentValue()

G4String RE01PrimaryGeneratorMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 71 of file RE01PrimaryGeneratorMessenger.cc.

72 {
73  G4String cv;
74 
75  if( command==fGenCmd )
76  {
78  { cv = "PYTHIA"; }
79  else
80  { cv = "particleGun"; }
81  }
82 
83  return cv;
84 }
RE01PrimaryGeneratorAction * fMyAction
Here is the call graph for this function:

◆ SetNewValue()

void RE01PrimaryGeneratorMessenger::SetNewValue ( G4UIcommand command,
G4String  newValues 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 64 of file RE01PrimaryGeneratorMessenger.cc.

65 {
66  if( command==fGenCmd )
67  { fMyAction->SetHEPEvtGenerator(newValue=="PYTHIA"); }
68 }
RE01PrimaryGeneratorAction * fMyAction
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fGenCmd

G4UIcmdWithAString* RE01PrimaryGeneratorMessenger::fGenCmd
private

Definition at line 57 of file RE01PrimaryGeneratorMessenger.hh.

◆ fMyAction

RE01PrimaryGeneratorAction* RE01PrimaryGeneratorMessenger::fMyAction
private

Definition at line 53 of file RE01PrimaryGeneratorMessenger.hh.

◆ fMydetDirectory

G4UIdirectory* RE01PrimaryGeneratorMessenger::fMydetDirectory
private

Definition at line 56 of file RE01PrimaryGeneratorMessenger.hh.


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