G4PolarizationMessenger Class Reference

#include <G4PolarizationMessenger.hh>

Inheritance diagram for G4PolarizationMessenger:

G4UImessenger

Public Member Functions

 G4PolarizationMessenger (G4PolarizationManager *runMgr)
 ~G4PolarizationMessenger ()
void SetNewValue (G4UIcommand *command, G4String newValues)
G4String GetCurrentValue (G4UIcommand *command)

Detailed Description

Definition at line 61 of file G4PolarizationMessenger.hh.


Constructor & Destructor Documentation

G4PolarizationMessenger::G4PolarizationMessenger ( G4PolarizationManager runMgr  ) 

Definition at line 57 of file G4PolarizationMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_GeomClosed, G4State_Idle, G4State_PreInit, G4UIparameter::SetDefaultValue(), G4UIcmdWithABool::SetDefaultValue(), G4UIcmdWithAnInteger::SetDefaultValue(), G4UIcommand::SetGuidance(), G4UIcommand::SetParameter(), G4UIcmdWithABool::SetParameterName(), G4UIcmdWithAnInteger::SetParameterName(), and G4UIcommand::SetRange().

00058   : polarizationManager(polMgr)
00059 {
00060   polarizationDirectory = new G4UIdirectory("/polarization/");
00061   polarizationDirectory->SetGuidance("polarization control commands.");
00062 
00063   managerDirectory = new G4UIdirectory("/polarization/manager/");
00064   managerDirectory->SetGuidance("general polarization information.");
00065 
00066   verboseCmd = new G4UIcmdWithAnInteger("/polarization/manager/verbose",this);
00067   verboseCmd->SetGuidance("Set the Verbose level of G4PolarizationManager.");
00068   verboseCmd->SetGuidance(" 0 : Silent (default)");
00069   verboseCmd->SetGuidance(" 1 : Verbose");
00070   verboseCmd->SetParameterName("level",true);
00071   verboseCmd->SetDefaultValue(0);
00072   verboseCmd->SetRange("level >=0 && level <=1");
00073 
00074   optActivateCmd = new G4UIcmdWithABool("/polarization/manager/activate",this);
00075   optActivateCmd->SetGuidance("activate/deactivate polarization treatment");
00076   optActivateCmd->SetParameterName("flag",true);
00077   optActivateCmd->SetDefaultValue(true);
00078 
00079 
00080   volumeDirectory = new G4UIdirectory("/polarization/volume/");
00081   volumeDirectory->SetGuidance("Status control commands of registered polarized logical volumes.");
00082 
00083   printVolumeListCmd = new G4UIcmdWithoutParameter("/polarization/volume/list",this);
00084   printVolumeListCmd->SetGuidance("print list of registered polarized logical volumes");
00085   printVolumeListCmd->AvailableForStates(G4State_PreInit,G4State_Idle,G4State_GeomClosed);
00086   
00087   setPolarizationCmd = new G4UIcommand("/polarization/volume/set",this);
00088   setPolarizationCmd->SetGuidance("set or change polarization of a logical volume");
00089 //   setPolarizationCmd->SetParameterName("polarization",true);
00090 //   setPolarizationCmd->SetDefaultValue("worldVolume  0. 0. 0.");
00091   setPolarizationCmd->AvailableForStates(G4State_PreInit,G4State_Idle,G4State_GeomClosed);
00092 
00093   G4UIparameter* param;
00094   param = new G4UIparameter("logicalVolumeName",'s',false);
00095   param->SetDefaultValue("worldVolume");
00096   setPolarizationCmd->SetParameter(param);
00097   param = new G4UIparameter("px",'d',true);
00098   param->SetDefaultValue("0.0");
00099   setPolarizationCmd->SetParameter(param);
00100   param = new G4UIparameter("py",'d',true);
00101   param->SetDefaultValue("0.0");
00102   setPolarizationCmd->SetParameter(param);
00103   param = new G4UIparameter("pz",'d',true);
00104   param->SetDefaultValue("0.0");
00105   setPolarizationCmd->SetParameter(param);
00106 
00107   testDirectory = new G4UIdirectory("/polarization/test/");
00108   testDirectory->SetGuidance("provides access to some internal test routines.");
00109 
00110   testPolarizationTransformationCmd = new G4UIcmdWithoutParameter("/polarization/test/polarizationTransformation",this);
00111   testPolarizationTransformationCmd->SetGuidance("checks definition of particle reference frame and corresponding translation routines"); 
00112   testPolarizationTransformationCmd->AvailableForStates(G4State_PreInit,G4State_Idle,G4State_GeomClosed);
00113 
00114 
00115 
00116 }

G4PolarizationMessenger::~G4PolarizationMessenger (  ) 

Definition at line 118 of file G4PolarizationMessenger.cc.

00119 {
00120   delete verboseCmd;
00121 }


Member Function Documentation

G4String G4PolarizationMessenger::GetCurrentValue ( G4UIcommand command  )  [virtual]

Reimplemented from G4UImessenger.

Definition at line 159 of file G4PolarizationMessenger.cc.

References G4UIcommand::ConvertToString(), and G4PolarizationManager::GetVerbose().

00160 {
00161   G4String cv;
00162   if( command==verboseCmd )
00163   { cv = verboseCmd->ConvertToString(polarizationManager->GetVerbose()); }
00164 
00165   return cv;
00166 }

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

Reimplemented from G4UImessenger.

Definition at line 123 of file G4PolarizationMessenger.cc.

References G4UIcmdWithABool::GetNewBoolValue(), G4UIcmdWithAnInteger::GetNewIntValue(), G4String::isNull(), G4PolarizationManager::ListVolumes(), G4PolarizationManager::SetActivated(), G4PolarizationManager::SetVerbose(), G4PolarizationManager::SetVolumePolarization(), G4UImessenger::StoD(), G4PolarizationHelper::TestInteractionFrame(), and G4PolarizationHelper::TestPolarizationTransformations().

00124 {
00125   if( command==verboseCmd ) { 
00126     polarizationManager->SetVerbose(verboseCmd->GetNewIntValue(newValue)); 
00127   }
00128   else if ( command==optActivateCmd ) { 
00129     polarizationManager->SetActivated(optActivateCmd->GetNewBoolValue(newValue));
00130   }
00131   else if ( command==printVolumeListCmd ) { 
00132     polarizationManager->ListVolumes();
00133   }
00134   else if ( command==setPolarizationCmd ) {
00135     G4Tokenizer next( newValue );
00136     G4String volumeName=next();
00137     G4double px=0.,py=0.,pz=0.;
00138     G4String dvalue=next();
00139     if (!dvalue.isNull()) {
00140       px=StoD(dvalue);
00141       dvalue=next();
00142       if (!dvalue.isNull()) {
00143         py=StoD(dvalue);
00144         dvalue=next();
00145         if (!dvalue.isNull()) pz=StoD(dvalue);
00146       }
00147     }
00148     G4ThreeVector pol(px,py,pz);
00149     polarizationManager->SetVolumePolarization(volumeName,pol);
00150   }
00151   else if ( command==testPolarizationTransformationCmd ) {
00152     G4PolarizationHelper::TestPolarizationTransformations();
00153   }
00154   else if (command==testInteractionFrameCmd ) {
00155     G4PolarizationHelper::TestInteractionFrame();
00156   }
00157 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:56 2013 for Geant4 by  doxygen 1.4.7