Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PolarizationMessenger Class Reference

#include <G4PolarizationMessenger.hh>

+ Inheritance diagram for G4PolarizationMessenger:

Public Member Functions

 G4PolarizationMessenger (G4PolarizationManager *runMgr)
 
 ~G4PolarizationMessenger () override
 
void SetNewValue (G4UIcommand *command, G4String newValues) override
 
G4String GetCurrentValue (G4UIcommand *command) override
 
G4PolarizationMessengeroperator= (const G4PolarizationMessenger &right)=delete
 
 G4PolarizationMessenger (const G4PolarizationMessenger &)=delete
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
G4bool CommandsShouldBeInMaster () const
 

Public Attributes

G4PolarizationManagerpolarizationManager
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String LtoS (G4long l)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (const G4String &s)
 
G4long StoL (const G4String &s)
 
G4double StoD (const 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 = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 

Detailed Description

Definition at line 52 of file G4PolarizationMessenger.hh.

Constructor & Destructor Documentation

◆ G4PolarizationMessenger() [1/2]

G4PolarizationMessenger::G4PolarizationMessenger ( G4PolarizationManager * runMgr)
explicit

Definition at line 48 of file G4PolarizationMessenger.cc.

49 : polarizationManager(polMgr)
50{
51 polarizationDirectory = new G4UIdirectory("/polarization/");
52 polarizationDirectory->SetGuidance("polarization control commands.");
53
54 managerDirectory = new G4UIdirectory("/polarization/manager/");
55 managerDirectory->SetGuidance("general polarization information.");
56
57 verboseCmd = new G4UIcmdWithAnInteger("/polarization/manager/verbose", this);
58 verboseCmd->SetGuidance("Set the Verbose level of G4PolarizationManager.");
59 verboseCmd->SetGuidance(" 0 : Silent (default)");
60 verboseCmd->SetGuidance(" 1 : Verbose");
61 verboseCmd->SetParameterName("level", true);
62 verboseCmd->SetDefaultValue(0);
63 verboseCmd->SetRange("level >=0 && level <=1");
64
65 optActivateCmd = new G4UIcmdWithABool("/polarization/manager/activate", this);
66 optActivateCmd->SetGuidance("activate/deactivate polarization treatment");
67 optActivateCmd->SetParameterName("flag", true);
68 optActivateCmd->SetDefaultValue(true);
69
70 volumeDirectory = new G4UIdirectory("/polarization/volume/");
71 volumeDirectory->SetGuidance(
72 "Status control commands of registered polarized logical volumes.");
73
74 printVolumeListCmd =
75 new G4UIcmdWithoutParameter("/polarization/volume/list", this);
76 printVolumeListCmd->SetGuidance(
77 "print list of registered polarized logical volumes");
80
81 setPolarizationCmd = new G4UIcommand("/polarization/volume/set", this);
82 setPolarizationCmd->SetGuidance(
83 "set or change polarization of a logical volume");
86
87 G4UIparameter* param;
88 param = new G4UIparameter("logicalVolumeName", 's', false);
89 param->SetDefaultValue("worldVolume");
90 setPolarizationCmd->SetParameter(param);
91 param = new G4UIparameter("px", 'd', true);
92 param->SetDefaultValue("0.0");
93 setPolarizationCmd->SetParameter(param);
94 param = new G4UIparameter("py", 'd', true);
95 param->SetDefaultValue("0.0");
96 setPolarizationCmd->SetParameter(param);
97 param = new G4UIparameter("pz", 'd', true);
98 param->SetDefaultValue("0.0");
99 setPolarizationCmd->SetParameter(param);
100
101 testDirectory = new G4UIdirectory("/polarization/test/");
102 testDirectory->SetGuidance("provides access to some internal test routines.");
103
104 testPolarizationTransformationCmd = new G4UIcmdWithoutParameter(
105 "/polarization/test/polarizationTransformation", this);
106 testPolarizationTransformationCmd->SetGuidance(
107 "checks definition of particle reference frame and corresponding "
108 "translation routines");
109 testPolarizationTransformationCmd->AvailableForStates(
111
112 testInteractionFrameCmd =
113 new G4UIcmdWithoutParameter("/polarization/test/interactionFrame", this);
114 testInteractionFrameCmd->SetGuidance(
115 "checks definition of interaction frame");
116 testInteractionFrameCmd->AvailableForStates(G4State_PreInit, G4State_Idle,
118}
@ G4State_Idle
@ G4State_GeomClosed
@ G4State_PreInit
G4PolarizationManager * polarizationManager
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4int defVal)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
void SetRange(const char *rs)
void AvailableForStates(G4ApplicationState s1)
void SetDefaultValue(const char *theDefaultValue)

◆ ~G4PolarizationMessenger()

G4PolarizationMessenger::~G4PolarizationMessenger ( )
override

Definition at line 120 of file G4PolarizationMessenger.cc.

121{
122 delete verboseCmd;
123 delete testInteractionFrameCmd;
124 delete testPolarizationTransformationCmd;
125 delete testDirectory;
126 delete setPolarizationCmd;
127 delete printVolumeListCmd;
128 delete volumeDirectory;
129 delete optActivateCmd;
130 delete managerDirectory;
131 delete polarizationDirectory;
132}

◆ G4PolarizationMessenger() [2/2]

G4PolarizationMessenger::G4PolarizationMessenger ( const G4PolarizationMessenger & )
delete

Member Function Documentation

◆ GetCurrentValue()

G4String G4PolarizationMessenger::GetCurrentValue ( G4UIcommand * command)
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 181 of file G4PolarizationMessenger.cc.

182{
183 G4String cv;
184 if(command == verboseCmd)
185 {
187 }
188
189 return cv;
190}
static G4String ConvertToString(G4bool boolVal)

◆ operator=()

G4PolarizationMessenger & G4PolarizationMessenger::operator= ( const G4PolarizationMessenger & right)
delete

◆ SetNewValue()

void G4PolarizationMessenger::SetNewValue ( G4UIcommand * command,
G4String newValues )
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 134 of file G4PolarizationMessenger.cc.

136{
137 if(command == verboseCmd)
138 {
139 polarizationManager->SetVerbose(verboseCmd->GetNewIntValue(newValue));
140 }
141 else if(command == optActivateCmd)
142 {
144 optActivateCmd->GetNewBoolValue(newValue));
145 }
146 else if(command == printVolumeListCmd)
147 {
149 }
150 else if(command == setPolarizationCmd)
151 {
152 G4Tokenizer next(newValue);
153 G4String volumeName = next();
154 G4double px = 0., py = 0., pz = 0.;
155 G4String dvalue = next();
156 if(!dvalue.empty())
157 {
158 px = StoD(dvalue);
159 dvalue = next();
160 if(!dvalue.empty())
161 {
162 py = StoD(dvalue);
163 dvalue = next();
164 if(!dvalue.empty())
165 pz = StoD(dvalue);
166 }
167 }
168 G4ThreeVector pol(px, py, pz);
170 }
171 else if(command == testPolarizationTransformationCmd)
172 {
174 }
175 else if(command == testInteractionFrameCmd)
176 {
178 }
179}
double G4double
Definition G4Types.hh:83
static void TestPolarizationTransformations()
void SetVolumePolarization(G4LogicalVolume *lVol, const G4ThreeVector &pol)
static G4bool GetNewBoolValue(const char *paramString)
static G4int GetNewIntValue(const char *paramString)
G4double StoD(const G4String &s)

Member Data Documentation

◆ polarizationManager

G4PolarizationManager* G4PolarizationMessenger::polarizationManager

Definition at line 61 of file G4PolarizationMessenger.hh.

Referenced by GetCurrentValue(), and SetNewValue().


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