ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
G4StackManager.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4StackManager.hh
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
//
28
// Last Modification : 04/Oct/11 P. Mato - making use of G4TrackStack with value semantics
30
31
32
#ifndef G4StackManager_h
33
#define G4StackManager_h 1
34
35
#include "
G4UserStackingAction.hh
"
36
#include "
G4StackedTrack.hh
"
37
#include "
G4TrackStack.hh
"
38
#include "
G4SmartTrackStack.hh
"
39
#include "
G4ClassificationOfNewTrack.hh
"
40
#include "
G4Track.hh
"
41
#include "
G4TrackStatus.hh
"
42
#include "
globals.hh
"
43
#include "
evmandefs.hh
"
44
45
class
G4StackingMessenger
;
46
class
G4VTrajectory
;
47
48
// class description:
49
//
50
// This is the manager class of handling stacks of G4Track objects.
51
// This class must be a singleton and be constructed by G4EventManager.
52
// Almost all methods must be invoked exclusively by G4EventManager.
53
// Especially, some Clear() methods MUST NOT be invoked by the user.
54
// Event abortion is handled by G4EventManager.
55
//
56
// This G4StackingManager has three stacks, the urgent stack, the
57
// waiting stack, and the postpone to next event stack. The meanings
58
// of each stack is descrived in the Geant4 user's manual.
59
//
60
61
class
G4StackManager
62
{
63
public
:
64
G4StackManager
();
65
~G4StackManager
();
66
67
private
:
68
const
G4StackManager
&
operator=
(
const
G4StackManager
&
right
);
69
G4bool
operator==
(
const
G4StackManager
&right)
const
;
70
G4bool
operator!=
(
const
G4StackManager
&right)
const
;
71
72
public
:
73
G4int
PushOneTrack
(
G4Track
*newTrack,
G4VTrajectory
*newTrajectory = 0);
74
G4Track
*
PopNextTrack
(
G4VTrajectory
**newTrajectory);
75
G4int
PrepareNewEvent
();
76
77
public
:
// with description
78
void
ReClassify
();
79
// Send all tracks stored in the Urgent stack one by one to
80
// the user's concrete ClassifyNewTrack() method. This method
81
// can be invoked from the user's G4UserStackingAction concrete
82
// class, especially fron its NewStage() method. Be aware that
83
// when the urgent stack becomes empty, all tracks in the waiting
84
// stack are send to the urgent stack and then the user's NewStage()
85
// method is invoked.
86
87
void
SetNumberOfAdditionalWaitingStacks
(
G4int
iAdd);
88
// Set the number of additional (optional) waiting stacks.
89
// This method must be invoked at PreInit, Init or Idle states.
90
// Once the user set the number of additional waiting stacks,
91
// he/she can use the corresponding ENUM in G4ClassificationOfNewTrack.
92
// The user should invoke G4RunManager::SetNumberOfAdditionalWaitingStacks
93
// method, which invokes this method.
94
95
void
TransferStackedTracks
(
G4ClassificationOfNewTrack
origin
,
G4ClassificationOfNewTrack
destination);
96
// Transfter all stacked tracks from the origin stack to the destination stack.
97
// The destination stack needs not be empty.
98
// If the destination is fKill, tracks are deleted.
99
// If the origin is fKill, nothing happen.
100
101
void
TransferOneStackedTrack
(
G4ClassificationOfNewTrack
origin,
G4ClassificationOfNewTrack
destination);
102
// Transfter one stacked track from the origin stack to the destination stack.
103
// The transfered track is the one which came last to the origin stack.
104
// The destination stack needs not be empty.
105
// If the destination is fKill, the track is deleted.
106
// If the origin is fKill, nothing happen.
107
108
private
:
109
G4UserStackingAction
*
userStackingAction
;
110
G4int
verboseLevel
;
111
#ifdef G4_USESMARTSTACK
112
G4SmartTrackStack
*
urgentStack
;
113
#else
114
G4TrackStack
*
urgentStack
;
115
#endif
116
G4TrackStack
*
waitingStack
;
117
G4TrackStack
*
postponeStack
;
118
G4StackingMessenger
*
theMessenger
;
119
std::vector<G4TrackStack*>
additionalWaitingStacks
;
120
G4int
numberOfAdditionalWaitingStacks
;
121
122
public
:
123
void
clear
();
124
void
ClearUrgentStack
();
125
void
ClearWaitingStack
(
int
i=0);
126
void
ClearPostponeStack
();
127
G4int
GetNTotalTrack
()
const
;
128
G4int
GetNUrgentTrack
()
const
;
129
G4int
GetNWaitingTrack
(
int
i=0)
const
;
130
G4int
GetNPostponedTrack
()
const
;
131
void
SetVerboseLevel
(
G4int
const
value
);
132
void
SetUserStackingAction
(
G4UserStackingAction
*
value
);
133
134
private
:
135
G4ClassificationOfNewTrack
DefaultClassification
(
G4Track
*aTrack);
136
};
137
138
#endif
139
geant4
tree
geant4-10.6-release
source
event
include
G4StackManager.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:13
using
1.8.2 with
ECCE GitHub integration