Geant4 9.6.0
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 ()
 
void SetNewValue (G4UIcommand *command, G4String newValues)
 
G4String GetCurrentValue (G4UIcommand *command)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
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)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 

Detailed Description

Definition at line 61 of file G4PolarizationMessenger.hh.

Constructor & Destructor Documentation

◆ G4PolarizationMessenger()

G4PolarizationMessenger::G4PolarizationMessenger ( G4PolarizationManager runMgr)

Definition at line 57 of file G4PolarizationMessenger.cc.

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

◆ ~G4PolarizationMessenger()

G4PolarizationMessenger::~G4PolarizationMessenger ( )

Definition at line 118 of file G4PolarizationMessenger.cc.

119{
120 delete verboseCmd;
121}

Member Function Documentation

◆ GetCurrentValue()

G4String G4PolarizationMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 159 of file G4PolarizationMessenger.cc.

160{
161 G4String cv;
162 if( command==verboseCmd )
163 { cv = verboseCmd->ConvertToString(polarizationManager->GetVerbose()); }
164
165 return cv;
166}
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:349

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 123 of file G4PolarizationMessenger.cc.

124{
125 if( command==verboseCmd ) {
126 polarizationManager->SetVerbose(verboseCmd->GetNewIntValue(newValue));
127 }
128 else if ( command==optActivateCmd ) {
129 polarizationManager->SetActivated(optActivateCmd->GetNewBoolValue(newValue));
130 }
131 else if ( command==printVolumeListCmd ) {
132 polarizationManager->ListVolumes();
133 }
134 else if ( command==setPolarizationCmd ) {
135 G4Tokenizer next( newValue );
136 G4String volumeName=next();
137 G4double px=0.,py=0.,pz=0.;
138 G4String dvalue=next();
139 if (!dvalue.isNull()) {
140 px=StoD(dvalue);
141 dvalue=next();
142 if (!dvalue.isNull()) {
143 py=StoD(dvalue);
144 dvalue=next();
145 if (!dvalue.isNull()) pz=StoD(dvalue);
146 }
147 }
148 G4ThreeVector pol(px,py,pz);
149 polarizationManager->SetVolumePolarization(volumeName,pol);
150 }
151 else if ( command==testPolarizationTransformationCmd ) {
153 }
154 else if (command==testInteractionFrameCmd ) {
156 }
157}
double G4double
Definition: G4Types.hh:64
static void TestPolarizationTransformations()
static void TestInteractionFrame()
void SetVolumePolarization(G4LogicalVolume *lVol, const G4ThreeVector &pol)
G4bool isNull() const
static G4bool GetNewBoolValue(const char *paramString)
static G4int GetNewIntValue(const char *paramString)
G4double StoD(G4String s)

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