Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 // 28 #include "G4Nucleon.hh" 29 30 // ------------------------------------------- 31 // GEANT 4 class implementation file 32 // 33 // ---------------- G4Nucleon ----------- 34 // by Gunter Folger, May 1998. 35 // class for a nucleon (inside a 3D Nucl 36 // ------------------------------------------- 37 38 G4Nucleon::G4Nucleon() 39 : theBindingE(0.) , theParticleType(0), theSpl 40 {} 41 42 G4Nucleon::~G4Nucleon() 43 { 44 } 45 46 void G4Nucleon::Boost(const G4LorentzVector & 47 { 48 // see e.g. CERNLIB short writeup U101 for t 49 G4double mass=aMomentum.mag(); 50 G4double factor= 51 ( theMomentum.vect()*aMomentum.vect()/(a 52 53 theMomentum.setE(1/mass*theMomentum.dot(aMom 54 theMomentum.setVect(factor*aMomentum.vect() 55 } 56 57 #include <iostream> 58 std::ostream & operator << (std::ostream &stre 59 { 60 // stream<< nucleon.GetDefinition()->GetParti 61 // << " is " << nucleon.AreYouHit() ? " " : 62 // << " hit. Momentum/position:" << G4endl; 63 stream<< " momentum : " << nucleon.Get4Mome 64 stream<< " position : " << nucleon.GetPosit 65 return stream; 66 } 67