Geant4-11
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
G4IT Class Referenceabstract

#include <G4IT.hh>

Inheritance diagram for G4IT:
G4VUserTrackInformation G4Molecule

Public Member Functions

virtual G4bool diff (const G4IT &right) const =0
 
virtual G4bool equal (const G4IT &right) const =0
 
 G4IT ()
 
 G4IT (G4Track *)
 
const G4ITBoxGetITBox () const
 
virtual G4ITType GetITSubType () const
 
virtual const G4ITType GetITType () const =0
 
G4TrackListNodeGetListNode ()
 
virtual const G4StringGetName () const =0
 
G4ITGetNext ()
 
const G4ITGetNext () const
 
G4KDNode_BaseGetNode () const
 
void GetParentID (int &, int &)
 
const G4ThreeVectorGetPosition () const
 
G4double GetPreStepGlobalTime () const
 
G4double GetPreStepLocalTime () const
 
const G4ThreeVectorGetPreStepPosition () const
 
G4ITGetPrevious ()
 
const G4ITGetPrevious () const
 
G4TrackGetTrack ()
 
const G4TrackGetTrack () const
 
G4TrackingInformationGetTrackingInfo ()
 
const G4StringGetType () const
 
G4bool operator!= (const G4IT &right) const
 
G4bool operator< (const G4IT &right) const
 
G4bool operator== (const G4IT &right) const
 
double operator[] (int i) const
 
virtual void Print () const
 
void RecordCurrentPositionNTime ()
 
void SetITBox (G4ITBox *)
 
void SetListNode (G4TrackListNode *node)
 
void SetNext (G4IT *)
 
void SetNode (G4KDNode_Base *)
 
void SetParentID (int, int)
 
void SetPrevious (G4IT *)
 
void SetTrack (G4Track *)
 
void TakeOutBox ()
 
virtual ~G4IT ()
 

Protected Member Functions

 G4IT (const G4IT &)
 
G4IToperator= (const G4IT &)
 

Protected Attributes

G4TrackfpTrack
 
G4StringpType = nullptr
 

Private Attributes

int fParentID_A
 
int fParentID_B
 
G4ITBoxfpITBox
 
G4KDNode_BasefpKDNode
 
G4ITfpNextIT
 
G4ITfpPreviousIT
 
G4TrackingInformationfpTrackingInformation
 
G4TrackListNodefpTrackNode
 

Detailed Description

G4IT is a interface which allows the inheriting object to be tracked using G4ITStepProcessor The inheriting class must implement the operator < , == and != in order to enable the sorting out. also the concrete header of MyIT ("MyIt.hh") should contain : ITDef(MyIT) and the source of MyIT.cc : ITImp(MyIT)

Definition at line 87 of file G4IT.hh.

Constructor & Destructor Documentation

◆ G4IT() [1/3]

G4IT::G4IT ( )

Definition at line 67 of file G4IT.cc.

67 :
69 fpTrack(nullptr),
70 fpPreviousIT(nullptr),
71 fpNextIT(nullptr),
73{
74 fpITBox = nullptr;
75 fpKDNode = nullptr;
76 fpTrackNode = nullptr;
77 fParentID_A = 0;
78 fParentID_B = 0;
79}
G4IT * fpPreviousIT
Definition: G4IT.hh:171
G4IT * fpNextIT
Definition: G4IT.hh:172
G4ITBox * fpITBox
Definition: G4IT.hh:170
G4Track * fpTrack
Definition: G4IT.hh:167
G4TrackingInformation * fpTrackingInformation
Definition: G4IT.hh:178
G4TrackListNode * fpTrackNode
Definition: G4IT.hh:179
int fParentID_A
Definition: G4IT.hh:175
int fParentID_B
Definition: G4IT.hh:176
G4KDNode_Base * fpKDNode
Definition: G4IT.hh:173

References fParentID_A, fParentID_B, fpITBox, fpKDNode, and fpTrackNode.

◆ G4IT() [2/3]

G4IT::G4IT ( G4Track aTrack)

Definition at line 124 of file G4IT.cc.

124 :
126 fpPreviousIT(0),
127 fpNextIT(0),
129{
130 fpITBox = 0;
131 fpTrack = aTrack;
132 fpKDNode = nullptr;
133 fpTrackNode = nullptr;
134 fParentID_A = 0;
135 fParentID_B = 0;
137}
void RecordCurrentPositionNTime()
Definition: G4IT.cc:220

References fParentID_A, fParentID_B, fpITBox, fpKDNode, fpTrack, fpTrackNode, and RecordCurrentPositionNTime().

◆ ~G4IT()

G4IT::~G4IT ( )
virtual

Definition at line 160 of file G4IT.cc.

161{
162 TakeOutBox();
163
165 {
167 fpTrackingInformation = nullptr;
168 }
169
170// Note :
171// G4ITTrackingManager will delete fTrackNode.
172// fKDNode will be deleted when the KDTree is rebuilt
173}
void TakeOutBox()
Definition: G4IT.cc:139

References fpTrackingInformation, and TakeOutBox().

◆ G4IT() [3/3]

G4IT::G4IT ( const G4IT )
protected

Definition at line 82 of file G4IT.cc.

82 :
84 fpTrack(nullptr),
85 fpPreviousIT(nullptr),
86 fpNextIT(nullptr),
88{
89 fpITBox = nullptr;
90 fpKDNode = nullptr;
91 fpTrackNode = nullptr;
92 fParentID_A = 0;
93 fParentID_B = 0;
94}

References fParentID_A, fParentID_B, fpITBox, fpKDNode, and fpTrackNode.

Member Function Documentation

◆ diff()

virtual G4bool G4IT::diff ( const G4IT right) const
pure virtual

Referenced by operator<().

◆ equal()

virtual G4bool G4IT::equal ( const G4IT right) const
pure virtual

Referenced by operator==().

◆ GetITBox()

const G4ITBox * G4IT::GetITBox ( ) const
inline

Definition at line 183 of file G4IT.hh.

184{
185 return fpITBox;
186}

References fpITBox.

◆ GetITSubType()

virtual G4ITType G4IT::GetITSubType ( ) const
inlinevirtual

Reimplemented in G4Molecule.

Definition at line 159 of file G4IT.hh.

160 {
161 return 0;
162 }

Referenced by G4ITTrackHolder::PushDelayed(), and G4ITTrackHolder::PushTo().

◆ GetITType()

virtual const G4ITType G4IT::GetITType ( ) const
pure virtual

◆ GetListNode()

G4TrackListNode * G4IT::GetListNode ( )
inline

Definition at line 148 of file G4IT.hh.

149 {
150 return fpTrackNode;
151 }

References fpTrackNode.

◆ GetName()

virtual const G4String & G4IT::GetName ( ) const
pure virtual

◆ GetNext() [1/2]

G4IT * G4IT::GetNext ( )
inline

Definition at line 208 of file G4IT.hh.

209{
210 return fpNextIT;
211}

References fpNextIT.

Referenced by G4ITBox::Extract(), G4ITBox::TransferTo(), and G4ITBox::~G4ITBox().

◆ GetNext() [2/2]

const G4IT * G4IT::GetNext ( ) const
inline

Definition at line 245 of file G4IT.hh.

246{
247 return fpNextIT;
248}

References fpNextIT.

◆ GetNode()

G4KDNode_Base * G4IT::GetNode ( ) const
inline

Definition at line 255 of file G4IT.hh.

256{
257 return fpKDNode;
258}

References fpKDNode.

◆ GetParentID()

void G4IT::GetParentID ( int &  p_a,
int &  p_b 
)
inline

Definition at line 234 of file G4IT.hh.

235{
236 p_a = fParentID_A;
237 p_b = fParentID_B;
238}

References fParentID_A, and fParentID_B.

◆ GetPosition()

const G4ThreeVector & G4IT::GetPosition ( ) const

Definition at line 214 of file G4IT.cc.

215{
216 if (fpTrack) return GetTrack()->GetPosition();
217 return *(new G4ThreeVector());
218}
CLHEP::Hep3Vector G4ThreeVector
G4Track * GetTrack()
Definition: G4IT.hh:218
const G4ThreeVector & GetPosition() const

References fpTrack, G4Track::GetPosition(), and GetTrack().

◆ GetPreStepGlobalTime()

G4double G4IT::GetPreStepGlobalTime ( ) const

Definition at line 228 of file G4IT.cc.

229{
231}
G4double GetPreStepGlobalTime() const

References fpTrackingInformation, and G4TrackingInformation::GetPreStepGlobalTime().

◆ GetPreStepLocalTime()

G4double G4IT::GetPreStepLocalTime ( ) const

Definition at line 233 of file G4IT.cc.

234{
236}
G4double GetPreStepLocalTime() const

References fpTrackingInformation, and G4TrackingInformation::GetPreStepLocalTime().

◆ GetPreStepPosition()

const G4ThreeVector & G4IT::GetPreStepPosition ( ) const

Definition at line 238 of file G4IT.cc.

239{
241}
const G4ThreeVector & GetPreStepPosition() const

References fpTrackingInformation, and G4TrackingInformation::GetPreStepPosition().

◆ GetPrevious() [1/2]

G4IT * G4IT::GetPrevious ( )
inline

Definition at line 203 of file G4IT.hh.

204{
205 return fpPreviousIT;
206}

References fpPreviousIT.

Referenced by G4ITBox::Extract(), and G4ITBox::FindIT().

◆ GetPrevious() [2/2]

const G4IT * G4IT::GetPrevious ( ) const
inline

Definition at line 240 of file G4IT.hh.

241{
242 return fpPreviousIT;
243}

References fpPreviousIT.

◆ GetTrack() [1/2]

G4Track * G4IT::GetTrack ( )
inline

◆ GetTrack() [2/2]

const G4Track * G4IT::GetTrack ( ) const
inline

Definition at line 223 of file G4IT.hh.

224{
225 return fpTrack;
226}

References fpTrack.

◆ GetTrackingInfo()

G4TrackingInformation * G4IT::GetTrackingInfo ( )
inline

◆ GetType()

const G4String & G4VUserTrackInformation::GetType ( ) const
inherited

Definition at line 75 of file G4VUserTrackInformation.cc.

76{
77 static const G4String NOTYPE = "NONE";
78 if(pType != nullptr)
79 return *pType;
80 else
81 return NOTYPE;
82}

References G4VUserTrackInformation::pType.

Referenced by G4ScintillationTrackInformation::IsScintillationTrackInformation().

◆ operator!=()

G4bool G4IT::operator!= ( const G4IT right) const

Definition at line 202 of file G4IT.cc.

203{
204 return !(this->operator==(right));
205}
G4bool operator==(const G4IT &right) const
Definition: G4IT.cc:193

References operator==().

◆ operator<()

G4bool G4IT::operator< ( const G4IT right) const

Definition at line 180 of file G4IT.cc.

181{
182 if (GetITType() == right.GetITType())
183 {
184 return (this->diff(right));
185 }
186 else
187 {
188 return (GetITType() < right.GetITType());
189 }
190 return false;
191}
virtual const G4ITType GetITType() const =0
virtual G4bool diff(const G4IT &right) const =0

References diff(), and GetITType().

◆ operator=()

G4IT & G4IT::operator= ( const G4IT right)
protected

Definition at line 97 of file G4IT.cc.

98{
99 G4ExceptionDescription exceptionDescription;
100 exceptionDescription
101 << "The assignment operator of G4IT should not be used, "
102 "this feature is not supported."
103 << "If really needed, please contact the developers.";
104 G4Exception("G4IT::operator=(const G4IT& right)",
105 "G4IT001",
107 exceptionDescription);
108
109 if (this == &right) return *this;
110
111 fpTrack = nullptr;
112 fpITBox = nullptr;
113 fpPreviousIT = nullptr;
114 fpNextIT = nullptr;
115 fpKDNode = nullptr;
116 fParentID_A = 0;
117 fParentID_B = 0;
118 fpTrackingInformation = nullptr;
119 fpTrackNode = nullptr;
120
121 return *this;
122}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40

References FatalException, fParentID_A, fParentID_B, fpITBox, fpKDNode, fpNextIT, fpPreviousIT, fpTrack, fpTrackingInformation, fpTrackNode, and G4Exception().

◆ operator==()

G4bool G4IT::operator== ( const G4IT right) const

Definition at line 193 of file G4IT.cc.

194{
195 if (GetITType() == right.GetITType())
196 {
197 return this->equal(right);
198 }
199 return false;
200}
virtual G4bool equal(const G4IT &right) const =0

References equal(), and GetITType().

Referenced by operator!=().

◆ operator[]()

double G4IT::operator[] ( int  i) const

Definition at line 207 of file G4IT.cc.

208{
209 return fpTrack->GetPosition()[i];
210}

References fpTrack, and G4Track::GetPosition().

◆ Print()

virtual void G4IT::Print ( ) const
inlinevirtual

Reimplemented from G4VUserTrackInformation.

Definition at line 97 of file G4IT.hh.

98 {
99 ;
100 }

◆ RecordCurrentPositionNTime()

void G4IT::RecordCurrentPositionNTime ( )

Definition at line 220 of file G4IT.cc.

221{
222 if (fpTrack)
223 {
225 }
226}
void RecordCurrentPositionNTime(G4Track *)

References fpTrack, fpTrackingInformation, and G4TrackingInformation::RecordCurrentPositionNTime().

Referenced by G4IT().

◆ SetITBox()

void G4IT::SetITBox ( G4ITBox aITBox)
inline

Definition at line 188 of file G4IT.hh.

189{
190 fpITBox = aITBox;
191}

References fpITBox.

Referenced by G4ITBox::Extract(), and G4ITBox::Push().

◆ SetListNode()

void G4IT::SetListNode ( G4TrackListNode node)
inline

Definition at line 152 of file G4IT.hh.

153 {
154 fpTrackNode = node;
155 }

References fpTrackNode.

◆ SetNext()

void G4IT::SetNext ( G4IT aIT)
inline

Definition at line 198 of file G4IT.hh.

199{
200 fpNextIT = aIT;
201}

References fpNextIT.

Referenced by G4ITBox::Extract(), and G4ITBox::Push().

◆ SetNode()

void G4IT::SetNode ( G4KDNode_Base aNode)
inline

Definition at line 250 of file G4IT.hh.

251{
252 fpKDNode = aNode;
253}

References fpKDNode.

◆ SetParentID()

void G4IT::SetParentID ( int  p_a,
int  p_b 
)
inline

Definition at line 228 of file G4IT.hh.

229{
230 fParentID_A = p_a;
231 fParentID_B = p_b;
232}

References fParentID_A, and fParentID_B.

Referenced by G4ITModelProcessor::ComputeTrackReaction().

◆ SetPrevious()

void G4IT::SetPrevious ( G4IT aIT)
inline

Definition at line 193 of file G4IT.hh.

194{
195 fpPreviousIT = aIT;
196}

References fpPreviousIT.

Referenced by G4ITBox::Extract(), and G4ITBox::Push().

◆ SetTrack()

void G4IT::SetTrack ( G4Track track)
inline

Definition at line 213 of file G4IT.hh.

214{
215 fpTrack = track;
216}

References fpTrack.

◆ TakeOutBox()

void G4IT::TakeOutBox ( )

Definition at line 139 of file G4IT.cc.

140{
141 if(fpITBox)
142 {
143 fpITBox->Extract(this);
144 fpITBox = nullptr;
145 }
146
147 if(fpTrackNode)
148 {
149 delete fpTrackNode;
150 fpTrackNode = nullptr;
151 }
152
153 if(fpKDNode)
154 {
156 fpKDNode = nullptr;
157 }
158}
void InactiveNode(G4KDNode_Base *)
Definition: G4KDNode.cc:57
void Extract(G4IT *)
Definition: G4ITBox.cc:86

References G4ITBox::Extract(), fpITBox, fpKDNode, fpTrackNode, and InactiveNode().

Referenced by ~G4IT().

Field Documentation

◆ fParentID_A

int G4IT::fParentID_A
private

Definition at line 175 of file G4IT.hh.

Referenced by G4IT(), GetParentID(), operator=(), and SetParentID().

◆ fParentID_B

int G4IT::fParentID_B
private

Definition at line 176 of file G4IT.hh.

Referenced by G4IT(), GetParentID(), operator=(), and SetParentID().

◆ fpITBox

G4ITBox* G4IT::fpITBox
private

Definition at line 170 of file G4IT.hh.

Referenced by G4IT(), GetITBox(), operator=(), SetITBox(), and TakeOutBox().

◆ fpKDNode

G4KDNode_Base* G4IT::fpKDNode
private

Definition at line 173 of file G4IT.hh.

Referenced by G4IT(), GetNode(), operator=(), SetNode(), and TakeOutBox().

◆ fpNextIT

G4IT* G4IT::fpNextIT
private

Definition at line 172 of file G4IT.hh.

Referenced by GetNext(), operator=(), and SetNext().

◆ fpPreviousIT

G4IT* G4IT::fpPreviousIT
private

Definition at line 171 of file G4IT.hh.

Referenced by GetPrevious(), operator=(), and SetPrevious().

◆ fpTrack

G4Track* G4IT::fpTrack
protected

◆ fpTrackingInformation

G4TrackingInformation* G4IT::fpTrackingInformation
private

◆ fpTrackNode

G4TrackListNode* G4IT::fpTrackNode
private

Definition at line 179 of file G4IT.hh.

Referenced by G4IT(), GetListNode(), operator=(), SetListNode(), and TakeOutBox().

◆ pType

G4String* G4VUserTrackInformation::pType = nullptr
protectedinherited

The documentation for this class was generated from the following files: