Garfield++ 5.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
GarfieldPhysicsList Class Reference

#include <GarfieldPhysicsList.hh>

+ Inheritance diagram for GarfieldPhysicsList:

Public Member Functions

 GarfieldPhysicsList ()
 
virtual ~GarfieldPhysicsList ()
 
virtual void SetCuts ()
 
virtual void ConstructParticle ()
 
virtual void ConstructProcess ()
 

Protected Member Functions

void AddParameterisation ()
 

Detailed Description

Definition at line 37 of file GarfieldPhysicsList.hh.

Constructor & Destructor Documentation

◆ GarfieldPhysicsList()

GarfieldPhysicsList::GarfieldPhysicsList ( )

Definition at line 48 of file GarfieldPhysicsList.cc.

48 : G4VModularPhysicsList() {
49 G4int verb = 0;
50 SetVerboseLevel(verb);
51 defaultCutValue = 1 * CLHEP::mm;
52 QGSP_BERT_HP* physicsList = new QGSP_BERT_HP;
53 for (G4int i = 0;; ++i) {
54 G4VPhysicsConstructor* elem =
55 const_cast<G4VPhysicsConstructor*>(physicsList->GetPhysics(i));
56 if (!elem) break;
57 G4cout << "RegisterPhysics: " << elem->GetPhysicsName() << G4endl;
58 RegisterPhysics(elem);
59 }
60}

◆ ~GarfieldPhysicsList()

GarfieldPhysicsList::~GarfieldPhysicsList ( )
virtual

Definition at line 64 of file GarfieldPhysicsList.cc.

64{}

Member Function Documentation

◆ AddParameterisation()

void GarfieldPhysicsList::AddParameterisation ( )
protected

Definition at line 66 of file GarfieldPhysicsList.cc.

66 {
67 GarfieldPhysics* garfieldPhysics = GarfieldPhysics::GetInstance();
68
69 std::string ionizationModel = garfieldPhysics->GetIonizationModel();
70
71 auto fastSimProcess_garfield = new G4FastSimulationManagerProcess("G4FSMP_garfield");
72
73 auto theParticleIterator = GetParticleIterator();
74 theParticleIterator->reset();
75 while ((*theParticleIterator)()) {
76 G4ParticleDefinition* particle = theParticleIterator->value();
77 G4ProcessManager* pmanager = particle->GetProcessManager();
78 G4EmConfigurator* config = G4LossTableManager::Instance()->EmConfigurator();
79 G4LossTableManager::Instance()->SetVerbose(1);
80
81 auto particleName = particle->GetParticleName();
82 if (garfieldPhysics->FindParticleName(particleName, "garfield")) {
83 pmanager->AddDiscreteProcess(fastSimProcess_garfield);
84 }
85
86 if (garfieldPhysics->FindParticleName(particleName, "geant4")) {
87 double eMin = MeV * garfieldPhysics->GetMinEnergyMeVParticle(
88 particleName, "geant4");
89 double eMax = MeV * garfieldPhysics->GetMaxEnergyMeVParticle(
90 particleName, "geant4");
91 if (ionizationModel == "PAI") {
92 G4PAIModel* pai = new G4PAIModel(particle, "G4PAIModel");
93 if (particleName == "e-" || particleName == "e+") {
94 config->SetExtraEmModel(particleName, "eIoni", pai,
95 "RegionGarfield", eMin, eMax, pai);
96 } else if (particleName == "mu-" || particleName == "mu+") {
97 config->SetExtraEmModel(particleName, "muIoni", pai,
98 "RegionGarfield", eMin, eMax, pai);
99 } else if (particleName == "proton" ||
100 particleName == "pi+" || particleName == "pi-") {
101 config->SetExtraEmModel(particleName, "hIoni", pai,
102 "RegionGarfield", eMin, eMax, pai);
103 } else if (particleName == "alpha" || particleName == "He3" ||
104 particleName == "GenericIon") {
105 config->SetExtraEmModel(particleName, "ionIoni", pai,
106 "RegionGarfield", eMin, eMax, pai);
107 }
108 } else if (ionizationModel == "PAIPhot") {
109 G4PAIPhotModel* paiPhot = new G4PAIPhotModel(particle, "G4PAIModel");
110 if (particleName == "e-" || particleName == "e+") {
111 config->SetExtraEmModel(particleName, "eIoni", paiPhot,
112 "RegionGarfield", eMin, eMax, paiPhot);
113 } else if (particleName == "mu-" || particleName == "mu+") {
114 config->SetExtraEmModel(particleName, "muIoni", paiPhot,
115 "RegionGarfield", eMin, eMax, paiPhot);
116 } else if (particleName == "proton" ||
117 particleName == "pi+" || particleName == "pi-") {
118 config->SetExtraEmModel(particleName, "hIoni", paiPhot,
119 "RegionGarfield", eMin, eMax, paiPhot);
120 } else if (particleName == "alpha" || particleName == "He3" ||
121 particleName == "GenericIon") {
122 config->SetExtraEmModel(particleName, "ionIoni", paiPhot,
123 "RegionGarfield", eMin, eMax, paiPhot);
124 }
125 }
126 }
127 }
128}
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")

Referenced by ConstructProcess().

◆ ConstructParticle()

void GarfieldPhysicsList::ConstructParticle ( )
virtual

Definition at line 148 of file GarfieldPhysicsList.cc.

148 {
149 G4VModularPhysicsList::ConstructParticle();
150}

◆ ConstructProcess()

void GarfieldPhysicsList::ConstructProcess ( )
virtual

Definition at line 152 of file GarfieldPhysicsList.cc.

152 {
153 G4VModularPhysicsList::ConstructProcess();
155}

◆ SetCuts()

void GarfieldPhysicsList::SetCuts ( )
virtual

Definition at line 130 of file GarfieldPhysicsList.cc.

130 {
131 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100. * eV,
132 100. * TeV);
133
134 SetCutsWithDefault();
135
136 G4Region* region = G4RegionStore::GetInstance()->GetRegion("RegionGarfield");
137 G4ProductionCuts* cuts = new G4ProductionCuts();
138 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex("gamma"));
139 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex("e-"));
140 cuts->SetProductionCut(1 * um, G4ProductionCuts::GetIndex("e+"));
141 if (region) {
142 region->SetProductionCuts(cuts);
143 }
144
145 DumpCutValuesTable();
146}

The documentation for this class was generated from the following files: