71 {
72 G4Cerenkov* theCerenkovProcess = new G4Cerenkov ("Cerenkov");
73 G4Scintillation* theScintillationProcess = new G4Scintillation ("Scintillation");
74 G4OpAbsorption* theOpAbsorptionProcess = new G4OpAbsorption ();
75 G4OpRayleigh* theOpRayleighProcess = new G4OpRayleigh ();
76 G4OpBoundaryProcess* theOpBoundaryProcess = new G4OpBoundaryProcess();
77
78 theCerenkovProcess->SetVerboseLevel(0);
79 theScintillationProcess->SetVerboseLevel(0);
80 theOpAbsorptionProcess->SetVerboseLevel(0);
81 theOpRayleighProcess->SetVerboseLevel(0);
82 theOpBoundaryProcess->SetVerboseLevel(0);
83
84 G4int MaxNumPhotons = 300;
85
86 theCerenkovProcess->SetTrackSecondariesFirst(true);
87 theCerenkovProcess->SetMaxNumPhotonsPerStep(MaxNumPhotons);
88
89 theScintillationProcess->SetTrackSecondariesFirst(true);
90#if G4VERSION_NUMBER < 1100
91
92 theScintillationProcess->SetScintillationYieldFactor(1.);
93#endif
94
96
98 {
99
101 G4ProcessManager* pmanager =
particle->GetProcessManager();
103
104 if (theCerenkovProcess->IsApplicable(*particle)) {
105 ATH_MSG_DEBUG(
" Adding CerenkovProcess to: " << particleName );
106 pmanager->AddProcess (theCerenkovProcess);
107 pmanager->SetProcessOrdering(theCerenkovProcess, idxPostStep);
108 }
109
110 if (theScintillationProcess->IsApplicable(*particle)) {
111 ATH_MSG_DEBUG(
" Adding ScintillationProcess to: " << particleName );
112 pmanager->AddProcess (theScintillationProcess);
113 pmanager->SetProcessOrderingToLast(theScintillationProcess, idxAtRest);
114 pmanager->SetProcessOrderingToLast(theScintillationProcess, idxPostStep);
115 }
116
117 if (particleName == "opticalphoton") {
118
119 ATH_MSG_DEBUG(
" Adding OpAbsorptionProcess, OpRayleighProcess and OpBoundaryProcess to opticalphoton " );
120 pmanager->AddDiscreteProcess(theOpAbsorptionProcess);
121 pmanager->AddDiscreteProcess(theOpRayleighProcess);
122 pmanager->AddDiscreteProcess(theOpBoundaryProcess);
123 }
124 }
125}
std::string particleName(const G4Step *theStep)
TODO.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses