]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TGeant4/TG4PhysicsConstructorOptical.cxx
Initial version
[u/mrichter/AliRoot.git] / TGeant4 / TG4PhysicsConstructorOptical.cxx
CommitLineData
b94a914b 1// $Id$
2// Category: physics
3//
e5967ab3 4// Author: I. Hrivnacova
5//
6// Class TG4PhysicsConstructorOptical
7// ----------------------------------
8// See the class description in the header file.
b94a914b 9// According to ExN06PhysicsList (geant4 1.1)
10
11#include "TG4PhysicsConstructorOptical.h"
e5967ab3 12#include "TG4ProcessControlMap.h"
13#include "TG4ProcessMCMap.h"
b94a914b 14
15#include <G4ParticleDefinition.hh>
16#include <G4ProcessManager.hh>
17#include <G4Cerenkov.hh>
18#include <G4OpAbsorption.hh>
19#include <G4OpRayleigh.hh>
20#include <G4OpBoundaryProcess.hh>
21
72095f7c 22//_____________________________________________________________________________
b94a914b 23TG4PhysicsConstructorOptical::TG4PhysicsConstructorOptical(const G4String& name)
24 : G4VPhysicsConstructor(name)
25{
26//
27 SetVerboseLevel(1);
28}
29
72095f7c 30//_____________________________________________________________________________
b94a914b 31TG4PhysicsConstructorOptical::~TG4PhysicsConstructorOptical() {
32//
33}
34
35// protected methods
36
72095f7c 37//_____________________________________________________________________________
b94a914b 38void TG4PhysicsConstructorOptical::ConstructParticle()
39{
40// The particles are constructed in the
41// TG4ModularPhysicsList.
42// ---
43}
44
72095f7c 45//_____________________________________________________________________________
b94a914b 46void TG4PhysicsConstructorOptical::ConstructProcess()
47{
48// Constructs optical processes.
49// According to ExN06PhysicsList.cc.
50// (geant4 1.1)
51// ---
52
53 G4Cerenkov* theCerenkovProcess = new G4Cerenkov("Cerenkov");
54 G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption();
55 G4OpRayleigh* theRayleighScatteringProcess = new G4OpRayleigh();
56 G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess();
57
58 theCerenkovProcess->DumpPhysicsTable();
59 //theAbsorptionProcess->DumpPhysicsTable();
60 //theRayleighScatteringProcess->DumpPhysicsTable();
61
62 // add verbose
63 //theCerenkovProcess->SetVerboseLevel(1);
64 //theAbsorptionProcess->SetVerboseLevel(1);
65 //theRayleighScatteringProcess->SetVerboseLevel(1);
66 //theBoundaryProcess->SetVerboseLevel(1);
67
68 G4int maxNumPhotons = 300;
69
70 theCerenkovProcess->SetTrackSecondariesFirst(true);
71 theCerenkovProcess->SetMaxNumPhotonsPerStep(maxNumPhotons);
72
73 //G4OpticalSurfaceModel themodel = unified;
74 // model from GEANT3
75 G4OpticalSurfaceModel themodel = glisur;
76 theBoundaryProcess->SetModel(themodel);
77
78 theParticleIterator->reset();
79 while( (*theParticleIterator)() ){
80 G4ParticleDefinition* particle = theParticleIterator->value();
81 G4ProcessManager* processManager = particle->GetProcessManager();
82 G4String particleName = particle->GetParticleName();
83 if (theCerenkovProcess->IsApplicable(*particle)) {
84 processManager->AddContinuousProcess(theCerenkovProcess);
85 }
86 if (particleName == "opticalphoton") {
87 G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
88 processManager->AddDiscreteProcess(theAbsorptionProcess);
89 processManager->AddDiscreteProcess(theRayleighScatteringProcess);
90 processManager->AddDiscreteProcess(theBoundaryProcess);
91 }
92 }
93
e5967ab3 94 // map to G3 controls
95 TG4ProcessControlMap* controlMap = TG4ProcessControlMap::Instance();
96 controlMap->Add(theCerenkovProcess, kCKOV);
97 controlMap->Add(theAbsorptionProcess, kLABS);
98 controlMap->Add(theRayleighScatteringProcess, kRAYL);
99 controlMap->Add(theBoundaryProcess, kLABS);
100
101 // map to AliMCProcess codes
102 TG4ProcessMCMap* mcMap = TG4ProcessMCMap::Instance();
103 mcMap->Add(theCerenkovProcess, kPCerenkov);
104 mcMap->Add(theAbsorptionProcess, kPLightAbsorption);
105 mcMap->Add(theRayleighScatteringProcess, kPRayleigh);
106 mcMap->Add(theBoundaryProcess, kPLightScattering);
107
b94a914b 108 if (verboseLevel>0)
109 G4cout << "### " << namePhysics << " physics constructed." << G4endl;
110}
111