Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4PolarizationMessenger Class Reference

#include <G4PolarizationMessenger.hh>

Inheritance diagram for G4PolarizationMessenger:
Collaboration diagram for G4PolarizationMessenger:

Public Member Functions

 G4PolarizationMessenger (G4PolarizationManager *runMgr)
 
 ~G4PolarizationMessenger ()
 
void SetNewValue (G4UIcommand *command, G4String newValues) override
 
G4String GetCurrentValue (G4UIcommand *command) override
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
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 61 of file G4PolarizationMessenger.hh.

Constructor & Destructor Documentation

G4PolarizationMessenger::G4PolarizationMessenger ( G4PolarizationManager runMgr)
explicit

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  volumeDirectory = new G4UIdirectory("/polarization/volume/");
80  volumeDirectory->SetGuidance("Status control commands of registered polarized logical volumes.");
81 
82  printVolumeListCmd = new G4UIcmdWithoutParameter("/polarization/volume/list",this);
83  printVolumeListCmd->SetGuidance("print list of registered polarized logical volumes");
85 
86  setPolarizationCmd = new G4UIcommand("/polarization/volume/set",this);
87  setPolarizationCmd->SetGuidance("set or change polarization of a logical volume");
88 // setPolarizationCmd->SetParameterName("polarization",true);
89 // setPolarizationCmd->SetDefaultValue("worldVolume 0. 0. 0.");
91 
92  G4UIparameter* param;
93  param = new G4UIparameter("logicalVolumeName",'s',false);
94  param->SetDefaultValue("worldVolume");
95  setPolarizationCmd->SetParameter(param);
96  param = new G4UIparameter("px",'d',true);
97  param->SetDefaultValue("0.0");
98  setPolarizationCmd->SetParameter(param);
99  param = new G4UIparameter("py",'d',true);
100  param->SetDefaultValue("0.0");
101  setPolarizationCmd->SetParameter(param);
102  param = new G4UIparameter("pz",'d',true);
103  param->SetDefaultValue("0.0");
104  setPolarizationCmd->SetParameter(param);
105 
106  testDirectory = new G4UIdirectory("/polarization/test/");
107  testDirectory->SetGuidance("provides access to some internal test routines.");
108 
109  testPolarizationTransformationCmd = new G4UIcmdWithoutParameter("/polarization/test/polarizationTransformation",this);
110  testPolarizationTransformationCmd->SetGuidance("checks definition of particle reference frame and corresponding translation routines");
111  testPolarizationTransformationCmd->AvailableForStates(G4State_PreInit,G4State_Idle,G4State_GeomClosed);
112 
113  testInteractionFrameCmd = new G4UIcmdWithoutParameter("/polarization/test/interactionFrame",this);
114  testInteractionFrameCmd->SetGuidance("checks definition of interaction frame");
116 }
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const char *theDefaultValue)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
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 SetDefaultValue(G4int defVal)

Here is the call graph for this function:

G4PolarizationMessenger::~G4PolarizationMessenger ( )

Definition at line 118 of file G4PolarizationMessenger.cc.

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

Member Function Documentation

G4String G4PolarizationMessenger::GetCurrentValue ( G4UIcommand command)
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 168 of file G4PolarizationMessenger.cc.

169 {
170  G4String cv;
171  if( command==verboseCmd )
172  { cv = verboseCmd->ConvertToString(polarizationManager->GetVerbose()); }
173 
174  return cv;
175 }
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:372

Here is the call graph for this function:

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

Reimplemented from G4UImessenger.

Definition at line 132 of file G4PolarizationMessenger.cc.

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

Here is the call graph for this function:


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