Geant4-11
G4ProcessTable.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// G4ProcessTable
27//
28// Class description:
29//
30// This class is used for "book keeping" of all processes
31// which are registered for all particles
32
33// Author: H.Kurashige, 4 August 1998
34// --------------------------------------------------------------------
35#ifndef G4ProcessTable_hh
36#define G4ProcessTable_hh 1
37
38#include <vector>
39
40#include "globals.hh"
41#include "G4ProcTblElement.hh"
42#include "G4ProcessVector.hh"
44
45class G4UImessenger;
47
49{
51
52 public:
53
54 using G4ProcTableVector = std::vector<G4ProcTblElement*>;
55 using G4ProcNameVector = std::vector<G4String>;
56
58 // Destructor
59
62 G4bool operator==(const G4ProcessTable &right) const = delete;
63 G4bool operator!=(const G4ProcessTable &right) const = delete;
64 // Copy constructor and operators not allowed
65
67 // Return the pointer to the G4ProcessTable object
68 // As "singleton" one can get the instance pointer by this function
69
70 inline G4int Length() const;
71 // Return the number of processes in the table
72
73 G4int Insert(G4VProcess* aProcess, G4ProcessManager* aProcMgr);
74 G4int Remove(G4VProcess* aProcess, G4ProcessManager* aProcMgr);
75 // Each process object is registered with information of process
76 // managers that use it
77
78 G4VProcess* FindProcess(const G4String& processName,
79 const G4String& particleName) const;
80 inline G4VProcess* FindProcess(const G4String& processName,
81 const G4ParticleDefinition* particle) const;
82 G4VProcess* FindProcess(const G4String& processName,
83 const G4ProcessManager* processManager) const;
85 const G4ParticleDefinition* particle) const;
86 G4VProcess* FindProcess(G4int processSubType,
87 const G4ParticleDefinition* particle) const;
88 // Return the process pointer
89
92 // Implementation of registration mechanism
93
96 inline G4ProcessVector* FindProcesses( const G4String& processName );
98 // Return pointer of a process vector which includes processes specified
99 // Note: user is responsible to delete this process vector object
100
101 void SetProcessActivation( const G4String& processName,
102 G4bool fActive );
103 void SetProcessActivation( const G4String& processName,
104 const G4String& particleName,
105 G4bool fActive );
106 inline void SetProcessActivation( const G4String& processName,
107 const G4ParticleDefinition* particle,
108 G4bool fActive );
109 void SetProcessActivation( const G4String& processName,
110 G4ProcessManager* processManager,
111 G4bool fActive );
112 void SetProcessActivation( G4ProcessType processType,
113 G4bool fActive );
114 void SetProcessActivation( G4ProcessType processType,
115 const G4String& particleName,
116 G4bool fActive );
117 inline void SetProcessActivation( G4ProcessType processType,
118 const G4ParticleDefinition* particle,
119 G4bool fActive );
120 void SetProcessActivation( G4ProcessType processType,
121 G4ProcessManager* processManager,
122 G4bool fActive );
123 // These methods are provided to activate or inactivate processes
124
126 // Return pointer of the list of process name
127
129 // Return pointer of the vector of G4ProcTblElement
130
131 void DumpInfo(G4VProcess* process,
132 const G4ParticleDefinition* particle = nullptr);
133 // Dump out information of the process table. The second argument
134 // is used to specify processes designated by a particle
135
136 inline void SetVerboseLevel(G4int value);
137 inline G4int GetVerboseLevel() const;
138 // Set/Get control flag for output message
139 // 0: Silent
140 // 1: Warning message
141 // 2: More
142
143 private:
144
146 // Private default constructor
147
148 G4ProcTableVector* Find(const G4String& processName );
149 G4ProcTableVector* Find(G4ProcessType processType );
150 // Return pointer of a ProcTableVector which includes
151 // ProcTbleElement specified
152
154 // Extract all process objects from the process table
155
156 private:
157
160
163
165 // Used only internally as temporary buffer
166
167 std::vector<G4VProcess*> fListProcesses;
168 // Used for registration of process instances
169
171 // Control flag for output message
172};
173
174#include "G4ProcessTable.icc"
175
176#endif
G4ProcessType
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4ProcessTable(const G4ProcessTable &)=delete
void DumpInfo(G4VProcess *process, const G4ParticleDefinition *particle=nullptr)
G4ProcessVector * ExtractProcesses(G4ProcTableVector *) const
G4ProcTableVector * Find(const G4String &processName)
static G4ProcessTable * GetProcessTable()
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const
G4VProcess * FindProcess(const G4String &processName, const G4ParticleDefinition *particle) const
G4ProcessTableMessenger * fProcTblMessenger
G4ProcessVector * FindProcesses(const G4String &processName)
G4int Insert(G4VProcess *aProcess, G4ProcessManager *aProcMgr)
void RegisterProcess(G4VProcess *)
void DeRegisterProcess(G4VProcess *)
G4int Length() const
G4ProcessTable & operator=(const G4ProcessTable &)=delete
G4ProcTableVector * tmpTblVector
G4ProcNameVector * GetNameList()
G4bool operator==(const G4ProcessTable &right) const =delete
G4bool operator!=(const G4ProcessTable &right) const =delete
void SetProcessActivation(G4ProcessType processType, const G4ParticleDefinition *particle, G4bool fActive)
G4ProcTableVector * fProcTblVector
G4int GetVerboseLevel() const
std::vector< G4VProcess * > fListProcesses
G4int Remove(G4VProcess *aProcess, G4ProcessManager *aProcMgr)
G4ProcTableVector * GetProcTableVector()
void SetProcessActivation(const G4String &processName, G4bool fActive)
std::vector< G4ProcTblElement * > G4ProcTableVector
G4ProcNameVector * fProcNameVector
G4ProcessVector * FindProcesses()
void SetVerboseLevel(G4int value)
G4ProcessVector * FindProcesses(G4ProcessType processType)
static G4ThreadLocal G4ProcessTable * fProcessTable
std::vector< G4String > G4ProcNameVector
void SetProcessActivation(const G4String &processName, const G4ParticleDefinition *particle, G4bool fActive)
G4ProcessVector * FindProcesses(const G4ProcessManager *pManager)
#define G4ThreadLocal
Definition: tls.hh:77