// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // // $Id: G4PDGCodeChecker.cc,v 1.11 2008/06/08 12:43:19 kurasige Exp $ // GEANT4 tag $Name: geant4-09-02-ref-02 $ // // // ---------------------------------------------------------------------- // GEANT 4 class implementation file // // History: first implementation, based on object model of // 17 Aug 1999 H.Kurashige // ********************************************************************** #include #include #include "G4PDGCodeChecker.hh" ///////////// G4PDGCodeChecker::G4PDGCodeChecker() { code = 0; verboseLevel = 1; } ///////////// G4int G4PDGCodeChecker::CheckPDGCode( G4int PDGcode, G4String particleType) { code = PDGcode; theParticleType = particleType; // clear QuarkContents G4int flavor; for (flavor=0; flavor0) { G4cout << " G4PDGCodeChecker::CheckPDGCode : "; G4cout << " meson has three quark "; G4cout << " PDG code=" << code <0) { G4cout << " G4PDGCodeChecker::CheckPDGCode : "; G4cout << " illegal code for baryon "; G4cout << " PDG code=" << code < NumberOfQuarkFlavor) { #ifdef G4VERBOSE if (verboseLevel>0) { G4cout << " G4PDGCodeChecker::CheckPDGCode : "; G4cout << " ??? unknown quark "; G4cout << " PDG code=" << code <0) { theQuarkContent[quark1-1] ++; theQuarkContent[quark2-1] ++; theQuarkContent[quark3-1] ++; } else { theAntiQuarkContent[quark1-1] ++; theAntiQuarkContent[quark2-1] ++; theAntiQuarkContent[quark3-1] ++; } return code; } ///////////// G4int G4PDGCodeChecker::CheckForMesons() { G4int tempPDGcode = code; // -- exceptions -- if (tempPDGcode == 310) spin = 0; //K0s if (tempPDGcode == 130) { //K0l spin = 0; quark2 = 3; quark3 = 1; } // if ((quark1 !=0)||(quark2==0)||(quark3==0)){ #ifdef G4VERBOSE if (verboseLevel>0) { G4cout << " G4PDGCodeChecker::CheckPDGCode : "; G4cout << " meson has only quark and anti-quark pair"; G4cout << " PDG code=" << code <0) { G4cout << " G4PDGCodeChecker::CheckPDGCode : "; G4cout << " illegal code for meson "; G4cout << " PDG code=" << code < NumberOfQuarkFlavor){ #ifdef G4VERBOSE if (verboseLevel>0) { G4cout << " G4PDGCodeChecker::CheckPDGCode : "; G4cout << " ??? unknown quark "; G4cout << " PDG code=" << code <0) { theQuarkContent[quark3-1] =1; theAntiQuarkContent[quark2-1] =1; } else { theQuarkContent[quark2-1] =1; theAntiQuarkContent[quark3-1] =1; } } else { // up type quark if (tempPDGcode >0) { theQuarkContent[quark2-1] =1; theAntiQuarkContent[quark3-1] =1; } else { theQuarkContent[quark3-1] =1; theAntiQuarkContent[quark2-1] =1; } } return code; } ///////////// G4int G4PDGCodeChecker::CheckForDiQuarks() { if ((quark1 ==0) || (quark2 ==0) || (quark3 !=0)) { // quark3 should be 0 // --- code is wrong return 0; } else if (quark1 < quark2) { // --- code is wrong return 0; } else if (quark2>NumberOfQuarkFlavor){ #ifdef G4VERBOSE if (verboseLevel>0) { G4cout << " G4PDGCodeChecker::CheckPDGCode : "; G4cout << " ??? unknown quark "; G4cout << " PDG code=" << code <0){ theQuarkContent[quark1-1] +=1; theQuarkContent[quark2-1] +=1; } else { theAntiQuarkContent[quark1-1] +=1; theAntiQuarkContent[quark2-1] +=1; } return code; } ///////////// G4int G4PDGCodeChecker::CheckForQuarks() { if ( std::abs(quark1)>NumberOfQuarkFlavor ) { #ifdef G4VERBOSE if (verboseLevel>0) { G4cout << " G4PDGCodeChecker::CheckPDGCode : "; G4cout << " ??? unknown quark "; G4cout << " PDG code=" << code <0){ theQuarkContent[quark1-1] =1; } else { theAntiQuarkContent[quark1-1] =1; } return code; } ///////////// G4bool G4PDGCodeChecker::CheckCharge(G4double thePDGCharge) const { // check charge G4double totalCharge = 0.0; for (G4int flavor= 0; flavor0.1*eplus) { #ifdef G4VERBOSE if (verboseLevel>0) { G4cout << " G4PDGCodeChecker::CheckCharge : "; G4cout << " illegal electric charge " << thePDGCharge/eplus; G4cout << " PDG code=" << code < A-L || L>A || Z<=0 ) { #ifdef G4VERBOSE if (verboseLevel>0) { G4cout << " G4PDGCodeChecker::CheckPDGCode : "; G4cout << " ??? Illegal PDG encoding for nucleus "; G4cout << " PDG code=" << code <