G4PrimaryVertex.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
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 // class description:
00042 //
00043 //  This is the class which represents a primary vertex. The ofject of this
00044 // class is set to G4Event objct by G4VPrimaryGenerator concrete class.
00045 // This class object has one or more G4PrimaryParticle objects as primary
00046 // particles.
00047 
00048 class G4PrimaryVertex 
00049 {
00050  public:
00051   inline void *operator new(size_t);
00052   inline void operator delete(void *aStackedTrack);
00053 
00054  public:  // with description
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: // with description
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 

Generated on Mon May 27 17:49:25 2013 for Geant4 by  doxygen 1.4.7