source: trunk/source/particles/management/src/G4PrimaryVertex.cc @ 1202

Last change on this file since 1202 was 1196, checked in by garnier, 15 years ago

update CVS release candidate geant4.9.3.01

File size: 3.4 KB
Line 
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// $Id: G4PrimaryVertex.cc,v 1.4 2007/10/06 06:49:29 kurasige Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30
31#include "G4PrimaryVertex.hh"
32#include "G4VUserPrimaryVertexInformation.hh"
33#include "G4ios.hh"
34
35G4Allocator<G4PrimaryVertex> aPrimaryVertexAllocator;
36
37G4PrimaryVertex::G4PrimaryVertex()
38:X0(0.),Y0(0.),Z0(0.),T0(0.),theParticle(0),theTail(0),
39 nextVertex(0),tailVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
40{;}
41
42G4PrimaryVertex::G4PrimaryVertex(
43          G4double x0,G4double y0,G4double z0,G4double t0)
44:X0(x0),Y0(y0),Z0(z0),T0(t0),theParticle(0),theTail(0),
45 nextVertex(0),tailVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
46{;}
47
48G4PrimaryVertex::G4PrimaryVertex(G4ThreeVector xyz0,G4double t0)
49:T0(t0),theParticle(0),theTail(0),
50 nextVertex(0),tailVertex(0),numberOfParticle(0),Weight0(1.0),userInfo(0)
51{
52  X0=xyz0.x();
53  Y0=xyz0.y();
54  Z0=xyz0.z();
55}
56
57G4PrimaryVertex::~G4PrimaryVertex()
58{
59  if(theParticle != 0)
60  { delete theParticle; }
61  if(nextVertex != 0)
62  { delete nextVertex; }
63  if(userInfo != 0)
64  { delete userInfo; }
65}
66
67const G4PrimaryVertex & 
68G4PrimaryVertex::operator=(const G4PrimaryVertex &)
69{ return *this; }
70G4int G4PrimaryVertex::operator==(const G4PrimaryVertex &right) const
71{ return (this==&right); }
72G4int G4PrimaryVertex::operator!=(const G4PrimaryVertex &right) const
73{ return (this!=&right); }
74
75void G4PrimaryVertex::Print() const
76{
77  G4cout << "Vertex  ( "
78         << X0/mm  << "[mm], " 
79         << Y0/mm << "[mm], " 
80         << Z0/mm << "[mm], " 
81         << T0/ns  << "[ns] )" 
82       << " Weight " << Weight0 << G4endl;
83  if(userInfo!=0) userInfo->Print();
84  G4cout << "#### Primary particles" << G4endl;
85  G4PrimaryParticle* aPrim = theParticle;
86  if(aPrim != 0)
87  {
88    aPrim->Print();
89    aPrim = aPrim->GetNext();
90  }
91}
Note: See TracBrowser for help on using the repository browser.