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
event
include
G4TrackStack.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
// Last Modification : 09/Dec/96 M.Asai
31
//
32
33
34
#ifndef G4TrackStack_h
35
#define G4TrackStack_h 1
36
37
#include "
G4StackedTrack.hh
"
38
#include "
G4Types.hh
"
39
#include <vector>
40
41
class
G4SmartTrackStack
;
42
43
// class description:
44
//
45
// This is a stack class used by G4StackManager. This class object
46
// stores G4StackedTrack class objects in the form of bi-directional
47
// linked list.
48
49
class
G4TrackStack
:
public
std::vector<G4StackedTrack>
50
{
51
public
:
52
G4TrackStack
() : safetyValve1(0), safetyValve2(0), nstick(0) {}
53
G4TrackStack
(
size_t
n
) : safetyValve1(4*n/5), safetyValve2(4*n/5-100), nstick(100) { reserve(n);}
54
~G4TrackStack
();
55
56
private
:
57
const
G4TrackStack
& operator=(
const
G4TrackStack
&
right
);
58
G4int
operator==(
const
G4TrackStack
&
right
)
const
;
59
G4int
operator!=(
const
G4TrackStack
&
right
)
const
;
60
61
public
:
62
void
PushToStack
(
const
G4StackedTrack
& aStackedTrack) { push_back(aStackedTrack); }
63
G4StackedTrack
PopFromStack
() {
G4StackedTrack
st = back(); pop_back();
return
st; }
64
void
TransferTo
(
G4TrackStack
* aStack);
65
void
TransferTo
(
G4SmartTrackStack
* aStack);
66
67
void
clearAndDestroy
();
68
private
:
69
G4int
safetyValve1;
70
G4int
safetyValve2;
71
G4int
nstick;
72
73
public
:
74
G4int
GetNTrack
()
const
{
return
size(); }
75
G4int
GetMaxNTrack
()
const
{
return
max_size(); }
76
inline
G4int
GetSafetyValve1
()
const
{
return
safetyValve1; }
77
inline
G4int
GetSafetyValve2
()
const
{
return
safetyValve2; }
78
inline
G4int
GetNStick
()
const
{
return
nstick; }
79
80
G4double
getTotalEnergy
(
void
)
const
;
81
void
SetSafetyValve2
(
int
x
) { safetyValve2 = x < 0 ? 0 :
x
; }
82
83
};
84
85
#endif
Generated on Sat May 25 2013 14:33:05 for Geant4 by
1.8.4