Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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: [email protected])
40// Takashi Sasaki (e-mail: [email protected])
41//---------------------------------------------------------------
42#ifndef G4TrackingManager_hh
43#define G4TrackingManager_hh 1
44
45#include "G4StepStatus.hh" // Include from 'tracking'
46#include "G4SteppingManager.hh" // Include from 'tracking'
47#include "G4Track.hh" // Include from 'tracking'
48#include "G4TrackStatus.hh" // Include from 'tracking'
49#include "G4TrackVector.hh" // Include from 'tracking'
51#include "G4UserSteppingAction.hh" // Include from 'tracking'
52#include "G4UserTrackingAction.hh" // Include from 'tracking'
53#include "G4VTrajectory.hh" // Include from 'tracking'
54#include "globals.hh" // Include from 'global'
55
57
58////////////////////////
60////////////////////////
61{
62 public:
64
65 public:
66 // Constructor/Destructor
67
68 // G4TrackingManger should be dynamically allocated, therefore you
69 // need to invoke new() when you call this constructor.
70 // G4SteppingManger and G4UserTrackingAction will be created
71 // in this constructor. "This" pointer will be passed to
72 // G4UserTrackingAction.
75
76 // Get/Set functions
77
78 G4Track* GetTrack() const;
79
81 void SetStoreTrajectory(G4int value);
82
84
86
88 void SetTrajectory(G4VTrajectory* aTrajectory);
89
91
92 void SetUserAction(G4UserTrackingAction* apAction);
93 void SetUserAction(G4UserSteppingAction* apAction);
94
95 void SetVerboseLevel(G4int vLevel);
96 G4int GetVerboseLevel() const;
97
98 // Other member functions
99
100 void ProcessOneTrack(G4Track* apValueG4Track);
101 // Invoking this function, a G4Track given by the argument
102 // will be tracked.
103
104 void EventAborted();
105 // Invoking this function, the current tracking will be
106 // aborted immediately. The tracking will return the
107 // G4TrackStatus in 'fUserKillTrackAndSecondaries'.
108 // By this the EventManager deletes the current track and all
109 // its associated secondaries.
110
112 // This method can be invoked from the user's G4UserTrackingAction
113 // implementation to set his/her own G4VUserTrackInformation concrete
114 // class object to a G4Track object.
115
116 private:
117 void TrackBanner(); // verbose
118
119 // Member data
120
121 G4Track* fpTrack = nullptr;
122 G4SteppingManager* fpSteppingManager = nullptr;
123 G4UserTrackingAction* fpUserTrackingAction = nullptr;
124 G4VTrajectory* fpTrajectory = nullptr;
125 G4int StoreTrajectory = 0;
126 G4int verboseLevel = 0;
127 G4TrackingMessenger* messenger = nullptr;
128 G4bool EventIsAborted = false;
129};
130
131//*******************************************************************
132//
133// Inline function
134//
135//*******************************************************************
136
137inline G4Track* G4TrackingManager::GetTrack() const { return fpTrack; }
138
139inline G4int G4TrackingManager::GetStoreTrajectory() const { return StoreTrajectory; }
140
141inline void G4TrackingManager::SetStoreTrajectory(G4int value) { StoreTrajectory = value; }
142
144{
145 return fpSteppingManager;
146}
147
149{
150 return fpUserTrackingAction;
151}
152
153inline G4VTrajectory* G4TrackingManager::GimmeTrajectory() const { return fpTrajectory; }
154
156{
157 return fpSteppingManager->GetfSecondary();
158}
159
161{
162 fpUserTrackingAction = apAction;
163 if (apAction != nullptr) {
164 apAction->SetTrackingManagerPointer(this);
165 }
166}
167
169{
170 fpSteppingManager->SetUserAction(apAction);
171 if (apAction != nullptr) {
172 apAction->SetSteppingManagerPointer(fpSteppingManager);
173 }
174}
175
177{
178 verboseLevel = vLevel;
179 fpSteppingManager->SetVerboseLevel(vLevel);
180}
181
182inline G4int G4TrackingManager::GetVerboseLevel() const { return verboseLevel; }
183
185{
186 if (fpTrack != nullptr) fpTrack->SetUserInformation(aValue);
187}
188
189#endif
std::vector< G4Track * > G4TrackVector
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4TrackVector * GetfSecondary()
void SetVerboseLevel(G4int vLevel)
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)