Garfield++ 3.0
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 auto theParticleIterator = GetParticleIterator();
82 theParticleIterator->reset();
83 while ((*theParticleIterator)()) {
84
85 G4ParticleDefinition* particle = theParticleIterator->value();
86 G4ProcessManager* pmanager = particle->GetProcessManager();
87 G4EmConfigurator* config =
88 G4LossTableManager::Instance()->EmConfigurator();
89 G4LossTableManager::Instance()->SetVerbose(1);
90
91 if (garfieldPhysics->FindParticleName(particle->GetParticleName(),
92 "garfield")) {
93 pmanager->AddDiscreteProcess(fastSimProcess_garfield);
94 }
95
96 if (garfieldPhysics->FindParticleName(particle->GetParticleName(),
97 "geant4")) {
98 double minEnergy_MeV = garfieldPhysics->GetMinEnergyMeVParticle(
99 particle->GetParticleName(), "geant4");
100 double maxEnergy_MeV = garfieldPhysics->GetMaxEnergyMeVParticle(
101 particle->GetParticleName(), "geant4");
102 if (ionizationModel == "PAI") {
103
104 G4PAIModel* pai = new G4PAIModel(particle, "G4PAIModel");
105 if (particle->GetParticleName() == "e-"
106 || particle->GetParticleName() == "e+") {
107
108 config->SetExtraEmModel(particle->GetParticleName(),
109 "eIoni", pai, "RegionGarfield", minEnergy_MeV * MeV,
110 maxEnergy_MeV * MeV, pai);
111
112 } else if (particle->GetParticleName() == "mu-"
113 || particle->GetParticleName() == "mu+") {
114
115 config->SetExtraEmModel(particle->GetParticleName(),
116 "muIoni", pai, "RegionGarfield", minEnergy_MeV * MeV,
117 maxEnergy_MeV * MeV, pai);
118
119 } else if (particle->GetParticleName() == "proton"
120 || particle->GetParticleName() == "pi+"
121 || particle->GetParticleName() == "pi-") {
122
123 config->SetExtraEmModel(particle->GetParticleName(),
124 "hIoni", pai, "RegionGarfield", minEnergy_MeV * MeV,
125 maxEnergy_MeV * MeV, pai);
126
127 } else if (particle->GetParticleName() == "alpha"
128 || particle->GetParticleName() == "He3"
129 || particle->GetParticleName() == "GenericIon") {
130
131 config->SetExtraEmModel(particle->GetParticleName(),
132 "ionIoni", pai, "RegionGarfield", minEnergy_MeV * MeV,
133 maxEnergy_MeV * MeV, pai);
134
135 }
136
137 } else if (ionizationModel == "PAIPhot") {
138
139 G4PAIPhotModel* paiPhot = new G4PAIPhotModel(particle,
140 "G4PAIModel");
141 if (particle->GetParticleName() == "e-"
142 || particle->GetParticleName() == "e+") {
143
144 config->SetExtraEmModel(particle->GetParticleName(),
145 "eIoni", paiPhot, "RegionGarfield", minEnergy_MeV * MeV,
146 maxEnergy_MeV * MeV, paiPhot);
147
148 } else if (particle->GetParticleName() == "mu-"
149 || particle->GetParticleName() == "mu+") {
150
151 config->SetExtraEmModel(particle->GetParticleName(),
152 "muIoni", paiPhot, "RegionGarfield", minEnergy_MeV * MeV,
153 maxEnergy_MeV * MeV, paiPhot);
154
155 } else if (particle->GetParticleName() == "proton"
156 || particle->GetParticleName() == "pi+"
157 || particle->GetParticleName() == "pi-") {
158
159 config->SetExtraEmModel(particle->GetParticleName(),
160 "hIoni", paiPhot, "RegionGarfield", minEnergy_MeV * MeV,
161 maxEnergy_MeV * MeV, paiPhot);
162
163 } else if (particle->GetParticleName() == "alpha"
164 || particle->GetParticleName() == "He3"
165 || particle->GetParticleName() == "GenericIon") {
166
167 config->SetExtraEmModel(particle->GetParticleName(),
168 "ionIoni", paiPhot, "RegionGarfield", minEnergy_MeV * MeV,
169 maxEnergy_MeV * MeV, paiPhot);
170
171 }
172 }
173 }
174 }
175}
176
177
179 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100. * eV,
180 100. * TeV);
181
182 SetCutsWithDefault();
183
184 G4Region *region = G4RegionStore::GetInstance()->GetRegion(
185 "RegionGarfield");
186 G4ProductionCuts * cuts = new G4ProductionCuts();
187 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex("gamma"));
188 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex("e-"));
189 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex("e+"));
190 if (region) {
191 region->SetProductionCuts(cuts);
192 }
193
194 DumpCutValuesTable();
195}
196
198 G4VModularPhysicsList::ConstructParticle();
199}
200
202 G4VModularPhysicsList::ConstructProcess();
204}
205
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")