CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LaserOpticalPhysicsList.cc
Go to the documentation of this file.
1 
10 #include "G4ProcessManager.hh"
11 
12 #include "G4Cerenkov.hh"
13 #include "G4Scintillation.hh"
14 #include "G4OpAbsorption.hh"
15 #include "G4OpRayleigh.hh"
16 #include "G4OpBoundaryProcess.hh"
17 
19  : G4VPhysicsConstructor(name),
20  wasActivated(false),
21  theScintProcess(),
22  theCerenkovProcess(),
23  theAbsorptionProcess(),
24  theRayleighScattering(),
25  theBoundaryProcess(),
26  theWLSProcess()
27 {
28  if (verboseLevel > 0)
29  std::cout << "<LaserOpticalPhysicsList::LaserOpticalPhysicsList(...)> entering constructor ..." << std::endl;
30 }
31 
33 {
34  if (verboseLevel > 0)
35  {
36  std::cout << "<LaserOpticalPhysicsList::~LaserOpticalPhysicsList()> entering destructor ... " << std::endl;
37  std::cout << " deleting the processes ... ";
38  }
39  if ( theWLSProcess != 0 ) { delete theWLSProcess; }
40  if ( theBoundaryProcess != 0 ) { delete theBoundaryProcess; }
41  if ( theRayleighScattering != 0 ) { delete theRayleighScattering; }
42  if ( theAbsorptionProcess != 0 ) { delete theAbsorptionProcess; }
43 // if ( theCerenkovProcess != 0 ) { delete theCerenkovProcess; }
44  if ( theScintProcess != 0 ) { delete theScintProcess; }
45  if (verboseLevel > 0)
46  std::cout << " done " << std::endl;
47 }
48 
50 {
51  if (verboseLevel > 0)
52  std::cout << "<LaserOpticalPhysicsList::ConstructParticle()>: constructing the optical photon ... " << std::endl;
53 
54  // optical photon
55  G4OpticalPhoton::OpticalPhotonDefinition();
56 }
57 
59 {
60  if (verboseLevel > 0)
61  std::cout << "<LaserOpticalPhysicsList::ConstructProcess()>: constructing the physics ... " << std::endl;
62 
63  theScintProcess = new G4Scintillation();
64 // theCerenkovProcess=new G4Cerenkov();
65  theAbsorptionProcess=new G4OpAbsorption();
66  theRayleighScattering=new G4OpRayleigh();
67  theBoundaryProcess=new G4OpBoundaryProcess("OpBoundary");
68  theWLSProcess=new G4OpWLS();
69 
70  // set the verbosity level
71  theAbsorptionProcess->SetVerboseLevel(verboseLevel);
72  theBoundaryProcess->SetVerboseLevel(verboseLevel);
73 
74  G4ProcessManager * pManager = 0;
75 
76  pManager = G4OpticalPhoton::OpticalPhoton()->GetProcessManager();
77  pManager->AddDiscreteProcess(theAbsorptionProcess);
78  pManager->AddDiscreteProcess(theRayleighScattering);
79  theBoundaryProcess->SetModel(unified);
80  pManager->AddDiscreteProcess(theBoundaryProcess);
81  pManager->AddDiscreteProcess(theWLSProcess);
82 
83  theScintProcess->SetScintillationYieldFactor(1.);
84  theScintProcess->SetScintillationExcitationRatio(0.0);
85  theScintProcess->SetTrackSecondariesFirst(true);
86 
87  theParticleIterator->reset();
88  while( (*theParticleIterator)() )
89  {
90  G4ParticleDefinition* particle = theParticleIterator->value();
91  pManager = particle->GetProcessManager();
92 // if(theCerenkovProcess->IsApplicable(*particle))
93 // {
94 // pManager->AddContinuousProcess(theCerenkovProcess);
95 // }
96  if(theScintProcess->IsApplicable(*particle))
97  {
98  pManager->AddProcess(theScintProcess);
99  pManager->SetProcessOrderingToLast(theScintProcess,idxAtRest);
100  pManager->SetProcessOrderingToLast(theScintProcess,idxPostStep);
101  }
102  }
103 
104  wasActivated = true;
105 }
virtual void ConstructProcess()
construct Optical Processes
virtual void ConstructParticle()
construct Optical Photons
virtual ~LaserOpticalPhysicsList()
destructor
LaserOpticalPhysicsList(const G4String &name="optical")
constructor
G4OpBoundaryProcess * theBoundaryProcess
tuple cout
Definition: gather_cfg.py:121
G4OpAbsorption * theAbsorptionProcess