Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
examples
extended
exoticphysics
phonon
src
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
32
#include "
XPhononScatteringProcess.hh
"
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
"
41
#include "
XPhononTrackInformation.hh
"
42
#include "
XPhysicalLattice.hh
"
43
44
#include "
G4TransportationManager.hh
"
45
#include "
G4Navigator.hh
"
46
#include "
G4SystemOfUnits.hh
"
47
48
49
XPhononScatteringProcess::XPhononScatteringProcess
(
const
G4String
& aName)
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
61
XPhononScatteringProcess::~XPhononScatteringProcess
()
62
{;}
63
64
XPhononScatteringProcess::XPhononScatteringProcess
(
XPhononScatteringProcess
&
right
)
65
:
G4VDiscreteProcess
(right)
66
{;}
67
68
G4double
69
XPhononScatteringProcess::GetMeanFreePath
(
70
const
G4Track
& aTrack,
G4double
/*previousStepSize*/
,
G4ForceCondition
*
condition
)
71
{
72
73
//Use LatticeManager3 to get physical lattice of current volume
74
XLatticeManager3
* LM =
XLatticeManager3::GetXLatticeManager
();
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
94
G4VParticleChange
*
95
XPhononScatteringProcess::PostStepDoIt
(
const
G4Track
& aTrack,
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
108
aParticleChange
.
ProposeEnergy
(0.);
109
aParticleChange
.
ProposeTrackStatus
(
fStopAndKill
);
110
aParticleChange
.
SetNumberOfSecondaries
(1);
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
121
XLatticeManager3
* LM =
XLatticeManager3::GetXLatticeManager
();
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
150
sec->
SetUserInformation
(
new
XPhononTrackInformation
(Lattice->
fLocalToGlobal
.
TransformAxis
(newDir)));
151
sec->
SetVelocity
(Lattice->
MapKtoV
(polarization, newDir)*
m
/
s
);
152
sec->
UseGivenVelocity
(
true
);
153
aParticleChange
.
AddSecondary
(sec);
154
155
return
&
aParticleChange
;
156
}
157
158
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
159
160
161
G4bool
XPhononScatteringProcess::IsApplicable
(
const
G4ParticleDefinition
& aPD)
162
{
163
return
((&aPD==
XLPhonon::PhononDefinition
())|(&aPD==
XTPhononFast::PhononDefinition
())|(&aPD==
XTPhononSlow::PhononDefinition
()));
164
165
}
166
167
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
168
Generated on Sat May 25 2013 14:32:24 for Geant4 by
1.8.4