GEMC  1.8
Geant4 Monte-Carlo Framework
OpticalPhysics.cc
Go to the documentation of this file.
1 // %%%%%%%%%%
2 // G4 headers
3 // %%%%%%%%%%
4 #include "G4OpAbsorption.hh"
5 #include "G4OpBoundaryProcess.hh"
6 #include "G4OpRayleigh.hh"
7 #include "G4OpticalPhoton.hh"
8 #include "G4OpWLS.hh"
9 // #include "G4ParticleDefinition.hh"
10 // #include "G4ParticleTable.hh"
11 #include "G4ProcessManager.hh"
12 
13 #include "G4Cerenkov.hh"
14 
15 // %%%%%%%%%%%%
16 // gemc headers
17 // %%%%%%%%%%%%
18 #include "OpticalPhysics.h"
19 
20 // %%%%%%%%%%%
21 // C++ headers
22 // %%%%%%%%%%%
23 #include <string>
24 using namespace std;
25 
27 {
28  gemcOpt = Opt;
29 }
30 
32 
34 {
35  G4OpticalPhoton::OpticalPhotonDefinition();
36 }
37 
38 
40 {
41  string hd_msg = gemcOpt.args["LOG_MSG"].args + " Optical Physics List: <<< ";
42  double VERB = gemcOpt.args["PHY_VERBOSITY"].arg ;
43  cout << hd_msg << " Building Optical Physics processes " << endl;
44 
45  theScintProcess = new G4Scintillation("Scintillation");
46  theScintProcess->SetScintillationYieldFactor(1.);
47  theScintProcess->SetScintillationExcitationRatio(0.0);
48  theScintProcess->SetTrackSecondariesFirst(true);
49 
50  G4Cerenkov* theCerenkovProcess = new G4Cerenkov("Cerenkov");
51  theCerenkovProcess->SetMaxNumPhotonsPerStep(200);
52  theCerenkovProcess->SetTrackSecondariesFirst(true);
53 
54  G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption();
55  G4OpRayleigh* theRayleighScattering = new G4OpRayleigh();
56 
57  G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess();
58 
59  G4OpWLS* theWLSProcess = new G4OpWLS();
60  theWLSProcess->UseTimeProfile("delta");
61 
62  G4ProcessManager * pManager = 0;
63 
64  if(VERB > 2) cout << hd_msg << endl
65  << " > Optical Photon: " << endl
66  << " Absorption " << endl
67  << " Rayleigh Scattering" << endl
68  << " Boundary Processes" << endl
69  << " WaveLength Shifting " << endl;
70  pManager = G4OpticalPhoton::OpticalPhoton()->GetProcessManager();
71  pManager->AddDiscreteProcess(theAbsorptionProcess);
72  pManager->AddDiscreteProcess(theRayleighScattering);
73  pManager->AddDiscreteProcess(theBoundaryProcess);
74  pManager->AddDiscreteProcess(theWLSProcess);
75 
76  theParticleIterator->reset();
77  while( (*theParticleIterator)() )
78  {
79  G4ParticleDefinition* particle = theParticleIterator->value();
80  string particleName = particle->GetParticleName();
81 
82  pManager = particle->GetProcessManager();
83  if(theCerenkovProcess->IsApplicable(*particle))
84  {
85  if(VERB > 2) cout << hd_msg << " " << particleName << ": Cerenkov Process" << endl;
86  pManager->AddProcess(theCerenkovProcess);
87  pManager->SetProcessOrdering(theCerenkovProcess, idxPostStep);
88  }
89 
90  if(theScintProcess->IsApplicable(*particle))
91  {
92  if(VERB > 2) cout << hd_msg << " " << particleName << ": Scintillation Process" << endl;
93  pManager->AddProcess(theScintProcess);
94  pManager->SetProcessOrderingToLast(theScintProcess, idxAtRest);
95  pManager->SetProcessOrderingToLast(theScintProcess, idxPostStep);
96  }
97  }
98 }
99 
100 
102 {
103  string hd_msg = gemcOpt.args["LOG_MSG"].args + " Optical Physics List: <<< ";
104  double VERB = gemcOpt.args["PHY_VERBOSITY"].arg ;
105 
106  if(VERB > 2) cout << hd_msg << " Scintillation yield factor: " << yf << endl;
107  if(theScintProcess)
108  theScintProcess->SetScintillationYieldFactor(yf);
109 }
110 
111 
void SetScintYieldFactor(G4double yf)
gemc_opts gemcOpt
STL namespace.
OpticalPhysics(gemc_opts)
virtual void ConstructParticle()
virtual void ConstructProcess()
map< string, opts > args
Options map.
Definition: usage.h:68
G4Scintillation * theScintProcess
virtual ~OpticalPhysics()