Geant4  10.02.p02
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 //
26 
27 #include "XPhysicalLattice.hh"
28 #include "G4VPhysicalVolume.hh"
29 #include "G4PhysicalConstants.hh"
30 #include "G4SystemOfUnits.hh"
31 
32 #include "G4LogicalVolume.hh"
33 #include "G4Box.hh"
34 
36  fLattice=NULL;
37  fVolume=NULL;
38  fTheta=0.;
39  fPhi=0.;
40  fOmega=0.;
41 
42 
43  fCurvatureRadius = G4ThreeVector(0.,0.,0.); // if cr = 0 == no bending
44  fThermalVibrationAmplitude = 0.1 * angstrom; // no physical meaning
45  fMillerOrientation[0] = 2;
46  fMillerOrientation[1] = 2;
47  fMillerOrientation[2] = 0;
48 }
49 
50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
51 
53  XLogicalLattice* Lat){
54  fLattice=Lat;
55  fVolume=Vol;
64  fMu=fLattice->GetMu();
65 
67 
70 }
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
73 
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
77 
79  double Gamma,
80  double Lambda,
81  double Mu)
82 {
83  fBeta=Beta;
84  fGamma=Gamma;
85  fLambda=Lambda;
86  fMu=Mu;
87 }
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
90 
91 
93  fA=a;
94 }
95 
96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
97 
98 
100  fB=b;
101 }
102 
103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
104 
105 
106 void XPhysicalLattice::SetLDOS(double LDOS){
107  fDosL=LDOS;
108 }
109 
110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
111 
112 void XPhysicalLattice::SetSTDOS(double STDOS)
113 {
114  fDosST = STDOS;
115 }
116 
117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
118 
119 void XPhysicalLattice::SetFTDOS(double FTDOS){
120  fDosFT = FTDOS;
121 }
122 
123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
124 
125 
127  return fBeta;
128 }
129 
130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
131 
132 
134  return fGamma;
135 }
136 
137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
138 
140  return fLambda;
141 }
142 
143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
144 
145 
147 {
148  return fMu;
149 }
150 
151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
152 
153 
155 {
156  return fB;
157 }
158 
159 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
160 
161 
163 {
164  return fA;
165 }
166 
167 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
168 
169 
171  return fDosL;
172 }
173 
174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
175 
176 
178  return fDosST;
179 }
180 
181 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
182 
183 
185 {
186  return fDosFT;
187 }
188 
189 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
190 
191 
192 
194 //Loads the group velocity in m/s
196 double XPhysicalLattice::MapKtoV(int polarizationState, G4ThreeVector k){
197  double groupVelocity;
198 
199  k.rotate(G4ThreeVector(0,1,0), fTheta).rotate(G4ThreeVector(0,0,1), fPhi);
200  groupVelocity = fLattice->MapKtoV(polarizationState, k);
201  k.rotate(G4ThreeVector(0,0,1), -fPhi).rotate(G4ThreeVector(0,1,0), -fTheta);
202 
203  return groupVelocity;
204 }
205 
206 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
207 
208 
209 
211 //Loads the normalized direction vector along VG
214  G4ThreeVector k){
215 
216  G4ThreeVector GroupVelocity;
217 
218  k=k.rotate(G4ThreeVector(0,1,0), fTheta).rotate(G4ThreeVector(0,0,1), fPhi);
219  GroupVelocity = fLattice->MapKtoVDir(polarizationState, k);
220 
221  return GroupVelocity.rotate(G4ThreeVector(0,0,1), -fPhi)
222  .rotate(G4ThreeVector(0,1,0), -fTheta).unit();
223 }
224 
225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
226 
227 
229  return fVolume;
230 }
231 
232 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
233 
234 
236  fVolume=Vol;
237 }
238 
239 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
240 
241 
243  fTheta=t_rot;
244  fPhi= p_rot;
245 }
246 
247 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
248 
250  G4double o_rot,
251  G4double p_rot){
252  fTheta = t_rot;
253  fOmega = o_rot;
254  fPhi = p_rot;
255 }
256 
257 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
258 
260  //fTheta=pi/2-std::atan2(n+0.000001,l+0.000001)*rad;
261  //fPhi=pi/2-std::atan2(l+0.000001,k+0.000001)*rad;
262 
263  // // // added for channeling // // //
264  fMillerOrientation[0]=l;
265  fMillerOrientation[1]=k;
267  // // // // // // // // // // // // //
268 }
269 
270 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
271 
272 
274  fLattice=Lat;
275 }
276 
277 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
278 // Begin Channeling specific code
279 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
280 
281 
282 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
283 
285 SetThermalVibrationAmplitude(G4double vThermalVibrationAmplitude){
286  fThermalVibrationAmplitude = vThermalVibrationAmplitude;
287 }
288 
289 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
290 
293 }
294 
295 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
296 
299  G4ThreeVector& vPosition){
300  vMomentum.rotate(G4ThreeVector(1.,0.,0.),fOmega)
301  .rotate(G4ThreeVector(0.,1.,0.), fTheta)
302  .rotate(G4ThreeVector(0.,0.,1.), fPhi);
303 
304  if(IsBent() ){
305  G4ThreeVector vBendingAngle = ComputeBendingAngle(vPosition);
306  vMomentum.rotate(G4ThreeVector(1.,0.,0.), vBendingAngle.z())
307  .rotate(G4ThreeVector(0.,1.,0.),vBendingAngle.x());
308  }
309 
310  return vMomentum;
311 }
312 
313 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
314 
317  G4ThreeVector& vPosition){
318  vMomentum.rotate(G4ThreeVector(0.,0.,1.), -fPhi)
319  .rotate(G4ThreeVector(0.,1.,0.), -fTheta)
320  .rotate(G4ThreeVector(1.,0.,0.), fOmega);
321 
322  if(IsBent() ){
323  G4ThreeVector vBendingAngle = ComputeBendingAngle(vPosition);
324  vMomentum.rotate(G4ThreeVector(0.,1.,0.), -vBendingAngle.x())
325  .rotate(G4ThreeVector(1.,0.,0.), -vBendingAngle.z());
326  }
327 
328  return vMomentum;
329 }
330 
331 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
332 
334  G4ThreeVector dir = G4ThreeVector(0.,0.,1.);
336  vPosition);
337 }
338 
339 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
340 
342  fUnitCell = cell;
343 }
344 
345 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
346 
348  return fUnitCell;
349 }
350 
351 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
352 
354  fCurvatureRadius = cr;
355 }
356 
357 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
358 
360  return fCurvatureRadius;
361 }
362 
363 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
364 
366  if(fCurvatureRadius.x() != 0.) {
367  return true;
368  }
369  else {
370  return false;
371  }
372 }
373 
374 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
375 
377 
378  G4double vAngleX = 0.;
379  G4double vAngleY = 0.;
380 
381  if(GetCurvatureRadius().x() != 0){
382  vAngleX = vPosition.phi();
383  }
384 
385  return G4ThreeVector(vAngleX,0.,vAngleY);
386 }
387 
388 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
389 
391  return fLattice;
392 }
393 
394 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
395 
397  if(vIndex<3 && vIndex>=0)
398  return fMillerOrientation[vIndex];
399  else return -1;
400 }
401 
402 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
403 
406 }
407 
408 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
409 
411  G4double vInterplanarPeriod =
413  GetMiller(1),
414  GetMiller(2));
415  return vInterplanarPeriod;
416 }
417 
418 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void SetLDOS(double)
G4double GetAnhDecConstant()
void SetXLogicalLattice(XLogicalLattice *)
void SetFTDOS(double)
G4int GetMiller(G4int)
double MapKtoV(int, G4ThreeVector)
void SetThermalVibrationAmplitude(G4double)
G4double fThermalVibrationAmplitude
G4ThreeVector GetLatticeAngles()
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
XLogicalLattice * fLattice
G4ThreeVector GetCurvatureRadius()
G4ThreeVector ComputeBendingAngle(G4ThreeVector &)
G4double a
Definition: TRTMaterials.hh:39
int G4int
Definition: G4Types.hh:78
G4ThreeVector MapKtoVDir(int, G4ThreeVector)
double MapKtoV(int, G4ThreeVector)
void SetUnitCell(XUnitCell *)
G4ThreeVector ProjectMomentumVectorFromWorldToLattice(G4ThreeVector &, G4ThreeVector &)
G4AffineTransform fLocalToGlobal
G4AffineTransform & Invert()
void SetSTDOS(double)
G4double GetAnhDecConstant()
G4VPhysicalVolume * fVolume
bool G4bool
Definition: G4Types.hh:79
const G4int n
G4double GetThermalVibrationAmplitude()
XUnitCell * GetXUnitCell()
G4ThreeVector ProjectMomentumVectorFromLatticeToWorld(G4ThreeVector &, G4ThreeVector &)
void SetMillerOrientation(int, int, int)
void SetCurvatureRadius(G4ThreeVector)
void SetLatticeOrientation(G4double, G4double)
XLogicalLattice * GetLogicalLattice()
const G4double x[NPOINTSGL]
G4double ComputeDirectPeriod(G4int, G4int, G4int)
Definition: XUnitCell.cc:219
G4RotationMatrix * GetObjectRotation() const
void SetDynamicalConstants(double, double, double, double)
G4ThreeVector fCurvatureRadius
void SetAnhDecConstant(G4double)
double G4double
Definition: G4Types.hh:76
void SetPhysicalVolume(G4VPhysicalVolume *)
void SetScatteringConstant(G4double)
G4ThreeVector GetLatticeDirection(G4ThreeVector &)
G4AffineTransform fGlobalToLocal
G4double ComputeInterplanarPeriod()
G4ThreeVector MapKtoVDir(int, G4ThreeVector)
G4VPhysicalVolume * GetVolume()
G4double GetScatteringConstant()
G4double GetScatteringConstant()
static const double angstrom
Definition: G4SIunits.hh:101