ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VRestDiscreteProcess.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4VRestDiscreteProcess.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 "Randomize.hh"
42 #include "G4Step.hh"
43 #include "G4Track.hh"
44 #include "G4MaterialTable.hh"
45 #include "G4VParticleChange.hh"
46 
48  :G4VProcess("No Name Discrete Process")
49 {
50  G4Exception("G4VRestDiscreteProcess::G4VRestDiscreteProcess","ProcMan102",
51  JustWarning,"Default constructor is called");
52 }
53 
55  : G4VProcess(aName, aType)
56 {
57  enableAlongStepDoIt = false;
58 }
59 
61 {
62 }
63 
65  : G4VProcess(right)
66 {
67 }
68 
70  const G4Track& track,
71  G4double previousStepSize,
73  )
74 {
75  if ( (previousStepSize < 0.0) || (theNumberOfInteractionLengthLeft<=0.0)) {
76  // beggining of tracking (or just after DoIt of this process)
78  } else if ( previousStepSize > 0.0) {
79  // subtract NumberOfInteractionLengthLeft
80  SubtractNumberOfInteractionLengthLeft(previousStepSize);
81  } else {
82  // zero step
83  // DO NOTHING
84  }
85 
86  // condition is set to "Not Forced"
87  *condition = NotForced;
88 
89  // get mean free path
90  currentInteractionLength = GetMeanFreePath(track, previousStepSize, condition);
91 
95  } else {
96  value = DBL_MAX;
97  }
98 #ifdef G4VERBOSE
99  if (verboseLevel>1){
100  G4cout << "G4VRestDiscreteProcess::PostStepGetPhysicalInteractionLength ";
101  G4cout << "[ " << GetProcessName() << "]" <<G4endl;
102  track.GetDynamicParticle()->DumpInfo();
103  G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl;
104  G4cout << "InteractionLength= " << value/cm <<"[cm] " <<G4endl;
105  }
106 #endif
107  return value;
108 }
109 
111  const G4Track& ,
112  const G4Step&
113  )
114 {
115 // reset NumberOfInteractionLengthLeft
117 
118  return pParticleChange;
119 }
120 
122  const G4Track& track,
124  )
125 {
126  // beggining of tracking
128 
129  // condition is set to "Not Forced"
130  *condition = NotForced;
131 
132  // get mean life time
133  currentInteractionLength = GetMeanLifeTime(track, condition);
134 
135 #ifdef G4VERBOSE
136  if ((currentInteractionLength <0.0) || (verboseLevel>2)){
137  G4cout << "G4VRestDiscreteProcess::AtRestGetPhysicalInteractionLength ";
138  G4cout << "[ " << GetProcessName() << "]" <<G4endl;
139  track.GetDynamicParticle()->DumpInfo();
140  G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl;
141  G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<G4endl;
142  }
143 #endif
144 
146 }
147 
148 
150  const G4Track&,
151  const G4Step&
152  )
153 {
154 // clear NumberOfInteractionLengthLeft
156 
157  return pParticleChange;
158 }