Geant4  10.03
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 //
28 //
29 
31 
33 }
34 
35 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
36 
38 }
39 
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
41 
43  XVCrystalCharacteristic* vPotential){
44  fPotential = vPotential;
45 }
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
48 
50  return fPotential;
51 }
52 
53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
54 
56  XVCrystalCharacteristic* vDensity){
57  fDensityElectron = vDensity;
58 }
59 
60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
61 
63  return fDensityElectron;
64 }
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
67 
69  XVCrystalCharacteristic* vDensity){
70  fDensityNuclei = vDensity;
71 }
72 
73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
74 
76  return fDensityNuclei;
77 }
78 
79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
80 
82  XPhysicalLattice* vLattice){
83  fLattice = vLattice;
87 }
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
90 
92  return fLattice;
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
96 
99  G4int vParticleCharge){
100  if(vParticleCharge < 0){
101  fIntDensNucleiNegative = vDensity;
102  }
103  else if(vParticleCharge > 0){
104  fIntDensNucleiPositive = vDensity;
105  }
106  else{
107  G4cout << "XCrystalIntegratedDensityHub:: ERROR - Charge == 0";
108  G4cout << G4endl;
109  }
110 }
111 
112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
113 
116  if(vParticleCharge < 0.){
117  return fIntDensNucleiNegative;
118  }
119  else if(vParticleCharge > 0.){
120  return fIntDensNucleiPositive;
121  }
122  else{
123  G4cout << "XCrystalIntegratedDensityHub:: ERROR - Charge == 0";
124  G4cout << G4endl;
125  return NULL;
126  }
127 }
128 
129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
130 
132  XVCrystalIntegratedDensity* vDensity,
133  G4int vParticleCharge){
134  if(vParticleCharge < 0){
135  fIntDensElectronNegative = vDensity;
136  }
137  else if(vParticleCharge > 0){
138  fIntDensElectronPositive = vDensity;
139  }
140  else{
141  G4cout << "XCrystalIntegratedDensityHub:: ERROR - Charge == 0";
142  G4cout << G4endl;
143  }
144 }
145 
146 
147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
148 
151  if(vParticleCharge < 0.){
153  }
154  else if(vParticleCharge > 0.){
156  }
157  else{
158  G4cout << "XCrystalIntegratedDensityHub:: ERROR - Charge == 0" ;
159  G4cout << G4endl;
160  return NULL;
161  }
162 }
163 
164 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
165 
167  XPhysicalLattice* vLattice){
168  //now it checks only of the table is initialized,
169  //it does not check if the particular crystal is initialized.
170  //To be changed in the future!
171  if(vLattice != GetXPhysicalLattice()) return false;
172  else return true;
173 }
174 
175 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
176 
183 
189 
195 
201 }
202 
203 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
204 
207  XPhysicalLattice* vLattice,
208  G4int vParticleCharge){
209  if(vParticleCharge < 0.){
210  return fIntDensNucleiNegative->GetIntegratedDensity(vPotential,
211  vLattice,
212  vParticleCharge);
213  }
214  else if(vParticleCharge > 0.){
215  return fIntDensNucleiPositive->GetIntegratedDensity(vPotential,
216  vLattice,
217  vParticleCharge);
218  }
219  else{
220  G4cout << "XCrystalIntegratedDensityHub:: ERROR - Charge == 0";
221  G4cout << G4endl;
222  return -1;
223  }
224 }
225 
226 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
227 
230  XPhysicalLattice* vLattice,
231  G4int vParticleCharge){
232  if(vParticleCharge < 0.){
234  vLattice,
235  vParticleCharge);
236  }
237  else if(vParticleCharge > 0.){
239  vLattice,
240  vParticleCharge);
241  }
242  else{
243  G4cout << "XCrystalIntegratedDensityHub:: ERROR - Charge == 0";
244  G4cout << G4endl;
245  return -1;
246  }
247 }
248 
249 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
250 
252  std::string filename;
253  fIntDensElectronNegative->PrintOnFile(filename=vFileName + "_neg_eld.txt");
254  fIntDensElectronPositive->PrintOnFile(filename=vFileName + "_pos_eld.txt");
255 
256  fIntDensNucleiNegative->PrintOnFile(filename=vFileName + "_neg_nud.txt");
257  fIntDensNucleiPositive->PrintOnFile(filename=vFileName + "_pos_nud.txt");
258 }
259 
260 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
261 
263  std::string filename;
264  fIntDensElectronNegative->ReadFromFile(filename=vFileName + "_neg_eld.txt");
265  fIntDensElectronPositive->ReadFromFile(filename=vFileName + "_pos_eld.txt");
266 
267  fIntDensNucleiNegative->ReadFromFile(filename=vFileName + "_neg_nud.txt");
268  fIntDensNucleiPositive->ReadFromFile(filename=vFileName + "_pos_nud.txt");
269 }
270 
271 //....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)
Definition of the XCrystalIntegratedDensityHub class.
XVCrystalIntegratedDensity * fIntDensNucleiPositive
XVCrystalIntegratedDensity * fIntDensElectronPositive