Garfield++ 4.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
33#include "G4EmConfigurator.hh"
34#include "G4FastSimulationManagerProcess.hh"
35#include "G4LossTableManager.hh"
36#include "G4PAIModel.hh"
37#include "G4PAIPhotModel.hh"
38#include "G4ProcessManager.hh"
39#include "G4ProcessVector.hh"
40#include "G4ProductionCuts.hh"
41#include "G4Region.hh"
42#include "G4RegionStore.hh"
43#include "G4SystemOfUnits.hh"
44#include "G4UnitsTable.hh"
45#include "GarfieldPhysics.hh"
46#include "QGSP_BERT_HP.hh"
47
48//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
49
50GarfieldPhysicsList::GarfieldPhysicsList() : 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) break;
59 G4cout << "RegisterPhysics: " << elem->GetPhysicsName() << G4endl;
60 RegisterPhysics(elem);
61 }
62}
63
64//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65
67
70
71 std::string ionizationModel = garfieldPhysics->GetIonizationModel();
72
73 auto fastSimProcess_garfield = new G4FastSimulationManagerProcess("G4FSMP_garfield");
74
75 auto theParticleIterator = GetParticleIterator();
76 theParticleIterator->reset();
77 while ((*theParticleIterator)()) {
78 G4ParticleDefinition* particle = theParticleIterator->value();
79 G4ProcessManager* pmanager = particle->GetProcessManager();
80 G4EmConfigurator* config = G4LossTableManager::Instance()->EmConfigurator();
81 G4LossTableManager::Instance()->SetVerbose(1);
82
83 auto particleName = particle->GetParticleName();
84 if (garfieldPhysics->FindParticleName(particleName, "garfield")) {
85 pmanager->AddDiscreteProcess(fastSimProcess_garfield);
86 }
87
88 if (garfieldPhysics->FindParticleName(particleName, "geant4")) {
89 double eMin = MeV * garfieldPhysics->GetMinEnergyMeVParticle(
90 particleName, "geant4");
91 double eMax = MeV * garfieldPhysics->GetMaxEnergyMeVParticle(
92 particleName, "geant4");
93 if (ionizationModel == "PAI") {
94 G4PAIModel* pai = new G4PAIModel(particle, "G4PAIModel");
95 if (particleName == "e-" || particleName == "e+") {
96 config->SetExtraEmModel(particleName, "eIoni", pai,
97 "RegionGarfield", eMin, eMax, pai);
98 } else if (particleName == "mu-" || particleName == "mu+") {
99 config->SetExtraEmModel(particleName, "muIoni", pai,
100 "RegionGarfield", eMin, eMax, pai);
101 } else if (particleName == "proton" ||
102 particleName == "pi+" || particleName == "pi-") {
103 config->SetExtraEmModel(particleName, "hIoni", pai,
104 "RegionGarfield", eMin, eMax, pai);
105 } else if (particleName == "alpha" || particleName == "He3" ||
106 particleName == "GenericIon") {
107 config->SetExtraEmModel(particleName, "ionIoni", pai,
108 "RegionGarfield", eMin, eMax, pai);
109 }
110 } else if (ionizationModel == "PAIPhot") {
111 G4PAIPhotModel* paiPhot = new G4PAIPhotModel(particle, "G4PAIModel");
112 if (particleName == "e-" || particleName == "e+") {
113 config->SetExtraEmModel(particleName, "eIoni", paiPhot,
114 "RegionGarfield", eMin, eMax, paiPhot);
115 } else if (particleName == "mu-" || particleName == "mu+") {
116 config->SetExtraEmModel(particleName, "muIoni", paiPhot,
117 "RegionGarfield", eMin, eMax, paiPhot);
118 } else if (particleName == "proton" ||
119 particleName == "pi+" || particleName == "pi-") {
120 config->SetExtraEmModel(particleName, "hIoni", paiPhot,
121 "RegionGarfield", eMin, eMax, paiPhot);
122 } else if (particleName == "alpha" || particleName == "He3" ||
123 particleName == "GenericIon") {
124 config->SetExtraEmModel(particleName, "ionIoni", paiPhot,
125 "RegionGarfield", eMin, eMax, paiPhot);
126 }
127 }
128 }
129 }
130}
131
133 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100. * eV,
134 100. * TeV);
135
136 SetCutsWithDefault();
137
138 G4Region* region = G4RegionStore::GetInstance()->GetRegion("RegionGarfield");
139 G4ProductionCuts* cuts = new G4ProductionCuts();
140 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex("gamma"));
141 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex("e-"));
142 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex("e+"));
143 if (region) {
144 region->SetProductionCuts(cuts);
145 }
146
147 DumpCutValuesTable();
148}
149
151 G4VModularPhysicsList::ConstructParticle();
152}
153
155 G4VModularPhysicsList::ConstructProcess();
157}
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")