Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:51

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4ParticleDefinition inline methods implementation
0027 //
0028 // Authors: G.Cosmo, 2 December 1995 - Design, based on object model
0029 //          M.Asai, 29 January 1996 - First implementation
0030 // --------------------------------------------------------------------
0031 
0032 inline G4int G4ParticleDefinition::GetInstanceID() const
0033 {
0034   return g4particleDefinitionInstanceID;
0035 }
0036 
0037 inline G4bool G4ParticleDefinition::GetPDGStable() const
0038 {
0039   if (IsGeneralIon()) {
0040     return (GetIonLifeTime() < 0.);
0041   }
0042 
0043   return thePDGStable;
0044 }
0045 
0046 inline G4double G4ParticleDefinition::GetPDGLifeTime() const
0047 {
0048   return thePDGLifeTime;
0049 }
0050 
0051 inline G4double G4ParticleDefinition::GetIonLifeTime() const
0052 {
0053   //-- No longer needed to access to G4IonTable.
0054   //-- Method GetIonLifeTime() itself is kept for compatibility
0055 
0056   return thePDGLifeTime;
0057 }
0058 
0059 inline G4ParticleTable* G4ParticleDefinition::GetParticleTable() const
0060 {
0061   return theParticleTable;
0062 }
0063 
0064 inline G4DecayTable* G4ParticleDefinition::GetDecayTable() const
0065 {
0066   return theDecayTable;
0067 }
0068 
0069 inline void G4ParticleDefinition::SetDecayTable(G4DecayTable* aDecayTable)
0070 {
0071   theDecayTable = aDecayTable;
0072 }
0073 
0074 inline void G4ParticleDefinition::SetVerboseLevel(G4int value)
0075 {
0076   verboseLevel = value;
0077 }
0078 
0079 inline G4int G4ParticleDefinition::GetVerboseLevel() const
0080 {
0081   return verboseLevel;
0082 }
0083 
0084 inline G4ProcessManager* G4ParticleDefinition::GetMasterProcessManager() const
0085 {
0086   return theProcessManagerShadow;
0087 }
0088 
0089 inline void G4ParticleDefinition::SetMasterProcessManager(G4ProcessManager* aNewPM)
0090 {
0091   theProcessManagerShadow = aNewPM;
0092 }
0093 
0094 inline G4int G4ParticleDefinition::GetQuarkContent(G4int flavor) const
0095 {
0096   G4int content = 0;
0097   if ((flavor > 0) && (flavor <= NumberOfQuarkFlavor)) {
0098     content = theQuarkContent[flavor - 1];
0099   }
0100   else {
0101 #ifdef G4VERBOSE
0102     if (verboseLevel > 0) {
0103       std::ostringstream message;
0104       message << "Invalid Quark Flavor: " << flavor;
0105       G4Exception("G4ParticleDefinition::GetQuarkContent()", "InvalidFlavor", JustWarning, message);
0106     }
0107 #endif
0108   }
0109   return content;
0110 }
0111 
0112 inline G4int G4ParticleDefinition::GetAntiQuarkContent(G4int flavor) const
0113 {
0114   G4int content = 0;
0115   if ((flavor > 0) && (flavor <= NumberOfQuarkFlavor)) {
0116     content = theAntiQuarkContent[flavor - 1];
0117   }
0118   else {
0119 #ifdef G4VERBOSE
0120     if (verboseLevel > 0) {
0121       std::ostringstream message;
0122       message << "Invalid Quark Flavor: " << flavor;
0123       G4Exception("G4ParticleDefinition::GetAntiQuarkContent()", "InvalidFlavor", JustWarning,
0124                   message);
0125     }
0126 #endif
0127   }
0128   return content;
0129 }
0130 
0131 inline void G4ParticleDefinition::SetParticleSubType(const G4String& subtype)
0132 {
0133   theParticleSubType = subtype;
0134 }
0135 
0136 inline void G4ParticleDefinition::SetAntiPDGEncoding(G4int aEncoding)
0137 {
0138   theAntiPDGEncoding = aEncoding;
0139 }
0140 
0141 inline G4bool G4ParticleDefinition::GetApplyCutsFlag() const
0142 {
0143   return fApplyCutsFlag;
0144 }
0145 
0146 inline void G4ParticleDefinition::SetAtomicNumber(G4int i)
0147 {
0148   theAtomicNumber = i;
0149 }
0150 
0151 inline G4int G4ParticleDefinition::GetAtomicNumber() const
0152 {
0153   return theAtomicNumber;
0154 }
0155 
0156 inline void G4ParticleDefinition::SetAtomicMass(G4int i)
0157 {
0158   theAtomicMass = i;
0159 }
0160 
0161 inline G4int G4ParticleDefinition::GetAtomicMass() const
0162 {
0163   return theAtomicMass;
0164 }
0165 
0166 inline void G4ParticleDefinition::SetPDGMagneticMoment(G4double magneticMoment)
0167 {
0168   thePDGMagneticMoment = magneticMoment;
0169 }
0170 
0171 inline G4bool G4ParticleDefinition::IsGeneralIon() const
0172 {
0173   return isGeneralIon;
0174 }
0175 
0176 inline G4bool G4ParticleDefinition::IsMuonicAtom() const
0177 {
0178   return isMuonicAtom;
0179 }
0180 
0181 inline G4int G4ParticleDefinition::GetParticleDefinitionID() const
0182 {
0183   return g4particleDefinitionInstanceID;
0184 }
0185 
0186 inline G4bool G4ParticleDefinition::IsHypernucleus() const
0187 {
0188   return GetNumberOfLambdasInHypernucleus() > 0;
0189 }
0190 
0191 inline G4int G4ParticleDefinition::GetNumberOfLambdasInHypernucleus() const
0192 {
0193   G4int numberOfLambdas = 0;
0194   // PDG code of hypernuclei: 10LZZZAAAI
0195   if (thePDGEncoding > 0 && thePDGEncoding / 1000000000 != 0) {
0196     numberOfLambdas = (thePDGEncoding / 10000000) % 100;
0197   }
0198   return numberOfLambdas;
0199 }
0200 
0201 inline G4bool G4ParticleDefinition::IsAntiHypernucleus() const
0202 {
0203   return GetNumberOfAntiLambdasInAntiHypernucleus() > 0;
0204 }
0205 
0206 inline G4int G4ParticleDefinition::GetNumberOfAntiLambdasInAntiHypernucleus() const
0207 {
0208   G4int numberOfAntiLambdas = 0;
0209   // PDG code of anti-hypernuclei: -10LZZZAAAI
0210   if (thePDGEncoding < 0 && thePDGEncoding / 1000000000 != 0) {
0211     numberOfAntiLambdas = (std::abs(thePDGEncoding) / 10000000) % 100;
0212   }
0213   return numberOfAntiLambdas;
0214 }