CMS 3D CMS Logo

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