// // ******************************************************************** // * DISCLAIMER * // * * // * The following disclaimer summarizes all the specific disclaimers * // * of contributors to this software. The specific disclaimers,which * // * govern, are listed with their locations in: * // * http://cern.ch/geant4/license * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. * // * * // * This code implementation is the intellectual property of the * // * GEANT4 collaboration. * // * By copying, distributing or modifying the Program (or any work * // * based on the Program) you indicate your acceptance of this * // * statement, and all its terms. * // ******************************************************************** // // // $Id: G4PAIxSection.cc,v 1.14 2003/02/12 08:57:11 gcosmo Exp $ // GEANT4 tag $Name: geant4-05-01 $ // // // G4PAIxSection.cc -- class implementation file // // GEANT 4 class implementation file // // For information related to this code, please, contact // the Geant4 Collaboration. // // History: // 1st version 11.06.97 V. Grichine // 20.11.98 adapted to a new Material/SandiaTable interface, mma // 17.05.01 V. Grichine, low energy extension down to 10*keV of proton // 28.05.01 V.Ivanchenko minor changes to provide ANSI -wall compilation #include "G4PAIxSection.hh" #include "globals.hh" #include "G4ios.hh" #include "G4Poisson.hh" #include "G4Material.hh" /* ****************************************************************** // Init array of Lorentz factors const G4double G4PAIxSection::fLorentzFactor[22] = { 0.0 , 1.1 , 1.2 , 1.3 , 1.5 , 1.8 , 2.0 , 2.5 , 3.0 , 4.0 , 7.0 , 10.0 , 20.0 , 40.0 , 70.0 , 100.0 , 300.0 , 600.0 , 1000.0 , 3000.0 , 10000.0 , 50000.0 } ; const G4int G4PAIxSection:: fRefGammaNumber = 29 ; // The number of gamma for creation of // spline (9) ***************************************************************** */ // Local class constants const G4double G4PAIxSection::fDelta = 0.005 ; // energy shift from interval border const G4double G4PAIxSection::fError = 0.005 ; // error in lin-log approximation const G4int G4PAIxSection::fMaxSplineSize = 500 ; // Max size of output spline // arrays ////////////////////////////////////////////////////////////////// // // Constructor // G4PAIxSection::G4PAIxSection(G4int materialIndex, G4double maxEnergyTransfer) { const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable() ; G4int i, j ; fDensity = (*theMaterialTable)[materialIndex]->GetDensity() ; fElectronDensity = (*theMaterialTable)[materialIndex]-> GetElectronDensity() ; fIntervalNumber = (*theMaterialTable)[materialIndex]-> GetSandiaTable()->GetMatNbOfIntervals() ; G4cout< GetSandiaTable()->GetSandiaCofForMaterial(i-1,0); fA1[i] = (*theMaterialTable)[materialIndex]-> GetSandiaTable()->GetSandiaCofForMaterial(i-1,1); fA2[i] = (*theMaterialTable)[materialIndex]-> GetSandiaTable()->GetSandiaCofForMaterial(i-1,2); fA3[i] = (*theMaterialTable)[materialIndex]-> GetSandiaTable()->GetSandiaCofForMaterial(i-1,3); fA4[i] = (*theMaterialTable)[materialIndex]-> GetSandiaTable()->GetSandiaCofForMaterial(i-1,4); // G4cout<= maxEnergyTransfer) { fEnergyInterval[i] = maxEnergyTransfer ; fIntervalNumber = i ; break; } } if(fEnergyInterval[fIntervalNumber] != maxEnergyTransfer) { fIntervalNumber++; fEnergyInterval[fIntervalNumber] = maxEnergyTransfer ; } // Now checking, if two borders are too close together for(i=1;i 1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i])) { continue ; } else { for(j=i;jGetDensity(); fElectronDensity = (*theMaterialTable)[materialIndex]-> GetElectronDensity() ; fIntervalNumber = intNumber ; // (*theMaterialTable)[materialIndex]->GetSandiaTable()->GetMatNbOfIntervals() ; // G4cout< // GetSandiaTable()->GetSandiaCofForMaterial(i-1,0); fA1[i] = photoAbsCof[i-1][1] ; //(*theMaterialTable)[materialIndex]-> // GetSandiaTable()->GetSandiaCofForMaterial(i-1,1); fA2[i] = photoAbsCof[i-1][2] ; //(*theMaterialTable)[materialIndex]-> // GetSandiaTable()->GetSandiaCofForMaterial(i-1,2); fA3[i] = photoAbsCof[i-1][3] ; //(*theMaterialTable)[materialIndex]-> // GetSandiaTable()->GetSandiaCofForMaterial(i-1,3); fA4[i] = photoAbsCof[i-1][4] ; //(*theMaterialTable)[materialIndex]-> // GetSandiaTable()->GetSandiaCofForMaterial(i-1,4); if( i == 1 || i == fIntervalNumber) { // G4cout<= maxEnergyTransfer) { fEnergyInterval[i] = maxEnergyTransfer ; fIntervalNumber = i ; break; } } if(fEnergyInterval[fIntervalNumber] != maxEnergyTransfer) { fIntervalNumber++; fEnergyInterval[fIntervalNumber] = maxEnergyTransfer ; } // Now checking, if two borders are too close together for(i=1;i 1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i])) { continue ; } else { for(j=i;jGetDensity(); fElectronDensity = (*theMaterialTable)[materialIndex]->GetElectronDensity() ; G4SandiaTable thisMaterialSandiaTable(materialIndex) ; numberOfElements = (*theMaterialTable)[materialIndex]->GetNumberOfElements() ; G4int* thisMaterialZ = new G4int[numberOfElements] ; for(i=0;i GetElement(i)->GetZ() ; } fIntervalNumber = thisMaterialSandiaTable.SandiaIntervals (thisMaterialZ,numberOfElements) ; fIntervalNumber = thisMaterialSandiaTable.SandiaMixing ( thisMaterialZ , (*theMaterialTable)[materialIndex]->GetFractionVector() , numberOfElements,fIntervalNumber) ; fEnergyInterval = new G4double[fIntervalNumber+2] ; fA1 = new G4double[fIntervalNumber+2] ; fA2 = new G4double[fIntervalNumber+2] ; fA3 = new G4double[fIntervalNumber+2] ; fA4 = new G4double[fIntervalNumber+2] ; for(i=1;i<=fIntervalNumber;i++) { fEnergyInterval[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,0) ; fA1[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,1)*fDensity ; fA2[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,2)*fDensity ; fA3[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,3)*fDensity ; fA4[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,4)*fDensity ; if( i == 1 || i == fIntervalNumber) { // G4cout<= maxEnergyTransfer) { fEnergyInterval[i] = maxEnergyTransfer ; fIntervalNumber = i ; break; } } if(fEnergyInterval[fIntervalNumber] != maxEnergyTransfer) { fIntervalNumber++; fEnergyInterval[fIntervalNumber] = maxEnergyTransfer ; } // Now checking, if two borders are too close together for(i=1;i 1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i])) { continue ; } else { for(j=i;j