Geant4 Cross Reference |
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 // 28 // ----------------------------------------------------------------------------- 29 // GEANT 4 class header file 30 // 31 // History: first implementation, A. Feliciello, 30th June 1998 32 33 // ----------------------------------------------------------------------------- 34 35 #ifndef G4CollisionInitialState_hh 36 #define G4CollisionInitialState_hh 37 38 #include "G4KineticTrack.hh" 39 #include "G4KineticTrackVector.hh" 40 #include "G4HadTmpUtil.hh" 41 42 class G4BCAction; 43 44 class G4CollisionInitialState 45 { 46 47 public: 48 G4CollisionInitialState(); 49 G4CollisionInitialState(G4double time, G4KineticTrack * aPrimary, 50 G4KineticTrack * aTarget); 51 G4CollisionInitialState(G4double time, G4KineticTrack * aPrimary, 52 const G4KineticTrackVector & aTarget, 53 G4BCAction * aFSGenerator); 54 55 ~G4CollisionInitialState() { } 56 57 G4CollisionInitialState(const G4CollisionInitialState & right); 58 G4CollisionInitialState & operator=(const G4CollisionInitialState & right); 59 60 G4bool operator<(const G4CollisionInitialState & right) const 61 {return (theCollisionTime < right.theCollisionTime);} 62 63 G4bool operator==(const G4CollisionInitialState& right) const 64 {return (theCollisionTime == right.theCollisionTime);} 65 66 67 G4KineticTrack * GetPrimary(void) 68 {return thePrimary;} 69 void SetPrimary(G4KineticTrack * aPrimary) 70 {thePrimary = aPrimary;} 71 72 G4KineticTrack * GetTarget(void) 73 {return theTarget;} 74 void SetTarget(G4KineticTrack * aTarget) 75 {theTarget = aTarget;} 76 77 void AddTarget(G4KineticTrack * aTarget) 78 {theTs.push_back(aTarget);} 79 G4KineticTrackVector & GetTargetCollection(void) 80 {return theTs;} 81 G4KineticTrackVector * GetFinalState(); 82 G4int GetTargetBaryonNumber() 83 { 84 G4double result=0; 85 for(size_t i=0; i<theTs.size(); i++) 86 { 87 result += theTs[i]->GetDefinition()->GetBaryonNumber(); 88 } 89 return G4lrint(result); 90 } 91 G4int GetTargetCharge() 92 { 93 G4double result=0; 94 for(size_t i=0; i<theTs.size(); i++) 95 { 96 result += theTs[i]->GetDefinition()->GetPDGCharge(); 97 } 98 return G4lrint(result); 99 } 100 101 // -new interface post pion: 102 103 G4double GetCollisionTime(void) 104 {return theCollisionTime;} 105 void SetCollisionTime(G4double value) 106 {theCollisionTime = value;} 107 108 // for debugging only 109 const G4BCAction * GetGenerator() 110 { 111 return theFSGenerator; 112 } 113 114 115 void Print() const; 116 117 // friend std::ostream& operator<<(std::ostream & out, const G4CollisionInitialState & collision){ 118 // out=1; 119 // return out; 120 // } 121 122 123 private: 124 125 G4double theCollisionTime; 126 G4KineticTrack * thePrimary; 127 G4KineticTrack * theTarget; 128 G4KineticTrackVector theTs; 129 G4BCAction * theFSGenerator; 130 }; 131 132 #endif 133 134 135