Geant4  10.01.p01
XCrystalIntegratedDensityHub.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 
30 }
31 
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
33 
35 }
36 
37 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
38 
40  XVCrystalCharacteristic* vPotential){
41  fPotential = vPotential;
42 }
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
45 
47  return fPotential;
48 }
49 
50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
51 
53  XVCrystalCharacteristic* vDensity){
54  fDensityElectron = vDensity;
55 }
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
58 
60  return fDensityElectron;
61 }
62 
63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
64 
66  XVCrystalCharacteristic* vDensity){
67  fDensityNuclei = vDensity;
68 }
69 
70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
71 
73  return fDensityNuclei;
74 }
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
77 
79  XPhysicalLattice* vLattice){
80  fLattice = vLattice;
84 }
85 
86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
87 
89  return fLattice;
90 }
91 
92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
93 
96  G4int vParticleCharge){
97  if(vParticleCharge < 0){
98  fIntDensNucleiNegative = vDensity;
99  }
100  else if(vParticleCharge > 0){
101  fIntDensNucleiPositive = vDensity;
102  }
103  else{
104  G4cout << "XCrystalIntegratedDensityHub:: ERROR - Charge == 0";
105  G4cout << G4endl;
106  }
107 }
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
110 
113  if(vParticleCharge < 0.){
114  return fIntDensNucleiNegative;
115  }
116  else if(vParticleCharge > 0.){
117  return fIntDensNucleiPositive;
118  }
119  else{
120  G4cout << "XCrystalIntegratedDensityHub:: ERROR - Charge == 0";
121  G4cout << G4endl;
122  return NULL;
123  }
124 }
125 
126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
127 
129  XVCrystalIntegratedDensity* vDensity,
130  G4int vParticleCharge){
131  if(vParticleCharge < 0){
132  fIntDensElectronNegative = vDensity;
133  }
134  else if(vParticleCharge > 0){
135  fIntDensElectronPositive = vDensity;
136  }
137  else{
138  G4cout << "XCrystalIntegratedDensityHub:: ERROR - Charge == 0";
139  G4cout << G4endl;
140  }
141 }
142 
143 
144 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
145 
148  if(vParticleCharge < 0.){
150  }
151  else if(vParticleCharge > 0.){
153  }
154  else{
155  G4cout << "XCrystalIntegratedDensityHub:: ERROR - Charge == 0" ;
156  G4cout << G4endl;
157  return NULL;
158  }
159 }
160 
161 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
162 
164  XPhysicalLattice* vLattice){
165  //now it checks only of the table is initialized,
166  //it does not check if the particular crystal is initialized.
167  //To be changed in the future!
168  if(vLattice != GetXPhysicalLattice()) return false;
169  else return true;
170 }
171 
172 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
173 
180 
186 
192 
198 }
199 
200 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
201 
204  XPhysicalLattice* vLattice,
205  G4int vParticleCharge){
206  if(vParticleCharge < 0.){
207  return fIntDensNucleiNegative->GetIntegratedDensity(vPotential,
208  vLattice,
209  vParticleCharge);
210  }
211  else if(vParticleCharge > 0.){
212  return fIntDensNucleiPositive->GetIntegratedDensity(vPotential,
213  vLattice,
214  vParticleCharge);
215  }
216  else{
217  G4cout << "XCrystalIntegratedDensityHub:: ERROR - Charge == 0";
218  G4cout << G4endl;
219  return -1;
220  }
221 }
222 
223 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
224 
227  XPhysicalLattice* vLattice,
228  G4int vParticleCharge){
229  if(vParticleCharge < 0.){
231  vLattice,
232  vParticleCharge);
233  }
234  else if(vParticleCharge > 0.){
236  vLattice,
237  vParticleCharge);
238  }
239  else{
240  G4cout << "XCrystalIntegratedDensityHub:: ERROR - Charge == 0";
241  G4cout << G4endl;
242  return -1;
243  }
244 }
245 
246 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
247 
249  std::string filename;
250  fIntDensElectronNegative->PrintOnFile(filename=vFileName + "_neg_eld.txt");
251  fIntDensElectronPositive->PrintOnFile(filename=vFileName + "_pos_eld.txt");
252 
253  fIntDensNucleiNegative->PrintOnFile(filename=vFileName + "_neg_nud.txt");
254  fIntDensNucleiPositive->PrintOnFile(filename=vFileName + "_pos_nud.txt");
255 }
256 
257 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
258 
260  std::string filename;
261  fIntDensElectronNegative->ReadFromFile(filename=vFileName + "_neg_eld.txt");
262  fIntDensElectronPositive->ReadFromFile(filename=vFileName + "_pos_eld.txt");
263 
264  fIntDensNucleiNegative->ReadFromFile(filename=vFileName + "_neg_nud.txt");
265  fIntDensNucleiPositive->ReadFromFile(filename=vFileName + "_pos_nud.txt");
266 }
267 
268 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
XVCrystalIntegratedDensity * fIntDensElectronNegative
XVCrystalCharacteristic * fDensityNuclei
XVCrystalCharacteristic * fDensityElectron
XVCrystalIntegratedDensity * fIntDensNucleiNegative
void SetDensityElectron(XVCrystalCharacteristic *)
G4double GetIntegratedDensity(G4double, XPhysicalLattice *, G4int)
int G4int
Definition: G4Types.hh:78
XVCrystalIntegratedDensity * GetIntegratedDensityNuclei(G4int)
XVCrystalIntegratedDensity * GetIntegratedDensityElectron(G4int)
G4bool HasBeenInitialized(XPhysicalLattice *)
void SetXPhysicalLattice(XPhysicalLattice *)
G4GLOB_DLL std::ostream G4cout
void SetDensityNuclei(XVCrystalCharacteristic *)
bool G4bool
Definition: G4Types.hh:79
XVCrystalCharacteristic * GetDensityNuclei()
void SetPotential(XVCrystalCharacteristic *)
void SetIntegratedDensityNuclei(XVCrystalIntegratedDensity *, G4int)
void SetXPhysicalLattice(XPhysicalLattice *)
void SetDensity(XVCrystalCharacteristic *)
XVCrystalCharacteristic * GetPotential()
void InitializePhysicalLattice(XPhysicalLattice *)
void SetPotential(XVCrystalCharacteristic *)
#define G4endl
Definition: G4ios.hh:61
XVCrystalCharacteristic * GetDensityElectron()
double G4double
Definition: G4Types.hh:76
void SetIntegratedDensityElectron(XVCrystalIntegratedDensity *, G4int)
XVCrystalIntegratedDensity * fIntDensNucleiPositive
XVCrystalIntegratedDensity * fIntDensElectronPositive