33 fNumberOfPoints = 512;
34 fIntegrationPoints[0] = 32;
35 fIntegrationPoints[1] = 32;
36 fIntegrationPoints[2] = 32;
48 unsigned int vIntegrationPoints){
50 if(vIntegrationPoints > 0){
51 fIntegrationPoints[vIndex] = vIntegrationPoints;
61 return fIntegrationPoints[vIndex];
71 return fIntegrationPoints[0]*fIntegrationPoints[1]*fIntegrationPoints[2];
78 fNumberOfPoints = vNumberOfPoints;
84 return fNumberOfPoints;
91 fPotential = vPotential;
129 fParticleCharge = vParticleCharge;
135 return fParticleCharge;
148 G4int vParticleCharge){
153 else if(vLattice!=fLattice)
return false;
154 else if(vParticleCharge!=fParticleCharge)
return false;
162 if(fParticleCharge < 0.){
167 if(fParticleCharge < 0.){
180 G4cout <<
"XVCrystalIntegratedDensity::InitializeTable()::";
207 G4int vParticleCharge){
209 G4double vPotentialModified = vPotential /
221 else if(vPotentialModified < 0.)
return fTableVector->
Value(0.);
224 return fTableVector->
Value(vPotentialModified);
234 unsigned int i1,i2,i3;
241 while(i1<fIntegrationPoints[2]){
243 G4double(fIntegrationPoints[2])*vSize.
z()));
244 while(i1<fIntegrationPoints[1]){
246 G4double(fIntegrationPoints[1])*vSize.
y()));
247 while(i1<fIntegrationPoints[0]){
249 G4double(fIntegrationPoints[0])*vSize.
x()));
250 if(fPotential->
GetEC(vPositionTemp,fLattice).
x()
251 < vPotentialInitial){
252 vDensity += fDensity->
GetEC(vPositionTemp,fLattice).
x();
276 double a0, a1 , a2 , a3 , x2;
279 a0 = -0.5 * p0 + 1.5 * p1 - 1.5 * p2 + 0.5 * p3;
280 a1 = p0 - 2.5 * p1 + 2.0 * p2 - 0.5 * p3;
281 a2 = -0.5 * p0 + 0.5 * p2;
284 return (a0 * x * x2 + a1 * x2 + a2 * x + a3);
290 std::ofstream vFileOut;
291 vFileOut.open(filename);
294 vFileOut <<
"energy,dens" << std::endl;
295 for(
unsigned int i = 0;i < fNumberOfPoints;i++){
300 vFileOut << std::endl;
308 std::ifstream vFileIn;
309 vFileIn.open(filename);
311 G4cout <<
"XVCrystalIntegratedDensity::";
312 G4cout <<
"ReadFromFile - ERROR READING FILE!!!!! ";
326 std::vector<G4double> fTable;
328 while(!vFileIn.eof()){
330 if(vDensity < 1.E-2) {
333 fTable.push_back(vDensity);
336 fNumberOfPoints = fTable.size();
340 std::fabs(fPotentialMaximum - fPotentialMinimum),
343 for(
unsigned int i=0;i<fTable.size();i++){
344 fTableVector->
PutValue(i,fTable.at(i));
349 G4cout <<
"XVCrystalIntegratedDensity::InitializeTable()::";
G4double fPotentialMinimum
void SetIntegrationPoints(unsigned int, unsigned int)
virtual void InitializeTable()
CLHEP::Hep3Vector G4ThreeVector
void ReadFromFile(const G4String &)
virtual G4double ComputeIntegratedDensity(G4double, G4int)
G4double FindCatmullRomInterpolate(G4double &p0, G4double &p1, G4double &p2, G4double &p3, G4double &x)
unsigned int GetNumberOfPoints()
size_t GetVectorLength() const
XPhysicalLattice * GetXPhysicalLattice()
G4double GetIntegratedDensity(G4double, XPhysicalLattice *, G4int)
virtual G4double GetMinimum(XPhysicalLattice *)
G4GLOB_DLL std::ostream G4cout
void PrintOnFile(const G4String &)
void PutValue(size_t index, G4double theValue)
unsigned int GetIntegrationPoints()
XUnitCell * GetXUnitCell()
G4double Value(G4double theEnergy, size_t &lastidx) const
void SetXPhysicalLattice(XPhysicalLattice *)
void SetDensity(XVCrystalCharacteristic *)
static constexpr double eV
G4ThreeVector GetEC(G4ThreeVector, XPhysicalLattice *)
G4int GetParticleCharge()
virtual G4double GetMaximum(XPhysicalLattice *)
G4bool HasBeenInitialized(XPhysicalLattice *, G4int)
G4double fPotentialMaximum
~XVCrystalIntegratedDensity()
void SetPotential(XVCrystalCharacteristic *)
XVCrystalCharacteristic * GetDensity()
XVCrystalIntegratedDensity()
XVCrystalCharacteristic * GetPotential()
Definition of the XVCrystalIntegratedDensity class.
virtual void ComputePotentialParameters()
void SetParticleCharge(G4int)
void SetNumberOfPoints(unsigned int)