source: trunk/source/processes/hadronic/models/cascade/cascade/src/paraMaker.cc @ 1315

Last change on this file since 1315 was 1315, checked in by garnier, 14 years ago

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

File size: 4.1 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// $Id: paraMaker.cc,v 1.17 2010/06/01 17:20:31 mkelsey Exp $
26// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
27//
28// 20100412  M. Kelsey -- Modify paraMaker[Truncated] to take buffer as argument
29// 20100517  M. Kelsey -- BUG FIX:  Must check for array boundary "if (Z>=70)"
30// 20100517  M. Kelsey -- Use G4CascadeInterpolator, which handles boundaries
31// 20100601  M. Kelsey -- Bug fix from Gunter Folger; resize(6,0.), not clear()
32
33#include "G4InuclSpecialFunctions.hh"
34#include "G4CascadeInterpolator.hh"
35
36void 
37G4InuclSpecialFunctions::paraMaker(G4double Z,
38           std::pair<std::vector<G4double>, std::vector<G4double> >& parms) {
39  G4int verboseLevel(0);
40
41  if (verboseLevel > 3) {
42    G4cout << " >>> G4InuclSpecialFunctions::paraMaker" << G4endl;
43  }
44
45  // calculates the coefficients for the phenomenological formulas for
46  // coulumb barier, c.s. etc needed for evaporators
47
48  static const G4double Z1[5] = {10.0, 20.0, 30.0, 50.0, 70.0};
49  static const G4double AP[5] = {0.42, 0.58, 0.68, 0.77, 0.80};
50  static const G4double CP[5] = {0.50, 0.28, 0.20, 0.15, 0.10};
51  static const G4double AA[5] = {0.68, 0.82, 0.91, 0.97, 0.98};
52  static const G4double CA[5] = {0.10, 0.10, 0.10, 0.08, 0.06};
53
54  // Set up input buffer for results
55  std::vector<G4double>& AK = parms.first; 
56  AK.resize(6,0.);
57
58  std::vector<G4double>& CPA = parms.second;
59  CPA.resize(6,0.);
60
61  AK[0] = 0.0;
62  CPA[0] = 0.0;
63
64  static G4CascadeInterpolator<5> interp(Z1, false);    // Do not extrapolate
65  AK[1]  = interp.interpolate(Z, AP);
66  AK[5]  = interp.interpolate(Z, AA);
67  CPA[1] = interp.interpolate(Z, CP);
68  CPA[5] = interp.interpolate(Z, CA);
69 
70  AK[2] = AK[1] + 0.06;
71  AK[3] = AK[1] + 0.12;
72  AK[4] = AK[5] - 0.06;
73
74  CPA[2] = CPA[1] * 0.5;
75  CPA[3] = CPA[1] / 3.0; 
76  CPA[4] = 4.0 * CPA[5] / 3.0;
77
78  return;       // Buffer filled
79}
80
81void 
82G4InuclSpecialFunctions::paraMakerTruncated(G4double Z,
83                                    std::pair<G4double,G4double>& parms) {
84  G4int verboseLevel(0);
85
86  if (verboseLevel > 3) {
87    G4cout << " >>> G4InuclSpecialFunctions::paraMakerTruncated" << G4endl;
88  }
89
90  // truncated version of the previous one
91  static const G4double Z1[5] = {10.0, 20.0, 30.0, 50.0, 70.0};
92  static const G4double AP[5] = {0.42, 0.58, 0.68, 0.77, 0.8};
93  static const G4double CP[5] = {0.5, 0.28, 0.2, 0.15, 0.1};
94
95  // Set up buffers for output
96  G4double& AK2=parms.first;
97  G4double& CP2=parms.second;
98
99  static G4CascadeInterpolator<5> interp(Z1, false);            // Do not extrapolate
100  AK2 = interp.interpolate(Z, AP);
101  CP2 = interp.interpolate(Z, CP);
102
103  return;       // Buffer filled
104}
Note: See TracBrowser for help on using the repository browser.