Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
43 #include "G4PhysicalConstants.hh"
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 
189 G4VProcess & 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 }