CMS 3D CMS Logo

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