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