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 != nullptr ) { delete theWLSProcess; }
43  if ( theBoundaryProcess != nullptr ) { delete theBoundaryProcess; }
44  if ( theRayleighScattering != nullptr ) { delete theRayleighScattering; }
45  if ( theAbsorptionProcess != nullptr ) { delete theAbsorptionProcess; }
46  if ( theScintProcess != nullptr ) { 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 = nullptr;
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 }
const std::vector< G4String > & PartNames() const
~LaserOpticalPhysicsList() override
destructor
void ConstructParticle() override
construct Optical Photons
LaserOpticalPhysicsList(const G4String &name="optical")
constructor
G4OpBoundaryProcess * theBoundaryProcess
void ConstructProcess() override
construct Optical Processes
G4OpAbsorption * theAbsorptionProcess