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