Back to home page

EIC code displayed by LXR

 
 

    


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

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 //
0027 //
0028 
0029 #ifndef G4Parton_h
0030 #define G4Parton_h 1
0031 
0032 // ------------------------------------------------------------
0033 //      GEANT 4 class header file
0034 //
0035 //      ---------------- G4Parton ----------------
0036 //             by Gunter Folger, June 1998.
0037 //       class for Parton (inside a string) used by Parton String Models
0038 // ------------------------------------------------------------
0039 
0040 #include "globals.hh"
0041 #include "G4ThreeVector.hh"
0042 #include "G4LorentzVector.hh"
0043 #include <iostream>
0044 #include "G4ParticleTable.hh"
0045 #include "Randomize.hh"
0046 
0047 class G4Parton
0048 {
0049    public:
0050       G4Parton()
0051       {
0052         // CAUTION: 
0053         // this is a preliminary definition yielding u and d quarks only!
0054         //
0055         PDGencoding=(G4int)(2.*G4UniformRand()); 
0056         theColour = (G4int)(3.*G4UniformRand())+1;
0057         theIsoSpinZ = ((G4int)(G4UniformRand()))-0.5;
0058         theSpinZ = ((G4int)(G4UniformRand()))-0.5;
0059       }
0060       
0061       G4Parton(G4int PDGencoding);
0062       G4Parton(const G4Parton &right);
0063 
0064       ~G4Parton();
0065 
0066       G4Parton & operator=(const G4Parton &right);
0067 
0068       G4bool operator==(const G4Parton &right) const;
0069 
0070       G4bool operator!=(const G4Parton &right) const;
0071       
0072       G4int GetPDGcode() const;
0073     
0074       G4ParticleDefinition * GetDefinition();
0075       void SetDefinition(G4ParticleDefinition * aDefinition);  // Uzhi
0076 
0077       void DefineMomentumInZ(G4double aLightConeMomentum, G4bool aDirection);      
0078       void DefineMomentumInZ(G4double aLightConeMomentum,G4double aLightConeE, G4bool aDirection);      
0079       
0080       const G4ThreeVector & GetPosition()const;
0081       void SetPosition(const G4ThreeVector &aPosition);
0082 
0083       const G4LorentzVector & Get4Momentum() const; 
0084       void Set4Momentum(const G4LorentzVector & aMomentum);
0085       
0086       void SetX(G4double anX) { theX = anX; }
0087       G4double GetX() {return theX;}
0088       
0089       void SetColour(G4int aColour) {theColour = aColour;}
0090       G4int GetColour() {return theColour;}
0091       
0092       void SetIsoSpinZ(G4double anIsoSpinZ) {theIsoSpinZ = anIsoSpinZ;}
0093       G4double GetIsoSpinZ() {return theIsoSpinZ;}
0094 
0095       void SetSpinZ(G4double aSpinZ) {theSpinZ = aSpinZ;}
0096       G4double GetSpinZ() {return theSpinZ;}
0097       
0098    private:
0099       G4double GetMass();
0100       
0101    public:  
0102       G4int PDGencoding;
0103       G4ParticleDefinition * theDefinition;
0104 
0105    private:  
0106       G4LorentzVector theMomentum;
0107       G4ThreeVector   thePosition;
0108       
0109       G4int theColour;
0110       G4double theIsoSpinZ;
0111       G4double theSpinZ;
0112       
0113       G4double theX;
0114       
0115 };
0116 
0117 inline G4bool G4Parton::operator==(const G4Parton &right) const
0118 {
0119     return this==&right;
0120 }   
0121 
0122 inline G4bool G4Parton::operator!=(const G4Parton &right) const
0123 {
0124     return this!=&right;
0125 }
0126 
0127 inline G4int G4Parton::GetPDGcode() const
0128 {
0129     return PDGencoding;
0130 }
0131     
0132 inline const G4ThreeVector & G4Parton::GetPosition() const
0133 {
0134     return thePosition;
0135 }
0136 
0137 inline void G4Parton::SetPosition(const G4ThreeVector &aPosition)
0138 {
0139     thePosition=aPosition;
0140 }
0141 
0142 
0143 inline const G4LorentzVector & G4Parton::Get4Momentum() const
0144 {
0145     return theMomentum;
0146 }
0147 
0148 inline void G4Parton::Set4Momentum(const G4LorentzVector & aMomentum)
0149 {
0150     theMomentum=aMomentum;
0151 }
0152 
0153 
0154 inline
0155 G4double G4Parton::GetMass()
0156 {
0157     return theDefinition->GetPDGMass();
0158 }
0159 
0160 inline
0161 G4ParticleDefinition * G4Parton::GetDefinition()
0162 {
0163     return theDefinition;
0164 }
0165 
0166 inline void G4Parton::SetDefinition(G4ParticleDefinition * aDefinition) // Uzhi
0167 {
0168     theDefinition = aDefinition;
0169     PDGencoding = theDefinition->GetPDGEncoding();
0170 }
0171 
0172 
0173 #endif