4 // According to ExN06PhysicsList (geant4 1.1)
6 #include "TG4PhysicsConstructorOptical.h"
8 #include <G4ParticleDefinition.hh>
9 #include <G4ProcessManager.hh>
10 #include <G4Cerenkov.hh>
11 #include <G4OpAbsorption.hh>
12 #include <G4OpRayleigh.hh>
13 #include <G4OpBoundaryProcess.hh>
15 TG4PhysicsConstructorOptical::TG4PhysicsConstructorOptical(const G4String& name)
16 : G4VPhysicsConstructor(name)
22 TG4PhysicsConstructorOptical::~TG4PhysicsConstructorOptical() {
28 void TG4PhysicsConstructorOptical::ConstructParticle()
30 // The particles are constructed in the
31 // TG4ModularPhysicsList.
35 void TG4PhysicsConstructorOptical::ConstructProcess()
37 // Constructs optical processes.
38 // According to ExN06PhysicsList.cc.
42 G4Cerenkov* theCerenkovProcess = new G4Cerenkov("Cerenkov");
43 G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption();
44 G4OpRayleigh* theRayleighScatteringProcess = new G4OpRayleigh();
45 G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess();
47 theCerenkovProcess->DumpPhysicsTable();
48 //theAbsorptionProcess->DumpPhysicsTable();
49 //theRayleighScatteringProcess->DumpPhysicsTable();
52 //theCerenkovProcess->SetVerboseLevel(1);
53 //theAbsorptionProcess->SetVerboseLevel(1);
54 //theRayleighScatteringProcess->SetVerboseLevel(1);
55 //theBoundaryProcess->SetVerboseLevel(1);
57 G4int maxNumPhotons = 300;
59 theCerenkovProcess->SetTrackSecondariesFirst(true);
60 theCerenkovProcess->SetMaxNumPhotonsPerStep(maxNumPhotons);
62 //G4OpticalSurfaceModel themodel = unified;
64 G4OpticalSurfaceModel themodel = glisur;
65 theBoundaryProcess->SetModel(themodel);
67 theParticleIterator->reset();
68 while( (*theParticleIterator)() ){
69 G4ParticleDefinition* particle = theParticleIterator->value();
70 G4ProcessManager* processManager = particle->GetProcessManager();
71 G4String particleName = particle->GetParticleName();
72 if (theCerenkovProcess->IsApplicable(*particle)) {
73 processManager->AddContinuousProcess(theCerenkovProcess);
75 if (particleName == "opticalphoton") {
76 G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
77 processManager->AddDiscreteProcess(theAbsorptionProcess);
78 processManager->AddDiscreteProcess(theRayleighScatteringProcess);
79 processManager->AddDiscreteProcess(theBoundaryProcess);
84 G4cout << "### " << namePhysics << " physics constructed." << G4endl;