Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VProcess.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//
27// $Id$
28//
29//
30// --------------------------------------------------------------
31// GEANT 4 class implementation file
32//
33// History: first implementation, based on object model of
34// 2nd December 1995, G.Cosmo
35// --------------------------------------------------------------
36// New Physics scheme 8 Jan. 1997 H.Kurahige
37// ------------------------------------------------------------
38// removed thePhysicsTable 02 Aug. 1998 H.Kurashige
39// Modified DumpInfo 15 Aug. 1998 H.Kurashige
40
41#include "G4VProcess.hh"
42
44#include "G4SystemOfUnits.hh"
45
46#include "G4PhysicsTable.hh"
47#include "G4MaterialTable.hh"
48#include "G4ElementTable.hh"
49#include "G4ElementVector.hh"
50
52 : aProcessManager(0),
53 pParticleChange(0),
54 theNumberOfInteractionLengthLeft(-1.0),
55 currentInteractionLength(-1.0),
56 theInitialNumberOfInteractionLength(-1.0),
57 theProcessName(aName),
58 theProcessType(aType),
59 theProcessSubType(-1),
60 thePILfactor(1.0),
61 enableAtRestDoIt(true),
62 enableAlongStepDoIt(true),
63 enablePostStepDoIt(true),
64 verboseLevel(0)
65
66{
68}
69
71{
72}
73
75 : aProcessManager(0),
76 pParticleChange(0),
77 theNumberOfInteractionLengthLeft(-1.0),
78 currentInteractionLength(-1.0),
79 theInitialNumberOfInteractionLength(-1.0),
80 theProcessName(right.theProcessName),
81 theProcessType(right.theProcessType),
82 theProcessSubType(right.theProcessSubType),
83 thePILfactor(1.0),
84 enableAtRestDoIt(right.enableAtRestDoIt),
85 enableAlongStepDoIt(right.enableAlongStepDoIt),
86 enablePostStepDoIt(right.enablePostStepDoIt),
87 verboseLevel(right.verboseLevel)
88{
89}
90
91
93{
96}
97
99 G4double previousStepSize )
100{
101 if (currentInteractionLength>0.0) {
105 }
106
107 } else {
108#ifdef G4VERBOSE
109 if (verboseLevel>0) {
110 G4cerr << "G4VProcess::SubtractNumberOfInteractionLengthLeft()";
111 G4cerr << " [" << theProcessName << "]" <<G4endl;
112 G4cerr << " currentInteractionLength = " << currentInteractionLength/cm << " [cm]";
113 G4cerr << " previousStepSize = " << previousStepSize/cm << " [cm]";
114 G4cerr << G4endl;
115 }
116#endif
117 G4String msg = "Negative currentInteractionLength for ";
118 msg += theProcessName;
119 G4Exception("G4VProcess::SubtractNumberOfInteractionLengthLeft()",
120 "ProcMan201",EventMustBeAborted,
121 msg);
122 }
123}
124
126{
130#ifdef G4VERBOSE
131 if (verboseLevel>2) {
132 G4cout << "G4VProcess::StartTracking() [" << theProcessName << "]" <<G4endl;
133 }
134#endif
135}
136
138{
139#ifdef G4VERBOSE
140 if (verboseLevel>2) {
141 G4cout << "G4VProcess::EndTracking() [" << theProcessName << "]" <<G4endl;
142 }
143#endif
147}
148
149
151{
152 static G4String typeNotDefined= "NotDefined";
153 static G4String typeTransportation = "Transportation";
154 static G4String typeElectromagnetic = "Electromagnetic";
155 static G4String typeOptical = "Optical";
156 static G4String typeHadronic = "Hadronic";
157 static G4String typePhotolepton_hadron = "Photolepton_hadron";
158 static G4String typeDecay = "Decay";
159 static G4String typeGeneral = "General";
160 static G4String typeParameterisation = "Parameterisation";
161 static G4String typeUserDefined = "UserDefined";
162 static G4String noType = "------"; // Do not modify this !!!!
163
164 if (aType == fNotDefined) {
165 return typeNotDefined;
166 } else if (aType == fTransportation ) {
167 return typeTransportation;
168 } else if (aType == fElectromagnetic ) {
169 return typeElectromagnetic;
170 } else if (aType == fOptical ) {
171 return typeOptical;
172 } else if (aType == fHadronic ) {
173 return typeHadronic;
174 } else if (aType == fPhotolepton_hadron ) {
175 return typePhotolepton_hadron;
176 } else if (aType == fDecay ) {
177 return typeDecay;
178 } else if (aType == fGeneral ) {
179 return typeGeneral;
180 } else if (aType == fParameterisation ) {
181 return typeParameterisation;
182 } else if (aType == fUserDefined ) {
183 return typeUserDefined;
184 } else {
185 return noType;
186 }
187}
188
189G4VProcess & G4VProcess::operator=(const G4VProcess &)
190{
191 G4Exception("G4VProcess::operator=","ProcMan101",
192 JustWarning,"Assignment operator is called but NO effect");
193 return *this;
194}
195
197{
198 return (this == &right);
199}
200
202{
203 return (this != &right);
204}
205
207{
208 G4cout << "Process Name " << theProcessName ;
209 G4cout << " : Type[" << GetProcessTypeName(theProcessType) << "]";
210 G4cout << " : SubType[" << theProcessSubType << "]"<< G4endl;
211}
212
213
215 const G4String& directory,
216 const G4String& tableName,
217 G4bool ascii)
218{
219 G4String thePhysicsTableFileExt;
220 if (ascii) thePhysicsTableFileExt = ".asc";
221 else thePhysicsTableFileExt = ".dat";
222
223 thePhysicsTableFileName = directory + "/";
224 thePhysicsTableFileName += tableName + "." + theProcessName + ".";
225 thePhysicsTableFileName += particle->GetParticleName() + thePhysicsTableFileExt;
226
228}
@ JustWarning
@ EventMustBeAborted
G4ProcessType
@ fOptical
@ fParameterisation
@ fGeneral
@ fDecay
@ fElectromagnetic
@ fHadronic
@ fUserDefined
@ fTransportation
@ fPhotolepton_hadron
@ fNotDefined
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:53
const G4String & GetParticleName() const
G4int operator==(const G4VProcess &right) const
Definition: G4VProcess.cc:196
G4double currentInteractionLength
Definition: G4VProcess.hh:297
G4double theInitialNumberOfInteractionLength
Definition: G4VProcess.hh:300
static const G4String & GetProcessTypeName(G4ProcessType)
Definition: G4VProcess.cc:150
G4ProcessType theProcessType
Definition: G4VProcess.hh:340
virtual void ResetNumberOfInteractionLengthLeft()
Definition: G4VProcess.cc:92
G4ParticleChange aParticleChange
Definition: G4VProcess.hh:289
void SubtractNumberOfInteractionLengthLeft(G4double previousStepSize)
Definition: G4VProcess.cc:98
G4VProcess(const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
Definition: G4VProcess.cc:51
G4String thePhysicsTableFileName
Definition: G4VProcess.hh:338
virtual ~G4VProcess()
Definition: G4VProcess.cc:70
G4int verboseLevel
Definition: G4VProcess.hh:368
G4int operator!=(const G4VProcess &right) const
Definition: G4VProcess.cc:201
G4double theNumberOfInteractionLengthLeft
Definition: G4VProcess.hh:293
virtual void StartTracking(G4Track *)
Definition: G4VProcess.cc:125
G4int theProcessSubType
Definition: G4VProcess.hh:343
G4String theProcessName
Definition: G4VProcess.hh:335
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
virtual void DumpInfo() const
Definition: G4VProcess.cc:206
virtual void EndTracking()
Definition: G4VProcess.cc:137
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
Definition: G4VProcess.cc:214
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41