Geant4  10.01.p03
XVCrystalCharacteristic.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 
28 
31 
32  fMaximum = DBL_MAX;
33  fMinimum = DBL_MAX;
34 }
35 
36 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
37 
39 }
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
42 
45  return fLatticeManager->GetXPhysicalLattice(vVolume);
46 }
47 
48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
49 
52  return GetXPhysicalLattice(vVolume)->GetXUnitCell();
53 }
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
56 
59  return GetXPhysicalLattice(vVolume)->GetLogicalLattice();
60 }
61 
62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
63 
66  if(fPhysicalLattice != vLattice){
67  fPhysicalLattice = vLattice;
69  }
70 }
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
73 
75 GetEC(G4ThreeVector vPosition,XPhysicalLattice* vLattice){
76  if(IsInitialized(vLattice)){
77  return ComputeECFromVector(vPosition);
78  }
79  else{
80  return ComputeEC(vPosition,vLattice);
81  }
82 }
83 
84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
85 
88 
89  G4double vTFSR = CLHEP::Bohr_radius * 0.88534;
90 
91  double vZ = vLattice->GetXUnitCell()->GetBase(0)->GetElement()->GetZ();
92  vTFSR /= (std::pow(vZ,0.333333333));
93 
94  return vTFSR;
95 }
96 
97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
98 
101  return G4ThreeVector(-1.,-1.,-1.);
102 }
103 
104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
105 
107  if(fMaximum == DBL_MAX){
108  fMaximum = ComputeMaximum(vLattice);
109  }
110  return fMaximum;
111 }
112 
113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
114 
116  if(fMinimum == DBL_MAX){
117  fMinimum = ComputeMinimum(vLattice);
118  }
119  return fMinimum;
120 }
121 
122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
123 
125  unsigned int vPrecisionX = 1024;
126  unsigned int vPrecisionY = 1024;
127  unsigned int vPrecisionZ = 1024;
128 
129  G4VPhysicalVolume* vVolume = vLattice->GetVolume();
130  G4double vStepX = GetXUnitCell(vVolume)->GetSize().x() / vPrecisionX;
131  G4double vStepY = GetXUnitCell(vVolume)->GetSize().y() / vPrecisionY;
132  G4double vStepZ = GetXUnitCell(vVolume)->GetSize().z() / vPrecisionZ;
133 
134  G4double vMaximum = -DBL_MAX;
135  G4double vValue;
136 
137  for(unsigned int i=0;i<vPrecisionX;i++){
138  for(unsigned int j=0;j<vPrecisionY;j++){
139  for(unsigned int k=0;k<vPrecisionZ;k++){
140  if( (vValue = GetEC(G4ThreeVector(vStepX * i,
141  vStepY * i,
142  vStepZ * i),
143  vLattice).mag() ) > vMaximum) {
144  vMaximum = vValue;
145  }
146  }
147  }
148  }
149 
150  return vMaximum;
151 }
152 
153 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
154 
156  unsigned int vPrecisionX = 1024;
157  unsigned int vPrecisionY = 1024;
158  unsigned int vPrecisionZ = 1024;
159 
160  G4VPhysicalVolume* vVolume = vLattice->GetVolume();
161  G4double vStepX = GetXUnitCell(vVolume)->GetSize().x() / vPrecisionX;
162  G4double vStepY = GetXUnitCell(vVolume)->GetSize().y() / vPrecisionY;
163  G4double vStepZ = GetXUnitCell(vVolume)->GetSize().z() / vPrecisionZ;
164 
165  G4double vMinimum = DBL_MAX;
166  G4double vValue;
167 
168  for(unsigned int i=0;i<vPrecisionX;i++){
169  for(unsigned int j=0;j<vPrecisionY;j++){
170  for(unsigned int k=0;k<vPrecisionZ;k++){
171  if( (vValue = GetEC(G4ThreeVector(vStepX * i,
172  vStepY * i,
173  vStepZ * i),
174  vLattice).mag() ) < vMinimum){
175  vMinimum = vValue;}
176  }
177  }
178  }
179 
180  return vMinimum;
181 }
182 
183 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
184 
186  if(vLattice == fPhysicalLattice){
187  return true;
188  }
189  else{
190  return false;
191  }
192 }
193 
194 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
static XLatticeManager3 * GetXLatticeManager()
G4Element * GetElement()
Definition: XLogicalBase.cc:53
CLHEP::Hep3Vector G4ThreeVector
XLogicalLattice * GetLogicalLattice(G4VPhysicalVolume *)
G4double GetZ() const
Definition: G4Element.hh:131
XPhysicalLattice * GetXPhysicalLattice(G4VPhysicalVolume *)
virtual G4ThreeVector ComputeECFromVector(G4ThreeVector)=0
virtual G4double GetMinimum(XPhysicalLattice *)
virtual G4double ComputeTFScreeningRadius(XPhysicalLattice *)
bool G4bool
Definition: G4Types.hh:79
G4ThreeVector GetSize()
Definition: XUnitCell.cc:48
XPhysicalLattice * fPhysicalLattice
virtual G4ThreeVector ComputePositionInUnitCell(G4ThreeVector, XPhysicalLattice *)
G4bool IsInitialized(XPhysicalLattice *)
XUnitCell * GetXUnitCell()
G4ThreeVector GetEC(G4ThreeVector, XPhysicalLattice *)
void InitializePhysicalLattice(XPhysicalLattice *)
XPhysicalLattice * GetXPhysicalLattice(G4VPhysicalVolume *)
virtual G4double GetMaximum(XPhysicalLattice *)
XLatticeManager3 * fLatticeManager
XLogicalLattice * GetLogicalLattice()
virtual G4ThreeVector ComputeEC(G4ThreeVector, XPhysicalLattice *)=0
virtual void InitializeVector()=0
XLogicalBase * GetBase(G4int)
Definition: XUnitCell.cc:60
XUnitCell * GetXUnitCell(G4VPhysicalVolume *)
double G4double
Definition: G4Types.hh:76
virtual G4double ComputeMaximum(XPhysicalLattice *)
virtual G4double ComputeMinimum(XPhysicalLattice *)
#define DBL_MAX
Definition: templates.hh:83
G4VPhysicalVolume * GetVolume()