[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 | // * * |
---|
| 21 | // * Parts of this code which have been developed by QinetiQ Ltd * |
---|
| 22 | // * under contract to the European Space Agency (ESA) are the * |
---|
| 23 | // * intellectual property of ESA. Rights to use, copy, modify and * |
---|
| 24 | // * redistribute this software for general public use are granted * |
---|
| 25 | // * in compliance with any licensing, distribution and development * |
---|
| 26 | // * policy adopted by the Geant4 Collaboration. This code has been * |
---|
| 27 | // * written by QinetiQ Ltd for the European Space Agency, under ESA * |
---|
| 28 | // * contract 17191/03/NL/LvH (Aurora Programme). * |
---|
| 29 | // * * |
---|
| 30 | // * By using, copying, modifying or distributing the software (or * |
---|
| 31 | // * any work based on the software) you agree to acknowledge its * |
---|
| 32 | // * use in resulting scientific publications, and indicate your * |
---|
| 33 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 34 | // ******************************************************************** |
---|
| 35 | // |
---|
| 36 | // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 37 | // |
---|
| 38 | // MODULE: G4GeneralSpaceNNCrossSection.cc |
---|
| 39 | // |
---|
| 40 | // Version: B.1 |
---|
| 41 | // Date: 15/04/04 |
---|
| 42 | // Author: P R Truscott |
---|
| 43 | // Organisation: QinetiQ Ltd, UK |
---|
| 44 | // Customer: ESA/ESTEC, NOORDWIJK |
---|
| 45 | // Contract: 17191/03/NL/LvH |
---|
| 46 | // |
---|
| 47 | // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 48 | // |
---|
| 49 | // CHANGE HISTORY |
---|
| 50 | // -------------- |
---|
| 51 | // |
---|
| 52 | // 6 October 2003, P R Truscott, QinetiQ Ltd, UK |
---|
| 53 | // Created. |
---|
| 54 | // |
---|
| 55 | // 15 March 2004, P R Truscott, QinetiQ Ltd, UK |
---|
| 56 | // Beta release |
---|
| 57 | // |
---|
| 58 | // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 59 | /////////////////////////////////////////////////////////////////////////////// |
---|
| 60 | // |
---|
| 61 | #include "G4GeneralSpaceNNCrossSection.hh" |
---|
| 62 | #include "G4DynamicParticle.hh" |
---|
| 63 | #include "G4Element.hh" |
---|
| 64 | #include "G4ParticleDefinition.hh" |
---|
| 65 | #include "G4ParticleTable.hh" |
---|
| 66 | #include "G4IonTable.hh" |
---|
[1340] | 67 | #include "G4HadTmpUtil.hh" |
---|
[819] | 68 | |
---|
| 69 | #include <iomanip> |
---|
[1340] | 70 | |
---|
| 71 | |
---|
[819] | 72 | G4GeneralSpaceNNCrossSection::G4GeneralSpaceNNCrossSection () |
---|
| 73 | { |
---|
| 74 | protonInelastic = new G4ProtonInelasticCrossSection(); |
---|
| 75 | ionProton = new G4IonProtonCrossSection(); |
---|
| 76 | TripathiGeneral = new G4TripathiCrossSection(); |
---|
| 77 | TripathiLight = new G4TripathiLightCrossSection(); |
---|
| 78 | Shen = new G4IonsShenCrossSection(); |
---|
| 79 | |
---|
| 80 | return; |
---|
| 81 | } |
---|
[1340] | 82 | |
---|
| 83 | |
---|
[819] | 84 | G4GeneralSpaceNNCrossSection::~G4GeneralSpaceNNCrossSection () |
---|
| 85 | { |
---|
| 86 | delete protonInelastic; |
---|
| 87 | delete ionProton; |
---|
| 88 | delete TripathiGeneral; |
---|
| 89 | delete TripathiLight; |
---|
| 90 | delete Shen; |
---|
| 91 | } |
---|
| 92 | /////////////////////////////////////////////////////////////////////////////// |
---|
| 93 | // |
---|
| 94 | |
---|
[1340] | 95 | G4bool G4GeneralSpaceNNCrossSection::IsIsoApplicable |
---|
| 96 | (const G4DynamicParticle* theProjectile, G4int ZZ, G4int AA) |
---|
[819] | 97 | { |
---|
[1340] | 98 | G4bool result = protonInelastic->IsIsoApplicable(theProjectile, ZZ, AA); |
---|
[819] | 99 | if (!result) |
---|
| 100 | { |
---|
[1340] | 101 | result = ionProton->IsIsoApplicable(theProjectile, ZZ, AA); |
---|
[819] | 102 | if (!result) |
---|
| 103 | { |
---|
[1340] | 104 | result = TripathiGeneral->IsIsoApplicable(theProjectile, ZZ, AA); |
---|
[819] | 105 | if (!result) |
---|
[1340] | 106 | result = Shen->IsIsoApplicable(theProjectile, ZZ, AA); |
---|
[819] | 107 | } |
---|
| 108 | } |
---|
| 109 | return result; |
---|
| 110 | } |
---|
| 111 | |
---|
| 112 | G4bool G4GeneralSpaceNNCrossSection::IsApplicable |
---|
| 113 | (const G4DynamicParticle* theProjectile, const G4Element* theTarget) |
---|
| 114 | { |
---|
| 115 | G4bool result = protonInelastic->IsApplicable(theProjectile, theTarget); |
---|
| 116 | if (!result) |
---|
| 117 | { |
---|
| 118 | result = ionProton->IsApplicable(theProjectile, theTarget); |
---|
| 119 | if (!result) |
---|
| 120 | { |
---|
| 121 | result = TripathiGeneral->IsApplicable(theProjectile, theTarget); |
---|
| 122 | if (!result) |
---|
| 123 | result = Shen->IsApplicable(theProjectile, theTarget); |
---|
| 124 | } |
---|
| 125 | } |
---|
| 126 | return result; |
---|
| 127 | } |
---|
| 128 | /////////////////////////////////////////////////////////////////////////////// |
---|
| 129 | // |
---|
| 130 | |
---|
| 131 | G4double G4GeneralSpaceNNCrossSection::GetCrossSection |
---|
| 132 | (const G4DynamicParticle* theProjectile, const G4Element* theTarget, |
---|
| 133 | G4double theTemperature) |
---|
| 134 | { |
---|
| 135 | G4int nIso = theTarget->GetNumberOfIsotopes(); |
---|
| 136 | G4double xsection = 0; |
---|
| 137 | |
---|
| 138 | if (nIso) { |
---|
| 139 | G4double sig; |
---|
| 140 | G4IsotopeVector* isoVector = theTarget->GetIsotopeVector(); |
---|
| 141 | G4double* abundVector = theTarget->GetRelativeAbundanceVector(); |
---|
[1340] | 142 | G4int ZZ; |
---|
| 143 | G4int AA; |
---|
[819] | 144 | |
---|
| 145 | for (G4int i = 0; i < nIso; i++) { |
---|
[1340] | 146 | ZZ = (*isoVector)[i]->GetZ(); |
---|
| 147 | AA = (*isoVector)[i]->GetN(); |
---|
| 148 | sig = GetZandACrossSection(theProjectile, ZZ, AA, theTemperature); |
---|
[819] | 149 | xsection += sig*abundVector[i]; |
---|
| 150 | } |
---|
| 151 | |
---|
| 152 | } else { |
---|
[1340] | 153 | G4int ZZ = G4lrint(theTarget->GetZ()); |
---|
| 154 | G4int AA = G4lrint(theTarget->GetN()); |
---|
| 155 | xsection = GetZandACrossSection(theProjectile, ZZ, AA, theTemperature); |
---|
[819] | 156 | } |
---|
| 157 | |
---|
| 158 | return xsection; |
---|
| 159 | } |
---|
| 160 | |
---|
| 161 | |
---|
[1340] | 162 | G4double |
---|
| 163 | G4GeneralSpaceNNCrossSection::GetZandACrossSection(const G4DynamicParticle* theProjectile, |
---|
| 164 | G4int ZZ, G4int AA, G4double theTemperature) |
---|
[819] | 165 | { |
---|
| 166 | G4double result = 0.0; |
---|
| 167 | |
---|
| 168 | const G4double AT = AA; |
---|
| 169 | const G4double ZT = ZZ; |
---|
| 170 | const G4double AP = theProjectile->GetDefinition()->GetBaryonNumber(); |
---|
| 171 | const G4double ZP = theProjectile->GetDefinition()->GetPDGCharge(); |
---|
| 172 | |
---|
| 173 | if (verboseLevel >= 2) |
---|
| 174 | { |
---|
| 175 | G4cout <<"In G4GeneralSpaceNNCrossSection::GetCrossSection" <<G4endl; |
---|
| 176 | G4cout <<"Projectile A = " <<std::setw(8) <<AP |
---|
| 177 | <<" Z = " <<std::setw(8) <<ZP |
---|
| 178 | <<" Energy = " <<theProjectile->GetKineticEnergy()/AP |
---|
| 179 | <<" MeV/nuc" <<G4endl; |
---|
| 180 | G4cout <<"Target A = " <<std::setw(8) <<AT |
---|
| 181 | <<" Z = " <<std::setw(8) <<ZT |
---|
| 182 | <<G4endl; |
---|
| 183 | } |
---|
| 184 | if (theProjectile->GetDefinition()==G4Proton::Proton()) |
---|
| 185 | { |
---|
| 186 | if (ZT>5) |
---|
| 187 | { |
---|
| 188 | result = protonInelastic-> |
---|
[1340] | 189 | GetZandACrossSection(theProjectile, ZZ, AA, theTemperature); |
---|
[819] | 190 | if (verboseLevel >= 2) |
---|
| 191 | G4cout <<"Selecting G4ProtonInelasticCrossSection" <<G4endl; |
---|
| 192 | } |
---|
| 193 | else |
---|
| 194 | { |
---|
| 195 | result = TripathiLight-> |
---|
[1340] | 196 | GetZandACrossSection(theProjectile, ZZ, AA, theTemperature); |
---|
[819] | 197 | if (verboseLevel >= 2) |
---|
| 198 | G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl; |
---|
| 199 | } |
---|
| 200 | } |
---|
| 201 | else if (AT==1 && ZT==1) |
---|
| 202 | { |
---|
| 203 | if (ZP>5) |
---|
| 204 | { |
---|
| 205 | result = ionProton-> |
---|
[1340] | 206 | GetZandACrossSection(theProjectile, ZZ, AA, theTemperature); |
---|
[819] | 207 | if (verboseLevel >= 2) |
---|
| 208 | G4cout <<"Selecting G4IonProtonCrossSection" <<G4endl; |
---|
| 209 | } |
---|
| 210 | else |
---|
| 211 | { |
---|
| 212 | result = TripathiLight-> |
---|
[1340] | 213 | GetZandACrossSection(theProjectile, ZZ, AA, theTemperature); |
---|
[819] | 214 | if (verboseLevel >= 2) |
---|
| 215 | G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl; |
---|
| 216 | } |
---|
| 217 | } |
---|
| 218 | else |
---|
| 219 | { |
---|
[1340] | 220 | if (TripathiLight->IsIsoApplicable(theProjectile, ZZ, AA)) |
---|
[819] | 221 | { |
---|
| 222 | result = TripathiLight-> |
---|
[1340] | 223 | GetZandACrossSection(theProjectile, ZZ, AA, theTemperature); |
---|
[819] | 224 | if (verboseLevel >= 2) |
---|
| 225 | G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl; |
---|
| 226 | } |
---|
[1340] | 227 | else if (TripathiGeneral->IsIsoApplicable(theProjectile, ZZ, AA)) |
---|
[819] | 228 | { |
---|
| 229 | result = TripathiGeneral-> |
---|
[1340] | 230 | GetZandACrossSection(theProjectile, ZZ, AA, theTemperature); |
---|
[819] | 231 | if (verboseLevel >= 2) |
---|
| 232 | G4cout <<"Selecting G4TripathiCrossSection" <<G4endl; |
---|
| 233 | } |
---|
[1340] | 234 | else if (Shen->IsIsoApplicable(theProjectile, ZZ, AA)) |
---|
[819] | 235 | { |
---|
| 236 | result = Shen-> |
---|
[1340] | 237 | GetZandACrossSection(theProjectile, ZZ, AA, theTemperature); |
---|
[819] | 238 | if (verboseLevel >= 2) |
---|
| 239 | G4cout <<"Selecting G4IonsShenCrossSection" <<G4endl; |
---|
| 240 | } |
---|
| 241 | } |
---|
| 242 | if (verboseLevel >= 2) |
---|
| 243 | { |
---|
| 244 | G4cout <<"Cross-section = " <<result/millibarn <<" mbarn" <<G4endl; |
---|
| 245 | G4cout <<G4endl; |
---|
| 246 | } |
---|
| 247 | |
---|
| 248 | return result; |
---|
| 249 | } |
---|
[1340] | 250 | |
---|