Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XPhononReflectionProcess.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 //
28 //
29 // $Id$
30 //
31 
33 
34 #include "G4Step.hh"
35 #include "G4StepPoint.hh"
36 #include "G4VParticleChange.hh"
37 #include "Randomize.hh"
38 #include "G4RandomDirection.hh"
39 #include "G4RandomTools.hh"
40 
41 #include "XTPhononFast.hh"
42 #include "XTPhononSlow.hh"
43 #include "XLPhonon.hh"
44 
45 #include "G4Material.hh"
46 #include "G4NistManager.hh"
48 #include "G4Navigator.hh"
49 #include "G4GeometryTolerance.hh"
50 
52 #include "XLatticeManager3.hh"
53 
54 #include "G4SystemOfUnits.hh"
55 
56 
58 :G4VDiscreteProcess(aName)
59 {
60  fAlminum = NULL;
62  G4cout<<"\n XPhononReflectionProcess::Constructor: Geometry surface tolerance is: " << kCarTolerance /mm << " mm";
63  if (verboseLevel>1) {
64  G4cout << GetProcessName() << " is created "<< G4endl;
65  }
66 }
67 
68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
69 
70 
72 {;}
73 
75 : G4VDiscreteProcess(right)
76 {;}
77 
78 G4double
80  const G4Track&, G4double /*previousStepSize*/, G4ForceCondition* condition )
81 {
82 // Always return DBL_MAX and Forced
83 // This ensures that the process is called
84 // at the end of every step. In
85 // PostStepDoIt the process decides whether
86 // the step encountered a volume boundary
87 // and a reflection should be applied
88 
89  *condition = Forced;
90 
91  return DBL_MAX;
92 }
93 
94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
95 
96 
97 
100  const G4Step& aStep )
101 {
102 
103  //This process handles the interaction of phonons with
104  //boundaries. Implementation of this class is highly
105  //geometry dependent.Currently, phonons are killed when
106  //they reach a boundary. If the other side of the
107  //boundary was Al, a hit is registered.
108 
109  aParticleChange.Initialize(aTrack);
110 
111  //Check if current step is limited by a volume boundary
112  G4StepPoint* postStepPoint = aStep.GetPostStepPoint();
113  if(postStepPoint->GetStepStatus()!=fGeomBoundary)
114  {
115 
116  //make sure that correct phonon velocity is used after the step
117 
119  XPhysicalLattice* Lattice = LM->GetXPhysicalLattice(aTrack.GetVolume());
120 
121  int pol = 0;
122  if (aTrack.GetDefinition() == XLPhonon::PhononDefinition()){
123  pol=0;
124  }
125  else if (aTrack.GetDefinition() == XTPhononSlow::Definition()){
126  pol=1;
127  }
128  else if (aTrack.GetDefinition() == XTPhononFast::Definition()){
129  pol=2;
130  }
131 
132  //Since step was not a volume boundary, just set correct phonon velocity and return
134  return &aParticleChange;
135  }
136 
137 
138  //do nothing but return is the step is too short
139  //This is to allow actual reflection where after
140  //the first boundary crossing a second, infinitesimal
141  //step occurs crossing back into the original volume
142  if(aTrack.GetStepLength()<=kCarTolerance/2)
143  {
144 
145  return &aParticleChange;
146  }
147 
148  G4double eKin = aTrack.GetKineticEnergy();
151 
152  return &aParticleChange;
153 }
154 
155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
156 
157 
159 {
161 }
162 
163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
164 
165 
167 {
168  if(!fAlminum)
169  { fAlminum = G4NistManager::Instance()->FindOrBuildMaterial("G4_Al"); }
170 }
171 
172 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
173 
174