ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VProcess.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4VProcess.cc
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 //
28 //
29 // --------------------------------------------------------------
30 // GEANT 4 class implementation file
31 //
32 // History: first implementation, based on object model of
33 // 2nd December 1995, G.Cosmo
34 // --------------------------------------------------------------
35 // New Physics scheme 8 Jan. 1997 H.Kurahige
36 // ------------------------------------------------------------
37 // removed thePhysicsTable 02 Aug. 1998 H.Kurashige
38 // Modified DumpInfo 15 Aug. 1998 H.Kurashige
39 // Add fPhonon to ProcessTypeName 30 Oct. 2013 M.Kelsey
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 #include "G4Log.hh"
51 
53  : aProcessManager(nullptr),
54  pParticleChange(nullptr),
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(nullptr)
67 
68 {
70 }
71 
73 {
74 }
75 
77  : aProcessManager(nullptr),
78  pParticleChange(nullptr),
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 void G4VProcess::ProcessDescription(std::ostream& outFile) const
186 {
187  outFile << "This process has not yet been described\n";
188 }
189 
191  const G4String& directory,
192  const G4String& tableName,
193  G4bool ascii)
194 {
195  G4String thePhysicsTableFileExt;
196  if (ascii) thePhysicsTableFileExt = ".asc";
197  else thePhysicsTableFileExt = ".dat";
198 
199  thePhysicsTableFileName = directory + "/";
200  thePhysicsTableFileName += tableName + "." + theProcessName + ".";
201  thePhysicsTableFileName += particle->GetParticleName() + thePhysicsTableFileExt;
202 
204 }
205 
207 {
208  BuildPhysicsTable(part);
209 }
210 
212 {
213  PreparePhysicsTable(part);
214 }
215 
217 {
218  masterProcessShadow = masterP;
219 }