[819] | 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 | // |
---|
[961] | 26 | // $Id: G4CrossSectionChargeDecreasePartial.cc,v 1.2 2008/07/14 20:47:34 sincerti Exp $ |
---|
[991] | 27 | // GEANT4 tag $Name: geant4-09-02 $ |
---|
[819] | 28 | |
---|
| 29 | #include "G4CrossSectionChargeDecreasePartial.hh" |
---|
| 30 | |
---|
[961] | 31 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
[819] | 32 | |
---|
| 33 | G4CrossSectionChargeDecreasePartial::G4CrossSectionChargeDecreasePartial() |
---|
| 34 | { |
---|
| 35 | |
---|
| 36 | //PROTON |
---|
| 37 | f0[0][0]=1.; |
---|
| 38 | a0[0][0]=-0.180; |
---|
| 39 | a1[0][0]=-3.600; |
---|
| 40 | b0[0][0]=-18.22; |
---|
| 41 | b1[0][0]=-1.997; |
---|
| 42 | c0[0][0]=0.215; |
---|
| 43 | d0[0][0]=3.550; |
---|
| 44 | x0[0][0]=3.450; |
---|
| 45 | x1[0][0]=5.251; |
---|
| 46 | |
---|
| 47 | numberOfPartialCrossSections[0] = 1; |
---|
| 48 | |
---|
| 49 | //ALPHA++ |
---|
| 50 | f0[0][1]=1.; a0[0][1]=0.95; |
---|
| 51 | a1[0][1]=-2.75; |
---|
| 52 | b0[0][1]=-23.00; |
---|
| 53 | c0[0][1]=0.215; |
---|
| 54 | d0[0][1]=2.95; |
---|
| 55 | x0[0][1]=3.50; |
---|
| 56 | |
---|
| 57 | f0[1][1]=1.; |
---|
| 58 | a0[1][1]=0.95; |
---|
| 59 | a1[1][1]=-2.75; |
---|
| 60 | b0[1][1]=-23.73; |
---|
| 61 | c0[1][1]=0.250; |
---|
| 62 | d0[1][1]=3.55; |
---|
| 63 | x0[1][1]=3.72; |
---|
| 64 | |
---|
| 65 | x1[0][1]=-1.; |
---|
| 66 | b1[0][1]=-1.; |
---|
| 67 | |
---|
| 68 | x1[1][1]=-1.; |
---|
| 69 | b1[1][1]=-1.; |
---|
| 70 | |
---|
| 71 | numberOfPartialCrossSections[1] = 2; |
---|
| 72 | |
---|
| 73 | // ALPHA+ |
---|
| 74 | f0[0][2]=1.; |
---|
| 75 | a0[0][2]=0.65; |
---|
| 76 | a1[0][2]=-2.75; |
---|
| 77 | b0[0][2]=-21.81; |
---|
| 78 | c0[0][2]=0.232; |
---|
| 79 | d0[0][2]=2.95; |
---|
| 80 | x0[0][2]=3.53; |
---|
| 81 | |
---|
| 82 | x1[0][2]=-1.; |
---|
| 83 | b1[0][2]=-1.; |
---|
| 84 | |
---|
| 85 | numberOfPartialCrossSections[2] = 1; |
---|
| 86 | |
---|
| 87 | } |
---|
| 88 | |
---|
[961] | 89 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 90 | |
---|
[819] | 91 | G4CrossSectionChargeDecreasePartial::~G4CrossSectionChargeDecreasePartial() |
---|
[961] | 92 | {} |
---|
[819] | 93 | |
---|
[961] | 94 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 95 | |
---|
[819] | 96 | G4double G4CrossSectionChargeDecreasePartial::CrossSection(G4double k, G4int index, |
---|
| 97 | const G4ParticleDefinition* particleDefinition) |
---|
| 98 | { |
---|
| 99 | G4int particleTypeIndex = 0; |
---|
| 100 | G4DNAGenericIonsManager* instance; |
---|
| 101 | instance = G4DNAGenericIonsManager::Instance(); |
---|
| 102 | |
---|
| 103 | if (particleDefinition == G4Proton::ProtonDefinition()) particleTypeIndex=0; |
---|
| 104 | if (particleDefinition == instance->GetIon("alpha++")) particleTypeIndex=1; |
---|
| 105 | if (particleDefinition == instance->GetIon("alpha+")) particleTypeIndex=2; |
---|
| 106 | |
---|
| 107 | // |
---|
| 108 | // sigma(T) = f0 10 ^ y(log10(T/eV)) |
---|
| 109 | // |
---|
| 110 | // / a0 x + b0 x < x0 |
---|
| 111 | // | |
---|
| 112 | // y(x) = < a0 x + b0 - c0 (x - x0)^d0 x0 <= x < x1 |
---|
| 113 | // | |
---|
| 114 | // \ a1 x + b1 x >= x1 |
---|
| 115 | // |
---|
| 116 | // |
---|
| 117 | // f0, a0, a1, b0, b1, c0, d0, x0, x1 are parameters that change for protons and helium (0, +, ++) |
---|
| 118 | // |
---|
| 119 | // f0 has been added to the code in order to manage partial (shell-dependent) cross sections (if no shell dependence is present. f0=1. Sum of f0 over the considered shells should give 1) |
---|
| 120 | // |
---|
| 121 | // From Rad. Phys. and Chem. 59 (2000) 255-275, M. Dingfelder et al. |
---|
| 122 | // Inelastic-collision cross sections of liquid water for interactions of energetic proton |
---|
| 123 | // |
---|
| 124 | |
---|
| 125 | if (x1[index][particleTypeIndex]<x0[index][particleTypeIndex]) |
---|
[961] | 126 | { |
---|
[819] | 127 | // |
---|
| 128 | // if x1 < x0 means that x1 and b1 will be calculated with the following formula (this piece of code is run on all alphas and not on protons) |
---|
| 129 | // |
---|
| 130 | // x1 = x0 + ((a0 - a1)/(c0 * d0)) ^ (1 / (d0 - 1)) |
---|
| 131 | // |
---|
| 132 | // b1 = (a0 - a1) * x1 + b0 - c0 * (x1 - x0) ^ d0 |
---|
| 133 | // |
---|
| 134 | |
---|
| 135 | x1[index][particleTypeIndex]=x0[index][particleTypeIndex] + std::pow((a0[index][particleTypeIndex] - a1[index][particleTypeIndex]) |
---|
| 136 | / (c0[index][particleTypeIndex] * d0[index][particleTypeIndex]), 1. / (d0[index][particleTypeIndex] - 1.)); |
---|
| 137 | b1[index][particleTypeIndex]=(a0[index][particleTypeIndex] - a1[index][particleTypeIndex]) * x1[index][particleTypeIndex] |
---|
| 138 | + b0[index][particleTypeIndex] - c0[index][particleTypeIndex] * std::pow(x1[index][particleTypeIndex] |
---|
| 139 | - x0[index][particleTypeIndex], d0[index][particleTypeIndex]); |
---|
[961] | 140 | } |
---|
[819] | 141 | |
---|
| 142 | G4double x(std::log10(k/eV)); |
---|
| 143 | G4double y; |
---|
| 144 | |
---|
| 145 | if (x<x0[index][particleTypeIndex]) |
---|
| 146 | y=a0[index][particleTypeIndex] * x + b0[index][particleTypeIndex]; |
---|
| 147 | else if (x<x1[index][particleTypeIndex]) |
---|
| 148 | y=a0[index][particleTypeIndex] * x + b0[index][particleTypeIndex] - c0[index][particleTypeIndex] |
---|
| 149 | * std::pow(x - x0[index][particleTypeIndex], d0[index][particleTypeIndex]); |
---|
| 150 | else |
---|
| 151 | y=a1[index][particleTypeIndex] * x + b1[index][particleTypeIndex]; |
---|
| 152 | |
---|
| 153 | return f0[index][particleTypeIndex] * std::pow(10., y)*m*m; |
---|
| 154 | |
---|
| 155 | } |
---|
| 156 | |
---|
| 157 | G4int G4CrossSectionChargeDecreasePartial::RandomSelect(G4double k, |
---|
| 158 | const G4ParticleDefinition* particleDefinition) |
---|
| 159 | { |
---|
| 160 | G4int particleTypeIndex = 0; |
---|
| 161 | G4DNAGenericIonsManager *instance; |
---|
| 162 | instance = G4DNAGenericIonsManager::Instance(); |
---|
| 163 | |
---|
| 164 | if (particleDefinition == G4Proton::ProtonDefinition()) particleTypeIndex = 0; |
---|
| 165 | if (particleDefinition == instance->GetIon("alpha++")) particleTypeIndex = 1; |
---|
| 166 | if (particleDefinition == instance->GetIon("alpha+")) particleTypeIndex = 2; |
---|
| 167 | |
---|
| 168 | const G4int n = numberOfPartialCrossSections[particleTypeIndex]; |
---|
| 169 | G4double* values(new G4double[n]); |
---|
| 170 | G4double value(0); |
---|
| 171 | G4int i = n; |
---|
| 172 | |
---|
| 173 | while (i>0) |
---|
[961] | 174 | { |
---|
[819] | 175 | i--; |
---|
| 176 | values[i]=CrossSection(k, i, particleDefinition); |
---|
| 177 | value+=values[i]; |
---|
[961] | 178 | } |
---|
[819] | 179 | |
---|
| 180 | value*=G4UniformRand(); |
---|
| 181 | |
---|
| 182 | i=n; |
---|
| 183 | while (i>0) |
---|
[961] | 184 | { |
---|
[819] | 185 | i--; |
---|
| 186 | |
---|
| 187 | if (values[i]>value) |
---|
| 188 | break; |
---|
| 189 | |
---|
| 190 | value-=values[i]; |
---|
[961] | 191 | } |
---|
[819] | 192 | |
---|
| 193 | delete[] values; |
---|
| 194 | |
---|
| 195 | return i; |
---|
| 196 | } |
---|
| 197 | |
---|
[961] | 198 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 199 | |
---|
[819] | 200 | G4double G4CrossSectionChargeDecreasePartial::Sum(G4double k, const G4ParticleDefinition* particleDefinition) |
---|
| 201 | { |
---|
| 202 | G4int particleTypeIndex = 0; |
---|
| 203 | G4DNAGenericIonsManager* instance; |
---|
| 204 | instance = G4DNAGenericIonsManager::Instance(); |
---|
| 205 | |
---|
| 206 | if (particleDefinition == G4Proton::ProtonDefinition()) particleTypeIndex=0; |
---|
| 207 | if (particleDefinition == instance->GetIon("alpha++")) particleTypeIndex=1; |
---|
| 208 | if (particleDefinition == instance->GetIon("alpha+")) particleTypeIndex=2; |
---|
| 209 | |
---|
| 210 | G4double totalCrossSection = 0.; |
---|
| 211 | |
---|
| 212 | for (G4int i=0; i<numberOfPartialCrossSections[particleTypeIndex]; i++) |
---|
[961] | 213 | { |
---|
| 214 | totalCrossSection += CrossSection(k,i,particleDefinition); |
---|
| 215 | } |
---|
[819] | 216 | return totalCrossSection; |
---|
| 217 | } |
---|