File indexing completed on 2025-01-18 09:59:13
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 #ifndef G4TRACKINGINFORMATION_HH
0047 #define G4TRACKINGINFORMATION_HH
0048
0049 #include "globals.hh"
0050 #include <vector>
0051 #include <map>
0052 #include "G4StepStatus.hh"
0053 #include "G4ThreeVector.hh"
0054 #include "G4TouchableHandle.hh"
0055 #include "G4TrackState.hh"
0056 #include "G4memory.hh"
0057 #include "G4ITStepProcessorState_Lock.hh"
0058
0059 class G4ITStepProcessor;
0060
0061 using G4SelectedAtRestDoItVector = std::vector<G4int>;
0062 using G4SelectedAlongStepDoItVector = std::vector<G4int>;
0063 using G4SelectedPostStepDoItVector = std::vector<G4int>;
0064 using G4SelectedPostStepAtTimeDoItVector = std::vector<G4int>;
0065
0066 class G4Trajectory_Lock;
0067 class G4Track;
0068 struct G4ProcessState_Lock;
0069 class G4TrackingInformation;
0070 class G4SaveNavigatorState_Lock;
0071 struct G4ITNavigatorState_Lock;
0072
0073
0074
0075
0076
0077
0078
0079 class G4TrackingInformation
0080 {
0081 public:
0082 G4TrackingInformation();
0083 ~G4TrackingInformation();
0084
0085
0086
0087
0088
0089
0090 inline bool IsLeadingStep()
0091 {
0092 return fStepLeader;
0093 }
0094 inline void SetLeadingStep(bool value)
0095 {
0096 fStepLeader = value;
0097 }
0098
0099
0100
0101
0102
0103
0104 G4shared_ptr<G4ProcessState_Lock> GetProcessState(size_t index);
0105
0106 inline void RecordProcessState(G4shared_ptr<G4ProcessState_Lock>,
0107 size_t index);
0108
0109
0110
0111 void SetStepProcessorState(G4ITStepProcessorState_Lock*);
0112 G4ITStepProcessorState_Lock* GetStepProcessorState();
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137 G4TrackStateManager& GetTrackStateManager()
0138 {
0139 return fTrackStateManager;
0140 }
0141
0142
0143
0144
0145
0146
0147 inline G4Trajectory_Lock* GetTrajectory_Lock()
0148 {
0149 return fpTrajectory_Lock;
0150 }
0151
0152 inline void SetTrajectory_Lock(G4Trajectory_Lock* trajLock)
0153 {
0154 fpTrajectory_Lock = trajLock;
0155 }
0156
0157 void RecordCurrentPositionNTime(G4Track*);
0158 inline const G4ThreeVector& GetPreStepPosition() const;
0159 inline G4double GetPreStepLocalTime() const;
0160 inline G4double GetPreStepGlobalTime() const;
0161
0162 inline void SetNavigatorState(G4ITNavigatorState_Lock *);
0163 inline G4ITNavigatorState_Lock* GetNavigatorState() const;
0164
0165
0166 protected:
0167
0168 friend class G4ITStepProcessor;
0169
0170 G4bool fStepLeader{false};
0171
0172 G4Trajectory_Lock* fpTrajectory_Lock;
0173
0174 G4TrackStateManager fTrackStateManager;
0175
0176
0177 G4ThreeVector fRecordedTrackPosition;
0178 G4double fRecordedTrackLocalTime;
0179 G4double fRecordedTrackGlobalTime;
0180
0181
0182 G4ITNavigatorState_Lock* fNavigatorState;
0183
0184
0185
0186
0187
0188
0189
0190
0191 std::vector<G4shared_ptr<G4ProcessState_Lock> > fProcessState;
0192
0193
0194 G4ITStepProcessorState_Lock* fpStepProcessorState{nullptr};
0195
0196
0197
0198
0199
0200 G4TrackingInformation(const G4TrackingInformation& other);
0201
0202
0203
0204
0205
0206 G4TrackingInformation& operator=(const G4TrackingInformation& other);
0207 };
0208
0209 inline
0210 void G4TrackingInformation::SetStepProcessorState(G4ITStepProcessorState_Lock* state)
0211 {
0212 fpStepProcessorState = state;
0213 }
0214
0215 inline G4ITStepProcessorState_Lock* G4TrackingInformation::GetStepProcessorState()
0216 {
0217 return fpStepProcessorState;
0218 }
0219
0220
0221
0222
0223
0224
0225
0226
0227 inline
0228 void G4TrackingInformation::RecordProcessState(G4shared_ptr<G4ProcessState_Lock> state,
0229 size_t index)
0230 {
0231
0232 fProcessState[index] = state;
0233 }
0234
0235 inline G4double G4TrackingInformation::GetPreStepGlobalTime() const
0236 {
0237 return fRecordedTrackGlobalTime;
0238 }
0239
0240 inline G4double G4TrackingInformation::GetPreStepLocalTime() const
0241 {
0242 return fRecordedTrackLocalTime;
0243 }
0244
0245 inline const G4ThreeVector& G4TrackingInformation::GetPreStepPosition() const
0246 {
0247 return fRecordedTrackPosition;
0248 }
0249
0250 inline void G4TrackingInformation::SetNavigatorState(G4ITNavigatorState_Lock* state)
0251 {
0252
0253 fNavigatorState = state;
0254 }
0255
0256 inline G4ITNavigatorState_Lock* G4TrackingInformation::GetNavigatorState() const
0257 {
0258 return fNavigatorState;
0259 }
0260
0261 #endif