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: G4TrackingManager.hh,v 1.21 2006/11/14 10:58:47 tsasaki Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-02-ref-02 $ |
---|
29 | // |
---|
30 | //--------------------------------------------------------------- |
---|
31 | // |
---|
32 | // G4TrackingManager.hh |
---|
33 | // |
---|
34 | // class description: |
---|
35 | // This is an interface class among the event, the track |
---|
36 | // and the tracking category. It handles necessary |
---|
37 | // message passings between the upper hierarchical object, which |
---|
38 | // is the event manager (G4EventManager), and lower hierarchical |
---|
39 | // objects in the tracking category. It receives one track in an |
---|
40 | // event from the event manager and takes care to finish tracking it. |
---|
41 | // Geant4 kernel use only. |
---|
42 | // |
---|
43 | // Contact: |
---|
44 | // Questions and comments to this code should be sent to |
---|
45 | // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp) |
---|
46 | // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp) |
---|
47 | // |
---|
48 | //--------------------------------------------------------------- |
---|
49 | |
---|
50 | class G4TrackingManager; |
---|
51 | |
---|
52 | #ifndef G4TrackingManager_h |
---|
53 | #define G4TrackingManager_h 1 |
---|
54 | |
---|
55 | #include "globals.hh" // Include from 'global' |
---|
56 | /////#include "G4Hit.hh" // Include from 'Hit/dig' |
---|
57 | #include "G4SteppingManager.hh" // Include from 'tracking' |
---|
58 | #include "G4Track.hh" // Include from 'tracking' |
---|
59 | #include "G4TrackingMessenger.hh" |
---|
60 | #include "G4TrackVector.hh" // Include from 'tracking' |
---|
61 | #include "G4TrackStatus.hh" // Include from 'tracking' |
---|
62 | #include "G4StepStatus.hh" // Include from 'tracking' |
---|
63 | #include "G4UserTrackingAction.hh" // Include from 'tracking' |
---|
64 | #include "G4UserSteppingAction.hh" // Include from 'tracking' |
---|
65 | #include "G4VTrajectory.hh" // Include from 'tracking' |
---|
66 | |
---|
67 | class G4VUserTrackInformation; |
---|
68 | |
---|
69 | //////////////////////// |
---|
70 | class G4TrackingManager |
---|
71 | //////////////////////// |
---|
72 | { |
---|
73 | |
---|
74 | //-------- |
---|
75 | public: // without description |
---|
76 | //-------- |
---|
77 | |
---|
78 | // Constructor/Destructor |
---|
79 | |
---|
80 | G4TrackingManager(); |
---|
81 | // TrackingManger should be dynamic persistent, therefore you |
---|
82 | // need to invoke new() when you call this constructor. |
---|
83 | // "G4SteppingManger' and "G4UserTrackingAction" will be |
---|
84 | // constructed in this constructor. "This" pointer will be |
---|
85 | // passed to "G4UserTrackingAction". |
---|
86 | |
---|
87 | ~G4TrackingManager(); |
---|
88 | |
---|
89 | // Get/Set functions |
---|
90 | |
---|
91 | G4Track* GetTrack() const; |
---|
92 | |
---|
93 | G4int GetStoreTrajectory() const; |
---|
94 | void SetStoreTrajectory(G4int value); |
---|
95 | |
---|
96 | G4SteppingManager* GetSteppingManager() const; |
---|
97 | |
---|
98 | G4UserTrackingAction* GetUserTrackingAction() const; |
---|
99 | |
---|
100 | G4VTrajectory* GimmeTrajectory() const; |
---|
101 | void SetTrajectory(G4VTrajectory* aTrajectory); |
---|
102 | |
---|
103 | G4TrackVector* GimmeSecondaries() const; |
---|
104 | |
---|
105 | // void SetNavigator(G4Navigator* apValue); |
---|
106 | |
---|
107 | void SetUserAction(G4UserTrackingAction* apAction); |
---|
108 | void SetUserAction(G4UserSteppingAction* apAction); |
---|
109 | |
---|
110 | void SetVerboseLevel(G4int vLevel); |
---|
111 | G4int GetVerboseLevel() const; |
---|
112 | |
---|
113 | |
---|
114 | // Other member functions |
---|
115 | |
---|
116 | void ProcessOneTrack(G4Track* apValueG4Track); |
---|
117 | // Invoking this function, a G4Track given by the argument |
---|
118 | // will be tracked. |
---|
119 | |
---|
120 | void EventAborted(); |
---|
121 | // Invoking this function, the current tracking will be |
---|
122 | // aborted immediately. The tracking will return the |
---|
123 | // G4TrackStatus in 'fUserKillTrackAndSecondaries'. |
---|
124 | // By this the EventManager deletes the current track and all |
---|
125 | // its accoicated csecondaries. |
---|
126 | |
---|
127 | void SetUserTrackInformation(G4VUserTrackInformation* aValue); |
---|
128 | // This method can be invoked from the user's G4UserTrackingAction |
---|
129 | // implementation to set his/her own G4VUserTrackInformation concrete |
---|
130 | // class object to a G4Track object. |
---|
131 | |
---|
132 | //--------- |
---|
133 | private: |
---|
134 | //--------- |
---|
135 | |
---|
136 | // Member data |
---|
137 | |
---|
138 | G4Track* fpTrack; |
---|
139 | G4SteppingManager* fpSteppingManager; |
---|
140 | G4UserTrackingAction* fpUserTrackingAction; |
---|
141 | G4VTrajectory* fpTrajectory; |
---|
142 | G4int StoreTrajectory; |
---|
143 | G4int verboseLevel; |
---|
144 | G4TrackingMessenger* messenger; |
---|
145 | G4bool EventIsAborted; |
---|
146 | // verbose |
---|
147 | void TrackBanner(); |
---|
148 | |
---|
149 | }; |
---|
150 | |
---|
151 | |
---|
152 | //******************************************************************* |
---|
153 | // |
---|
154 | // Inline function |
---|
155 | // |
---|
156 | //******************************************************************* |
---|
157 | |
---|
158 | inline G4Track* G4TrackingManager::GetTrack() const { |
---|
159 | return fpTrack; |
---|
160 | } |
---|
161 | |
---|
162 | inline G4int G4TrackingManager::GetStoreTrajectory() const { |
---|
163 | return StoreTrajectory; |
---|
164 | } |
---|
165 | |
---|
166 | inline void G4TrackingManager::SetStoreTrajectory(G4int value){ |
---|
167 | StoreTrajectory = value; |
---|
168 | } |
---|
169 | |
---|
170 | inline G4SteppingManager* G4TrackingManager::GetSteppingManager() const { |
---|
171 | return fpSteppingManager; |
---|
172 | } |
---|
173 | |
---|
174 | inline G4UserTrackingAction* G4TrackingManager::GetUserTrackingAction() const { |
---|
175 | return fpUserTrackingAction; |
---|
176 | } |
---|
177 | |
---|
178 | inline G4VTrajectory* G4TrackingManager::GimmeTrajectory() const { |
---|
179 | return fpTrajectory ; |
---|
180 | } |
---|
181 | |
---|
182 | inline G4TrackVector* G4TrackingManager::GimmeSecondaries() const { |
---|
183 | return fpSteppingManager->GetSecondary(); |
---|
184 | } |
---|
185 | |
---|
186 | inline void G4TrackingManager::SetUserAction(G4UserTrackingAction* apAction){ |
---|
187 | fpUserTrackingAction = apAction; |
---|
188 | if(apAction != NULL){ |
---|
189 | apAction->SetTrackingManagerPointer(this); |
---|
190 | } |
---|
191 | } |
---|
192 | |
---|
193 | inline void G4TrackingManager::SetUserAction(G4UserSteppingAction* apAction){ |
---|
194 | fpSteppingManager->SetUserAction(apAction); |
---|
195 | if(apAction != NULL){ |
---|
196 | apAction->SetSteppingManagerPointer(fpSteppingManager); |
---|
197 | } |
---|
198 | } |
---|
199 | |
---|
200 | inline void G4TrackingManager::SetVerboseLevel(G4int vLevel){ |
---|
201 | verboseLevel = vLevel; |
---|
202 | fpSteppingManager -> SetVerboseLevel( vLevel ); |
---|
203 | } |
---|
204 | |
---|
205 | |
---|
206 | inline G4int G4TrackingManager::GetVerboseLevel() const { |
---|
207 | return verboseLevel; |
---|
208 | } |
---|
209 | |
---|
210 | inline void G4TrackingManager::SetUserTrackInformation(G4VUserTrackInformation* aValue) { |
---|
211 | if(fpTrack) fpTrack->SetUserInformation(aValue); |
---|
212 | } |
---|
213 | |
---|
214 | #endif |
---|