Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:00

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 //      GEANT4 Class file
0028 //
0029 //
0030 //      File name:    G4QMDParticipant.hh 
0031 //
0032 //      Author: Koi, Tatsumi (tkoi@slac.stanford.edu)       
0033 // 
0034 //      Creation date: 29 March 2007
0035 // -----------------------------------------------------------------------------
0036 //
0037 // 081120 Add hit flag and related methods
0038 
0039 #ifndef G4QMDParticipant_hh
0040 #define G4QMDParticipant_hh
0041 
0042 #include <CLHEP/Units/SystemOfUnits.h>
0043 
0044 #include "G4ParticleDefinition.hh"
0045 #include "G4ThreeVector.hh"
0046 #include "G4LorentzVector.hh"
0047 
0048 class G4QMDParticipant 
0049 {
0050    public:
0051                                                 // momentum      position
0052       G4QMDParticipant( const G4ParticleDefinition* , G4ThreeVector , G4ThreeVector );
0053       ~G4QMDParticipant();
0054 
0055       void SetDefinition( const G4ParticleDefinition* pd ) { definition = pd; };
0056       const G4ParticleDefinition* GetDefinition() { return definition; };
0057 
0058       void SetPosition( G4ThreeVector r ) { position = r; };
0059       G4ThreeVector GetPosition() { return position; };
0060 
0061       void SetMomentum( G4ThreeVector p ) { momentum = p; };
0062       G4ThreeVector GetMomentum() { return momentum; };
0063 
0064       G4double GetMass() { return definition->GetPDGMass()/CLHEP::GeV; };
0065 
0066       G4LorentzVector Get4Momentum();
0067 
0068       G4double GetKineticEnergy() { return Get4Momentum().e() - GetMass(); };
0069 
0070       G4int GetBaryonNumber() { return definition->GetBaryonNumber(); };
0071       G4int GetNuc() { return definition->GetBaryonNumber(); };
0072 
0073       G4int GetChargeInUnitOfEplus() { return int ( definition->GetPDGCharge()/CLHEP::eplus ); };
0074 
0075       void UnsetInitialMark() { projectile = false; target = false; }
0076       void UnsetHitMark() { hit = false; }
0077       G4bool IsThisHit() { return hit; }
0078       void SetHitMark() { hit = true; }
0079 
0080       void SetProjectile() { projectile = true; }
0081       void SetTarget() { target = true; }
0082       G4bool IsThisProjectile() { return projectile; }
0083       G4bool IsThisTarget() { return target; }
0084 
0085    private:
0086       const G4ParticleDefinition* definition;
0087       G4ThreeVector momentum;
0088       G4ThreeVector position;
0089 
0090       G4bool projectile; 
0091       G4bool target; 
0092       G4bool hit; 
0093 };
0094 
0095 #endif