G4ParticlePropertyData.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 // class G4ParticlePropertyData
00029 //
00030 // Implementation
00031 //
00032 // History:
00033 // first implementation by H Kurashige 9 June 2003
00034 // Add   magnetic moment    by H Kurashige   Mar 2007
00035 
00036 #include "G4ios.hh"
00037 #include "globals.hh"
00038 #include "G4PhysicalConstants.hh"
00039 #include "G4SystemOfUnits.hh"
00040 #include "G4ParticlePropertyData.hh"
00041 
00042 
00044 G4ParticlePropertyData::~G4ParticlePropertyData()
00045 {
00046 }
00047 
00049 G4ParticlePropertyData::G4ParticlePropertyData(const G4String& particleName):
00050   theParticleName(particleName),
00051   thePDGMass(0.0),
00052   thePDGWidth(0.0),
00053   thePDGCharge(0.0),
00054   thePDGiSpin(0),
00055   thePDGiParity(0),
00056   thePDGiConjugation(0),
00057   thePDGiGParity(0),
00058   thePDGiIsospin(0),
00059   thePDGiIsospin3(0),
00060   thePDGMagneticMoment(0.0),
00061   theLeptonNumber(0),
00062   theBaryonNumber(0),
00063   thePDGEncoding(0),
00064   theAntiPDGEncoding(0),
00065   thePDGLifeTime(-1.0),
00066   fPDGMassModified(false),
00067   fPDGWidthModified(false),
00068   fPDGChargeModified(false),
00069   fPDGiSpinModified(false),
00070   fPDGiParityModified(false),
00071   fPDGiConjugationModified(false),
00072   fPDGiGParityModified(false),
00073   fPDGiIsospinModified(false),
00074   fPDGiIsospin3Modified(false),
00075   fPDGIsospinModified(false),
00076   fPDGIsospin3Modified(false),
00077   fPDGMagneticMomentModified(false),
00078   fLeptonNumberModified(false),
00079   fBaryonNumberModified(false),
00080   fPDGEncodingModified(false),
00081   fAntiPDGEncodingModified(false),
00082   fQuarkContentModified(false),
00083   fAntiQuarkContentModified(false),
00084   fPDGLifeTimeModified(false),
00085   verboseLevel(1)
00086 {
00087   for (size_t flv=0; flv<NumberOfQuarkFlavor; ++flv) {
00088     theQuarkContent[flv] =0;
00089     theAntiQuarkContent[flv]=0;
00090   }
00091 }
00092 
00093 
00095 G4ParticlePropertyData::G4ParticlePropertyData(const G4ParticlePropertyData &right):
00096   fPDGMassModified(false),
00097   fPDGWidthModified(false),
00098   fPDGChargeModified(false),
00099   fPDGiSpinModified(false),
00100   fPDGiParityModified(false),
00101   fPDGiConjugationModified(false),
00102   fPDGiGParityModified(false),
00103   fPDGiIsospinModified(false),
00104   fPDGiIsospin3Modified(false),
00105   fPDGIsospinModified(false),
00106   fPDGIsospin3Modified(false),
00107   fPDGMagneticMomentModified(false),
00108   fLeptonNumberModified(false),
00109   fBaryonNumberModified(false),
00110   fPDGEncodingModified(false),
00111   fAntiPDGEncodingModified(false),
00112   fQuarkContentModified(false),
00113   fAntiQuarkContentModified(false),
00114   fPDGLifeTimeModified(false)
00115 {
00116   verboseLevel      = right.verboseLevel; 
00117   theParticleName   = right.theParticleName;
00118   thePDGMass        = right.thePDGMass;
00119   thePDGWidth       = right. thePDGWidth;
00120   thePDGCharge      = right.thePDGCharge;
00121   thePDGiSpin       = right.thePDGiSpin;
00122   thePDGiParity     = right.thePDGiParity;
00123   thePDGiConjugation   = right.thePDGiConjugation;
00124   thePDGiGParity    = right.thePDGiGParity;
00125   thePDGiIsospin    = right.thePDGiIsospin;
00126   thePDGiIsospin3   = right.thePDGiIsospin3;
00127   thePDGMagneticMoment =  right.thePDGMagneticMoment;
00128   theLeptonNumber   = right.theLeptonNumber;
00129   theBaryonNumber   = right.theBaryonNumber;
00130   thePDGEncoding    = right.thePDGEncoding;
00131   theAntiPDGEncoding   = right.theAntiPDGEncoding;
00132   for (size_t flv=0; flv<NumberOfQuarkFlavor; ++flv) {
00133     theQuarkContent[flv]    = right.theQuarkContent[flv];
00134     theAntiQuarkContent[flv]= right.theAntiQuarkContent[flv];
00135   }
00136   thePDGLifeTime    = right.thePDGLifeTime;
00137 }
00138       
00140 G4ParticlePropertyData & G4ParticlePropertyData::operator=(const G4ParticlePropertyData &right)
00141 {
00142   if (this != &right) {
00143     verboseLevel      = right.verboseLevel; 
00144     theParticleName   = right.theParticleName;
00145     thePDGMass        = right.thePDGMass;
00146     thePDGWidth       = right. thePDGWidth;
00147     thePDGCharge      = right.thePDGCharge;
00148     thePDGiSpin       = right.thePDGiSpin;
00149     thePDGiParity     = right.thePDGiParity;
00150     thePDGiConjugation  = right.thePDGiConjugation;
00151     thePDGiGParity    = right.thePDGiGParity;
00152     thePDGiIsospin    = right.thePDGiIsospin;
00153     thePDGiIsospin3   = right.thePDGiIsospin3;
00154     thePDGMagneticMoment =  right.thePDGMagneticMoment;
00155     theLeptonNumber   = right.theLeptonNumber;
00156     theBaryonNumber   = right.theBaryonNumber;
00157     thePDGEncoding    = right.thePDGEncoding;
00158     theAntiPDGEncoding  = right.theAntiPDGEncoding;
00159     for (size_t flv=0; flv<NumberOfQuarkFlavor; ++flv) {
00160       theQuarkContent[flv]    = right.theQuarkContent[flv];
00161       theAntiQuarkContent[flv]= right.theAntiQuarkContent[flv];
00162     }
00163     thePDGLifeTime    = right.thePDGLifeTime;
00164     fPDGMassModified           = true;
00165     fPDGWidthModified          = true;  
00166     fPDGChargeModified         = true;
00167     fPDGiSpinModified          = true;
00168     fPDGiParityModified        = true;    
00169     fPDGiConjugationModified   = true;  
00170     fPDGiGParityModified       = true;
00171     fPDGiIsospinModified       = true; 
00172     fPDGiIsospin3Modified      = true;
00173     fPDGIsospinModified        = true; 
00174     fPDGIsospin3Modified       = true;
00175     fPDGMagneticMomentModified = true;
00176     fLeptonNumberModified      = true;
00177     fBaryonNumberModified      = true;
00178     fPDGEncodingModified       = true;
00179     fAntiPDGEncodingModified   = true;
00180     fQuarkContentModified      = true;
00181     fAntiQuarkContentModified  = true;
00182     fPDGLifeTimeModified       = true;   
00183   }
00184   return *this;
00185 }
00186   
00188 G4int G4ParticlePropertyData::operator==(const G4ParticlePropertyData &right) const
00189 {
00190   return (this == &right);
00191 }
00192 
00194 G4int G4ParticlePropertyData::operator!=(const G4ParticlePropertyData &right) const
00195 {
00196   return (this != &right);
00197 }
00198 
00200 void G4ParticlePropertyData::Print() const
00201 {
00202 #ifdef G4VERBOSE
00203   G4cout << " Particle Name : " << theParticleName << G4endl;
00204   G4cout << " PDG particle code : " << thePDGEncoding;
00205   G4cout << " [PDG anti-particle code: " << this->GetAntiPDGEncoding() << "]"<< G4endl;
00206   G4cout << " Mass [GeV/c2] : " << thePDGMass/GeV ;
00207   G4cout << "     Width : " << thePDGWidth/GeV << G4endl;
00208   G4cout << " Lifetime [nsec] : " << thePDGLifeTime/ns << G4endl;
00209   G4cout << " Charge [e]: " << thePDGCharge/eplus << G4endl;
00210   G4cout << " Spin : " << thePDGiSpin << "/2" << G4endl;
00211   G4cout << " Parity : " << thePDGiParity << G4endl;
00212   G4cout << " Charge conjugation : " << thePDGiConjugation << G4endl;
00213   G4cout << " Isospin : (I,Iz): (" << thePDGiIsospin <<"/2";
00214   G4cout << " , " << thePDGiIsospin3 << "/2 ) " << G4endl;
00215   G4cout << " GParity : " << thePDGiGParity << G4endl;
00216   G4cout << " MagneticMoment [MeV/T]: ";
00217   if (thePDGMagneticMoment != 0.0) {
00218     G4cout << thePDGMagneticMoment/MeV*tesla  << G4endl;
00219   }else {
00220     G4cout << "not defined " << G4endl;
00221   }
00222   G4cout << " Lepton number : " << theLeptonNumber;
00223   G4cout << " Baryon number : " << theBaryonNumber << G4endl;  
00224   G4cout << " Quark contents     (d,u,s,c,b,t) : " << theQuarkContent[0];
00225   G4cout << ", " << theQuarkContent[1];
00226   G4cout << ", " << theQuarkContent[2];
00227   G4cout << ", " << theQuarkContent[3];
00228   G4cout << ", " << theQuarkContent[4];
00229   G4cout << ", " << theQuarkContent[5] << G4endl;
00230   G4cout << " AntiQuark contents               : " << theAntiQuarkContent[0];
00231   G4cout << ", " << theAntiQuarkContent[1];
00232   G4cout << ", " << theAntiQuarkContent[2];
00233   G4cout << ", " << theAntiQuarkContent[3];
00234   G4cout << ", " << theAntiQuarkContent[4];
00235   G4cout << ", " << theAntiQuarkContent[5] << G4endl;
00236 #endif
00237 }
00238 
00239 
00240 
00241 
00242 
00243 
00244 
00245 
00246 

Generated on Mon May 27 17:49:16 2013 for Geant4 by  doxygen 1.4.7