Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PhysicsListHelper.hh
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// G4PhysicsListHelper
27//
28// Class description:
29//
30// Helper class for physics lists, to register processes according
31// to the ordering parameter table. This class is a singleton.
32
33// Author: H.Kurashige, 29 April 2011
34// --------------------------------------------------------------------
35#ifndef G4PhysicsListHelper_hh
36#define G4PhysicsListHelper_hh 1
37
39#include "G4ParticleTable.hh"
42#include "G4ios.hh"
43#include "globals.hh"
44
45#include <vector>
46
47class G4VProcess;
48
50{
52
53 public:
54 // Returns the pointer to the physics list helper
56
57 // Registers a process to the particle type according to the ordering
58 // parameter table. Returns 'true' if process is successfully registered.
60
61 // User must invoke this method in his ConstructProcess() implementation
62 // in order to enable particle transportation.
63 void AddTransportation();
64
65 // Set flag for using G4CoupledTransportation.
66 void UseCoupledTransportation(G4bool vl = true);
67
68 // Change the thresholds for killing looping tracks in transportation.
69 void UseHighLooperThresholds() { theLooperThresholds = 2; }
70 void UseLowLooperThresholds() { theLooperThresholds = 0; }
71
72 // Check consistencies of list of particles.
73 void CheckParticleList() const;
74
75 // Dump OrdingParameterTable.
76 void DumpOrdingParameterTable(G4int subType = -1) const;
77
79
80 // set/get controle flag for output message
81 // 0: Silent
82 // 1: Warning message
83 // 2: More
84 void SetVerboseLevel(G4int value);
85 G4int GetVerboseLevel() const;
86
87 private:
88 // Hidden constructor and destructor.
91
92 void ReadOrdingParameterTable();
93 void ReadInDefaultOrderingParameter();
94
95 private:
96 using G4OrdParamTable = std::vector<G4PhysicsListOrderingParameter>;
97
98 static G4ThreadLocal G4PhysicsListHelper* pPLHelper;
99
100 // The particle table has the complete List of existing particle types.
101 G4ParticleTable* theParticleTable = nullptr;
102 G4ParticleTable::G4PTblDicIterator* aParticleIterator = nullptr;
103
104 G4bool useCoupledTransportation = false;
105 G4int theLooperThresholds = 1; // 0 = Low, 1 = default, 2 = high
106 G4VProcess* theTransportationProcess = nullptr;
107
108 G4int verboseLevel = 1;
109
110 G4OrdParamTable* theTable = nullptr;
111 G4int sizeOfTable = 0;
112 G4String ordParamFileName = "";
113};
114
115// Inline methods implementations
116
118{
119 useCoupledTransportation = vl;
120}
121
123{
124 verboseLevel = value;
125}
126
128{
129 return verboseLevel;
130}
131
132#endif
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4bool RegisterProcess(G4VProcess *process, G4ParticleDefinition *particle)
void UseCoupledTransportation(G4bool vl=true)
static G4PhysicsListHelper * GetPhysicsListHelper()
void DumpOrdingParameterTable(G4int subType=-1) const
G4PhysicsListOrderingParameter GetOrdingParameter(G4int subType) const
void SetVerboseLevel(G4int value)
#define G4ThreadLocal
Definition tls.hh:77