Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
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 // $Id: G4VProcess.cc 105271 2017-07-18 07:35:12Z 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 #include "G4Log.hh"
52 
54  : aProcessManager(0),
55  pParticleChange(0),
56  theNumberOfInteractionLengthLeft(-1.0),
57  currentInteractionLength(-1.0),
58  theInitialNumberOfInteractionLength(-1.0),
59  theProcessName(aName),
60  theProcessType(aType),
61  theProcessSubType(-1),
62  thePILfactor(1.0),
63  enableAtRestDoIt(true),
64  enableAlongStepDoIt(true),
65  enablePostStepDoIt(true),
66  verboseLevel(0),
67  masterProcessShadow(0)
68 
69 {
71 }
72 
74 {
75 }
76 
78  : aProcessManager(0),
79  pParticleChange(0),
80  theNumberOfInteractionLengthLeft(-1.0),
81  currentInteractionLength(-1.0),
82  theInitialNumberOfInteractionLength(-1.0),
83  theProcessName(right.theProcessName),
84  theProcessType(right.theProcessType),
85  theProcessSubType(right.theProcessSubType),
86  thePILfactor(1.0),
87  enableAtRestDoIt(right.enableAtRestDoIt),
88  enableAlongStepDoIt(right.enableAlongStepDoIt),
89  enablePostStepDoIt(right.enablePostStepDoIt),
91  masterProcessShadow(right.masterProcessShadow)
92 {
93 }
94 
95 
97 {
100 }
101 
103 {
107 #ifdef G4VERBOSE
108  if (verboseLevel>2) {
109  G4cout << "G4VProcess::StartTracking() [" << theProcessName << "]" <<G4endl;
110  }
111 #endif
112 }
113 
115 {
116 #ifdef G4VERBOSE
117  if (verboseLevel>2) {
118  G4cout << "G4VProcess::EndTracking() [" << theProcessName << "]" <<G4endl;
119  }
120 #endif
124 }
125 
126 
127 namespace {
128  static const G4String typeNotDefined = "NotDefined";
129  static const G4String typeTransportation = "Transportation";
130  static const G4String typeElectromagnetic = "Electromagnetic";
131  static const G4String typeOptical = "Optical";
132  static const G4String typeHadronic = "Hadronic";
133  static const G4String typePhotolepton_hadron = "Photolepton_hadron";
134  static const G4String typeDecay = "Decay";
135  static const G4String typeGeneral = "General";
136  static const G4String typeParameterisation = "Parameterisation";
137  static const G4String typeUserDefined = "UserDefined";
138  static const G4String typePhonon = "Phonon";
139  static const G4String noType = "------";
140 }
141 
143 {
144  switch (aType) {
145  case fNotDefined: return typeNotDefined; break;
146  case fTransportation: return typeTransportation; break;
147  case fElectromagnetic: return typeElectromagnetic; break;
148  case fOptical: return typeOptical; break;
149  case fHadronic: return typeHadronic; break;
150  case fPhotolepton_hadron: return typePhotolepton_hadron; break;
151  case fDecay: return typeDecay; break;
152  case fGeneral: return typeGeneral; break;
153  case fParameterisation: return typeParameterisation; break;
154  case fUserDefined: return typeUserDefined; break;
155  case fPhonon: return typePhonon; break;
156  default: ;
157  }
158 
159  return noType;
160 }
161 
163 {
164  G4Exception("G4VProcess::operator=","ProcMan101",
165  JustWarning,"Assignment operator is called but NO effect");
166  return *this;
167 }
168 
170 {
171  return (this == &right);
172 }
173 
175 {
176  return (this != &right);
177 }
178 
180 {
181  G4cout << "Process Name " << theProcessName ;
182  G4cout << " : Type[" << GetProcessTypeName(theProcessType) << "]";
183  G4cout << " : SubType[" << theProcessSubType << "]"<< G4endl;
184 }
185 
186 void G4VProcess::ProcessDescription(std::ostream& outFile) const
187 {
188  outFile << "This process has not yet been described\n";
189 }
190 
192  const G4String& directory,
193  const G4String& tableName,
194  G4bool ascii)
195 {
196  G4String thePhysicsTableFileExt;
197  if (ascii) thePhysicsTableFileExt = ".asc";
198  else thePhysicsTableFileExt = ".dat";
199 
200  thePhysicsTableFileName = directory + "/";
201  thePhysicsTableFileName += tableName + "." + theProcessName + ".";
202  thePhysicsTableFileName += particle->GetParticleName() + thePhysicsTableFileExt;
203 
205 }
206 
208 {
209  BuildPhysicsTable(part);
210 }
211 
213 {
214  PreparePhysicsTable(part);
215 }
216 
218 {
219  masterProcessShadow = masterP;
220 }
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:210
virtual void ResetNumberOfInteractionLengthLeft()
Definition: G4VProcess.cc:96
#define G4endl
Definition: G4ios.hh:61
G4VProcess & operator=(const G4VProcess &right)
Definition: G4VProcess.cc:162
G4int operator==(const G4VProcess &right) const
Definition: G4VProcess.cc:169
const G4String & GetParticleName() const
G4int theProcessSubType
Definition: G4VProcess.hh:343
virtual void PreparePhysicsTable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:217
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4ParticleChange aParticleChange
Definition: G4VProcess.hh:289
static const G4String & GetProcessTypeName(G4ProcessType)
Definition: G4VProcess.cc:142
G4double currentInteractionLength
Definition: G4VProcess.hh:297
virtual ~G4VProcess()
Definition: G4VProcess.cc:73
virtual void EndTracking()
Definition: G4VProcess.cc:114
virtual void StartTracking(G4Track *)
Definition: G4VProcess.cc:102
bool G4bool
Definition: G4Types.hh:79
TString part[npart]
Definition: Style.C:32
G4String theProcessName
Definition: G4VProcess.hh:335
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
G4ProcessType theProcessType
Definition: G4VProcess.hh:340
G4ProcessType
G4int operator!=(const G4VProcess &right) const
Definition: G4VProcess.cc:174
#define G4UniformRand()
Definition: Randomize.hh:53
G4VProcess(const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
Definition: G4VProcess.cc:53
G4double theInitialNumberOfInteractionLength
Definition: G4VProcess.hh:300
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.hh:65
int G4int
Definition: G4Types.hh:78
G4int verboseLevel
Definition: G4VProcess.hh:371
virtual void ProcessDescription(std::ostream &outfile) const
Definition: G4VProcess.cc:186
G4GLOB_DLL std::ostream G4cout
virtual void SetMasterProcess(G4VProcess *masterP)
Definition: G4VProcess.cc:217
G4double theNumberOfInteractionLengthLeft
Definition: G4VProcess.hh:293
virtual void DumpInfo() const
Definition: G4VProcess.cc:179
virtual void PrepareWorkerPhysicsTable(const G4ParticleDefinition &)
Definition: G4VProcess.cc:212
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
Definition: G4VProcess.cc:191
virtual void BuildWorkerPhysicsTable(const G4ParticleDefinition &part)
Definition: G4VProcess.cc:207
G4String thePhysicsTableFileName
Definition: G4VProcess.hh:338
G4VProcess * masterProcessShadow
Definition: G4VProcess.hh:375