Ignore:
Timestamp:
Nov 19, 2009, 2:53:25 PM (15 years ago)
Author:
garnier
Message:

update par rapport a CVS

File:
1 edited

Legend:

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

    r968 r1192  
    2525//
    2626//
     27// History:
     28// -----------
     29//  21 Apr 2008   H. Abdelohauwed - 1st implementation
     30//  29 Apr 2009   ALF  Major Design Revision
     31//  11 Nov 2009   ALF update and code cleaning for the Dec Release
     32//
     33// -------------------------------------------------------------------
     34
     35// Class description:
     36// Low Energy Electromagnetic Physics, Cross section, p ionisation, K shell
     37// Further documentation available from http://www.ge.infn.it/geant4/lowE
     38
     39// -------------------------------------------------------------------
    2740
    2841#include "globals.hh"
     
    3043#include <fstream>
    3144#include <iomanip>
    32 #include "G4CompositeEMDataSet.hh"
    33 #include "G4ShellEMDataSet.hh"
     45//#include "G4CompositeEMDataSet.hh"
     46//#include "G4ShellEMDataSet.hh"
    3447#include "G4EMDataSet.hh"
    35 #include "G4VEMDataSet.hh"
    36 #include "G4VDataSetAlgorithm.hh"
     48//#include "G4VEMDataSet.hh"
     49//#include "G4VDataSetAlgorithm.hh"
    3750#include "G4LogLogInterpolation.hh"
    3851#include "G4PaulKCrossSection.hh"
     52#include "G4Proton.hh"
     53#include "G4Alpha.hh"
     54
    3955
    4056G4PaulKCrossSection::G4PaulKCrossSection()
    41 { }
     57{
     58
     59 
     60  interpolation = new G4LogLogInterpolation();
     61
     62  /*
     63    G4String path = getenv("G4LEDATA");
     64 
     65    if (!path)
     66    G4Exception("G4paulKCrossSection::G4paulKCrossSection: G4LEDATA environment variable not set");
     67    G4cout << path + "/kcsPaul/kcs-" << G4endl;
     68  */
     69
     70
     71    for (G4int i=4; i<93; i++) {
     72      protonDataSetMap[i] = new G4EMDataSet(i,interpolation);
     73      protonDataSetMap[i]->LoadData("pixe/kpcsPaul/kcs-");
     74    }
     75    for (G4int i=6; i<93; i++) {
     76      alphaDataSetMap[i] = new G4EMDataSet(i,interpolation);
     77      alphaDataSetMap[i]->LoadData("pixe/kacsPaul/kacs-");
     78    }
     79
     80
     81
     82
     83}
    4284
    4385G4PaulKCrossSection::~G4PaulKCrossSection()
    44 { }
     86{
    4587
    46 G4double G4PaulKCrossSection::CalculateKCrossSection(G4int zTarget,G4int zIncident, G4double energyIncident)
     88  protonDataSetMap.clear();
     89  alphaDataSetMap.clear();
     90
     91}
     92
     93G4double G4PaulKCrossSection::CalculateKCrossSection(G4int zTarget,G4double massIncident, G4double energyIncident)
    4794{
    4895 
    49  G4String fileName;
     96  G4Proton* aProtone = G4Proton::Proton();
     97  G4Alpha* aAlpha = G4Alpha::Alpha();
     98 
     99  G4double sigma = 0;
    50100
    51  if (zIncident == 1)
    52    { fileName = "kcsPaul/kcs-";}
     101  if (massIncident == aProtone->GetPDGMass() )
     102    {
     103     
     104      sigma = protonDataSetMap[zTarget]->FindValue(energyIncident/MeV) / barn;
     105     
     106    }
    53107  else
    54108    {
    55       if (zIncident == 2)
    56         { fileName = "kacsPaul/kacs-";}
    57        
     109      if (massIncident == aAlpha->GetPDGMass())
     110        {
     111         
     112          sigma = alphaDataSetMap[zTarget]->FindValue(energyIncident/MeV) / barn;
     113         
     114        }
     115      else
     116        {
     117          G4cout << "we can treat only Proton or Alpha incident particles " << G4endl;
     118          sigma = 0.;
     119        }
    58120    }
    59 
    60121 
    61   G4VDataSetAlgorithm* interpolation = new G4LogLogInterpolation();
    62 
    63   G4VEMDataSet* dataSet;
    64 
    65   dataSet = new G4EMDataSet(zTarget,interpolation);
    66122 
    67   dataSet->LoadData(fileName);
    68    
    69 
    70           G4double sigma = dataSet->FindValue(energyIncident/MeV) / barn;
    71 
    72           return sigma;
     123 
     124  return sigma;
    73125}
    74126
Note: See TracChangeset for help on using the changeset viewer.