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 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00027 // 00028 // MODULE: G4NucleusLimits.cc 00029 // 00030 // Version: 0.b.4 00031 // Date: 14/04/00 00032 // Author: F Lei & P R Truscott 00033 // Organisation: DERA UK 00034 // Customer: ESA/ESTEC, NOORDWIJK 00035 // Contract: 12115/96/JG/NL Work Order No. 3 00036 // 00037 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00038 // 00039 // CHANGE HISTORY 00040 // -------------- 00041 // 00042 // 29 February 2000, P R Truscott, DERA UK 00043 // 0.b.3 release. 00044 // 00045 // 14 April 2000, F Lei, DERA UK 00046 // 0.b.4 release. No change in this class 00047 // 00048 // 02 November 2011, L Desorgher 00049 // Remove the maximum limits of A<250 and Z<100 00050 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00052 // 00053 #include "G4NucleusLimits.hh" 00055 // 00056 G4NucleusLimits::G4NucleusLimits () 00057 : aMin(1), aMax(250), zMin(0), zMax(100) 00058 // 00059 // Default constructor sets the limits to cover all nuclei with Z<100. 00060 // 00061 {;} 00063 // 00064 G4NucleusLimits::G4NucleusLimits 00065 (G4int aMin1, G4int aMax1, G4int zMin1, G4int zMax1) 00066 { 00067 // 00068 // check that aMin1 is within [1, 250]. 00069 // 00070 if (aMin1 < 1) {aMin = 1;} 00071 //else if (aMin1 > 250) {aMin = 240;} 00072 else {aMin = aMin1;} 00073 00074 // 00075 // check that aMax1 is within [1, 250]. 00076 // 00077 if (aMax1 < 1) {aMax = 1;} 00078 //else if (aMax1 > 250) {aMax = 250;} 00079 else {aMax = aMax1;} 00080 00081 // 00082 // If aMin > aMax then swap them. 00083 // 00084 if (aMin > aMax) { 00085 G4int t = aMin; 00086 aMin = aMax; 00087 aMax = t; 00088 } 00089 // 00090 // check that zMin1 is within [0, 100]. 00091 // 00092 if (zMin1 < 0) {zMin = 0;} 00093 //else if (zMin1 > 100) {zMin = 100;} 00094 else {zMin = zMin1;} 00095 00096 // 00097 // check that zMax1 is within [0, 100]. 00098 // 00099 if (zMax1 < 0) {zMax = 0;} 00100 //else if (zMax1 > 100) {zMax = 100;} 00101 else {zMax = zMax1;} 00102 00103 // 00104 // If zMin > zMax then swap them. 00105 // 00106 if (zMin > zMax) { 00107 G4int t = zMin; 00108 zMin = zMax; 00109 zMax = t; 00110 } 00111 } 00112 00113 00114 G4NucleusLimits::~G4NucleusLimits () 00115 {;} 00116 00117 00118 std::ostream &operator << (std::ostream& strm, const G4NucleusLimits& q) 00119 { 00120 // Definition of the insertion operator << to provide the nucleus limits to 00121 // ostream 00122 strm << "Atomic weight: " << q.GetAMin() << "->" << q.GetAMax() 00123 << "Atomic number: " << q.GetZMin() << "->" << q.GetZMax(); 00124 return strm; 00125 } 00126