// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * 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. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // // $Id: G4PAIxSection.cc,v 1.21 2006/06/29 19:53:20 gunter Exp $ // GEANT4 tag $Name: $ // // // G4PAIxSection.cc -- class implementation file // // GEANT 4 class implementation file // // For information related to this code, please, contact // the Geant4 Collaboration. // // R&D: Vladimir.Grichine@cern.ch // // History: // // 13.05.03 V. Grichine, bug fixed for maxEnergyTransfer > max interval energy // 28.05.01 V.Ivanchenko minor changes to provide ANSI -wall compilation // 17.05.01 V. Grichine, low energy extension down to 10*keV of proton // 20.11.98 adapted to a new Material/SandiaTable interface, mma // 11.06.97 V. Grichine, 1st version // #include "G4PAIxSection.hh" #include "globals.hh" #include "G4ios.hh" #include "G4Poisson.hh" #include "G4Material.hh" #include "G4MaterialCutsCouple.hh" #include "G4SandiaTable.hh" using namespace std; /* ****************************************************************** // 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(G4MaterialCutsCouple* matCC) { fDensity = matCC->GetMaterial()->GetDensity(); G4int matIndex = matCC->GetMaterial()->GetIndex(); fSandia = new G4SandiaTable(matIndex); G4int i, j; fMatSandiaMatrix = new G4OrderedTable(); for (i = 0; i < fSandia->GetMaxInterval()-1; i++) { fMatSandiaMatrix->push_back(new G4DataVector(5,0.)); } for (i = 0; i < fSandia->GetMaxInterval()-1; i++) { (*(*fMatSandiaMatrix)[i])[0] = fSandia->GetSandiaMatTable(i,0); for(j = 1; j < 5 ; j++) { (*(*fMatSandiaMatrix)[i])[j] = fSandia->GetSandiaMatTable(i,j)*fDensity; } } } 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() ; fIntervalNumber--; // G4cout< GetSandiaTable()->GetSandiaCofForMaterial(i-1,0) >= maxEnergyTransfer) || i > fIntervalNumber ) { fEnergyInterval[i] = maxEnergyTransfer ; fIntervalNumber = i ; break; } fEnergyInterval[i] = (*theMaterialTable)[materialIndex]-> 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< 1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i])) { continue ; } else { for(j=i;jGetDensity(); fElectronDensity = (*theMaterialTable)[materialIndex]-> GetElectronDensity() ; fIntervalNumber = intNumber ; fIntervalNumber--; // G4cout<= maxEnergyTransfer ) || i > fIntervalNumber ) { fEnergyInterval[i] = maxEnergyTransfer ; fIntervalNumber = i ; break; } fEnergyInterval[i] = photoAbsCof[i-1][0] ; fA1[i] = photoAbsCof[i-1][1] ; fA2[i] = photoAbsCof[i-1][2] ; fA3[i] = photoAbsCof[i-1][3] ; fA4[i] = photoAbsCof[i-1][4] ; // G4cout< 1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i])) { continue ; } else { for(j=i;j 1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i])) { continue ; } else { for(j=i;j