70 fExcitationRatio(0.0),
72 fFiniteRiseTime(false),
73 fScintillationByParticleType(false),
74 fScintillationTrackInfo(false),
76 fCerenkovStackPhotons(true),
77 fScintillationStackPhotons(true)
83 fProcessUse.push_back(
true);
84 fProcessTrackSecondariesFirst.push_back(
true);
97 void G4OpticalPhysics::PrintStatistics()
const
103 if ( ! fProcessUse[i] ) {
109 G4cout <<
" Max number of photons per step: " << fMaxNumPhotons <<
G4endl;
110 G4cout <<
" Max beta change per step: " << fMaxBetaChange <<
G4endl;
111 if ( fProcessTrackSecondariesFirst[
kCerenkov] ) {
112 G4cout <<
" Track secondaries first: activated" <<
G4endl;
115 G4cout <<
" Track secondaries first: inactivated" <<
G4endl;
119 if (fScintillationByParticleType)
120 G4cout <<
" Scintillation by Particle Type: activated " <<
G4endl;
122 G4cout <<
" ExcitationRatio: " << fExcitationRatio <<
G4endl;
124 G4cout <<
" Track secondaries first: activated" <<
G4endl;
127 G4cout <<
" Track secondaries first: inactivated" <<
G4endl;
131 G4cout <<
" WLS process time profile: " << fProfile <<
G4endl;
150 #define DIR_CMDS "/process/optical"
151 #define GUIDANCE "Commands related to the optical physics simulation engine for "
153 namespace UIhelpers {
163 "Set the verbose level");
178 "Set the WLS time profile (delta or exponential)");
192 "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");
198 "Set scintillation yield factor");
205 "Set scintillation excitation ratio");
212 "Activate/Inactivate scintillation process by particle type");
218 "Activate/Inactivate scintillation track info");
224 "Set option to track secondaries before finishing their parent track");
238 "Set maximum number of photons per step");
245 "Set maximum change of beta of parent particle per step");
252 "Set option to track secondaries before finishing their parent track");
273 G4cout <<
"G4OpticalPhysics:: Add Optical Physics Processes"<<
G4endl;
276 std::vector<G4VProcess*> OpProcesses;
288 OpProcesses[
kRayleigh] = OpRayleighScatteringProcess;
292 OpProcesses[
kMieHG] = OpMieHGScatteringProcess;
297 OpProcesses[
kBoundary] = OpBoundaryProcess;
302 OpProcesses[
kWLS] = OpWLSProcess;
308 std::ostringstream o;
309 o <<
"Optical Photon without a Process Manager";
310 G4Exception(
"G4OpticalPhysics::ConstructProcess()",
"",
316 if ( fProcessUse[i] ) {
340 OpProcesses[
kCerenkov] = CerenkovProcess;
343 myParticleIterator->reset();
345 while( (*myParticleIterator)() ){
352 std::ostringstream o;
353 o <<
"Particle " << particleName <<
"without a Process Manager";
354 G4Exception(
"G4OpticalPhysics::ConstructProcess()",
"",
375 if ( fProcessUse[i] ) OpProcesses[i]->SetVerboseLevel(
verboseLevel);
387 fYieldFactor = yieldFactor;
395 fExcitationRatio = excitationRatio;
403 fMaxNumPhotons = maxNumPhotons;
411 fMaxBetaChange = maxBetaChange;
430 fScintillationByParticleType = scintillationByParticleType;
437 fScintillationTrackInfo = scintillationTrackInfo;
442 G4bool trackSecondariesFirst)
444 if ( index >= kNoProcess )
return;
445 if ( fProcessTrackSecondariesFirst[index] == trackSecondariesFirst )
return;
446 fProcessTrackSecondariesFirst[index] = trackSecondariesFirst;
456 fFiniteRiseTime = finiteRiseTime;
462 fInvokeSD = invokeSD;
467 fCerenkovStackPhotons = stackingFlag;
472 fScintillationStackPhotons = stackingFlag;
483 if ( index >= kNoProcess )
return;
484 if ( fProcessUse[index] == isUse )
return;
485 fProcessUse[index] = isUse;
void SetScintillationByParticleType(const G4bool)
void SetMaxBetaChangePerStep(const G4double d)
void SetScintillationTrackInfo(const G4bool trackType)
static G4LossTableManager * Instance()
void SetFiniteRiseTime(const G4bool state)
Number of processes, no selected process.
virtual void ConstructParticle()
void SetTrackSecondariesFirst(const G4bool state)
void SetMaxBetaChangePerStep(G4double)
This class is generic messenger.
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
Command & DeclareMethod(const G4String &name, const G4AnyMethod &fun, const G4String &doc="")
Scintillation process index.
Mie scattering process index.
void SetFiniteRiseTime(G4bool)
Absorption process index.
const G4String & GetParticleName() const
void SetScintillationByParticleType(G4bool)
void UseTimeProfile(const G4String name)
virtual void ConstructProcess()
virtual ~G4OpticalPhysics()
Command & SetDefaultValue(const G4String &)
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
void SetScintillationYieldFactor(const G4double yieldfactor)
void SetStackPhotons(const G4bool)
void SetStackPhotons(const G4bool)
G4GLOB_DLL std::ostream G4cout
void SetMaxNumPhotonsPerStep(G4int)
void Configure(G4OpticalProcessIndex, G4bool)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
G4EmSaturation * EmSaturation()
void SetMaxNumPhotonsPerStep(const G4int NumPhotons)
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
Command & SetStates(G4ApplicationState s0)
Wave Length Shifting process index.
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void SetScintillationExcitationRatio(const G4double ratio)
static G4OpticalPhoton * OpticalPhoton()
void SetScintillationExcitationRatio(G4double)
G4String G4OpticalProcessName(G4int)
Return the name for a given optical process index.
G4OpticalPhysics(G4int verbose=0, const G4String &name="Optical")
void SetScintillationYieldFactor(G4double)
void SetTrackSecondariesFirst(const G4bool state)
void SetScintillationStackPhotons(G4bool)
void SetProcessOrderingToLast(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
G4ProcessManager * GetProcessManager() const
Command & SetCandidates(const G4String &)
void buildCommands(T *proc, const char *dir, const char *guidance)
G4bool IsApplicable(const G4ParticleDefinition &aParticleType) override
void SetScintillationTrackInfo(G4bool)
void SetWLSTimeProfile(G4String)
void SetTrackSecondariesFirst(G4OpticalProcessIndex, G4bool)
Command & SetParameterName(const G4String &, G4bool, G4bool=false)
static G4OpticalPhoton * OpticalPhotonDefinition()
Rayleigh scattering process index.
G4bool IsApplicable(const G4ParticleDefinition &aParticleType) override
void SetCerenkovStackPhotons(G4bool)
void AddSaturation(G4EmSaturation *sat)
#define G4_DECLARE_PHYSCONSTR_FACTORY(physics_constructor)