Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4TrackingManager.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// G4TrackingManager
27//
28// Class description:
29//
30// This is an interface class between the event, the track and the tracking
31// categories. It handles necessary message passing between the upper
32// hierarchical object, which is the event manager (G4EventManager), and
33// lower hierarchical objects in the tracking category. It receives one track
34// in an event from the event manager and takes care to finish tracking it.
35// Used exclusively by the Geant4 kernel.
36
37// Contact:
38// Questions and comments to this code should be sent to
39// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
40// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
41//---------------------------------------------------------------
42#ifndef G4TrackingManager_hh
43#define G4TrackingManager_hh 1
44
45#include "globals.hh" // Include from 'global'
46#include "G4SteppingManager.hh" // Include from 'tracking'
47#include "G4Track.hh" // Include from 'tracking'
49#include "G4TrackVector.hh" // Include from 'tracking'
50#include "G4TrackStatus.hh" // Include from 'tracking'
51#include "G4StepStatus.hh" // Include from 'tracking'
52#include "G4UserTrackingAction.hh" // Include from 'tracking'
53#include "G4UserSteppingAction.hh" // Include from 'tracking'
54#include "G4VTrajectory.hh" // Include from 'tracking'
55
57
58////////////////////////
60////////////////////////
61{
62 public:
64
65 public:
66
67 // Constructor/Destructor
68
70 // G4TrackingManger should be dynamically allocated, therefore you
71 // need to invoke new() when you call this constructor.
72 // G4SteppingManger and G4UserTrackingAction will be created
73 // in this constructor. "This" pointer will be passed to
74 // G4UserTrackingAction.
75
77
78 // Get/Set functions
79
80 G4Track* GetTrack() const;
81
83 void SetStoreTrajectory(G4int value);
84
86
88
90 void SetTrajectory(G4VTrajectory* aTrajectory);
91
93
94 void SetUserAction(G4UserTrackingAction* apAction);
95 void SetUserAction(G4UserSteppingAction* apAction);
96
97 void SetVerboseLevel(G4int vLevel);
98 G4int GetVerboseLevel() const;
99
100 // Other member functions
101
102 void ProcessOneTrack(G4Track* apValueG4Track);
103 // Invoking this function, a G4Track given by the argument
104 // will be tracked.
105
106 void EventAborted();
107 // Invoking this function, the current tracking will be
108 // aborted immediately. The tracking will return the
109 // G4TrackStatus in 'fUserKillTrackAndSecondaries'.
110 // By this the EventManager deletes the current track and all
111 // its associated secondaries.
112
114 // This method can be invoked from the user's G4UserTrackingAction
115 // implementation to set his/her own G4VUserTrackInformation concrete
116 // class object to a G4Track object.
117
118 private:
119
120 void TrackBanner(); // verbose
121
122 // Member data
123
124 G4Track* fpTrack = nullptr;
125 G4SteppingManager* fpSteppingManager = nullptr;
126 G4UserTrackingAction* fpUserTrackingAction = nullptr;
127 G4VTrajectory* fpTrajectory = nullptr;
128 G4int StoreTrajectory = 0;
129 G4int verboseLevel = 0;
130 G4TrackingMessenger* messenger = nullptr;
131 G4bool EventIsAborted = false;
132};
133
134//*******************************************************************
135//
136// Inline function
137//
138//*******************************************************************
139
141{
142 return fpTrack;
143}
144
146{
147 return StoreTrajectory;
148}
149
151{
152 StoreTrajectory = value;
153}
154
156{
157 return fpSteppingManager;
158}
159
161{
162 return fpUserTrackingAction;
163}
164
166{
167 return fpTrajectory;
168}
169
171{
172 return fpSteppingManager->GetfSecondary();
173}
174
176{
177 fpUserTrackingAction = apAction;
178 if(apAction != nullptr)
179 {
180 apAction->SetTrackingManagerPointer(this);
181 }
182}
183
185{
186 fpSteppingManager->SetUserAction(apAction);
187 if(apAction != nullptr)
188 {
189 apAction->SetSteppingManagerPointer(fpSteppingManager);
190 }
191}
192
194{
195 verboseLevel = vLevel;
196 fpSteppingManager -> SetVerboseLevel( vLevel );
197}
198
200{
201 return verboseLevel;
202}
203
204inline void
206{
207 if(fpTrack != nullptr) fpTrack->SetUserInformation(aValue);
208}
209
210#endif
std::vector< G4Track * > G4TrackVector
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4TrackVector * GetfSecondary()
void SetUserAction(G4UserSteppingAction *apAction)
G4ProfilerConfig< G4ProfileType::Track > ProfilerConfig
Definition: G4Track.hh:70
void SetUserInformation(G4VUserTrackInformation *aValue) const
void SetUserAction(G4UserTrackingAction *apAction)
G4int GetVerboseLevel() const
G4TrackVector * GimmeSecondaries() const
void SetUserTrackInformation(G4VUserTrackInformation *aValue)
void SetVerboseLevel(G4int vLevel)
G4SteppingManager * GetSteppingManager() const
G4UserTrackingAction * GetUserTrackingAction() const
void SetStoreTrajectory(G4int value)
void ProcessOneTrack(G4Track *apValueG4Track)
G4Track * GetTrack() const
void SetTrajectory(G4VTrajectory *aTrajectory)
G4int GetStoreTrajectory() const
G4VTrajectory * GimmeTrajectory() const
virtual void SetSteppingManagerPointer(G4SteppingManager *pValue)
virtual void SetTrackingManagerPointer(G4TrackingManager *pValue)