Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
GarfieldPhysicsList.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// $Id: GarfieldPhysicsList.cc 999997 2015-12-11 14:47:43Z dpfeiffe $
27//
28/// \file GarfieldPhysicsList.cc
29/// \brief Implementation of the GarfieldPhysicsList class
30
32#include "GarfieldPhysics.hh"
33#include "G4ProcessManager.hh"
34#include "G4ProcessVector.hh"
35#include "G4UnitsTable.hh"
36#include "G4SystemOfUnits.hh"
37#include "QGSP_BERT_HP.hh"
38#include "G4FastSimulationManagerProcess.hh"
39#include "G4PAIPhotModel.hh"
40#include "G4PAIModel.hh"
41#include "G4LossTableManager.hh"
42#include "G4EmConfigurator.hh"
43#include "G4Region.hh"
44#include "G4RegionStore.hh"
45#include "G4ProductionCuts.hh"
46
47//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48
50 G4VModularPhysicsList() {
51 G4int verb = 0;
52 SetVerboseLevel(verb);
53 defaultCutValue = 1 * CLHEP::mm;
54 QGSP_BERT_HP *physicsList = new QGSP_BERT_HP;
55 for (G4int i = 0;; ++i) {
56 G4VPhysicsConstructor* elem =
57 const_cast<G4VPhysicsConstructor*>(physicsList->GetPhysics(i));
58 if (elem == NULL)
59 break;
60 G4cout << "RegisterPhysics: " << elem->GetPhysicsName() << G4endl;
61 RegisterPhysics(elem);
62 }
63
64}
65
66//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67
69
70}
71
73
75
76 std::string ionizationModel = garfieldPhysics->GetIonizationModel();
77
78 G4FastSimulationManagerProcess* fastSimProcess_garfield =
79 new G4FastSimulationManagerProcess("G4FSMP_garfield");
80
81 theParticleIterator->reset();
82 while ((*theParticleIterator)()) {
83
84 G4ParticleDefinition* particle = theParticleIterator->value();
85 G4ProcessManager* pmanager = particle->GetProcessManager();
86 G4EmConfigurator* config =
87 G4LossTableManager::Instance()->EmConfigurator();
88 G4LossTableManager::Instance()->SetVerbose(1);
89
90 if (garfieldPhysics->FindParticleName(particle->GetParticleName(),
91 "garfield")) {
92 pmanager->AddDiscreteProcess(fastSimProcess_garfield);
93 }
94
95 if (garfieldPhysics->FindParticleName(particle->GetParticleName(),
96 "geant4")) {
97 double minEnergy_MeV = garfieldPhysics->GetMinEnergyMeVParticle(
98 particle->GetParticleName(), "geant4");
99 double maxEnergy_MeV = garfieldPhysics->GetMaxEnergyMeVParticle(
100 particle->GetParticleName(), "geant4");
101 if (ionizationModel == "PAI") {
102
103 G4PAIModel* pai = new G4PAIModel(particle, "G4PAIModel");
104 if (particle->GetParticleName() == "e-"
105 || particle->GetParticleName() == "e+") {
106
107 config->SetExtraEmModel(particle->GetParticleName(),
108 "eIoni", pai, "RegionGarfield", minEnergy_MeV * MeV,
109 maxEnergy_MeV * MeV, pai);
110
111 } else if (particle->GetParticleName() == "mu-"
112 || particle->GetParticleName() == "mu+") {
113
114 config->SetExtraEmModel(particle->GetParticleName(),
115 "muIoni", pai, "RegionGarfield", minEnergy_MeV * MeV,
116 maxEnergy_MeV * MeV, pai);
117
118 } else if (particle->GetParticleName() == "proton"
119 || particle->GetParticleName() == "pi+"
120 || particle->GetParticleName() == "pi-") {
121
122 config->SetExtraEmModel(particle->GetParticleName(),
123 "hIoni", pai, "RegionGarfield", minEnergy_MeV * MeV,
124 maxEnergy_MeV * MeV, pai);
125
126 } else if (particle->GetParticleName() == "alpha"
127 || particle->GetParticleName() == "He3"
128 || particle->GetParticleName() == "GenericIon") {
129
130 config->SetExtraEmModel(particle->GetParticleName(),
131 "ionIoni", pai, "RegionGarfield", minEnergy_MeV * MeV,
132 maxEnergy_MeV * MeV, pai);
133
134 }
135
136 } else if (ionizationModel == "PAIPhot") {
137
138 G4PAIPhotModel* paiPhot = new G4PAIPhotModel(particle,
139 "G4PAIModel");
140 if (particle->GetParticleName() == "e-"
141 || particle->GetParticleName() == "e+") {
142
143 config->SetExtraEmModel(particle->GetParticleName(),
144 "eIoni", paiPhot, "RegionGarfield", minEnergy_MeV * MeV,
145 maxEnergy_MeV * MeV, paiPhot);
146
147 } else if (particle->GetParticleName() == "mu-"
148 || particle->GetParticleName() == "mu+") {
149
150 config->SetExtraEmModel(particle->GetParticleName(),
151 "muIoni", paiPhot, "RegionGarfield", minEnergy_MeV * MeV,
152 maxEnergy_MeV * MeV, paiPhot);
153
154 } else if (particle->GetParticleName() == "proton"
155 || particle->GetParticleName() == "pi+"
156 || particle->GetParticleName() == "pi-") {
157
158 config->SetExtraEmModel(particle->GetParticleName(),
159 "hIoni", paiPhot, "RegionGarfield", minEnergy_MeV * MeV,
160 maxEnergy_MeV * MeV, paiPhot);
161
162 } else if (particle->GetParticleName() == "alpha"
163 || particle->GetParticleName() == "He3"
164 || particle->GetParticleName() == "GenericIon") {
165
166 config->SetExtraEmModel(particle->GetParticleName(),
167 "ionIoni", paiPhot, "RegionGarfield", minEnergy_MeV * MeV,
168 maxEnergy_MeV * MeV, paiPhot);
169
170 }
171 }
172 }
173 }
174}
175
176
178 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100. * eV,
179 100. * TeV);
180
181 SetCutsWithDefault();
182
183 G4Region *region = G4RegionStore::GetInstance()->GetRegion(
184 "RegionGarfield");
185 G4ProductionCuts * cuts = new G4ProductionCuts();
186 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex("gamma"));
187 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex("e-"));
188 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex("e+"));
189 if (region) {
190 region->SetProductionCuts(cuts);
191 }
192
193 DumpCutValuesTable();
194}
195
197 G4VModularPhysicsList::ConstructParticle();
198}
199
201 G4VModularPhysicsList::ConstructProcess();
203}
204
Definition of the GarfieldPhysicsList class.
Definition of the GarfieldPhysics class.
virtual void ConstructProcess()
virtual void ConstructParticle()
double GetMaxEnergyMeVParticle(std::string name, std::string program="garfield")
static GarfieldPhysics * GetInstance()
double GetMinEnergyMeVParticle(std::string name, std::string program="garfield")
std::string GetIonizationModel()
bool FindParticleName(const std::string name, std::string program="garfield")