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 // $Id$ 00028 // 00029 // ---------------- G4QParticle ---------------- 00030 // by Mikhail Kossov, Sept 1999. 00031 // class header for Particles in the CHIPS Model 00032 // --------------------------------------------------- 00033 // Short description: The G4QParticle is a part of the CHIPS World. It is 00034 // characterized by the quark content, spin, mass, width and a vector of 00035 // the decay channels (G4QDecayCannelVector). 00036 // ----------------------------------------------------------------------- 00037 00038 #ifndef G4QParticle_h 00039 #define G4QParticle_h 1 00040 00041 #include <iostream> 00042 #include "globals.hh" 00043 #include "G4QDecayChanVector.hh" 00044 00045 class G4QParticle 00046 { 00047 public: 00048 // Constructors 00049 G4QParticle(); // Default Constructor 00050 G4QParticle(G4bool f, G4int theQCode); // QCode Constructor, f-verbose 00051 G4QParticle(G4int thePDG); // PDGCode Constructor 00052 G4QParticle(const G4QParticle& right); // Copy Constructor by value 00053 G4QParticle(G4QParticle* right); // Copy Constructor by pointer 00054 00055 ~G4QParticle(); // Public Destructor 00056 00057 // Operators 00058 const G4QParticle& operator=(const G4QParticle& right); 00059 G4bool operator==(const G4QParticle& rhs) const; 00060 G4bool operator!=(const G4QParticle& rhs) const; 00061 00062 // Selectors 00063 G4QPDGCode GetQPDG() const; // Get a PDG-Particle of the Particle 00064 G4int GetPDGCode() const; // Get a PDG Code of the Particle 00065 G4int GetQCode() const; // Get a Q Code of the Particle 00066 G4int GetSpin() const; // Get 2s+1 of the Particle 00067 G4int GetCharge() const; // Get a Charge of the Particle 00068 G4int GetStrange() const; // Get a Strangeness of the Particle 00069 G4int GetBaryNum() const; // Get a Baryon Number of the Particle 00070 G4QContent GetQContent(); // Get Quark Content of the Particle 00071 G4QDecayChanVector GetDecayVector(); // Get a Decay Vector for the Particle 00072 G4double GetMass(); // Get a mass value for the Particle 00073 G4double GetWidth(); // Get a width value for the Particle 00074 00075 // Modifiers 00076 G4QDecayChanVector InitDecayVector(G4int Q);// Init DecayVector in theCHIPSWorld by QCode 00077 void InitPDGParticle(G4int thePDGCode); 00078 void InitQParticle(G4int theQCode); 00079 00080 // General 00081 G4double MinMassOfFragm(); // Minimal mass of decaing fragments 00082 00083 private: 00084 // Encapsulated functions 00085 00086 private: 00087 // the Body 00088 G4QPDGCode aQPDG; 00089 G4QDecayChanVector aDecay; 00090 G4QContent aQuarkCont; // @@ Secondary (added for acceleration - check) 00091 }; 00092 00093 // Not member operators 00094 std::ostream& operator<<(std::ostream& lhs, G4QParticle& rhs); 00095 // Not member functions 00096 //---------------------------------------------------------------------------------------- 00097 00098 inline G4bool G4QParticle::operator==(const G4QParticle& rhs) const {return this==&rhs;} 00099 inline G4bool G4QParticle::operator!=(const G4QParticle& rhs) const {return this!=&rhs;} 00100 00101 inline G4QPDGCode G4QParticle::GetQPDG() const {return aQPDG;} 00102 inline G4int G4QParticle::GetQCode() const {return aQPDG.GetQCode();} 00103 inline G4int G4QParticle::GetPDGCode() const {return aQPDG.GetPDGCode();} 00104 inline G4int G4QParticle::GetSpin() const {return aQPDG.GetSpin();} 00105 inline G4int G4QParticle::GetCharge() const {return aQuarkCont.GetCharge();} 00106 inline G4int G4QParticle::GetStrange() const {return aQuarkCont.GetStrangeness();} 00107 inline G4int G4QParticle::GetBaryNum() const {return aQuarkCont.GetBaryonNumber();} 00108 inline G4QContent G4QParticle::GetQContent() {return aQuarkCont;} 00109 inline G4QDecayChanVector G4QParticle::GetDecayVector() {return aDecay;} 00110 inline G4double G4QParticle::GetMass() {return aQPDG.GetMass();} 00111 inline G4double G4QParticle::GetWidth() {return aQPDG.GetWidth();} 00112 00113 inline G4double G4QParticle::MinMassOfFragm() 00114 { 00115 G4int nCh=aDecay.size(); 00116 G4double mass=GetMass(); 00117 G4double min=mass; 00118 if(nCh) 00119 { 00120 min=aDecay[0]->GetMinMass(); 00121 if(nCh>1) for(G4int j=1; j<nCh; j++) 00122 { 00123 G4double next=aDecay[j]->GetMinMass(); 00124 if(next<min) min=next; 00125 } 00126 } 00127 G4double w=GetWidth(); 00128 G4double lim=mass+.001; 00129 if(w) lim-=1.5*w; 00130 if(min<lim) min=lim; 00131 return min; 00132 } 00133 00134 #endif 00135 00136 00137