ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
paraMaker.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file paraMaker.cc
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 // 20100412 M. Kelsey -- Modify paraMaker[Truncated] to take buffer as argument
28 // 20100517 M. Kelsey -- BUG FIX: Must check for array boundary "if (Z>=70)"
29 // 20100517 M. Kelsey -- Use G4CascadeInterpolator, which handles boundaries
30 // 20100601 M. Kelsey -- Bug fix from Gunter Folger; resize(6,0.), not clear()
31 // 20100914 M. Kelsey -- Migrate to integer A and Z
32 // 20130807 M. Kelsey -- Convert to class object for thread isolation
33 
35 #include "G4CascadeInterpolator.hh"
36 
37 
38 // Interpolation constants for calculating k factors for Coulomb energy
39 // calculation. AP: proton, AA: alpha
40 namespace {
41  static const G4double Z1[5] = {10.0, 20.0, 30.0, 50.0, 70.0};
42  static const G4double AP[5] = {0.42, 0.58, 0.68, 0.77, 0.80};
43  static const G4double CP[5] = {0.50, 0.28, 0.20, 0.15, 0.10};
44  static const G4double AA[5] = {0.68, 0.82, 0.91, 0.97, 0.98};
45  static const G4double CA[5] = {0.10, 0.10, 0.10, 0.08, 0.06};
46 }
47 
48 // Constructor and destructor
49 
51  : verboseLevel(vb), interp(new G4CascadeInterpolator<5>(Z1, false)) {;}
52 
54  delete interp;
55 }
56 
57 
58 // calculates the coefficients for the phenomenological formulas for
59 // coulumb barier, c.s. etc needed for evaporators
60 
63  std::pair<std::vector<G4double>, std::vector<G4double> >& parms) {
64  if (verboseLevel > 3) {
65  G4cout << " >>> G4InuclSpecialFunctions::paraMaker" << G4endl;
66  }
67 
68  // Set up input buffer for results
69  std::vector<G4double>& AK = parms.first;
70  AK.resize(6,0.);
71 
72  std::vector<G4double>& CPA = parms.second;
73  CPA.resize(6,0.);
74 
75  AK[0] = 0.0;
76  CPA[0] = 0.0;
77 
78  AK[1] = interp->interpolate(Z, AP);
79  AK[5] = interp->interpolate(Z, AA);
80  CPA[1] = interp->interpolate(Z, CP);
81  CPA[5] = interp->interpolate(Z, CA);
82 
83  AK[2] = AK[1] + 0.06;
84  AK[3] = AK[1] + 0.12;
85  AK[4] = AK[5] - 0.06;
86 
87  CPA[2] = CPA[1] * 0.5;
88  CPA[3] = CPA[1] / 3.0;
89  CPA[4] = 4.0 * CPA[5] / 3.0;
90 
91  return; // Buffer filled
92 }
93 
94 void
96 getTruncated(G4double Z, std::pair<G4double,G4double>& parms) {
97  if (verboseLevel > 3) {
98  G4cout << " >>> G4InuclSpecialFunctions::paraMakerTruncated" << G4endl;
99  }
100 
101  // Set up buffers for output
102  G4double& AK2=parms.first;
103  G4double& CP2=parms.second;
104 
105  AK2 = interp->interpolate(Z, AP);
106  CP2 = interp->interpolate(Z, CP);
107 
108  return; // Buffer filled
109 }