File indexing completed on 2025-01-18 09:58:32
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 G4IT_h
0047 #define G4IT_h 1
0048
0049 #include "globals.hh"
0050 #include "G4ITType.hh"
0051 #include "G4ThreeVector.hh"
0052 #include "G4VUserTrackInformation.hh"
0053 #include "G4KDNode.hh"
0054
0055
0056
0057
0058
0059
0060
0061
0062 class G4IT;
0063 template<>
0064 G4KDNode<G4IT>::~G4KDNode();
0065
0066 class G4TrackingInformation;
0067
0068 class G4KDNode_Base;
0069 class G4ITBox;
0070 class G4Track;
0071
0072 G4IT* GetIT(const G4Track* track);
0073 G4IT* GetIT(const G4Track& track);
0074
0075 template<class OBJECT> class G4FastListNode;
0076 using G4TrackListNode = G4FastListNode<G4Track>;
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087 class G4IT : public virtual G4VUserTrackInformation
0088 {
0089 public:
0090 G4IT();
0091 G4IT(G4Track*);
0092 ~G4IT() override;
0093
0094
0095
0096
0097 void Print() const override
0098 {
0099 ;
0100 }
0101 virtual const G4String& GetName() const = 0;
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111 virtual G4bool diff(const G4IT& right) const = 0;
0112 virtual G4bool equal(const G4IT& right) const = 0;
0113 G4bool operator<(const G4IT& right) const;
0114 G4bool operator==(const G4IT& right) const;
0115 G4bool operator!=(const G4IT& right) const;
0116
0117 void SetTrack(G4Track*);
0118 inline G4Track* GetTrack();
0119 inline const G4Track* GetTrack() const;
0120
0121 void RecordCurrentPositionNTime();
0122 const G4ThreeVector& GetPosition() const;
0123 double operator[](int i) const;
0124 const G4ThreeVector& GetPreStepPosition() const;
0125 G4double GetPreStepLocalTime() const;
0126 G4double GetPreStepGlobalTime() const;
0127
0128 inline void SetPrevious(G4IT*);
0129 inline void SetNext(G4IT*);
0130 inline G4IT* GetPrevious();
0131 inline G4IT* GetNext();
0132 inline const G4IT* GetPrevious() const;
0133 inline const G4IT* GetNext() const;
0134 inline void SetITBox(G4ITBox*);
0135 inline const G4ITBox* GetITBox() const;
0136 void TakeOutBox();
0137 inline void SetNode(G4KDNode_Base*);
0138 inline G4KDNode_Base* GetNode() const;
0139
0140 inline void SetParentID(int, int);
0141 inline void GetParentID(int&, int&);
0142
0143 inline G4TrackingInformation* GetTrackingInfo()
0144 {
0145 return fpTrackingInformation;
0146 }
0147
0148 inline G4TrackListNode* GetListNode()
0149 {
0150 return fpTrackNode;
0151 }
0152 inline void SetListNode(G4TrackListNode* node)
0153 {
0154 fpTrackNode = node;
0155 }
0156
0157 virtual const G4ITType GetITType() const = 0;
0158
0159 virtual G4ITType GetITSubType() const
0160 {
0161 return 0;
0162 }
0163
0164 protected:
0165 G4IT(const G4IT&);
0166 G4IT& operator=(const G4IT&);
0167 G4Track* fpTrack;
0168
0169 private:
0170 G4ITBox * fpITBox;
0171 G4IT* fpPreviousIT;
0172 G4IT* fpNextIT;
0173 G4KDNode_Base* fpKDNode;
0174
0175 int fParentID_A;
0176 int fParentID_B;
0177
0178 G4TrackingInformation* fpTrackingInformation;
0179 G4TrackListNode* fpTrackNode;
0180 };
0181
0182
0183 inline const G4ITBox* G4IT::GetITBox() const
0184 {
0185 return fpITBox;
0186 }
0187
0188 inline void G4IT::SetITBox(G4ITBox * aITBox)
0189 {
0190 fpITBox = aITBox;
0191 }
0192
0193 inline void G4IT::SetPrevious(G4IT* aIT)
0194 {
0195 fpPreviousIT = aIT;
0196 }
0197
0198 inline void G4IT::SetNext(G4IT* aIT)
0199 {
0200 fpNextIT = aIT;
0201 }
0202
0203 inline G4IT* G4IT::GetPrevious()
0204 {
0205 return fpPreviousIT;
0206 }
0207
0208 inline G4IT* G4IT::GetNext()
0209 {
0210 return fpNextIT;
0211 }
0212
0213 inline void G4IT::SetTrack(G4Track* track)
0214 {
0215 fpTrack = track;
0216 }
0217
0218 inline G4Track* G4IT::GetTrack()
0219 {
0220 return fpTrack;
0221 }
0222
0223 inline const G4Track* G4IT::GetTrack() const
0224 {
0225 return fpTrack;
0226 }
0227
0228 inline void G4IT::SetParentID(int p_a, int p_b)
0229 {
0230 fParentID_A = p_a;
0231 fParentID_B = p_b;
0232 }
0233
0234 inline void G4IT::GetParentID(int& p_a, int&p_b)
0235 {
0236 p_a = fParentID_A;
0237 p_b = fParentID_B;
0238 }
0239
0240 inline const G4IT* G4IT::GetPrevious() const
0241 {
0242 return fpPreviousIT;
0243 }
0244
0245 inline const G4IT* G4IT::GetNext() const
0246 {
0247 return fpNextIT;
0248 }
0249
0250 inline void G4IT::SetNode(G4KDNode_Base* aNode)
0251 {
0252 fpKDNode = aNode;
0253 }
0254
0255 inline G4KDNode_Base* G4IT::GetNode() const
0256 {
0257 return fpKDNode;
0258 }
0259 #endif