Geant4  10.02.p03
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)
 
G4String GetCurrentValue (G4UIcommand *command)
 
- 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
 

Private Attributes

G4PolarizationManagerpolarizationManager
 
G4UIdirectorypolarizationDirectory
 
G4UIdirectorymanagerDirectory
 
G4UIcmdWithAnIntegerverboseCmd
 
G4UIcmdWithABooloptActivateCmd
 
G4UIdirectoryvolumeDirectory
 
G4UIcmdWithoutParameterprintVolumeListCmd
 
G4UIcommandsetPolarizationCmd
 
G4UIdirectorytestDirectory
 
G4UIcmdWithoutParametertestPolarizationTransformationCmd
 
G4UIcmdWithoutParametertestInteractionFrameCmd
 

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::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);
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);
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");
96  param = new G4UIparameter("px",'d',true);
97  param->SetDefaultValue("0.0");
99  param = new G4UIparameter("py",'d',true);
100  param->SetDefaultValue("0.0");
102  param = new G4UIparameter("pz",'d',true);
103  param->SetDefaultValue("0.0");
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");
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)
G4UIcmdWithAnInteger * verboseCmd
void SetDefaultValue(const char *theDefaultValue)
G4UIcmdWithoutParameter * testInteractionFrameCmd
G4UIcmdWithoutParameter * testPolarizationTransformationCmd
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
G4PolarizationManager * polarizationManager
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
G4UIcmdWithoutParameter * printVolumeListCmd
void SetDefaultValue(G4int defVal)
Here is the call graph for this function:

◆ ~G4PolarizationMessenger()

G4PolarizationMessenger::~G4PolarizationMessenger ( )

Definition at line 118 of file G4PolarizationMessenger.cc.

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

Member Function Documentation

◆ GetCurrentValue()

G4String G4PolarizationMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 168 of file G4PolarizationMessenger.cc.

169 {
170  G4String cv;
171  if( command==verboseCmd )
173 
174  return cv;
175 }
G4UIcmdWithAnInteger * verboseCmd
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
G4PolarizationManager * polarizationManager
Here is the call graph for this function:

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 132 of file G4PolarizationMessenger.cc.

133 {
134  if( command==verboseCmd ) {
136  }
137  else if ( command==optActivateCmd ) {
139  }
140  else if ( command==printVolumeListCmd ) {
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);
159  }
160  else if ( command==testPolarizationTransformationCmd ) {
162  }
163  else if (command==testInteractionFrameCmd ) {
165  }
166 }
static void TestPolarizationTransformations()
static G4int GetNewIntValue(const char *paramString)
G4UIcmdWithAnInteger * verboseCmd
G4UIcmdWithoutParameter * testInteractionFrameCmd
G4UIcmdWithoutParameter * testPolarizationTransformationCmd
static G4bool GetNewBoolValue(const char *paramString)
G4PolarizationManager * polarizationManager
static void TestInteractionFrame()
G4UIcmdWithoutParameter * printVolumeListCmd
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:

Member Data Documentation

◆ managerDirectory

G4UIdirectory* G4PolarizationMessenger::managerDirectory
private

Definition at line 76 of file G4PolarizationMessenger.hh.

◆ optActivateCmd

G4UIcmdWithABool* G4PolarizationMessenger::optActivateCmd
private

Definition at line 78 of file G4PolarizationMessenger.hh.

◆ polarizationDirectory

G4UIdirectory* G4PolarizationMessenger::polarizationDirectory
private

Definition at line 74 of file G4PolarizationMessenger.hh.

◆ polarizationManager

G4PolarizationManager* G4PolarizationMessenger::polarizationManager
private

Definition at line 71 of file G4PolarizationMessenger.hh.

◆ printVolumeListCmd

G4UIcmdWithoutParameter* G4PolarizationMessenger::printVolumeListCmd
private

Definition at line 81 of file G4PolarizationMessenger.hh.

◆ setPolarizationCmd

G4UIcommand* G4PolarizationMessenger::setPolarizationCmd
private

Definition at line 82 of file G4PolarizationMessenger.hh.

◆ testDirectory

G4UIdirectory* G4PolarizationMessenger::testDirectory
private

Definition at line 84 of file G4PolarizationMessenger.hh.

◆ testInteractionFrameCmd

G4UIcmdWithoutParameter* G4PolarizationMessenger::testInteractionFrameCmd
private

Definition at line 86 of file G4PolarizationMessenger.hh.

◆ testPolarizationTransformationCmd

G4UIcmdWithoutParameter* G4PolarizationMessenger::testPolarizationTransformationCmd
private

Definition at line 85 of file G4PolarizationMessenger.hh.

◆ verboseCmd

G4UIcmdWithAnInteger* G4PolarizationMessenger::verboseCmd
private

Definition at line 77 of file G4PolarizationMessenger.hh.

◆ volumeDirectory

G4UIdirectory* G4PolarizationMessenger::volumeDirectory
private

Definition at line 80 of file G4PolarizationMessenger.hh.


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