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 // GEANT4 Class file 00028 // 00029 // 00030 // File name: G4QMDParticipant.hh 00031 // 00032 // Author: Koi, Tatsumi (tkoi@slac.stanford.edu) 00033 // 00034 // Creation date: 29 March 2007 00035 // ----------------------------------------------------------------------------- 00036 // 00037 // 081120 Add hit flag and related methods 00038 00039 #ifndef G4QMDParticipant_hh 00040 #define G4QMDParticipant_hh 00041 00042 #include <CLHEP/Units/SystemOfUnits.h> 00043 00044 #include "G4ParticleDefinition.hh" 00045 #include "G4ThreeVector.hh" 00046 #include "G4LorentzVector.hh" 00047 00048 class G4QMDParticipant 00049 { 00050 public: 00051 // momentum position 00052 G4QMDParticipant( G4ParticleDefinition* , G4ThreeVector , G4ThreeVector ); 00053 ~G4QMDParticipant(); 00054 00055 void SetDefinition( G4ParticleDefinition* pd ) { definition = pd; }; 00056 G4ParticleDefinition* GetDefinition() { return definition; }; 00057 00058 void SetPosition( G4ThreeVector r ) { position = r; }; 00059 G4ThreeVector GetPosition() { return position; }; 00060 00061 void SetMomentum( G4ThreeVector p ) { momentum = p; }; 00062 G4ThreeVector GetMomentum() { return momentum; }; 00063 00064 G4double GetMass() { return definition->GetPDGMass()/CLHEP::GeV; }; 00065 00066 G4LorentzVector Get4Momentum(); 00067 00068 G4double GetKineticEnergy() { return Get4Momentum().e() - GetMass(); }; 00069 00070 G4int GetBaryonNumber() { return definition->GetBaryonNumber(); }; 00071 G4int GetNuc() { return definition->GetBaryonNumber(); }; 00072 00073 G4int GetChargeInUnitOfEplus() { return int ( definition->GetPDGCharge()/CLHEP::eplus ); }; 00074 00075 void UnsetInitialMark() { projectile = false; target = false; } 00076 void UnsetHitMark() { hit = false; } 00077 G4bool IsThisHit() { return hit; } 00078 void SetHitMark() { hit = true; } 00079 00080 void SetProjectile() { projectile = true; } 00081 void SetTarget() { target = true; } 00082 G4bool IsThisProjectile() { return projectile; } 00083 G4bool IsThisTarget() { return target; } 00084 00085 private: 00086 G4ParticleDefinition* definition; 00087 G4ThreeVector momentum; 00088 G4ThreeVector position; 00089 00090 G4bool projectile; 00091 G4bool target; 00092 G4bool hit; 00093 }; 00094 00095 #endif