Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/lowenergy/src/G4PaulKCrossSection.cc

    r1228 r1315  
    2525//
    2626//
     27// History:
     28// -----------
     29//  21 Apr 2008   H. Abdelohauwed - 1st implementation
     30//  29 Apr 2009   ALF  Major Design Revision
     31//
     32// -------------------------------------------------------------------
     33
     34// Class description:
     35// Low Energy Electromagnetic Physics, Cross section, p ionisation, K shell
     36// Further documentation available from http://www.ge.infn.it/geant4/lowE
     37
     38// -------------------------------------------------------------------
    2739
    2840#include "globals.hh"
     
    3042#include <fstream>
    3143#include <iomanip>
    32 #include "G4CompositeEMDataSet.hh"
    33 #include "G4ShellEMDataSet.hh"
     44//#include "G4CompositeEMDataSet.hh"
     45//#include "G4ShellEMDataSet.hh"
    3446#include "G4EMDataSet.hh"
    35 #include "G4VEMDataSet.hh"
    36 #include "G4VDataSetAlgorithm.hh"
     47//#include "G4VEMDataSet.hh"
     48//#include "G4VDataSetAlgorithm.hh"
    3749#include "G4LogLogInterpolation.hh"
    3850#include "G4PaulKCrossSection.hh"
     51#include "G4Proton.hh"
     52#include "G4Alpha.hh"
     53
    3954
    4055G4PaulKCrossSection::G4PaulKCrossSection()
    41 { }
     56{
     57
     58 
     59  interpolation = new G4LogLogInterpolation();
     60
     61  /*
     62    G4String path = getenv("G4LEDATA");
     63 
     64    if (!path)
     65    G4Exception("G4paulKCrossSection::G4paulKCrossSection: G4LEDATA environment variable not set");
     66    G4cout << path + "/kcsPaul/kcs-" << G4endl;
     67  */
     68
     69
     70    for (G4int i=4; i<93; i++) {
     71      protonDataSetMap[i] = new G4EMDataSet(i,interpolation);
     72      protonDataSetMap[i]->LoadData("pixe/kpcsPaul/kcs-");
     73    }
     74    for (G4int i=6; i<93; i++) {
     75      alphaDataSetMap[i] = new G4EMDataSet(i,interpolation);
     76      alphaDataSetMap[i]->LoadData("pixe/kacsPaul/kacs-");
     77    }
     78
     79
     80
     81
     82}
    4283
    4384G4PaulKCrossSection::~G4PaulKCrossSection()
    44 { }
     85{
    4586
    46 G4double G4PaulKCrossSection::CalculateKCrossSection(G4int zTarget,G4int zIncident, G4double energyIncident)
     87  protonDataSetMap.clear();
     88  alphaDataSetMap.clear();
     89
     90}
     91
     92G4double G4PaulKCrossSection::CalculateKCrossSection(G4int zTarget,G4double massIncident, G4double energyIncident)
    4793{
    4894 
    49  G4String fileName;
     95  G4Proton* aProtone = G4Proton::Proton();
     96  G4Alpha* aAlpha = G4Alpha::Alpha();
     97 
     98  G4double sigma = 0;
    5099
    51  if (zIncident == 1)
    52    { fileName = "kcsPaul/kcs-";}
     100  if (massIncident == aProtone->GetPDGMass() )
     101    {
     102     
     103      sigma = protonDataSetMap[zTarget]->FindValue(energyIncident/MeV) / barn;
     104     
     105    }
    53106  else
    54107    {
    55       if (zIncident == 2)
    56         { fileName = "kacsPaul/kacs-";}
    57        
     108      if (massIncident == aAlpha->GetPDGMass())
     109        {
     110         
     111          sigma = alphaDataSetMap[zTarget]->FindValue(energyIncident/MeV) / barn;
     112         
     113        }
     114      else
     115        {
     116          G4cout << "we can treat only Proton or Alpha incident particles " << G4endl;
     117          sigma = 0.;
     118        }
    58119    }
    59 
    60120 
    61   G4VDataSetAlgorithm* interpolation = new G4LogLogInterpolation();
    62 
    63   G4VEMDataSet* dataSet;
    64 
    65   dataSet = new G4EMDataSet(zTarget,interpolation);
    66121 
    67   dataSet->LoadData(fileName);
    68    
    69 
    70           G4double sigma = dataSet->FindValue(energyIncident/MeV) / barn;
    71 
    72           return sigma;
     122 
     123  return sigma;
    73124}
    74125
Note: See TracChangeset for help on using the changeset viewer.