Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XPhysicalLattice.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 #include "XPhysicalLattice.hh"
32 #include "G4VPhysicalVolume.hh"
33 #include "G4PhysicalConstants.hh"
34 #include "G4SystemOfUnits.hh"
35 
37  fLattice=NULL;
38  fVolume=NULL;
39  fTheta=0;
40  fPhi=0;
41 }
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
44 
45 
47  fLattice=Lat;
48  fVolume=Vol;
49  fA=fLattice->GetAnhDecConstant();
50  fB=fLattice->GetScatteringConstant();
51  fDosL=fLattice->GetLDOS();
52  fDosST=fLattice->GetSTDOS();
53  fDosFT=fLattice->GetFTDOS();
54  fBeta=fLattice->GetBeta();
55  fGamma=fLattice->GetGamma();
56  fLambda=fLattice->GetLambda();
57  fMu=fLattice->GetMu();
58 
59  G4RotationMatrix *rot = fVolume->GetObjectRotation();
60 
63 }
64 
65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
66 
67 
69 
70 void XPhysicalLattice::SetDynamicalConstants(double Beta, double Gamma, double Lambda, double Mu)
71 {
72  fBeta=Beta;
73  fGamma=Gamma;
74  fLambda=Lambda;
75  fMu=Mu;
76 }
77 
78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
79 
80 
82  fA=a;
83 }
84 
85 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
86 
87 
89  fB=b;
90 }
91 
92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
93 
94 
95 void XPhysicalLattice::SetLDOS(double LDOS){
96  fDosL=LDOS;
97 }
98 
99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
100 
101 void XPhysicalLattice::SetSTDOS(double STDOS)
102 {
103  fDosST = STDOS;
104 }
105 
106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
107 
108 void XPhysicalLattice::SetFTDOS(double FTDOS){
109  fDosFT = FTDOS;
110 }
111 
112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
113 
114 
116  return fBeta;
117 }
118 
119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
120 
121 
123  return fGamma;
124 }
125 
126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
127 
129  return fLambda;
130 }
131 
132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
133 
134 
136 {
137  return fMu;
138 }
139 
140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
141 
142 
144 {
145  return fB;
146 }
147 
148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
149 
150 
152 {
153  return fA;
154 }
155 
156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
157 
158 
160  return fDosL;
161 }
162 
163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
164 
165 
167  return fDosST;
168 }
169 
170 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
171 
172 
174 {
175  return fDosFT;
176 }
177 
178 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
179 
180 
181 
183 //Loads the group velocity in m/s
185 double XPhysicalLattice::MapKtoV(int polarizationState, G4ThreeVector k){
186  double groupVelocity;
187 
188  k.rotate(G4ThreeVector(0,1,0), fTheta).rotate(G4ThreeVector(0,0,1), fPhi);
189  groupVelocity = fLattice->MapKtoV(polarizationState, k);
190  k.rotate(G4ThreeVector(0,0,1), -fPhi).rotate(G4ThreeVector(0,1,0), -fTheta);
191 
192  return groupVelocity;
193 }
194 
195 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
196 
197 
198 
200 //Loads the normalized direction vector along VG
203 
204  G4ThreeVector GroupVelocity;
205 
206  k=k.rotate(G4ThreeVector(0,1,0), fTheta).rotate(G4ThreeVector(0,0,1), fPhi);
207  GroupVelocity = fLattice->MapKtoVDir(polarizationState, k);
208 
209  return GroupVelocity.rotate(G4ThreeVector(0,0,1), -fPhi).rotate(G4ThreeVector(0,1,0), -fTheta).unit();
210 }
211 
212 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
213 
214 
216  return fVolume;
217 }
218 
219 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
220 
221 
223  fVolume=Vol;
224 }
225 
226 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
227 
228 
230  fTheta=t_rot;
231  fPhi= p_rot;
232 }
233 
234 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
235 
236 
238  fTheta=pi/2-std::atan2(n+0.000001,l+0.000001)*rad;
239  fPhi=pi/2-std::atan2(l+0.000001,k+0.000001)*rad;
240 }
241 
242 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
243 
244 
246  fLattice=Lat;
247 }
248 
249 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
250