Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4TrackingInformation.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// Author: Mathieu Karamitros
28
29// The code is developed in the framework of the ESA AO7146
30//
31// We would be very happy hearing from you, send us your feedback! :)
32//
33// In order for Geant4-DNA to be maintained and still open-source,
34// article citations are crucial.
35// If you use Geant4-DNA chemistry and you publish papers about your software,
36// in addition to the general paper on Geant4-DNA:
37//
38// Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
39//
40// we would be very happy if you could please also cite the following
41// reference papers on chemistry:
42//
43// J. Comput. Phys. 274 (2014) 841-882
44// Prog. Nucl. Sci. Tec. 2 (2011) 503-508
45
46#ifndef G4TRACKINGINFORMATION_HH
47#define G4TRACKINGINFORMATION_HH
48
49#include "globals.hh"
50#include <vector>
51#include <map>
52#include "G4StepStatus.hh"
53#include "G4ThreeVector.hh"
54#include "G4TouchableHandle.hh"
55#include "G4TrackState.hh"
56#include "G4memory.hh"
58
60
61typedef std::vector<G4int> G4SelectedAtRestDoItVector;
62typedef std::vector<G4int> G4SelectedAlongStepDoItVector;
63typedef std::vector<G4int> G4SelectedPostStepDoItVector;
64typedef std::vector<G4int> G4SelectedPostStepAtTimeDoItVector;
65
66class G4Trajectory_Lock;
67class G4Track;
70class G4SaveNavigatorState_Lock;
71struct G4ITNavigatorState_Lock;
72
73/** The class G4TrackingInformation (hold by G4IT)
74 * emcompasses processes informations computed
75 * at the PS/AS/AtRest/InteractionLength stage,
76 * and also, the selection of processes for the
77 * given step.
78 */
80{
81public:
84
85 //________________________________________________
86 /** If the track is the one having the minimum step time,
87 * then it "leads" the step. It will interact will all the
88 * other tracks will be transported.
89 */
90 inline bool IsLeadingStep()
91 {
92 return fStepLeader;
93 }
94 inline void SetLeadingStep(bool value)
95 {
96 fStepLeader = value;
97 }
98
99 //________________________________________________
100 /** Every process should store the information
101 * computed at the InteractionLegth stage in the track.
102 */
103
104 G4shared_ptr<G4ProcessState_Lock> GetProcessState(size_t index);
105
106 inline void RecordProcessState(G4shared_ptr<G4ProcessState_Lock>,
107 size_t index);
108
109 //___________________________________________________
110
113
114 /*
115 std::map<int,G4VTrackStateHandle> fTrackStates;
116 std::map<void*,G4VTrackStateHandle> fMultipleTrackStates;
117
118 void SetTrackState(void* adress, G4VTrackStateHandle state)
119 {
120 fMultipleTrackStates[adress] = state;
121 }
122 G4VTrackStateHandle GetTrackState(void* adress)
123 {
124 return fMultipleTrackStates[adress];
125 }
126
127 void SetTrackState(G4VTrackStateHandle state)
128 {
129 fTrackStates[state->GetID()] = state;
130 }
131 template<typename T> G4VTrackStateHandle GetTrackState()
132 {
133 return fTrackStates[G4TrackStateID<T>::GetID()] ;
134 }
135 */
136
138 {
139 return fTrackStateManager;
140 }
141 /*
142 G4TrackStateManager& GetTrackStateManager() const
143 {
144 return fTrackStateManager;
145 }
146 */
147 inline G4Trajectory_Lock* GetTrajectory_Lock()
148 {
149 return fpTrajectory_Lock;
150 }
151
152 inline void SetTrajectory_Lock(G4Trajectory_Lock* trajLock)
153 {
154 fpTrajectory_Lock = trajLock;
155 }
156
158 inline const G4ThreeVector& GetPreStepPosition() const;
159 inline G4double GetPreStepLocalTime() const;
160 inline G4double GetPreStepGlobalTime() const;
161
162 inline void SetNavigatorState(G4ITNavigatorState_Lock *);
163 inline G4ITNavigatorState_Lock* GetNavigatorState() const;
164
165 //-------------
166protected:
167 //-------------
168 friend class G4ITStepProcessor;
169 //_______________________________________________________
171 //_______________________________________________________
172 G4Trajectory_Lock* fpTrajectory_Lock;
173
175
176 //_______________________________________________________
180
181 //_______________________________________________________
182 G4ITNavigatorState_Lock* fNavigatorState;
183// G4SaveNavigatorState_Lock* fNavigatorState;
184
185//_______________________________________________________
186 /** Holds the information related to processes
187 * Indexed on GetPhysIntVector
188 * (cf. G4ITStepProcessor header)
189 */
190// std::vector<G4ProcessState_Lock*> fProcessState;
191 std::vector<G4shared_ptr<G4ProcessState_Lock> > fProcessState;
192
193 //_______________________________________________________
195
196 //_______________________________________________________
197 /** Copy constructor
198 * \param other Object to copy from
199 */
201
202 /** Assignment operator
203 * \param other Object to assign from
204 * \return A reference to this
205 */
207};
208
209inline
211{
212 fpStepProcessorState = state;
213}
214
216{
218}
219/*
220 inline void G4TrackingInformation::RecordProcessState(G4ProcessState_Lock* state,
221 size_t index)
222 {
223 // G4cout << "G4TrackingInformation::RecordProcessState" << G4endl;
224 fProcessState[index] = state;
225 }*/
226
227inline
228void G4TrackingInformation::RecordProcessState(G4shared_ptr<G4ProcessState_Lock> state,
229 size_t index)
230{
231 // G4cout << "G4TrackingInformation::RecordProcessState" << G4endl;
232 fProcessState[index] = state;
233}
234
236{
238}
239
241{
243}
244
246{
248}
249
250inline void G4TrackingInformation::SetNavigatorState(G4ITNavigatorState_Lock* state)
251{
252 // G4cout << "Set Navigator state : " << state << G4endl;
253 fNavigatorState = state;
254}
255
256inline G4ITNavigatorState_Lock* G4TrackingInformation::GetNavigatorState() const
257{
258 return fNavigatorState;
259}
260
261#endif // G4TRACKINGINFORMATION_HH
std::vector< G4int > G4SelectedPostStepAtTimeDoItVector
std::vector< G4int > G4SelectedAlongStepDoItVector
std::vector< G4int > G4SelectedAtRestDoItVector
std::vector< G4int > G4SelectedPostStepDoItVector
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
void SetTrajectory_Lock(G4Trajectory_Lock *trajLock)
G4TrackStateManager fTrackStateManager
std::vector< G4shared_ptr< G4ProcessState_Lock > > fProcessState
G4shared_ptr< G4ProcessState_Lock > GetProcessState(size_t index)
G4TrackStateManager & GetTrackStateManager()
G4ITStepProcessorState_Lock * fpStepProcessorState
void SetStepProcessorState(G4ITStepProcessorState_Lock *)
G4ITNavigatorState_Lock * fNavigatorState
G4double GetPreStepLocalTime() const
void RecordProcessState(G4shared_ptr< G4ProcessState_Lock >, size_t index)
G4double GetPreStepGlobalTime() const
void SetNavigatorState(G4ITNavigatorState_Lock *)
G4ITStepProcessorState_Lock * GetStepProcessorState()
G4Trajectory_Lock * fpTrajectory_Lock
void RecordCurrentPositionNTime(G4Track *)
G4TrackingInformation & operator=(const G4TrackingInformation &other)
void SetLeadingStep(bool value)
G4ITNavigatorState_Lock * GetNavigatorState() const
G4Trajectory_Lock * GetTrajectory_Lock()
const G4ThreeVector & GetPreStepPosition() const