Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
G4QParticle.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// $Id$
28//
29// ---------------- G4QParticle ----------------
30// by Mikhail Kossov, Sept 1999.
31// class header for Particles in the CHIPS Model
32// ---------------------------------------------------
33// Short description: The G4QParticle is a part of the CHIPS World. It is
34// characterized by the quark content, spin, mass, width and a vector of
35// the decay channels (G4QDecayCannelVector).
36// -----------------------------------------------------------------------
37
38#ifndef G4QParticle_h
39#define G4QParticle_h 1
40
41#include <iostream>
42#include "globals.hh"
43#include "G4QDecayChanVector.hh"
44
46{
47public:
48 // Constructors
49 G4QParticle(); // Default Constructor
50 G4QParticle(G4bool f, G4int theQCode); // QCode Constructor, f-verbose
51 G4QParticle(G4int thePDG); // PDGCode Constructor
52 G4QParticle(const G4QParticle& right); // Copy Constructor by value
53 G4QParticle(G4QParticle* right); // Copy Constructor by pointer
54
55 ~G4QParticle(); // Public Destructor
56
57 // Operators
58 const G4QParticle& operator=(const G4QParticle& right);
59 G4bool operator==(const G4QParticle& rhs) const;
60 G4bool operator!=(const G4QParticle& rhs) const;
61
62 // Selectors
63 G4QPDGCode GetQPDG() const; // Get a PDG-Particle of the Particle
64 G4int GetPDGCode() const; // Get a PDG Code of the Particle
65 G4int GetQCode() const; // Get a Q Code of the Particle
66 G4int GetSpin() const; // Get 2s+1 of the Particle
67 G4int GetCharge() const; // Get a Charge of the Particle
68 G4int GetStrange() const; // Get a Strangeness of the Particle
69 G4int GetBaryNum() const; // Get a Baryon Number of the Particle
70 G4QContent GetQContent(); // Get Quark Content of the Particle
71 G4QDecayChanVector GetDecayVector(); // Get a Decay Vector for the Particle
72 G4double GetMass(); // Get a mass value for the Particle
73 G4double GetWidth(); // Get a width value for the Particle
74
75 // Modifiers
76 G4QDecayChanVector InitDecayVector(G4int Q);// Init DecayVector in theCHIPSWorld by QCode
77 void InitPDGParticle(G4int thePDGCode);
78 void InitQParticle(G4int theQCode);
79
80 // General
81 G4double MinMassOfFragm(); // Minimal mass of decaing fragments
82
83private:
84 // Encapsulated functions
85
86private:
87 // the Body
88 G4QPDGCode aQPDG;
89 G4QDecayChanVector aDecay;
90 G4QContent aQuarkCont; // @@ Secondary (added for acceleration - check)
91};
92
93// Not member operators
94std::ostream& operator<<(std::ostream& lhs, G4QParticle& rhs);
95// Not member functions
96//----------------------------------------------------------------------------------------
97
98inline G4bool G4QParticle::operator==(const G4QParticle& rhs) const {return this==&rhs;}
99inline G4bool G4QParticle::operator!=(const G4QParticle& rhs) const {return this!=&rhs;}
100
101inline G4QPDGCode G4QParticle::GetQPDG() const {return aQPDG;}
102inline G4int G4QParticle::GetQCode() const {return aQPDG.GetQCode();}
103inline G4int G4QParticle::GetPDGCode() const {return aQPDG.GetPDGCode();}
104inline G4int G4QParticle::GetSpin() const {return aQPDG.GetSpin();}
105inline G4int G4QParticle::GetCharge() const {return aQuarkCont.GetCharge();}
106inline G4int G4QParticle::GetStrange() const {return aQuarkCont.GetStrangeness();}
107inline G4int G4QParticle::GetBaryNum() const {return aQuarkCont.GetBaryonNumber();}
108inline G4QContent G4QParticle::GetQContent() {return aQuarkCont;}
110inline G4double G4QParticle::GetMass() {return aQPDG.GetMass();}
111inline G4double G4QParticle::GetWidth() {return aQPDG.GetWidth();}
112
114{
115 G4int nCh=aDecay.size();
116 G4double mass=GetMass();
117 G4double min=mass;
118 if(nCh)
119 {
120 min=aDecay[0]->GetMinMass();
121 if(nCh>1) for(G4int j=1; j<nCh; j++)
122 {
123 G4double next=aDecay[j]->GetMinMass();
124 if(next<min) min=next;
125 }
126 }
127 G4double w=GetWidth();
128 G4double lim=mass+.001;
129 if(w) lim-=1.5*w;
130 if(min<lim) min=lim;
131 return min;
132}
133
134#endif
135
136
137
std::vector< G4QDecayChan * > G4QDecayChanVector
std::ostream & operator<<(std::ostream &lhs, G4QParticle &rhs)
Definition: G4QParticle.cc:129
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
G4int GetCharge() const
Definition: G4QContent.cc:1159
G4int GetBaryonNumber() const
Definition: G4QContent.cc:1182
G4int GetStrangeness() const
Definition: G4QContent.hh:184
G4double GetWidth()
Definition: G4QPDGCode.cc:740
G4int GetPDGCode() const
Definition: G4QPDGCode.hh:326
G4double GetMass()
Definition: G4QPDGCode.cc:693
G4int GetSpin() const
Definition: G4QPDGCode.hh:330
G4int GetQCode() const
Definition: G4QPDGCode.hh:327
G4double GetMass()
Definition: G4QParticle.hh:110
G4int GetPDGCode() const
Definition: G4QParticle.hh:103
G4QPDGCode GetQPDG() const
Definition: G4QParticle.hh:101
G4bool operator!=(const G4QParticle &rhs) const
Definition: G4QParticle.hh:99
G4int GetStrange() const
Definition: G4QParticle.hh:106
G4QContent GetQContent()
Definition: G4QParticle.hh:108
G4bool operator==(const G4QParticle &rhs) const
Definition: G4QParticle.hh:98
G4double GetWidth()
Definition: G4QParticle.hh:111
void InitQParticle(G4int theQCode)
Definition: G4QParticle.cc:780
G4int GetBaryNum() const
Definition: G4QParticle.hh:107
void InitPDGParticle(G4int thePDGCode)
Definition: G4QParticle.cc:789
G4QDecayChanVector GetDecayVector()
Definition: G4QParticle.hh:109
G4double MinMassOfFragm()
Definition: G4QParticle.hh:113
G4int GetCharge() const
Definition: G4QParticle.hh:105
G4int GetSpin() const
Definition: G4QParticle.hh:104
const G4QParticle & operator=(const G4QParticle &right)
Definition: G4QParticle.cc:107
G4int GetQCode() const
Definition: G4QParticle.hh:102
G4QDecayChanVector InitDecayVector(G4int Q)
Definition: G4QParticle.cc:153