G4PaulKxsModel.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // History:
00028 // -----------
00029 //  21 Apr 2008   H. Abdelohauwed - 1st implementation
00030 //  29 Apr 2009   ALF  Major Design Revision
00031 //  22 Oct 2011   ALF  Warning removals and Z checks fix for alphas
00032 //  29 Oct 2011   ALF  Changed name to G4PAulKxsModel
00033 //
00034 // -------------------------------------------------------------------
00035 
00036 // Class description:
00037 // Low Energy Electromagnetic Physics, Cross section, p ionisation, K shell
00038 // Further documentation available from http://www.ge.infn.it/geant4/lowE
00039 
00040 // -------------------------------------------------------------------
00041 
00042 #include <fstream>
00043 #include <iomanip>
00044 
00045 #include "G4PaulKxsModel.hh"
00046 
00047 #include "globals.hh"
00048 #include "G4SystemOfUnits.hh"
00049 #include "G4ios.hh"
00050 #include "G4EMDataSet.hh"
00051 #include "G4LogLogInterpolation.hh"
00052 #include "G4Proton.hh"
00053 #include "G4Alpha.hh"
00054 
00055 
00056 G4PaulKxsModel::G4PaulKxsModel()
00057 { 
00058 
00059   
00060   interpolation = new G4LogLogInterpolation();
00061 
00062 
00063     for (G4int i=4; i<93; i++) {
00064       protonDataSetMap[i] = new G4EMDataSet(i,interpolation);
00065       protonDataSetMap[i]->LoadData("pixe/kpcsPaul/kcs-");
00066     }
00067     for (G4int i=6; i<93; i++) {
00068       alphaDataSetMap[i] = new G4EMDataSet(i,interpolation);
00069       alphaDataSetMap[i]->LoadData("pixe/kacsPaul/kacs-");
00070     }
00071 
00072 
00073 
00074 
00075 }
00076 
00077 G4PaulKxsModel::~G4PaulKxsModel()
00078 { 
00079 
00080   protonDataSetMap.clear();
00081   alphaDataSetMap.clear();
00082   delete interpolation;
00083 
00084 }
00085 
00086 G4double G4PaulKxsModel::CalculateKCrossSection(G4int zTarget,G4double massIncident, G4double energyIncident)
00087 {
00088   
00089   G4Proton* aProtone = G4Proton::Proton();
00090   G4Alpha* aAlpha = G4Alpha::Alpha();
00091   
00092   G4double sigma = 0;
00093 
00094   if (massIncident == aProtone->GetPDGMass() && zTarget < 93 && zTarget > 3)
00095     {
00096 
00097       //      G4EMDataSet* currentDataset =  protonDataSetMap[zTarget];
00098       //      currentDataset->GetEnergies
00099 
00100   if (energyIncident > protonDataSetMap[zTarget]->GetEnergies(0).back() ||
00101       energyIncident < protonDataSetMap[zTarget]->GetEnergies(0).front() )
00102         {sigma = 0;}
00103       else {     
00104         sigma = protonDataSetMap[zTarget]->FindValue(energyIncident/MeV); 
00105       }
00106     }
00107   else
00108     {
00109       if (massIncident == aAlpha->GetPDGMass() && zTarget < 93 && zTarget > 5)
00110         {
00111           if (energyIncident > alphaDataSetMap[zTarget]->GetEnergies(0).back() ||
00112               energyIncident < alphaDataSetMap[zTarget]->GetEnergies(0).front() )
00113             {sigma = 0;}
00114           else {
00115             sigma = alphaDataSetMap[zTarget]->FindValue(energyIncident/MeV); 
00116           }
00117         }
00118       else
00119         { 
00120           
00121 // G4Exception("G4PaulKxsModel::CalculateKCrossSection()","de0004",JustWarning, "Energy deposited locally");
00122           sigma = 0.;
00123 
00124         }
00125     }
00126   
00127   
00128   // sigma is in internal units (mm^2)
00129   return sigma;
00130 }
00131 
00132 
00133 
00134 
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 

Generated on Mon May 27 17:49:17 2013 for Geant4 by  doxygen 1.4.7