Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XPhononScatteringProcess.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 "G4VParticleChange.hh"
36 #include "Randomize.hh"
37 #include "G4RandomDirection.hh"
38 #include "XLPhonon.hh"
39 #include "XTPhononFast.hh"
40 #include "XTPhononSlow.hh"
42 #include "XPhysicalLattice.hh"
43 
45 #include "G4Navigator.hh"
46 #include "G4SystemOfUnits.hh"
47 
48 
50 : G4VDiscreteProcess(aName)
51 {
52 
53  if (verboseLevel>1) {
54  G4cout << GetProcessName() << " is created "<< G4endl;
55  }
56 }
57 
58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
59 
60 
62 {;}
63 
65 : G4VDiscreteProcess(right)
66 {;}
67 
68 G4double
70  const G4Track& aTrack, G4double /*previousStepSize*/, G4ForceCondition* condition )
71 {
72 
73  //Use LatticeManager3 to get physical lattice of current volume
75  XPhysicalLattice* Lattice = LM->GetXPhysicalLattice(aTrack.GetVolume());
76  if(Lattice==0) G4cout<<"\n\nXPhononScatteringProcess::GetMeanFreePath: WARNING!! PHYSICAL LATTICE POINTER IS NULL!!!\n\n";
77 
78  //Dynamical constants retrieved from PhysicalLattice
79  G4double B=Lattice->GetScatteringConstant();
80  G4double h=6.626e-34*m2*kg/s;
81  G4double E= aTrack.GetKineticEnergy();
82 
83  //Calculate mean free path
84  G4double mfp = 1/((E/h)*(E/h)*(E/h)*(E/h)*B)*aTrack.GetVelocity();
85 
86  *condition = NotForced;
87 
88  return mfp;
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
92 
93 
96  const G4Step& aStep)
97 {
98 
99  G4StepPoint* postStepPoint = aStep.GetPostStepPoint();
100  if(postStepPoint->GetStepStatus()==fGeomBoundary)
101  { return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep);}
102 
103  //Initialize particle change
104  aParticleChange.Initialize(aTrack);
105 
106  // Kill current track, then create scattered
107  // phonon as a secondary
111 
112  //randomly generate a new direction
113  //modeMixer determines what the new
114  //polarization type will be
115  G4Track* sec;
116  G4ThreeVector vgroup;
117  G4ThreeVector newDir = G4RandomDirection();
118  G4double modeMixer = G4UniformRand();
119 
120  //Use LattaiceManager3 to obtains PhysicalLattice of current volume
122  XPhysicalLattice* Lattice = LM->GetXPhysicalLattice(aTrack.GetVolume());
123  double cProbST=Lattice->GetSTDOS();
124  double cProbFT=Lattice->GetFTDOS()+cProbST;
125 
126  //Generate the new track after scattering
127  //the probabilities for the different po-
128  //larization types depends on the DOS
129  int polarization;
130  if(modeMixer<cProbST){
131  polarization = 1;
132  vgroup=Lattice->MapKtoVDir(1, newDir);
133  vgroup=Lattice->fLocalToGlobal.TransformAxis(vgroup);
134  sec=new G4Track(new G4DynamicParticle(XTPhononSlow::PhononDefinition(),vgroup.unit(), aTrack.GetKineticEnergy()), aTrack.GetGlobalTime(), aTrack.GetPosition());
135 
136  }else if(modeMixer<cProbFT){
137  polarization = 2;
138  vgroup=Lattice->MapKtoVDir(2, newDir);
139  vgroup=Lattice->fLocalToGlobal.TransformAxis(vgroup);
140  sec=new G4Track(new G4DynamicParticle(XTPhononFast::PhononDefinition(),vgroup.unit(), aTrack.GetKineticEnergy()), aTrack.GetGlobalTime(), aTrack.GetPosition());
141 
142  } else {
143  polarization = 0;
144  vgroup=Lattice->MapKtoVDir(0, newDir);
145  vgroup=Lattice->fLocalToGlobal.TransformAxis(vgroup);
146  sec=new G4Track(new G4DynamicParticle(XLPhonon::PhononDefinition(),vgroup.unit(), aTrack.GetKineticEnergy()), aTrack.GetGlobalTime(), aTrack.GetPosition());
147 
148  }
149 
151  sec->SetVelocity(Lattice->MapKtoV(polarization, newDir)*m/s);
152  sec->UseGivenVelocity(true);
154 
155  return &aParticleChange;
156 }
157 
158 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
159 
160 
162 {
164 
165 }
166 
167 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
168