00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef G4PrimaryVertex_h
00033 #define G4PrimaryVertex_h 1
00034
00035 #include "globals.hh"
00036 #include "G4Allocator.hh"
00037 #include "G4ThreeVector.hh"
00038 #include "G4PrimaryParticle.hh"
00039 class G4VUserPrimaryVertexInformation;
00040
00041
00042
00043
00044
00045
00046
00047
00048 class G4PrimaryVertex
00049 {
00050 public:
00051 inline void *operator new(size_t);
00052 inline void operator delete(void *aStackedTrack);
00053
00054 public:
00055 G4PrimaryVertex();
00056 G4PrimaryVertex(G4double x0,G4double y0,G4double z0,G4double t0);
00057 G4PrimaryVertex(G4ThreeVector xyz0,G4double t0);
00058 virtual ~G4PrimaryVertex();
00059
00060 public:
00061 G4PrimaryVertex(const G4PrimaryVertex &right);
00062 G4PrimaryVertex & operator=(const G4PrimaryVertex &right);
00063
00064 G4int operator==(const G4PrimaryVertex &right) const;
00065 G4int operator!=(const G4PrimaryVertex &right) const;
00066
00067 public:
00068 G4ThreeVector GetPosition() const;
00069 void SetPosition(G4double x0,G4double y0,G4double z0);
00070 G4double GetX0() const;
00071 G4double GetY0() const;
00072 G4double GetZ0() const;
00073 G4double GetT0() const;
00074 void SetT0(G4double t0);
00075 G4int GetNumberOfParticle() const;
00076 void SetPrimary(G4PrimaryParticle * pp);
00077 G4PrimaryParticle* GetPrimary(G4int i=0) const;
00078 void SetNext(G4PrimaryVertex* nv);
00079 G4PrimaryVertex* GetNext() const;
00080 G4double GetWeight() const;
00081 void SetWeight(G4double w);
00082 void SetUserInformation(G4VUserPrimaryVertexInformation* anInfo);
00083 G4VUserPrimaryVertexInformation* GetUserInformation() const;
00084
00085 void Print() const;
00086
00087 private:
00088 G4double X0;
00089 G4double Y0;
00090 G4double Z0;
00091 G4double T0;
00092 G4PrimaryParticle * theParticle;
00093 G4PrimaryParticle * theTail;
00094 G4PrimaryVertex* nextVertex;
00095 G4PrimaryVertex* tailVertex;
00096 G4int numberOfParticle;
00097 G4double Weight0;
00098 G4VUserPrimaryVertexInformation* userInfo;
00099
00100 };
00101
00102 #if defined G4PARTICLES_ALLOC_EXPORT
00103 extern G4DLLEXPORT G4Allocator<G4PrimaryVertex> aPrimaryVertexAllocator;
00104 #else
00105 extern G4DLLIMPORT G4Allocator<G4PrimaryVertex> aPrimaryVertexAllocator;
00106 #endif
00107
00108 inline void * G4PrimaryVertex::operator new(size_t)
00109 {
00110 void * aPrimaryVertex;
00111 aPrimaryVertex = (void *) aPrimaryVertexAllocator.MallocSingle();
00112 return aPrimaryVertex;
00113 }
00114
00115 inline void G4PrimaryVertex::operator delete(void * aPrimaryVertex)
00116 {
00117 aPrimaryVertexAllocator.FreeSingle((G4PrimaryVertex *) aPrimaryVertex);
00118 }
00119
00120 inline G4ThreeVector G4PrimaryVertex::GetPosition() const
00121 { return G4ThreeVector(X0,Y0,Z0); }
00122
00123 inline void G4PrimaryVertex::SetPosition(G4double x0,G4double y0,G4double z0)
00124 { X0 = x0; Y0 = y0; Z0 = z0; }
00125
00126 inline G4double G4PrimaryVertex::GetX0() const
00127 { return X0; }
00128
00129 inline G4double G4PrimaryVertex::GetY0() const
00130 { return Y0; }
00131
00132 inline G4double G4PrimaryVertex::GetZ0() const
00133 { return Z0; }
00134
00135 inline G4double G4PrimaryVertex::GetT0() const
00136 { return T0; }
00137
00138 inline void G4PrimaryVertex::SetT0(G4double t0)
00139 { T0 = t0; }
00140
00141 inline G4int G4PrimaryVertex::GetNumberOfParticle() const
00142 { return numberOfParticle; }
00143
00144 inline void G4PrimaryVertex::SetPrimary(G4PrimaryParticle * pp)
00145 {
00146 if(theParticle == 0) { theParticle = pp; }
00147 else { theTail->SetNext(pp); }
00148 theTail = pp;
00149 numberOfParticle++;
00150 }
00151
00152
00153 inline void G4PrimaryVertex::SetNext(G4PrimaryVertex* nv){
00154 if(nextVertex == 0) { nextVertex = nv; }
00155 else { tailVertex->SetNext(nv); }
00156 tailVertex = nv;
00157 }
00158
00159 inline G4PrimaryVertex* G4PrimaryVertex::GetNext() const
00160 { return nextVertex; }
00161
00162 inline G4double G4PrimaryVertex::GetWeight() const
00163 { return Weight0; }
00164
00165 inline void G4PrimaryVertex::SetWeight(G4double w)
00166 { Weight0 = w; }
00167
00168 inline void G4PrimaryVertex::SetUserInformation(G4VUserPrimaryVertexInformation* anInfo)
00169 { userInfo = anInfo; }
00170
00171 inline G4VUserPrimaryVertexInformation* G4PrimaryVertex::GetUserInformation() const
00172 { return userInfo; }
00173
00174 #endif
00175