source: trunk/source/processes/electromagnetic/lowenergy/src/G4hShellCrossSectionDoubleExp.cc @ 1347

Last change on this file since 1347 was 1347, checked in by garnier, 13 years ago

geant4 tag 9.4

File size: 7.5 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26// -------------------------------------------------------------------
27//
28// GEANT4 Class file
29//
30//
31// File name:  G4hShellCrossSectionDoubleExp.cc   
32//
33// Author:     Simona Saliceti (simona.saliceti@ge.infn.it)
34//
35// History:
36// -----------
37// From 23 Oct 2001 A. Mantero G4hShellCrossSection
38// 30/03/2004 Simona Saliceti 1st implementation
39// -------------------------------------------------------------------
40// Class Description:
41// Empiric Model for shell cross sections in proton ionisation
42// -------------------------------------------------------------------
43// $Id: G4hShellCrossSectionDoubleExp.cc,v 1.11 2010/02/05 08:54:12 sincerti Exp $
44// GEANT4 tag $Name: geant4-09-04-ref-00 $
45
46#include "globals.hh"
47#include <vector>
48#include "G4hShellCrossSectionDoubleExp.hh"
49#include "G4AtomicTransitionManager.hh"
50#include "G4Electron.hh"
51#include "G4hShellCrossSectionDoubleExpData.hh"
52#include "G4Proton.hh"
53#include "G4ParticleDefinition.hh"
54
55G4hShellCrossSectionDoubleExp::G4hShellCrossSectionDoubleExp()
56{
57  kShellData = new G4hShellCrossSectionDoubleExpData();
58
59  atomTotalCrossSection = 0.;
60}
61
62G4hShellCrossSectionDoubleExp::~G4hShellCrossSectionDoubleExp()
63{ }
64
65std::vector<G4double> G4hShellCrossSectionDoubleExp::GetCrossSection(G4int Z,
66                                                                     G4double incidentEnergy,
67                                                                     G4double mass,
68                                                                     G4double deltaEnergy,
69                                                                     G4bool testFlag) const
70{
71  mass = 0.0;
72  deltaEnergy = 0.0;
73
74  std::vector<G4double> aCrossSection; 
75 
76  // Fill the vector of cross sections with the value just calculated
77  aCrossSection.push_back(GetCrossSectionDoubleExp(Z,incidentEnergy));
78 
79  if (testFlag) 
80    {
81      G4cout <<"Element: " <<Z<<" Particle Energy: "<<incidentEnergy/MeV<<" MeV" <<G4endl;
82      G4cout <<"Cross Section: "<<aCrossSection[0]/barn<<" barns"<< G4endl;
83    }
84  return aCrossSection;
85}
86
87//This function calculated the cross section with the Empiric model
88G4double G4hShellCrossSectionDoubleExp::GetCrossSectionDoubleExp(G4int Z, 
89                                                                 G4double incidentEnergy) const
90{
91  // Vector that stores the calculated cross-sections for each shell:
92  G4double  crossSectionsInBarn = 0.0;
93  G4double  crossSections = 0.0;
94
95  std::vector<std::vector<G4double>*> parVec = kShellData->GetParam(Z);
96  std::vector<G4double>* energyVec = parVec[0];
97  std::vector<G4double>* par1Vec  = parVec[1];
98  std::vector<G4double>* par2Vec  = parVec[2];
99 
100  std::vector<G4double>::iterator i = (*par1Vec).begin();
101 
102  G4double a1 = *i;
103  G4double b1 = *(i+1);
104  G4double c1 = *(i+2);
105
106  std::vector<G4double>::iterator j = (*par2Vec).begin();
107
108  G4double a2 = *j;
109  G4double b2 = *(j+1);
110  G4double c2 = *(j+2);
111  G4double d2 = *(j+3);
112  G4double e2 = *(j+4);
113
114  G4double incidentEnergyInMeV = incidentEnergy/MeV;
115 
116  // energy is the energy to split the file in low and high energy
117  std::vector<G4double>::iterator l = (*energyVec).begin();
118  G4double energy = *l;
119  energy = energy/MeV;
120
121  if(incidentEnergyInMeV <= energy)
122    {
123      if(Z<26)
124        {
125          crossSectionsInBarn = (std::pow(incidentEnergyInMeV,(a1)))*std::exp((b1)-((c1)*(incidentEnergyInMeV)));       
126        }         
127      else if(Z>=26)
128        {
129          crossSectionsInBarn = a1*(std::pow(b1,(1./incidentEnergyInMeV)))*(std::pow(incidentEnergyInMeV,c1));
130        } 
131    }   
132  else if(incidentEnergyInMeV > energy)
133    {
134      if(Z<26 || (Z>=36 && Z<=65))
135        {
136          crossSectionsInBarn = (a2)*(std::pow((b2),(1./incidentEnergyInMeV)))*(std::pow(incidentEnergyInMeV,(c2)));
137        }
138      else if(Z>=26 && Z<36)
139        {
140          crossSectionsInBarn = a2+b2*(std::log(incidentEnergyInMeV))+c2*(std::pow(std::log(incidentEnergyInMeV),2))+d2*(std::pow(std::log(incidentEnergyInMeV),3));
141        } 
142      else if(Z>65 && Z<=92)
143        {
144          crossSectionsInBarn = a2+b2*(std::log(incidentEnergyInMeV))+c2*(std::pow(std::log(incidentEnergyInMeV),2))+d2*(std::pow(std::log(incidentEnergyInMeV),3))+e2*(std::pow(std::log(incidentEnergyInMeV),4));
145        }
146    }
147
148  //   if(Z<26 && incidentEnergyInMeV <= energy)
149  //     {
150  //     crossSectionsInBarn = (std::pow(incidentEnergyInMeV,(a1)))*std::exp((b1)-((c1)*incidentEnergyInMeV));   
151  //     }         
152  //   else if(Z>=26 && incidentEnergyInMeV <= energy)
153  //     {
154  //       crossSectionsInBarn = a1*(std::pow(b1,(1./incidentEnergyInMeV)))*(std::pow(incidentEnergyInMeV,c1));
155  //     }     
156  //   else if((Z<26 || (36<=Z && Z<=65)) && incidentEnergyInMeV > energy)
157  //     {
158  //       crossSectionsInBarn = (a2)*(std::pow((b2),(1./incidentEnergyInMeV)))*(std::pow(incidentEnergyInMeV,(c2)));
159  //     }
160  //   else if(Z>=26 && Z<=35 && incidentEnergyInMeV > energy)
161  //     {
162  //       crossSectionsInBarn = a2+b2*(std::log(incidentEnergyInMeV))+c2*(std::pow(std::log(incidentEnergyInMeV),2))+d2*(std::pow(std::log(incidentEnergyInMeV),3));
163  //     }
164  //   else if(Z>=67 && Z<=92 && incidentEnergyInMeV > energy)
165  //     {
166  //       crossSectionsInBarn = a2+b2*(std::log(incidentEnergyInMeV))+c2*(std::pow(std::log(incidentEnergyInMeV),2))+d2*(std::pow(std::log(incidentEnergyInMeV),3))+e2*(std::pow(std::log(incidentEnergyInMeV),4));
167  //     }
168
169  crossSections = crossSectionsInBarn*barn;
170  return crossSections;
171}
172 
173// This function gives the atomic cross section of k shell only
174void G4hShellCrossSectionDoubleExp::SetTotalCS(G4double value)
175{
176  atomTotalCrossSection = value;
177}
178
179//A new implementation of Probability to calculate the cross section probability for k shell only
180std::vector<G4double> G4hShellCrossSectionDoubleExp::Probabilities(
181                                                                   G4int Z, 
182                                                                   G4double incidentEnergy, 
183                                                                   G4double hMass, 
184                                                                   G4double deltaEnergy
185                                                                   ) const
186{ 
187  hMass = 0.0;
188  deltaEnergy = 0.0;
189 
190  std::vector<G4double> kProbability;//(0);
191 
192 
193  if (atomTotalCrossSection!=0.) // SI - 26 june 2008
194 
195  { 
196    kProbability.push_back(GetCrossSectionDoubleExp(Z,incidentEnergy)/atomTotalCrossSection);
197    // ---- MGP ---- Next line corrected to kProbability[0] instead of [1], which is not initialized!
198    kProbability.push_back(1 - kProbability[0]);
199  }
200
201  return kProbability;
202}
203 
204 
205
Note: See TracBrowser for help on using the repository browser.