SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
LCOpticalPhysics.cc
Go to the documentation of this file.
1 #include "LCOpticalPhysics.hh"
2 
3 // Geant4
4 #include "G4Version.hh"
5 
7  G4VPhysicsConstructor(name) {
8 }
9 
11 }
12 
14  // optical photon
15  G4OpticalPhoton::OpticalPhotonDefinition();
16 }
17 
19  ConstructOp();
20 }
21 
22 #ifndef aParticleIterator
23 #define aParticleIterator ((subInstanceManager.offset[g4vpcInstanceID])._aParticleIterator)
24 #endif
25 
27  theCerenkovProcess = new G4Cerenkov("Cerenkov");
28  theScintillationProcess = new G4Scintillation("Scintillation");
29  theAbsorptionProcess = new G4OpAbsorption();
30  theRayleighScatteringProcess = new G4OpRayleigh();
31  theBoundaryProcess = new G4OpBoundaryProcess();
32 
33  theCerenkovProcess->SetMaxNumPhotonsPerStep(300);
34  theScintillationProcess->SetScintillationYieldFactor(1.);
35 
36 //if ( G4VERSION_NUMBER < 1000 )
37 // G4ParticleTable::G4PTblDicIterator* aParticleIterator = G4ParticleTable::GetParticleTable()->GetIterator();
38 //#endif
39  aParticleIterator->reset();
40 
41  while ((*aParticleIterator)()) {
42 
43  G4ParticleDefinition* particle = aParticleIterator->value();
44  G4ProcessManager* pmanager = particle->GetProcessManager();
45  G4String particleName = particle->GetParticleName();
46 
47  if (theCerenkovProcess->IsApplicable(*particle)) {
48  pmanager->AddProcess(theCerenkovProcess);
49  pmanager->SetProcessOrderingToLast(theCerenkovProcess, idxPostStep);
50  }
51  if (theScintillationProcess->IsApplicable(*particle)) {
52  pmanager->AddProcess(theScintillationProcess);
53  pmanager->SetProcessOrderingToLast(theScintillationProcess, idxAtRest);
54  pmanager->SetProcessOrderingToLast(theScintillationProcess, idxPostStep);
55  }
56  if (particleName == "opticalphoton") {
57  pmanager->AddDiscreteProcess(theAbsorptionProcess);
58  pmanager->AddDiscreteProcess(theRayleighScatteringProcess);
59  pmanager->AddDiscreteProcess(theBoundaryProcess);
60  }
61  }
62 }
#define aParticleIterator
G4OpAbsorption * theAbsorptionProcess
G4OpRayleigh * theRayleighScatteringProcess
G4OpBoundaryProcess * theBoundaryProcess
G4Scintillation * theScintillationProcess
LCOpticalPhysics(const G4String &name="optical")
virtual ~LCOpticalPhysics()
G4Cerenkov * theCerenkovProcess
@ name
Definition: LogStream.hh:26