ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VRestContinuousDiscreteProcess.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4VRestContinuousDiscreteProcess.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 
39 #include "G4SystemOfUnits.hh"
40 
41 #include "G4Step.hh"
42 #include "G4Track.hh"
43 #include "G4MaterialTable.hh"
44 #include "G4VParticleChange.hh"
45 
47  :G4VProcess("No Name Discrete Process"),
48  valueGPILSelection(CandidateForSelection)
49 {
50  G4Exception("G4VRestContinuousDiscreteProcess::G4VRestContinuousDiscreteProcess()",
51  "ProcMan102",JustWarning,"Default constructor is called");
52 }
53 
55  : G4VProcess(aName, aType),
56  valueGPILSelection(CandidateForSelection)
57 {
58 }
59 
61 {
62 }
63 
65  : G4VProcess(right),
66  valueGPILSelection(right.valueGPILSelection)
67 {
68 }
69 
71  const G4Track& track,
73  )
74 {
75  // beggining of tracking
77 
78  // condition is set to "Not Forced"
79  *condition = NotForced;
80 
81  // get mean life time
82  currentInteractionLength = GetMeanLifeTime(track, condition);
83 
84 #ifdef G4VERBOSE
85  if ((currentInteractionLength <0.0) || (verboseLevel>2)){
86  G4cout << "G4VRestContinuousDiscreteProcess::AtRestGetPhysicalInteractionLength ";
87  G4cout << "[ " << GetProcessName() << "]" <<G4endl;
88  track.GetDynamicParticle()->DumpInfo();
89  G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl;
90  G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<G4endl;
91  }
92 #endif
93 
95 }
96 
97 
99  const G4Track&,
100  const G4Step&
101  )
102 {
103 // clear NumberOfInteractionLengthLeft
105 
106  return pParticleChange;
107 }
108 
110  const G4Track& track,
111  G4double previousStepSize,
112  G4double currentMinimumStep,
113  G4double& currentSafety,
114  G4GPILSelection* selection
115  )
116 {
117  // GPILSelection is set to defaule value of CandidateForSelection
119 
120  // get Step limit proposed by the process
121  G4double steplength = GetContinuousStepLimit(track,previousStepSize,currentMinimumStep, currentSafety);
122 
123  // set return value for G4GPILSelection
124  *selection = valueGPILSelection;
125 
126 #ifdef G4VERBOSE
127  if (verboseLevel>1){
128  G4cout << "G4VRestContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength ";
129  G4cout << "[ " << GetProcessName() << "]" <<G4endl;
130  track.GetDynamicParticle()->DumpInfo();
131  G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl;
132  G4cout << "IntractionLength= " << steplength/cm <<"[cm] " <<G4endl;
133  }
134 #endif
135  return steplength ;
136 }
137 
139  const G4Track& ,
140  const G4Step&
141  )
142 {
143  return pParticleChange;
144 }
145 
147  const G4Track& track,
148  G4double previousStepSize,
150  )
151 {
152  if ( (previousStepSize < 0.0) || (theNumberOfInteractionLengthLeft<=0.0)) {
153  // beggining of tracking (or just after DoIt of this process)
155  } else if ( previousStepSize > 0.0) {
156  // subtract NumberOfInteractionLengthLeft
157  SubtractNumberOfInteractionLengthLeft(previousStepSize);
158  } else {
159  // zero step
160  // DO NOTHING
161  }
162 
163  // condition is set to "Not Forced"
164  *condition = NotForced;
165 
166  // get mean free path
167  currentInteractionLength = GetMeanFreePath(track, previousStepSize, condition);
168 
169 
170  G4double value;
173  } else {
174  value = DBL_MAX;
175  }
176 #ifdef G4VERBOSE
177  if (verboseLevel>1){
178  G4cout << "G4VRestContinuousDiscreteProcess::PostStepGetPhysicalInteractionLength ";
179  G4cout << "[ " << GetProcessName() << "]" <<G4endl;
180  track.GetDynamicParticle()->DumpInfo();
181  G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl;
182  G4cout << "InteractionLength= " << value/cm <<"[cm] " <<G4endl;
183  }
184 #endif
185  return value;
186 }
187 
189  const G4Track& ,
190  const G4Step&
191  )
192 {
193 // clear NumberOfInteractionLengthLeft
195 
196  return pParticleChange;
197 }