paraMaker.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id$
00027 //
00028 // 20100412  M. Kelsey -- Modify paraMaker[Truncated] to take buffer as argument
00029 // 20100517  M. Kelsey -- BUG FIX:  Must check for array boundary "if (Z>=70)"
00030 // 20100517  M. Kelsey -- Use G4CascadeInterpolator, which handles boundaries
00031 // 20100601  M. Kelsey -- Bug fix from Gunter Folger; resize(6,0.), not clear()
00032 // 20100914  M. Kelsey -- Migrate to integer A and Z
00033 
00034 #include "G4InuclSpecialFunctions.hh"
00035 #include "G4CascadeInterpolator.hh"
00036 
00037 void 
00038 G4InuclSpecialFunctions::paraMaker(G4double Z,
00039            std::pair<std::vector<G4double>, std::vector<G4double> >& parms) {
00040   G4int verboseLevel(0);
00041 
00042   if (verboseLevel > 3) {
00043     G4cout << " >>> G4InuclSpecialFunctions::paraMaker" << G4endl;
00044   }
00045 
00046   // calculates the coefficients for the phenomenological formulas for
00047   // coulumb barier, c.s. etc needed for evaporators
00048 
00049   static const G4double Z1[5] = {10.0, 20.0, 30.0, 50.0, 70.0};
00050   static const G4double AP[5] = {0.42, 0.58, 0.68, 0.77, 0.80};
00051   static const G4double CP[5] = {0.50, 0.28, 0.20, 0.15, 0.10};
00052   static const G4double AA[5] = {0.68, 0.82, 0.91, 0.97, 0.98};
00053   static const G4double CA[5] = {0.10, 0.10, 0.10, 0.08, 0.06};
00054 
00055   // Set up input buffer for results
00056   std::vector<G4double>& AK = parms.first; 
00057   AK.resize(6,0.);
00058 
00059   std::vector<G4double>& CPA = parms.second;
00060   CPA.resize(6,0.);
00061 
00062   AK[0] = 0.0;
00063   CPA[0] = 0.0;
00064 
00065   static G4CascadeInterpolator<5> interp(Z1, false);    // Do not extrapolate
00066   AK[1]  = interp.interpolate(Z, AP);
00067   AK[5]  = interp.interpolate(Z, AA);
00068   CPA[1] = interp.interpolate(Z, CP);
00069   CPA[5] = interp.interpolate(Z, CA);
00070   
00071   AK[2] = AK[1] + 0.06;
00072   AK[3] = AK[1] + 0.12;
00073   AK[4] = AK[5] - 0.06;
00074 
00075   CPA[2] = CPA[1] * 0.5;
00076   CPA[3] = CPA[1] / 3.0;  
00077   CPA[4] = 4.0 * CPA[5] / 3.0;
00078 
00079   return;       // Buffer filled
00080 }
00081 
00082 void 
00083 G4InuclSpecialFunctions::paraMakerTruncated(G4double Z,
00084                                     std::pair<G4double,G4double>& parms) {
00085   G4int verboseLevel(0);
00086 
00087   if (verboseLevel > 3) {
00088     G4cout << " >>> G4InuclSpecialFunctions::paraMakerTruncated" << G4endl;
00089   }
00090 
00091   // truncated version of the previous one
00092   static const G4double Z1[5] = {10.0, 20.0, 30.0, 50.0, 70.0};
00093   static const G4double AP[5] = {0.42, 0.58, 0.68, 0.77, 0.8};
00094   static const G4double CP[5] = {0.5, 0.28, 0.2, 0.15, 0.1};
00095 
00096   // Set up buffers for output
00097   G4double& AK2=parms.first;
00098   G4double& CP2=parms.second;
00099 
00100   static G4CascadeInterpolator<5> interp(Z1, false);            // Do not extrapolate
00101   AK2 = interp.interpolate(Z, AP);
00102   CP2 = interp.interpolate(Z, CP);
00103 
00104   return;       // Buffer filled
00105 }

Generated on Mon May 27 17:50:32 2013 for Geant4 by  doxygen 1.4.7