Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
exGPSHistoMessenger Class Reference

#include <exGPSHistoMessenger.hh>

Inheritance diagram for exGPSHistoMessenger:
G4UImessenger

Public Member Functions

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

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
 

Detailed Description

Definition at line 47 of file exGPSHistoMessenger.hh.

Constructor & Destructor Documentation

exGPSHistoMessenger::exGPSHistoMessenger ( exGPSHistoManager histoManager)

Definition at line 44 of file exGPSHistoMessenger.cc.

45  :G4UImessenger(),
46  fExGPSHisto(histoManager),
47  fFileNameCmd(0),
48  fMaxEngCmd(0),
49  fMinEngCmd(0),
50  fMaxPosCmd(0),
51  fMinPosCmd(0)
52 
53 {
54  fExGPSHistoDir = new G4UIdirectory("/analysis/");
55  fExGPSHistoDir->SetGuidance("exGPS analysis control.");
56 
57  fFileNameCmd = new G4UIcmdWithAString("/analysis/filename",this);
58  fFileNameCmd->SetGuidance("Input the name for the ROOT output file.");
59  fFileNameCmd->SetParameterName("filename",true,true);
60  fFileNameCmd->SetDefaultValue("exgps");
61 
62 
63  fMaxEngCmd = new G4UIcmdWithADoubleAndUnit("/analysis/maxeng",this);
64  fMaxEngCmd->SetGuidance("Sets the maximum energy of histo");
65  fMaxEngCmd->SetParameterName("maxeng",true,true);
66  fMaxEngCmd->SetDefaultUnit("keV");
67  fMaxEngCmd->SetUnitCandidates("eV keV MeV GeV TeV PeV");
68 
69  fMinEngCmd = new G4UIcmdWithADoubleAndUnit("/analysis/mineng",this);
70  fMinEngCmd->SetGuidance("Sets the minimum energy of histo");
71  fMinEngCmd->SetParameterName("mineng",true,true);
72  fMinEngCmd->SetDefaultUnit("keV");
73  fMinEngCmd->SetUnitCandidates("eV keV MeV GeV TeV PeV");
74 
75  fMaxPosCmd = new G4UIcmdWithADoubleAndUnit("/analysis/maxpos",this);
76  fMaxPosCmd->SetGuidance("Set max length of source position");
77  fMaxPosCmd->SetParameterName("maxpos",true,true);
78  fMaxPosCmd->SetDefaultUnit("cm");
79  fMaxPosCmd->SetUnitCandidates("micron mm cm m km");
80 
81  fMinPosCmd = new G4UIcmdWithADoubleAndUnit("/analysis/minpos",this);
82  fMinPosCmd->SetGuidance("Set min length of source position");
83  fMinPosCmd->SetParameterName("minpos",true,true);
84  fMinPosCmd->SetDefaultUnit("cm");
85  fMinPosCmd->SetUnitCandidates("micron mm cm m km");
86 
87 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetDefaultValue(const char *defVal)
void SetDefaultUnit(const char *defUnit)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetUnitCandidates(const char *candidateList)
exGPSHistoMessenger::~exGPSHistoMessenger ( )
virtual

Definition at line 91 of file exGPSHistoMessenger.cc.

92 {
93  delete fFileNameCmd;
94  delete fMaxEngCmd;
95  delete fMinEngCmd;
96  delete fMaxPosCmd;
97  delete fMinPosCmd;
98 }

Member Function Documentation

void exGPSHistoMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 102 of file exGPSHistoMessenger.cc.

References G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), exGPSHistoManager::SetEMax(), exGPSHistoManager::SetEMin(), exGPSHistoManager::SetFileName(), exGPSHistoManager::SetPosMax(), and exGPSHistoManager::SetPosMin().

104 {
105 
106  // 1D Histograms
107 
108  if( command == fFileNameCmd )
109  {
110  fExGPSHisto->SetFileName(newValue);
111  }
112  else if( command == fMaxPosCmd)
113  {
114  fExGPSHisto->SetPosMax(fMaxPosCmd->GetNewDoubleValue(newValue));
115  }
116  else if( command == fMinPosCmd)
117  {
118  fExGPSHisto->SetPosMin(fMinPosCmd->GetNewDoubleValue(newValue));
119  }
120  else if( command == fMaxEngCmd)
121  {
122  fExGPSHisto->SetEMax(fMaxEngCmd->GetNewDoubleValue(newValue));
123  }
124  else if( command == fMinEngCmd)
125  {
126  fExGPSHisto->SetEMin(fMinEngCmd->GetNewDoubleValue(newValue));
127  }
128 }
static G4double GetNewDoubleValue(const char *paramString)
void SetFileName(G4String name)
void SetEMax(G4double emax)
void SetPosMin(G4double posmin)
void SetPosMax(G4double posmax)
void SetEMin(G4double emin)

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