Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
source
particles
management
include
G4PrimaryVertex.hh
Go to the documentation of this file.
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$
28
//
29
//
30
31
32
#ifndef G4PrimaryVertex_h
33
#define G4PrimaryVertex_h 1
34
35
#include "
globals.hh
"
36
#include "
G4Allocator.hh
"
37
#include "
G4ThreeVector.hh
"
38
#include "
G4PrimaryParticle.hh
"
39
class
G4VUserPrimaryVertexInformation
;
40
41
// class description:
42
//
43
// This is the class which represents a primary vertex. The ofject of this
44
// class is set to G4Event objct by G4VPrimaryGenerator concrete class.
45
// This class object has one or more G4PrimaryParticle objects as primary
46
// particles.
47
48
class
G4PrimaryVertex
49
{
50
public
:
51
inline
void
*
operator
new
(size_t);
52
inline
void
operator
delete
(
void
*aStackedTrack);
53
54
public
:
// with description
55
G4PrimaryVertex
();
56
G4PrimaryVertex
(
G4double
x0,
G4double
y0,
G4double
z0,
G4double
t0);
57
G4PrimaryVertex
(
G4ThreeVector
xyz0,
G4double
t0);
58
virtual
~G4PrimaryVertex
();
59
60
public
:
61
G4PrimaryVertex
(
const
G4PrimaryVertex
&
right
);
62
G4PrimaryVertex
&
operator=
(
const
G4PrimaryVertex
&right);
63
64
G4int
operator==
(
const
G4PrimaryVertex
&right)
const
;
65
G4int
operator!=
(
const
G4PrimaryVertex
&right)
const
;
66
67
public
:
// with description
68
G4ThreeVector
GetPosition
()
const
;
69
void
SetPosition
(
G4double
x0,
G4double
y0,
G4double
z0);
70
G4double
GetX0
()
const
;
71
G4double
GetY0
()
const
;
72
G4double
GetZ0
()
const
;
73
G4double
GetT0
()
const
;
74
void
SetT0
(
G4double
t0);
75
G4int
GetNumberOfParticle
()
const
;
76
void
SetPrimary
(
G4PrimaryParticle
*
pp
);
77
G4PrimaryParticle
*
GetPrimary
(
G4int
i=0)
const
;
78
void
SetNext
(
G4PrimaryVertex
* nv);
79
G4PrimaryVertex
*
GetNext
()
const
;
80
G4double
GetWeight
()
const
;
81
void
SetWeight
(
G4double
w);
82
void
SetUserInformation
(
G4VUserPrimaryVertexInformation
* anInfo);
83
G4VUserPrimaryVertexInformation
*
GetUserInformation
()
const
;
84
85
void
Print
()
const
;
86
87
private
:
88
G4double
X0;
89
G4double
Y0;
90
G4double
Z0;
91
G4double
T0;
92
G4PrimaryParticle
* theParticle;
93
G4PrimaryParticle
* theTail;
94
G4PrimaryVertex
* nextVertex;
95
G4PrimaryVertex
* tailVertex;
96
G4int
numberOfParticle;
97
G4double
Weight0;
98
G4VUserPrimaryVertexInformation
* userInfo;
99
100
};
101
102
#if defined G4PARTICLES_ALLOC_EXPORT
103
extern
G4DLLEXPORT
G4Allocator<G4PrimaryVertex>
aPrimaryVertexAllocator
;
104
#else
105
extern
G4DLLIMPORT
G4Allocator<G4PrimaryVertex>
aPrimaryVertexAllocator
;
106
#endif
107
108
inline
void
* G4PrimaryVertex::operator
new
(size_t)
109
{
110
void
* aPrimaryVertex;
111
aPrimaryVertex = (
void
*)
aPrimaryVertexAllocator
.MallocSingle();
112
return
aPrimaryVertex;
113
}
114
115
inline
void
G4PrimaryVertex::operator
delete
(
void
* aPrimaryVertex)
116
{
117
aPrimaryVertexAllocator
.FreeSingle((
G4PrimaryVertex
*) aPrimaryVertex);
118
}
119
120
inline
G4ThreeVector
G4PrimaryVertex::GetPosition
()
const
121
{
return
G4ThreeVector
(X0,Y0,Z0); }
122
123
inline
void
G4PrimaryVertex::SetPosition
(
G4double
x0,
G4double
y0,
G4double
z0)
124
{ X0 = x0; Y0 = y0; Z0 = z0; }
125
126
inline
G4double
G4PrimaryVertex::GetX0
()
const
127
{
return
X0; }
128
129
inline
G4double
G4PrimaryVertex::GetY0
()
const
130
{
return
Y0; }
131
132
inline
G4double
G4PrimaryVertex::GetZ0
()
const
133
{
return
Z0; }
134
135
inline
G4double
G4PrimaryVertex::GetT0
()
const
136
{
return
T0; }
137
138
inline
void
G4PrimaryVertex::SetT0
(
G4double
t0)
139
{ T0 = t0; }
140
141
inline
G4int
G4PrimaryVertex::GetNumberOfParticle
()
const
142
{
return
numberOfParticle; }
143
144
inline
void
G4PrimaryVertex::SetPrimary
(
G4PrimaryParticle
*
pp
)
145
{
146
if
(theParticle == 0) { theParticle =
pp
; }
147
else
{ theTail->
SetNext
(pp); }
148
theTail =
pp
;
149
numberOfParticle++;
150
}
151
152
153
inline
void
G4PrimaryVertex::SetNext
(
G4PrimaryVertex
* nv){
154
if
(nextVertex == 0) { nextVertex = nv; }
155
else
{ tailVertex->
SetNext
(nv); }
156
tailVertex = nv;
157
}
158
159
inline
G4PrimaryVertex
*
G4PrimaryVertex::GetNext
()
const
160
{
return
nextVertex; }
161
162
inline
G4double
G4PrimaryVertex::GetWeight
()
const
163
{
return
Weight0; }
164
165
inline
void
G4PrimaryVertex::SetWeight
(
G4double
w)
166
{ Weight0 = w; }
167
168
inline
void
G4PrimaryVertex::SetUserInformation
(
G4VUserPrimaryVertexInformation
* anInfo)
169
{ userInfo = anInfo; }
170
171
inline
G4VUserPrimaryVertexInformation
*
G4PrimaryVertex::GetUserInformation
()
const
172
{
return
userInfo; }
173
174
#endif
175
Generated on Sat May 25 2013 14:33:23 for Geant4 by
1.8.4