G4OpticalPhysicsMessenger Class Reference

#include <G4OpticalPhysicsMessenger.hh>

Inheritance diagram for G4OpticalPhysicsMessenger:

G4UImessenger

Public Member Functions

 G4OpticalPhysicsMessenger (G4OpticalPhysics *)
virtual ~G4OpticalPhysicsMessenger ()
virtual void SetNewValue (G4UIcommand *, G4String)

Detailed Description

Definition at line 74 of file G4OpticalPhysicsMessenger.hh.


Constructor & Destructor Documentation

G4OpticalPhysicsMessenger::G4OpticalPhysicsMessenger ( G4OpticalPhysics  ) 

Definition at line 59 of file G4OpticalPhysicsMessenger.cc.

References G4UIcommand::AvailableForStates(), G4OpticalPhysicsMessenger(), G4OpticalProcessName(), G4State_EventProc, G4State_GeomClosed, G4State_Idle, G4State_PreInit, kNoProcess, G4UIcmdWithAString::SetCandidates(), G4UIcommand::SetGuidance(), G4UIcmdWithADouble::SetParameterName(), G4UIcmdWithAnInteger::SetParameterName(), G4UIcmdWithABool::SetParameterName(), G4UIcmdWithAString::SetParameterName(), and G4UIcommand::SetRange().

Referenced by G4OpticalPhysicsMessenger().

00061   : G4UImessenger(),
00062     fOpticalPhysics(opticalPhysics),
00063     fSelectedProcessIndex(kNoProcess),
00064     fSelectOpProcessCmd(0),
00065     fSetOpProcessUseCmd(0),
00066     fSetOpProcessVerboseCmd(0),
00067     fSetCerenkovMaxPhotonsCmd(0),
00068     fSetCerenkovMaxBetaChangeCmd(0),
00069     fSetScintillationYieldFactorCmd(0),
00070     fSetScintillationByParticleTypeCmd(0),
00071 //    fSetOpticalSurfaceModelCmd(0),
00072     fSetWLSTimeProfileCmd(0),
00073     fSetTrackSecondariesFirstCmd(0),
00074     fSetFiniteRiseTimeCmd(0)
00075 {
00076   fDir = new G4UIdirectory("/optics_engine/");
00077   fDir->SetGuidance("Commands related to the optical physics simulation engine.");
00078   
00079   fSelectOpProcessCmd
00080    = new G4UIcmdWithAString("/optics_engine/selectOpProcess", this);
00081   fSelectOpProcessCmd
00082    ->SetGuidance("Select optical process for applying use/verbose/trackfirst commands");
00083   fSelectOpProcessCmd->SetParameterName("OpProcess", false);
00084   G4String candidates;
00085   for ( G4int i=0; i<kNoProcess; i++ ) {
00086       candidates += G4OpticalProcessName(i);
00087       candidates += G4String(" ");
00088   }
00089   fSelectOpProcessCmd->SetCandidates(candidates);
00090   fSelectOpProcessCmd->AvailableForStates(G4State_PreInit, G4State_Idle, G4State_GeomClosed, G4State_EventProc);
00091 
00092   fSetOpProcessUseCmd
00093    = new G4UIcmdWithABool("/optics_engine/setOpProcessUse", this);
00094   fSetOpProcessUseCmd->SetGuidance("Use/Not use selected optical process");
00095   fSetOpProcessUseCmd->SetParameterName("OpProcessUse", false);
00096   fSetOpProcessUseCmd->AvailableForStates(G4State_PreInit);
00097 
00098   fSetOpProcessVerboseCmd 
00099     = new G4UIcmdWithAnInteger("/optics_engine/setOpProcessVerbose", this);  
00100   fSetOpProcessVerboseCmd->SetGuidance("Set verbosity level for selected optical process");
00101   fSetOpProcessVerboseCmd->SetParameterName("OpProcessVerbose", false);
00102   fSetOpProcessVerboseCmd->SetRange("OpProcessVerbose>=0");
00103   fSetOpProcessVerboseCmd->AvailableForStates(G4State_PreInit, G4State_Idle, G4State_GeomClosed, G4State_EventProc); 
00104 
00105   fSetCerenkovMaxPhotonsCmd 
00106     = new G4UIcmdWithAnInteger("/optics_engine/setCerenkovMaxPhotons", this);  
00107   fSetCerenkovMaxPhotonsCmd->SetGuidance("Set maximum number of photons per step");
00108   fSetCerenkovMaxPhotonsCmd->SetParameterName("CerenkovMaxPhotons", false);
00109   fSetCerenkovMaxPhotonsCmd->SetRange("CerenkovMaxPhotons>=0");
00110   fSetCerenkovMaxPhotonsCmd->AvailableForStates(G4State_PreInit, G4State_Idle, G4State_GeomClosed, G4State_EventProc);  
00111 
00112   fSetCerenkovMaxBetaChangeCmd 
00113     = new G4UIcmdWithADouble("/optics_engine/setCerenkovMaxBetaChange", this);  
00114   fSetCerenkovMaxBetaChangeCmd
00115     ->SetGuidance("Set maximum change of beta of parent particle per step");
00116   fSetCerenkovMaxBetaChangeCmd->SetParameterName("CerenkovMaxBetaChange", false);
00117   fSetCerenkovMaxBetaChangeCmd->SetRange("CerenkovMaxBetaChange>=0");
00118   fSetCerenkovMaxBetaChangeCmd->AvailableForStates(G4State_PreInit, G4State_Idle, G4State_GeomClosed, G4State_EventProc);
00119 
00120   fSetScintillationYieldFactorCmd 
00121     = new G4UIcmdWithADouble("/optics_engine/setScintillationYieldFactor", this);  
00122   fSetScintillationYieldFactorCmd->SetGuidance("Set scintillation yield factor");
00123   fSetScintillationYieldFactorCmd->SetParameterName("ScintillationYieldFactor", false);
00124   fSetScintillationYieldFactorCmd->SetRange("ScintillationYieldFactor>=0");
00125   fSetScintillationYieldFactorCmd->AvailableForStates(G4State_PreInit, G4State_Idle, G4State_GeomClosed, G4State_EventProc);
00126 
00127   fSetScintillationByParticleTypeCmd
00128    = new G4UIcmdWithABool("/optics_engine/setScintillationByParticleType", this);
00129   fSetScintillationByParticleTypeCmd->SetGuidance("Activate/Inactivate scintillation process by particle type");
00130   fSetScintillationByParticleTypeCmd->SetParameterName("ScintillationByParticleTypeActivation", false);
00131   fSetScintillationByParticleTypeCmd->AvailableForStates(G4State_PreInit, G4State_Idle, G4State_GeomClosed, G4State_EventProc);
00132 
00133 //  fSetOpticalSurfaceModelCmd 
00134 //    = new G4UIcmdWithAString("/optics_engine/setOpticalSurfaceModel", this);  
00135 //  fSetOpticalSurfaceModelCmd
00136 //    ->SetGuidance("Set optical surface model (glisur or unified)");
00137 //  fSetOpticalSurfaceModelCmd->SetParameterName("OpticalSurfaceModel", false);
00138 //  fSetOpticalSurfaceModelCmd->SetCandidates("glisur unified");
00139 //  fSetOpticalSurfaceModelCmd->AvailableForStates(G4State_PreInit, G4State_Idle, G4State_GeomClosed, G4State_EventProc);
00140 
00141   fSetWLSTimeProfileCmd
00142     = new G4UIcmdWithAString("/optics_engine/setWLSTimeProfile", this);
00143   fSetWLSTimeProfileCmd
00144     ->SetGuidance("Set the WLS time profile (delta or exponential)");
00145   fSetWLSTimeProfileCmd->SetParameterName("WLSTimeProfile", false);
00146   fSetWLSTimeProfileCmd->SetCandidates("delta exponential");
00147   fSetWLSTimeProfileCmd->AvailableForStates(G4State_PreInit, G4State_Idle, G4State_GeomClosed, G4State_EventProc);
00148 
00149   fSetTrackSecondariesFirstCmd 
00150     = new G4UIcmdWithABool("/optics_engine/setTrackSecondariesFirst", this);  
00151   fSetTrackSecondariesFirstCmd
00152     ->SetGuidance("Set option to track secondaries before finishing their parent track");
00153   fSetTrackSecondariesFirstCmd->SetParameterName("TrackSecondariesFirst", false);
00154   fSetTrackSecondariesFirstCmd->AvailableForStates(G4State_PreInit, G4State_Idle, G4State_GeomClosed, G4State_EventProc);
00155 
00156   fSetFiniteRiseTimeCmd
00157     = new G4UIcmdWithABool("/optics_engine/setFiniteRiseTime", this);
00158   fSetFiniteRiseTimeCmd
00159      ->SetGuidance("Set option of a finite rise-time for G4Scintillation - If set, the G4Scintillation process expects the user to have set the constant material property FAST/SLOWSCINTILLATIONRISETIME");
00160   fSetFiniteRiseTimeCmd->SetParameterName("FiniteRiseTime", false);
00161   fSetFiniteRiseTimeCmd->AvailableForStates(G4State_PreInit, G4State_Idle, G4State_GeomClosed, G4State_EventProc);
00162 }

G4OpticalPhysicsMessenger::~G4OpticalPhysicsMessenger (  )  [virtual]

Definition at line 164 of file G4OpticalPhysicsMessenger.cc.

00165 {
00166 // Destructor
00167 
00168   delete fDir;
00169   delete fSelectOpProcessCmd; 
00170   delete fSetOpProcessUseCmd; 
00171   delete fSetOpProcessVerboseCmd;
00172   delete fSetCerenkovMaxPhotonsCmd;
00173   delete fSetCerenkovMaxBetaChangeCmd;
00174   delete fSetScintillationYieldFactorCmd;
00175   delete fSetScintillationByParticleTypeCmd;
00176 //  delete fSetOpticalSurfaceModelCmd;
00177   delete fSetWLSTimeProfileCmd;
00178   delete fSetTrackSecondariesFirstCmd;
00179   delete fSetFiniteRiseTimeCmd;
00180 }


Member Function Documentation

void G4OpticalPhysicsMessenger::SetNewValue ( G4UIcommand ,
G4String   
) [virtual]

Reimplemented from G4UImessenger.

Definition at line 182 of file G4OpticalPhysicsMessenger.cc.

References G4UIcmdWithABool::GetNewBoolValue(), G4UIcmdWithADouble::GetNewDoubleValue(), G4UIcmdWithAnInteger::GetNewIntValue(), kAbsorption, kBoundary, kCerenkov, kMieHG, kNoProcess, kRayleigh, kScintillation, kWLS, G4OpticalPhysics::SetFiniteRiseTime(), G4OpticalPhysics::SetMaxBetaChangePerStep(), G4OpticalPhysics::SetMaxNumPhotonsPerStep(), G4OpticalPhysics::SetScintillationByParticleType(), G4OpticalPhysics::SetScintillationYieldFactor(), G4OpticalPhysics::SetTrackSecondariesFirst(), and G4OpticalPhysics::SetWLSTimeProfile().

00183 {
00185 
00186   if (command == fSelectOpProcessCmd) {
00187     if      ( newValue == "Cerenkov" )        {
00188             fSelectedProcessIndex = kCerenkov;
00189     } else if ( newValue == "Scintillation" ) {
00190             fSelectedProcessIndex = kScintillation;
00191     } else if ( newValue == "OpAbsorption" )  {
00192             fSelectedProcessIndex = kAbsorption;
00193     } else if ( newValue == "OpRayleigh" )    {
00194             fSelectedProcessIndex = kRayleigh;
00195     } else if ( newValue == "OpMieHG" )       {
00196             fSelectedProcessIndex = kMieHG;
00197     } else if ( newValue == "OpBoundary" )    {
00198            fSelectedProcessIndex = kBoundary;
00199     } else if ( newValue == "OpWLS" )         {
00200            fSelectedProcessIndex = kWLS;
00201     }
00202   }
00203   else if (command == fSetOpProcessUseCmd) {
00204     fOpticalPhysics->
00205        Configure(fSelectedProcessIndex,
00206                  fSetOpProcessUseCmd->GetNewBoolValue(newValue));
00207   }  
00208   else if (command == fSetOpProcessVerboseCmd) {
00209     if ( fSelectedProcessIndex < kNoProcess ) {
00210        fOpticalPhysics->
00211           SetProcessVerbose(fSelectedProcessIndex,
00212                             fSetOpProcessVerboseCmd->GetNewIntValue(newValue));
00213     } else {
00214       for ( G4int i=0; i<kNoProcess; i++ ) {
00215           fOpticalPhysics->
00216             SetProcessVerbose(i,fSetOpProcessVerboseCmd->GetNewIntValue(newValue));
00217       }
00218     }
00219   }
00220   else if (command == fSetCerenkovMaxPhotonsCmd) {
00221     fOpticalPhysics
00222       ->SetMaxNumPhotonsPerStep(
00223           fSetCerenkovMaxPhotonsCmd->GetNewIntValue(newValue));
00224   }  
00225   else if (command == fSetCerenkovMaxBetaChangeCmd) {
00226     fOpticalPhysics
00227       ->SetMaxBetaChangePerStep(
00228           fSetCerenkovMaxBetaChangeCmd->GetNewDoubleValue(newValue));
00229   }
00230   else if (command == fSetScintillationYieldFactorCmd) {
00231     fOpticalPhysics
00232       ->SetScintillationYieldFactor(
00233           fSetScintillationYieldFactorCmd->GetNewDoubleValue(newValue));
00234   }
00235   else if (command == fSetScintillationByParticleTypeCmd) {
00236     fOpticalPhysics
00237       ->SetScintillationByParticleType(
00238          fSetScintillationByParticleTypeCmd->GetNewBoolValue(newValue));
00239   }
00240   else if (command == fSetFiniteRiseTimeCmd) {
00241     fOpticalPhysics
00242       ->SetFiniteRiseTime(
00243          fSetFiniteRiseTimeCmd->GetNewBoolValue(newValue));
00244   }
00245 //  else if (command == fSetOpticalSurfaceModelCmd) {
00246 //    if ( newValue == "glisur" ) {
00247 //      fOpticalPhysics
00248 //        ->SetOpticalSurfaceModel(glisur);
00249 //    }    
00250 //    if ( newValue == "unified" ) {
00251 //      fOpticalPhysics
00252 //        ->SetOpticalSurfaceModel(unified);
00253 //    } 
00254 //  }
00255   else if (command == fSetWLSTimeProfileCmd) {
00256     if ( newValue == "delta" ) {
00257       fOpticalPhysics
00258         ->SetWLSTimeProfile("delta");     }
00259     if ( newValue == "exponential" ) {
00260       fOpticalPhysics
00261         ->SetWLSTimeProfile("exponential");
00262     }
00263   } 
00264   else if (command == fSetTrackSecondariesFirstCmd) {
00265     fOpticalPhysics->SetTrackSecondariesFirst(fSelectedProcessIndex,
00266                                               fSetTrackSecondariesFirstCmd->
00267                                                     GetNewBoolValue(newValue));
00268   }
00269 }


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