8 #include "G4ProcessManager.hh"
9 #include "G4ParticleTable.hh"
10 #include "G4VProcess.hh"
11 #include "G4Version.hh"
14 #include "G4Cerenkov.hh"
15 #include "G4Scintillation.hh"
16 #include "G4OpAbsorption.hh"
17 #include "G4OpRayleigh.hh"
18 #include "G4OpBoundaryProcess.hh"
20 #if G4VERSION_NUMBER > 1029
21 #define PARTICLEITERATOR (this->GetParticleIterator())
22 #elif G4VERSION_NUMBER > 1009
23 #define PARTICLEITERATOR aParticleIterator
25 #define PARTICLEITERATOR theParticleIterator
40 const std::string& nam,
const IInterface*
parent )
45 declareInterface< IPhysicsOptionTool >(
this ) ;
62 this->SetPhysicsName(
name());
63 return StatusCode::SUCCESS;
78 G4Cerenkov* theCerenkovProcess =
new G4Cerenkov (
"Cerenkov");
79 G4Scintillation* theScintillationProcess =
new G4Scintillation (
"Scintillation");
80 G4OpAbsorption* theOpAbsorptionProcess =
new G4OpAbsorption ();
81 G4OpRayleigh* theOpRayleighProcess =
new G4OpRayleigh ();
82 G4OpBoundaryProcess* theOpBoundaryProcess =
new G4OpBoundaryProcess();
84 theCerenkovProcess->SetVerboseLevel(0);
85 theScintillationProcess->SetVerboseLevel(0);
86 theOpAbsorptionProcess->SetVerboseLevel(0);
87 theOpRayleighProcess->SetVerboseLevel(0);
88 theOpBoundaryProcess->SetVerboseLevel(0);
90 G4int MaxNumPhotons = 300;
92 theCerenkovProcess->SetTrackSecondariesFirst(
true);
93 theCerenkovProcess->SetMaxNumPhotonsPerStep(MaxNumPhotons);
95 theScintillationProcess->SetTrackSecondariesFirst(
true);
96 #if G4VERSION_NUMBER < 1100
98 theScintillationProcess->SetScintillationYieldFactor(1.);
107 G4ProcessManager* pmanager =
particle->GetProcessManager();
110 if (theCerenkovProcess->IsApplicable(*
particle)) {
112 pmanager->AddProcess (theCerenkovProcess);
113 pmanager->SetProcessOrdering(theCerenkovProcess, idxPostStep);
116 if (theScintillationProcess->IsApplicable(*
particle)) {
118 pmanager->AddProcess (theScintillationProcess);
119 pmanager->SetProcessOrderingToLast(theScintillationProcess, idxAtRest);
120 pmanager->SetProcessOrderingToLast(theScintillationProcess, idxPostStep);
125 ATH_MSG_DEBUG(
" Adding OpAbsorptionProcess, OpRayleighProcess and OpBoundaryProcess to opticalphoton " );
126 pmanager->AddDiscreteProcess(theOpAbsorptionProcess);
127 pmanager->AddDiscreteProcess(theOpRayleighProcess);
128 pmanager->AddDiscreteProcess(theOpBoundaryProcess);