Geant4  10.00.p03
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: G4VProcess.cc 75600 2013-11-04 13:03:02Z gcosmo $
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 // Add fPhonon to ProcessTypeName 30 Oct. 2013 M.Kelsey
41 
42 #include "G4VProcess.hh"
43 
44 #include "G4PhysicalConstants.hh"
45 #include "G4SystemOfUnits.hh"
46 
47 #include "G4PhysicsTable.hh"
48 #include "G4MaterialTable.hh"
49 #include "G4ElementTable.hh"
50 #include "G4ElementVector.hh"
51 
53  : aProcessManager(0),
54  pParticleChange(0),
55  theNumberOfInteractionLengthLeft(-1.0),
56  currentInteractionLength(-1.0),
57  theInitialNumberOfInteractionLength(-1.0),
58  theProcessName(aName),
59  theProcessType(aType),
60  theProcessSubType(-1),
61  thePILfactor(1.0),
62  enableAtRestDoIt(true),
63  enableAlongStepDoIt(true),
64  enablePostStepDoIt(true),
65  verboseLevel(0),
66  masterProcessShadow(0)
67 
68 {
70 }
71 
73 {
74 }
75 
77  : aProcessManager(0),
78  pParticleChange(0),
79  theNumberOfInteractionLengthLeft(-1.0),
80  currentInteractionLength(-1.0),
81  theInitialNumberOfInteractionLength(-1.0),
82  theProcessName(right.theProcessName),
83  theProcessType(right.theProcessType),
84  theProcessSubType(right.theProcessSubType),
85  thePILfactor(1.0),
86  enableAtRestDoIt(right.enableAtRestDoIt),
87  enableAlongStepDoIt(right.enableAlongStepDoIt),
88  enablePostStepDoIt(right.enablePostStepDoIt),
89  verboseLevel(right.verboseLevel),
90  masterProcessShadow(right.masterProcessShadow)
91 {
92 }
93 
94 
96 {
99 }
100 
102 {
106 #ifdef G4VERBOSE
107  if (verboseLevel>2) {
108  G4cout << "G4VProcess::StartTracking() [" << theProcessName << "]" <<G4endl;
109  }
110 #endif
111 }
112 
114 {
115 #ifdef G4VERBOSE
116  if (verboseLevel>2) {
117  G4cout << "G4VProcess::EndTracking() [" << theProcessName << "]" <<G4endl;
118  }
119 #endif
123 }
124 
125 
126 namespace {
127  static const G4String typeNotDefined = "NotDefined";
128  static const G4String typeTransportation = "Transportation";
129  static const G4String typeElectromagnetic = "Electromagnetic";
130  static const G4String typeOptical = "Optical";
131  static const G4String typeHadronic = "Hadronic";
132  static const G4String typePhotolepton_hadron = "Photolepton_hadron";
133  static const G4String typeDecay = "Decay";
134  static const G4String typeGeneral = "General";
135  static const G4String typeParameterisation = "Parameterisation";
136  static const G4String typeUserDefined = "UserDefined";
137  static const G4String typePhonon = "Phonon";
138  static const G4String noType = "------";
139 }
140 
142 {
143  switch (aType) {
144  case fNotDefined: return typeNotDefined; break;
145  case fTransportation: return typeTransportation; break;
146  case fElectromagnetic: return typeElectromagnetic; break;
147  case fOptical: return typeOptical; break;
148  case fHadronic: return typeHadronic; break;
149  case fPhotolepton_hadron: return typePhotolepton_hadron; break;
150  case fDecay: return typeDecay; break;
151  case fGeneral: return typeGeneral; break;
152  case fParameterisation: return typeParameterisation; break;
153  case fUserDefined: return typeUserDefined; break;
154  case fPhonon: return typePhonon; break;
155  default: ;
156  }
157 
158  return noType;
159 }
160 
162 {
163  G4Exception("G4VProcess::operator=","ProcMan101",
164  JustWarning,"Assignment operator is called but NO effect");
165  return *this;
166 }
167 
169 {
170  return (this == &right);
171 }
172 
174 {
175  return (this != &right);
176 }
177 
179 {
180  G4cout << "Process Name " << theProcessName ;
181  G4cout << " : Type[" << GetProcessTypeName(theProcessType) << "]";
182  G4cout << " : SubType[" << theProcessSubType << "]"<< G4endl;
183 }
184 
185 
187  const G4String& directory,
188  const G4String& tableName,
189  G4bool ascii)
190 {
191  G4String thePhysicsTableFileExt;
192  if (ascii) thePhysicsTableFileExt = ".asc";
193  else thePhysicsTableFileExt = ".dat";
194 
195  thePhysicsTableFileName = directory + "/";
196  thePhysicsTableFileName += tableName + "." + theProcessName + ".";
197  thePhysicsTableFileName += particle->GetParticleName() + thePhysicsTableFileExt;
198 
200 }
201 
203 {
204  BuildPhysicsTable(part);
205 }
206 
208 {
209  PreparePhysicsTable(part);
210 }
211 
213 {
214  masterProcessShadow = masterP;
215 }
virtual void SetMasterProcess(G4VProcess *masterP)
Definition: G4VProcess.cc:212
G4VProcess * masterProcessShadow
Definition: G4VProcess.hh:372
G4ProcessType theProcessType
Definition: G4VProcess.hh:340
static const G4String & GetProcessTypeName(G4ProcessType)
Definition: G4VProcess.cc:141
G4int verboseLevel
Definition: G4VProcess.hh:368
G4VProcess(const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
Definition: G4VProcess.cc:52
G4double theNumberOfInteractionLengthLeft
Definition: G4VProcess.hh:293
G4int theProcessSubType
Definition: G4VProcess.hh:343
virtual void ResetNumberOfInteractionLengthLeft()
Definition: G4VProcess.cc:95
int G4int
Definition: G4Types.hh:78
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
Definition: G4VProcess.cc:186
const G4String & GetParticleName() const
virtual void BuildWorkerPhysicsTable(const G4ParticleDefinition &part)
Definition: G4VProcess.cc:202
virtual void StartTracking(G4Track *)
Definition: G4VProcess.cc:101
#define G4UniformRand()
Definition: Randomize.hh:87
G4GLOB_DLL std::ostream G4cout
virtual void PreparePhysicsTable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:217
bool G4bool
Definition: G4Types.hh:79
G4double currentInteractionLength
Definition: G4VProcess.hh:297
G4VProcess & operator=(const G4VProcess &right)
Definition: G4VProcess.cc:161
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:210
G4String thePhysicsTableFileName
Definition: G4VProcess.hh:338
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
G4ParticleChange aParticleChange
Definition: G4VProcess.hh:289
#define G4endl
Definition: G4ios.hh:61
G4String theProcessName
Definition: G4VProcess.hh:335
virtual void DumpInfo() const
Definition: G4VProcess.cc:178
virtual void PrepareWorkerPhysicsTable(const G4ParticleDefinition &)
Definition: G4VProcess.cc:207
G4double theInitialNumberOfInteractionLength
Definition: G4VProcess.hh:300
virtual void EndTracking()
Definition: G4VProcess.cc:113
G4int operator==(const G4VProcess &right) const
Definition: G4VProcess.cc:168
virtual ~G4VProcess()
Definition: G4VProcess.cc:72
G4int operator!=(const G4VProcess &right) const
Definition: G4VProcess.cc:173
G4ProcessType