// // ******************************************************************** // * 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: G4PAIySection.cc,v 1.6 2010/11/04 17:30:32 vnivanch Exp $ // GEANT4 tag $Name: emstand-V09-03-25 $ // // // G4PAIySection.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: // // 01.10.07, V.Ivanchenko create using V.Grichine G4PAIxSection class // 26.07.09, V.Ivanchenko added protection for mumerical exceptions for // low-density materials // #include "G4PAIySection.hh" #include "globals.hh" #include "G4ios.hh" #include "G4Poisson.hh" #include "G4Material.hh" #include "G4MaterialCutsCouple.hh" #include "G4SandiaTable.hh" using namespace std; // Local class constants const G4double G4PAIySection::fDelta = 0.005 ; // energy shift from interval border const G4double G4PAIySection::fError = 0.005 ; // error in lin-log approximation const G4int G4PAIySection::fMaxSplineSize = 500 ; // Max size of output spline // arrays ////////////////////////////////////////////////////////////////// // // Constructor // G4PAIySection::G4PAIySection() { fSandia = 0; fDensity = fElectronDensity = fNormalizationCof = 0.0; fIntervalNumber = fSplineNumber = 0; } //////////////////////////////////////////////////////////////////////////// // // Destructor G4PAIySection::~G4PAIySection() {} //////////////////////////////////////////////////////////////////////// // // Test Constructor with beta*gamma square value void G4PAIySection::Initialize( const G4Material* material, G4double maxEnergyTransfer, G4double betaGammaSq) { G4int i, j, numberOfElements ; fDensity = material->GetDensity(); fElectronDensity = material->GetElectronDensity() ; numberOfElements = material->GetNumberOfElements() ; fSandia = material->GetSandiaTable(); fIntervalNumber = fSandia->GetMaxInterval(); fIntervalNumber--; for(i=1;i<=fIntervalNumber;i++) { G4double e = fSandia->GetSandiaMatTablePAI(i,0); if(e >= maxEnergyTransfer || i > fIntervalNumber) { fEnergyInterval[i] = maxEnergyTransfer ; fIntervalNumber = i ; break; } fEnergyInterval[i] = e; fA1[i] = fSandia->GetSandiaMatTablePAI(i,1); fA2[i] = fSandia->GetSandiaMatTablePAI(i,2); fA3[i] = fSandia->GetSandiaMatTablePAI(i,3); fA4[i] = fSandia->GetSandiaMatTablePAI(i,4); } if(fEnergyInterval[fIntervalNumber] != maxEnergyTransfer) { fIntervalNumber++; fEnergyInterval[fIntervalNumber] = maxEnergyTransfer ; fA1[fIntervalNumber] = fA1[fIntervalNumber-1] ; fA2[fIntervalNumber] = fA2[fIntervalNumber-1] ; fA3[fIntervalNumber] = fA3[fIntervalNumber-1] ; fA4[fIntervalNumber] = fA4[fIntervalNumber-1] ; } // Now checking, if two borders are too close together for(i=1;i