Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // G4ParticlePropertyData class implementation << 23 // $Id: G4ParticlePropertyData.cc,v 1.1 2003/06/11 07:20:06 kurasige Exp $ 27 // 24 // 28 // Author: H.Kurashige, 9 June 2003 << 25 // class G4ParticlePropertyData 29 // ------------------------------------------- << 26 // 30 << 27 // Implementation 31 #include "G4ParticlePropertyData.hh" << 28 // >> 29 // History: >> 30 // first implementation by H Kurashige 9 June 2003 32 31 33 #include "G4PhysicalConstants.hh" << 34 #include "G4SystemOfUnits.hh" << 35 #include "G4ios.hh" 32 #include "G4ios.hh" 36 #include "globals.hh" 33 #include "globals.hh" >> 34 #include "G4ParticlePropertyData.hh" >> 35 37 36 38 G4ParticlePropertyData::G4ParticlePropertyData << 37 ///////////////////////////////////////////////////////////// 39 : theParticleName(particleName) << 38 G4ParticlePropertyData::~G4ParticlePropertyData() 40 { 39 { 41 for (std::size_t flv = 0; flv < NumberOfQuar << 42 theQuarkContent[flv] = 0; << 43 theAntiQuarkContent[flv] = 0; << 44 } << 45 } 40 } 46 41 47 G4ParticlePropertyData::G4ParticlePropertyData << 42 ///////////////////////////////////////////////////////////// 48 { << 43 G4ParticlePropertyData::G4ParticlePropertyData(const G4String& particleName): 49 verboseLevel = right.verboseLevel; << 44 theParticleName(particleName), 50 theParticleName = right.theParticleName; << 45 thePDGMass(0.0), 51 thePDGMass = right.thePDGMass; << 46 thePDGWidth(0.0), 52 thePDGWidth = right.thePDGWidth; << 47 thePDGCharge(0.0), 53 thePDGCharge = right.thePDGCharge; << 48 thePDGiSpin(0), 54 thePDGiSpin = right.thePDGiSpin; << 49 thePDGiParity(0), 55 thePDGiParity = right.thePDGiParity; << 50 thePDGiConjugation(0), 56 thePDGiConjugation = right.thePDGiConjugatio << 51 thePDGiGParity(0), 57 thePDGiGParity = right.thePDGiGParity; << 52 thePDGiIsospin(0), 58 thePDGiIsospin = right.thePDGiIsospin; << 53 thePDGiIsospin3(0), 59 thePDGiIsospin3 = right.thePDGiIsospin3; << 54 theLeptonNumber(0), 60 thePDGMagneticMoment = right.thePDGMagneticM << 55 theBaryonNumber(0), 61 theLeptonNumber = right.theLeptonNumber; << 56 thePDGEncoding(0), 62 theBaryonNumber = right.theBaryonNumber; << 57 theAntiPDGEncoding(0), 63 thePDGEncoding = right.thePDGEncoding; << 58 fPDGMassModified(false), 64 theAntiPDGEncoding = right.theAntiPDGEncodin << 59 fPDGWidthModified(false), 65 for (std::size_t flv = 0; flv < NumberOfQuar << 60 fPDGChargeModified(false), 66 theQuarkContent[flv] = right.theQuarkConte << 61 fPDGiSpinModified(false), 67 theAntiQuarkContent[flv] = right.theAntiQu << 62 fPDGiParityModified(false), >> 63 fPDGiConjugationModified(false), >> 64 fPDGiGParityModified(false), >> 65 fPDGiIsospinModified(false), >> 66 fPDGiIsospin3Modified(false), >> 67 fPDGIsospinModified(false), >> 68 fPDGIsospin3Modified(false), >> 69 fLeptonNumberModified(false), >> 70 fBaryonNumberModified(false), >> 71 fPDGEncodingModified(false), >> 72 fAntiPDGEncodingModified(false), >> 73 fQuarkContentModified(false), >> 74 fAntiQuarkContentModified(false), >> 75 fPDGLifeTimeModified(false), >> 76 verboseLevel(1) >> 77 { >> 78 for (size_t flv=0; flv<NumberOfQuarkFlavor; ++flv) { >> 79 theQuarkContent[flv] =0; >> 80 theAntiQuarkContent[flv]=0; 68 } 81 } 69 thePDGLifeTime = right.thePDGLifeTime; << 70 } 82 } 71 83 72 G4ParticlePropertyData& G4ParticlePropertyData << 84 >> 85 //////////////////////// >> 86 G4ParticlePropertyData::G4ParticlePropertyData(const G4ParticlePropertyData &right): >> 87 fPDGMassModified(false), >> 88 fPDGWidthModified(false), >> 89 fPDGChargeModified(false), >> 90 fPDGiSpinModified(false), >> 91 fPDGiParityModified(false), >> 92 fPDGiConjugationModified(false), >> 93 fPDGiGParityModified(false), >> 94 fPDGiIsospinModified(false), >> 95 fPDGiIsospin3Modified(false), >> 96 fPDGIsospinModified(false), >> 97 fPDGIsospin3Modified(false), >> 98 fLeptonNumberModified(false), >> 99 fBaryonNumberModified(false), >> 100 fPDGEncodingModified(false), >> 101 fAntiPDGEncodingModified(false), >> 102 fQuarkContentModified(false), >> 103 fAntiQuarkContentModified(false), >> 104 fPDGLifeTimeModified(false) >> 105 { >> 106 verboseLevel = right.verboseLevel; >> 107 theParticleName = right.theParticleName; >> 108 thePDGMass = right.thePDGMass; >> 109 thePDGWidth = right. thePDGWidth; >> 110 thePDGCharge = right.thePDGCharge; >> 111 thePDGiSpin = right.thePDGiSpin; >> 112 thePDGiParity = right.thePDGiParity; >> 113 thePDGiConjugation = right.thePDGiConjugation; >> 114 thePDGiGParity = right.thePDGiGParity; >> 115 thePDGiIsospin = right.thePDGiIsospin; >> 116 thePDGiIsospin3 = right.thePDGiIsospin3; >> 117 theLeptonNumber = right.theLeptonNumber; >> 118 theBaryonNumber = right.theBaryonNumber; >> 119 thePDGEncoding = right.thePDGEncoding; >> 120 theAntiPDGEncoding = right.theAntiPDGEncoding; >> 121 for (size_t flv=0; flv<NumberOfQuarkFlavor; ++flv) { >> 122 theQuarkContent[flv] = right.theQuarkContent[flv]; >> 123 theAntiQuarkContent[flv]= right.theAntiQuarkContent[flv]; >> 124 } >> 125 thePDGLifeTime = right.thePDGLifeTime; >> 126 } >> 127 >> 128 //////////////////////// >> 129 const G4ParticlePropertyData & G4ParticlePropertyData::operator=(const G4ParticlePropertyData &right) 73 { 130 { 74 if (this != &right) { 131 if (this != &right) { 75 verboseLevel = right.verboseLevel; << 132 verboseLevel = right.verboseLevel; 76 theParticleName = right.theParticleName; << 133 theParticleName = right.theParticleName; 77 thePDGMass = right.thePDGMass; << 134 thePDGMass = right.thePDGMass; 78 thePDGWidth = right.thePDGWidth; << 135 thePDGWidth = right. thePDGWidth; 79 thePDGCharge = right.thePDGCharge; << 136 thePDGCharge = right.thePDGCharge; 80 thePDGiSpin = right.thePDGiSpin; << 137 thePDGiSpin = right.thePDGiSpin; 81 thePDGiParity = right.thePDGiParity; << 138 thePDGiParity = right.thePDGiParity; 82 thePDGiConjugation = right.thePDGiConjugat << 139 thePDGiConjugation = right.thePDGiConjugation; 83 thePDGiGParity = right.thePDGiGParity; << 140 thePDGiGParity = right.thePDGiGParity; 84 thePDGiIsospin = right.thePDGiIsospin; << 141 thePDGiIsospin = right.thePDGiIsospin; 85 thePDGiIsospin3 = right.thePDGiIsospin3; << 142 thePDGiIsospin3 = right.thePDGiIsospin3; 86 thePDGMagneticMoment = right.thePDGMagneti << 143 theLeptonNumber = right.theLeptonNumber; 87 theLeptonNumber = right.theLeptonNumber; << 144 theBaryonNumber = right.theBaryonNumber; 88 theBaryonNumber = right.theBaryonNumber; << 145 thePDGEncoding = right.thePDGEncoding; 89 thePDGEncoding = right.thePDGEncoding; << 146 theAntiPDGEncoding = right.theAntiPDGEncoding; 90 theAntiPDGEncoding = right.theAntiPDGEncod << 147 for (size_t flv=0; flv<NumberOfQuarkFlavor; ++flv) { 91 for (std::size_t flv = 0; flv < NumberOfQu << 148 theQuarkContent[flv] = right.theQuarkContent[flv]; 92 theQuarkContent[flv] = right.theQuarkCon << 149 theAntiQuarkContent[flv]= right.theAntiQuarkContent[flv]; 93 theAntiQuarkContent[flv] = right.theAnti << 94 } 150 } 95 thePDGLifeTime = right.thePDGLifeTime; << 151 thePDGLifeTime = right.thePDGLifeTime; 96 fPDGMassModified = true; << 152 fPDGMassModified = true; 97 fPDGWidthModified = true; << 153 fPDGWidthModified = true; 98 fPDGChargeModified = true; << 154 fPDGChargeModified = true; 99 fPDGiSpinModified = true; << 155 fPDGiSpinModified = true; 100 fPDGiParityModified = true; << 156 fPDGiParityModified = true; 101 fPDGiConjugationModified = true; << 157 fPDGiConjugationModified = true; 102 fPDGiGParityModified = true; << 158 fPDGiGParityModified = true; 103 fPDGiIsospinModified = true; << 159 fPDGiIsospinModified = true; 104 fPDGiIsospin3Modified = true; << 160 fPDGiIsospin3Modified = true; 105 fPDGIsospinModified = true; << 161 fPDGIsospinModified = true; 106 fPDGIsospin3Modified = true; << 162 fPDGIsospin3Modified = true; 107 fPDGMagneticMomentModified = true; << 163 fLeptonNumberModified = true; 108 fLeptonNumberModified = true; << 164 fBaryonNumberModified = true; 109 fBaryonNumberModified = true; << 165 fPDGEncodingModified = true; 110 fPDGEncodingModified = true; << 166 fAntiPDGEncodingModified = true; 111 fAntiPDGEncodingModified = true; << 167 fQuarkContentModified = true; 112 fQuarkContentModified = true; << 113 fAntiQuarkContentModified = true; 168 fAntiQuarkContentModified = true; 114 fPDGLifeTimeModified = true; << 169 fPDGLifeTimeModified = true; 115 } 170 } 116 return *this; 171 return *this; 117 } 172 } 118 << 173 119 G4bool G4ParticlePropertyData::operator==(cons << 174 //////////////////////// >> 175 G4int G4ParticlePropertyData::operator==(const G4ParticlePropertyData &right) const 120 { 176 { 121 return (this == &right); 177 return (this == &right); 122 } 178 } 123 179 124 G4bool G4ParticlePropertyData::operator!=(cons << 180 //////////////////////// >> 181 G4int G4ParticlePropertyData::operator!=(const G4ParticlePropertyData &right) const 125 { 182 { 126 return (this != &right); 183 return (this != &right); 127 } 184 } 128 185 >> 186 //////////////////////// 129 void G4ParticlePropertyData::Print() const 187 void G4ParticlePropertyData::Print() const 130 { 188 { 131 #ifdef G4VERBOSE << 132 G4cout << " Particle Name : " << theParticle 189 G4cout << " Particle Name : " << theParticleName << G4endl; 133 G4cout << " PDG particle code : " << thePDGE 190 G4cout << " PDG particle code : " << thePDGEncoding; 134 G4cout << " [PDG anti-particle code: " << th << 191 G4cout << " [PDG anti-particle code: " << this->GetAntiPDGEncoding() << "]"<< G4endl; 135 G4cout << " Mass [GeV/c2] : " << thePDGMass << 192 G4cout << " Mass [GeV/c2] : " << thePDGMass/GeV ; 136 G4cout << " Width : " << thePDGWidth / G << 193 G4cout << " Width : " << thePDGWidth/GeV << G4endl; 137 G4cout << " Lifetime [nsec] : " << thePDGLif << 194 G4cout << " Lifetime [nsec] : " << thePDGLifeTime/ns << G4endl; 138 G4cout << " Charge [e]: " << thePDGCharge / << 195 G4cout << " Charge [e]: " << thePDGCharge/eplus << G4endl; 139 G4cout << " Spin : " << thePDGiSpin << "/2" 196 G4cout << " Spin : " << thePDGiSpin << "/2" << G4endl; 140 G4cout << " Parity : " << thePDGiParity << G 197 G4cout << " Parity : " << thePDGiParity << G4endl; 141 G4cout << " Charge conjugation : " << thePDG 198 G4cout << " Charge conjugation : " << thePDGiConjugation << G4endl; 142 G4cout << " Isospin : (I,Iz): (" << thePDGiI << 199 G4cout << " Isospin : (I,Iz): (" << thePDGiIsospin <<"/2"; 143 G4cout << " , " << thePDGiIsospin3 << "/2 ) 200 G4cout << " , " << thePDGiIsospin3 << "/2 ) " << G4endl; 144 G4cout << " GParity : " << thePDGiGParity << 201 G4cout << " GParity : " << thePDGiGParity << G4endl; 145 G4cout << " MagneticMoment [MeV/T]: "; << 146 if (thePDGMagneticMoment != 0.0) { << 147 G4cout << thePDGMagneticMoment / MeV * tes << 148 } << 149 else { << 150 G4cout << "not defined " << G4endl; << 151 } << 152 G4cout << " Lepton number : " << theLeptonNu 202 G4cout << " Lepton number : " << theLeptonNumber; 153 G4cout << " Baryon number : " << theBaryonNu << 203 G4cout << " Baryon number : " << theBaryonNumber << G4endl; 154 G4cout << " Quark contents (d,u,s,c,b,t) 204 G4cout << " Quark contents (d,u,s,c,b,t) : " << theQuarkContent[0]; 155 G4cout << ", " << theQuarkContent[1]; 205 G4cout << ", " << theQuarkContent[1]; 156 G4cout << ", " << theQuarkContent[2]; 206 G4cout << ", " << theQuarkContent[2]; 157 G4cout << ", " << theQuarkContent[3]; 207 G4cout << ", " << theQuarkContent[3]; 158 G4cout << ", " << theQuarkContent[4]; 208 G4cout << ", " << theQuarkContent[4]; 159 G4cout << ", " << theQuarkContent[5] << G4en 209 G4cout << ", " << theQuarkContent[5] << G4endl; 160 G4cout << " AntiQuark contents 210 G4cout << " AntiQuark contents : " << theAntiQuarkContent[0]; 161 G4cout << ", " << theAntiQuarkContent[1]; 211 G4cout << ", " << theAntiQuarkContent[1]; 162 G4cout << ", " << theAntiQuarkContent[2]; 212 G4cout << ", " << theAntiQuarkContent[2]; 163 G4cout << ", " << theAntiQuarkContent[3]; 213 G4cout << ", " << theAntiQuarkContent[3]; 164 G4cout << ", " << theAntiQuarkContent[4]; 214 G4cout << ", " << theAntiQuarkContent[4]; 165 G4cout << ", " << theAntiQuarkContent[5] << 215 G4cout << ", " << theAntiQuarkContent[5] << G4endl; 166 #endif << 167 } 216 } >> 217 >> 218 >> 219 >> 220 >> 221 >> 222 >> 223 >> 224 >> 225 168 226