Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
 

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 ( 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");
66  fPhysicsCmd->SetParameter(qmag);
67 
68  G4UIparameter* q = new G4UIparameter("qelec",'d',false);
69  q->SetGuidance("Electric charge charge");
70  q->SetDefaultValue("0");
71  fPhysicsCmd->SetParameter(q);
72  //
73  G4UIparameter* mass = new G4UIparameter("mass",'d',false);
74  mass->SetGuidance("mass");
75  mass->SetParameterRange("mass>0.");
76  qmag->SetDefaultValue("100");
77  fPhysicsCmd->SetParameter(mass);
78  //
79  G4UIparameter* unit = new G4UIparameter("unit",'s',false);
80  fPhysicsCmd->SetParameter(unit);
81  qmag->SetDefaultValue("GeV");
82  fPhysicsCmd->AvailableForStates(G4State_PreInit);
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:240
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *theGuidance)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)

Here is the call graph for this function:

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 }

Member Function Documentation

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);
126  fPhys->SetMagneticCharge(m);
127  fPhys->SetElectricCharge(q);
128  fPhys->SetMonopoleMass(mass*vUnit);
129  }
130  if (command == fMCmd) {
131  fPhys->SetMagneticCharge(fMCmd->GetNewDoubleValue(newValue));
132  }
133  if (command == fZCmd) {
134  fPhys->SetElectricCharge(fZCmd->GetNewDoubleValue(newValue));
135  }
136  if (command == fMassCmd) {
137  fPhys->SetMonopoleMass(fMassCmd->GetNewDoubleValue(newValue));
138  }
139 }
void SetElectricCharge(G4double)
void SetMonopoleMass(G4double)
void SetMagneticCharge(G4double)
static G4double GetNewDoubleValue(const char *paramString)
static constexpr double m
Definition: G4SIunits.hh:129
static G4double GetNewDoubleValue(const char *paramString)
static G4double ValueOf(const char *unitName)
Definition: G4UIcommand.cc:309
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:


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