File indexing completed on 2025-01-18 09:58:03
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef G4CollisionInitialState_hh
0036 #define G4CollisionInitialState_hh
0037
0038 #include "G4KineticTrack.hh"
0039 #include "G4KineticTrackVector.hh"
0040 #include "G4HadTmpUtil.hh"
0041
0042 class G4BCAction;
0043
0044 class G4CollisionInitialState
0045 {
0046
0047 public:
0048 G4CollisionInitialState();
0049 G4CollisionInitialState(G4double time, G4KineticTrack * aPrimary,
0050 G4KineticTrack * aTarget);
0051 G4CollisionInitialState(G4double time, G4KineticTrack * aPrimary,
0052 const G4KineticTrackVector & aTarget,
0053 G4BCAction * aFSGenerator);
0054
0055 ~G4CollisionInitialState() { }
0056
0057 G4CollisionInitialState(const G4CollisionInitialState & right);
0058 G4CollisionInitialState & operator=(const G4CollisionInitialState & right);
0059
0060 G4bool operator<(const G4CollisionInitialState & right) const
0061 {return (theCollisionTime < right.theCollisionTime);}
0062
0063 G4bool operator==(const G4CollisionInitialState& right) const
0064 {return (theCollisionTime == right.theCollisionTime);}
0065
0066
0067 G4KineticTrack * GetPrimary(void)
0068 {return thePrimary;}
0069 void SetPrimary(G4KineticTrack * aPrimary)
0070 {thePrimary = aPrimary;}
0071
0072 G4KineticTrack * GetTarget(void)
0073 {return theTarget;}
0074 void SetTarget(G4KineticTrack * aTarget)
0075 {theTarget = aTarget;}
0076
0077 void AddTarget(G4KineticTrack * aTarget)
0078 {theTs.push_back(aTarget);}
0079 G4KineticTrackVector & GetTargetCollection(void)
0080 {return theTs;}
0081 G4KineticTrackVector * GetFinalState();
0082 G4int GetTargetBaryonNumber()
0083 {
0084 G4double result=0;
0085 for(size_t i=0; i<theTs.size(); i++)
0086 {
0087 result += theTs[i]->GetDefinition()->GetBaryonNumber();
0088 }
0089 return G4lrint(result);
0090 }
0091 G4int GetTargetCharge()
0092 {
0093 G4double result=0;
0094 for(size_t i=0; i<theTs.size(); i++)
0095 {
0096 result += theTs[i]->GetDefinition()->GetPDGCharge();
0097 }
0098 return G4lrint(result);
0099 }
0100
0101
0102
0103 G4double GetCollisionTime(void)
0104 {return theCollisionTime;}
0105 void SetCollisionTime(G4double value)
0106 {theCollisionTime = value;}
0107
0108
0109 const G4BCAction * GetGenerator()
0110 {
0111 return theFSGenerator;
0112 }
0113
0114
0115 void Print() const;
0116
0117
0118
0119
0120
0121
0122
0123 private:
0124
0125 G4double theCollisionTime;
0126 G4KineticTrack * thePrimary;
0127 G4KineticTrack * theTarget;
0128 G4KineticTrackVector theTs;
0129 G4BCAction * theFSGenerator;
0130 };
0131
0132 #endif
0133
0134