]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TGeant4/TG4PhysicsConstructorOptical.cxx
added inheritance from TG4Verbose;
[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{
696e37fa 40// Instantiates particles.
b94a914b 41// ---
696e37fa 42
43 // optical photon
44 G4OpticalPhoton::OpticalPhotonDefinition();
b94a914b 45}
46
72095f7c 47//_____________________________________________________________________________
b94a914b 48void TG4PhysicsConstructorOptical::ConstructProcess()
49{
50// Constructs optical processes.
51// According to ExN06PhysicsList.cc.
52// (geant4 1.1)
53// ---
54
55 G4Cerenkov* theCerenkovProcess = new G4Cerenkov("Cerenkov");
56 G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption();
57 G4OpRayleigh* theRayleighScatteringProcess = new G4OpRayleigh();
58 G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess();
59
60 theCerenkovProcess->DumpPhysicsTable();
61 //theAbsorptionProcess->DumpPhysicsTable();
62 //theRayleighScatteringProcess->DumpPhysicsTable();
63
64 // add verbose
696e37fa 65 theCerenkovProcess->SetVerboseLevel(0);
66 theAbsorptionProcess->SetVerboseLevel(0);
67 theRayleighScatteringProcess->SetVerboseLevel(0);
68 theBoundaryProcess->SetVerboseLevel(0);
b94a914b 69
70 G4int maxNumPhotons = 300;
71
72 theCerenkovProcess->SetTrackSecondariesFirst(true);
73 theCerenkovProcess->SetMaxNumPhotonsPerStep(maxNumPhotons);
74
75 //G4OpticalSurfaceModel themodel = unified;
76 // model from GEANT3
77 G4OpticalSurfaceModel themodel = glisur;
78 theBoundaryProcess->SetModel(themodel);
79
80 theParticleIterator->reset();
81 while( (*theParticleIterator)() ){
82 G4ParticleDefinition* particle = theParticleIterator->value();
83 G4ProcessManager* processManager = particle->GetProcessManager();
84 G4String particleName = particle->GetParticleName();
85 if (theCerenkovProcess->IsApplicable(*particle)) {
86 processManager->AddContinuousProcess(theCerenkovProcess);
87 }
88 if (particleName == "opticalphoton") {
89 G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
90 processManager->AddDiscreteProcess(theAbsorptionProcess);
91 processManager->AddDiscreteProcess(theRayleighScatteringProcess);
92 processManager->AddDiscreteProcess(theBoundaryProcess);
93 }
94 }
95
e5967ab3 96 // map to G3 controls
97 TG4ProcessControlMap* controlMap = TG4ProcessControlMap::Instance();
98 controlMap->Add(theCerenkovProcess, kCKOV);
99 controlMap->Add(theAbsorptionProcess, kLABS);
100 controlMap->Add(theRayleighScatteringProcess, kRAYL);
101 controlMap->Add(theBoundaryProcess, kLABS);
102
103 // map to AliMCProcess codes
104 TG4ProcessMCMap* mcMap = TG4ProcessMCMap::Instance();
105 mcMap->Add(theCerenkovProcess, kPCerenkov);
106 mcMap->Add(theAbsorptionProcess, kPLightAbsorption);
107 mcMap->Add(theRayleighScatteringProcess, kPRayleigh);
108 mcMap->Add(theBoundaryProcess, kPLightScattering);
109
b94a914b 110 if (verboseLevel>0)
111 G4cout << "### " << namePhysics << " physics constructed." << G4endl;
112}
113