10 #include "G4Cerenkov.hh"
11 #include "G4OpAbsorption.hh"
12 #include "G4OpBoundaryProcess.hh"
13 #include "G4OpRayleigh.hh"
14 #include "G4ParticleTable.hh"
15 #include "G4ProcessManager.hh"
16 #include "G4Scintillation.hh"
17 #include "G4VProcess.hh"
18 #include "G4Version.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&
name,
const IInterface*
parent )
45 declareInterface< IPhysicsOptionTool >(
this ) ;
62 return StatusCode::SUCCESS;
66 return std::make_unique<LucidPhysicsTool::PhysicsConstructor>(
67 name(), this->msgLevel());
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();
78 theCerenkovProcess->SetVerboseLevel(0);
79 theScintillationProcess->SetVerboseLevel(0);
80 theOpAbsorptionProcess->SetVerboseLevel(0);
81 theOpRayleighProcess->SetVerboseLevel(0);
82 theOpBoundaryProcess->SetVerboseLevel(0);
84 G4int MaxNumPhotons = 300;
86 theCerenkovProcess->SetTrackSecondariesFirst(
true);
87 theCerenkovProcess->SetMaxNumPhotonsPerStep(MaxNumPhotons);
89 theScintillationProcess->SetTrackSecondariesFirst(
true);
90 #if G4VERSION_NUMBER < 1100
92 theScintillationProcess->SetScintillationYieldFactor(1.);
101 G4ProcessManager* pmanager =
particle->GetProcessManager();
104 if (theCerenkovProcess->IsApplicable(*
particle)) {
106 pmanager->AddProcess (theCerenkovProcess);
107 pmanager->SetProcessOrdering(theCerenkovProcess, idxPostStep);
110 if (theScintillationProcess->IsApplicable(*
particle)) {
112 pmanager->AddProcess (theScintillationProcess);
113 pmanager->SetProcessOrderingToLast(theScintillationProcess, idxAtRest);
114 pmanager->SetProcessOrderingToLast(theScintillationProcess, idxPostStep);
119 ATH_MSG_DEBUG(
" Adding OpAbsorptionProcess, OpRayleighProcess and OpBoundaryProcess to opticalphoton " );
120 pmanager->AddDiscreteProcess(theOpAbsorptionProcess);
121 pmanager->AddDiscreteProcess(theOpRayleighProcess);
122 pmanager->AddDiscreteProcess(theOpBoundaryProcess);