aboutsummaryrefslogtreecommitdiffstats
path: root/src/G4BeamTestEMPhysics.cxx
diff options
context:
space:
mode:
authorshivesh <s.p.mandalia@qmul.ac.uk>2018-08-25 17:57:22 +0100
committershivesh <s.p.mandalia@qmul.ac.uk>2018-08-25 17:57:22 +0100
commit738c2f88939a041fbc8b6b9cfa3c547b86bc6e42 (patch)
tree478718941a025703020c78b146a9b07ff2dabeff /src/G4BeamTestEMPhysics.cxx
parent92f4fb026c51d68cda6ad25159af01d60ad584e0 (diff)
downloadG4BeamTest-738c2f88939a041fbc8b6b9cfa3c547b86bc6e42.tar.gz
G4BeamTest-738c2f88939a041fbc8b6b9cfa3c547b86bc6e42.zip
Add Cerenkov Processes
Diffstat (limited to 'src/G4BeamTestEMPhysics.cxx')
-rw-r--r--src/G4BeamTestEMPhysics.cxx62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/G4BeamTestEMPhysics.cxx b/src/G4BeamTestEMPhysics.cxx
index 55ecf99..1aa9a7c 100644
--- a/src/G4BeamTestEMPhysics.cxx
+++ b/src/G4BeamTestEMPhysics.cxx
@@ -55,4 +55,66 @@ void G4BeamTestEMPhysics::ConstructProcess()
pManager->AddProcess(&positronIonisation, -1, 2, 2);
pManager->AddProcess(&positronBremsStrahlung, -1, 3, 3);
pManager->AddProcess(&annihilation, 0,-1, 4);
+
+ // Cerenkov Physics
+ ConstructOp();
+}
+
+void G4BeamTestEMPhysics::ConstructOp()
+{
+ G4Cerenkov* cerenkovProcess = &cerenkov;
+ G4int fMaxNumPhotonStep = 20;
+
+ cerenkovProcess->SetMaxNumPhotonsPerStep(fMaxNumPhotonStep);
+ G4cout << "MaxNumPhoton" << fMaxNumPhotonStep << G4endl;
+
+ cerenkovProcess->SetMaxBetaChangePerStep(10.0);
+ cerenkovProcess->SetTrackSecondariesFirst(true);
+ G4Scintillation* scintillationProcess = new G4Scintillation("Scintillation");
+ scintillationProcess->SetScintillationYieldFactor(1.);
+ scintillationProcess->SetTrackSecondariesFirst(true);
+ G4OpAbsorption* absorptionProcess = new G4OpAbsorption();
+ G4OpRayleigh* rayleighScatteringProcess = new G4OpRayleigh();
+ G4OpMieHG* mieHGScatteringProcess = new G4OpMieHG();
+ G4OpBoundaryProcess* boundaryProcess = new G4OpBoundaryProcess();
+
+/* cerenkovProcess->SetVerboseLevel(fVerboseLebel); */
+/* // scintillationProcess->SetVerboseLevel(fVerboseLebel); */
+/* absorptionProcess->SetVerboseLevel(fVerboseLebel); */
+/* rayleighScatteringProcess->SetVerboseLevel(fVerboseLebel); */
+/* mieHGScatteringProcess->SetVerboseLevel(fVerboseLebel); */
+/* boundaryProcess->SetVerboseLevel(fVerboseLebel); */
+
+ // Use Birks Correction in the Scintillation process
+
+ if(!G4Threading::IsWorkerThread())
+ {
+ G4EmSaturation* emSaturation =
+ G4LossTableManager::Instance()->EmSaturation();
+ scintillationProcess->AddSaturation(emSaturation);
+ }
+
+ auto theParticleIterator = GetParticleIterator();
+ theParticleIterator->reset();
+ while( (*theParticleIterator)() ){
+ G4ParticleDefinition* particle = theParticleIterator->value();
+ G4ProcessManager* pmanager = particle->GetProcessManager();
+ G4String particleName = particle->GetParticleName();
+ if (cerenkovProcess->IsApplicable(*particle)) {
+ pmanager->AddProcess(cerenkovProcess);
+ pmanager->SetProcessOrdering(cerenkovProcess,idxPostStep);
+ }
+ if (scintillationProcess->IsApplicable(*particle)) {
+ pmanager->AddProcess(scintillationProcess);
+ pmanager->SetProcessOrderingToLast(scintillationProcess, idxAtRest);
+ pmanager->SetProcessOrderingToLast(scintillationProcess, idxPostStep);
+ }
+ if (particleName == "opticalphoton") {
+ G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
+ pmanager->AddDiscreteProcess(absorptionProcess);
+ pmanager->AddDiscreteProcess(rayleighScatteringProcess);
+ pmanager->AddDiscreteProcess(mieHGScatteringProcess);
+ pmanager->AddDiscreteProcess(boundaryProcess);
+ }
+ }
}