Geant4  10.02.p03
G4MonopolePhysicsMessenger Class Reference

#include <G4MonopolePhysicsMessenger.hh>

Inheritance diagram for G4MonopolePhysicsMessenger:
Collaboration diagram for G4MonopolePhysicsMessenger:

Public Member Functions

 G4MonopolePhysicsMessenger (G4MonopolePhysics *)
 
 ~G4MonopolePhysicsMessenger ()
 
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
 
G4bool CommandsShouldBeInMaster () const
 

Private Attributes

G4MonopolePhysicsfPhys
 
G4UIdirectoryfPhysicsDir
 
G4UIcommandfPhysicsCmd
 
G4UIcmdWithADoublefMCmd
 
G4UIcmdWithADoublefZCmd
 
G4UIcmdWithADoubleAndUnitfMassCmd
 

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 48 of file G4MonopolePhysicsMessenger.hh.

Constructor & Destructor Documentation

◆ G4MonopolePhysicsMessenger()

G4MonopolePhysicsMessenger::G4MonopolePhysicsMessenger ( G4MonopolePhysics p)

Definition at line 48 of file G4MonopolePhysicsMessenger.cc.

49  : G4UImessenger(),
50  fPhys(p),
51  fPhysicsDir(0),
52  fPhysicsCmd(0),
53  fMCmd(0),
54  fZCmd(0),
55  fMassCmd(0)
56 {
57  fPhysicsDir = new G4UIdirectory("/monopole/");
58  fPhysicsDir->SetGuidance("histograms control");
59 
60  fPhysicsCmd = new G4UIcommand("/monopole/setup",this);
61  fPhysicsCmd->SetGuidance("Setup monopole");
62  //
63  G4UIparameter* qmag = new G4UIparameter("qmag",'d',false);
64  qmag->SetGuidance("Magnetic charge");
65  qmag->SetDefaultValue("1");
67 
68  G4UIparameter* q = new G4UIparameter("qelec",'d',false);
69  q->SetGuidance("Electric charge charge");
70  q->SetDefaultValue("0");
72  //
73  G4UIparameter* mass = new G4UIparameter("mass",'d',false);
74  mass->SetGuidance("mass");
75  mass->SetParameterRange("mass>0.");
76  qmag->SetDefaultValue("100");
78  //
79  G4UIparameter* unit = new G4UIparameter("unit",'s',false);
81  qmag->SetDefaultValue("GeV");
83 
84  fMCmd = new G4UIcmdWithADouble("/monopole/magCharge",this);
85  fMCmd->SetGuidance("Set monopole magnetic charge number");
86  fMCmd->SetParameterName("Qmag",false);
88 
89  fZCmd = new G4UIcmdWithADouble("/monopole/elCharge",this);
90  fZCmd->SetGuidance("Set monopole electric charge number");
91  fZCmd->SetParameterName("Qel",false);
93 
94  fMassCmd = new G4UIcmdWithADoubleAndUnit("/monopole/Mass",this);
95  fMassCmd->SetGuidance("Set monopole fMass");
96  fMassCmd->SetParameterName("Mass",false);
97  fMassCmd->SetRange("Mass>0.");
98  fMassCmd->SetUnitCategory("Energy");
100 
101 }
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
void SetParameterRange(const char *theRange)
void SetDefaultValue(const char *theDefaultValue)
void SetUnitCategory(const char *unitCategory)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *theGuidance)
G4UIcmdWithADoubleAndUnit * fMassCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
Here is the call graph for this function:

◆ ~G4MonopolePhysicsMessenger()

G4MonopolePhysicsMessenger::~G4MonopolePhysicsMessenger ( )

Definition at line 105 of file G4MonopolePhysicsMessenger.cc.

106 {
107  delete fPhysicsCmd;
108  delete fMCmd;
109  delete fZCmd;
110  delete fMassCmd;
111  delete fPhysicsDir;
112 }
G4UIcmdWithADoubleAndUnit * fMassCmd

Member Function Documentation

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 116 of file G4MonopolePhysicsMessenger.cc.

118 {
119  if (command == fPhysicsCmd)
120  { G4double q, m; G4double mass;
121  G4String unts;
122  std::istringstream is(newValue);
123  is >> m >> q >> mass >> unts;
124  G4String unit = unts;
125  G4double vUnit = G4UIcommand::ValueOf(unit);
128  fPhys->SetMonopoleMass(mass*vUnit);
129  }
130  if (command == fMCmd) {
132  }
133  if (command == fZCmd) {
135  }
136  if (command == fMassCmd) {
138  }
139 }
void SetElectricCharge(G4double)
void SetMonopoleMass(G4double)
void SetMagneticCharge(G4double)
static G4double GetNewDoubleValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
static G4double ValueOf(const char *unitName)
Definition: G4UIcommand.cc:308
static const double m
Definition: G4SIunits.hh:128
double G4double
Definition: G4Types.hh:76
G4UIcmdWithADoubleAndUnit * fMassCmd
Here is the call graph for this function:

Member Data Documentation

◆ fMassCmd

G4UIcmdWithADoubleAndUnit* G4MonopolePhysicsMessenger::fMassCmd
private

Definition at line 65 of file G4MonopolePhysicsMessenger.hh.

◆ fMCmd

G4UIcmdWithADouble* G4MonopolePhysicsMessenger::fMCmd
private

Definition at line 63 of file G4MonopolePhysicsMessenger.hh.

◆ fPhys

G4MonopolePhysics* G4MonopolePhysicsMessenger::fPhys
private

Definition at line 59 of file G4MonopolePhysicsMessenger.hh.

◆ fPhysicsCmd

G4UIcommand* G4MonopolePhysicsMessenger::fPhysicsCmd
private

Definition at line 62 of file G4MonopolePhysicsMessenger.hh.

◆ fPhysicsDir

G4UIdirectory* G4MonopolePhysicsMessenger::fPhysicsDir
private

Definition at line 61 of file G4MonopolePhysicsMessenger.hh.

◆ fZCmd

G4UIcmdWithADouble* G4MonopolePhysicsMessenger::fZCmd
private

Definition at line 64 of file G4MonopolePhysicsMessenger.hh.


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