Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4IT Class Referenceabstract

#include <G4IT.hh>

+ Inheritance diagram for G4IT:

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

G4TrackfpTrack
 
- Protected Attributes inherited from G4VUserTrackInformation
G4StringpType = nullptr
 

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),
72 fpTrackingInformation(new G4TrackingInformation())
73{
74 fpITBox = nullptr;
75 fpKDNode = nullptr;
76 fpTrackNode = nullptr;
77 fParentID_A = 0;
78 fParentID_B = 0;
79}
G4Track * fpTrack
Definition G4IT.hh:167
G4VUserTrackInformation()=default

◆ G4IT() [2/3]

G4IT::G4IT ( G4Track * aTrack)

Definition at line 124 of file G4IT.cc.

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

◆ ~G4IT()

G4IT::~G4IT ( )
override

Definition at line 160 of file G4IT.cc.

161{
162 TakeOutBox();
163
164 if(fpTrackingInformation != nullptr)
165 {
166 delete fpTrackingInformation;
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

◆ 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),
87 fpTrackingInformation(new G4TrackingInformation())
88{
89 fpITBox = nullptr;
90 fpKDNode = nullptr;
91 fpTrackNode = nullptr;
92 fParentID_A = 0;
93 fParentID_B = 0;
94}

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}

◆ 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 }

Referenced by G4FastList< OBJECT >::__GetNode(), G4FastList< OBJECT >::Flag(), G4FastList< OBJECT >::GetList(), and G4FastList< OBJECT >::GetNode().

◆ GetName()

◆ GetNext() [1/2]

G4IT * G4IT::GetNext ( )
inline

Definition at line 208 of file G4IT.hh.

209{
210 return fpNextIT;
211}

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}

◆ GetNode()

G4KDNode_Base * G4IT::GetNode ( ) const
inline

Definition at line 255 of file G4IT.hh.

256{
257 return fpKDNode;
258}

◆ 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}

◆ GetPosition()

const G4ThreeVector & G4IT::GetPosition ( ) const

Definition at line 212 of file G4IT.cc.

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

◆ GetPreStepGlobalTime()

G4double G4IT::GetPreStepGlobalTime ( ) const

Definition at line 226 of file G4IT.cc.

227{
228 return fpTrackingInformation->GetPreStepGlobalTime();
229}
G4double GetPreStepGlobalTime() const

◆ GetPreStepLocalTime()

G4double G4IT::GetPreStepLocalTime ( ) const

Definition at line 231 of file G4IT.cc.

232{
233 return fpTrackingInformation->GetPreStepLocalTime();
234}
G4double GetPreStepLocalTime() const

◆ GetPreStepPosition()

const G4ThreeVector & G4IT::GetPreStepPosition ( ) const

Definition at line 236 of file G4IT.cc.

237{
238 return fpTrackingInformation->GetPreStepPosition();
239}
const G4ThreeVector & GetPreStepPosition() const

◆ GetPrevious() [1/2]

G4IT * G4IT::GetPrevious ( )
inline

Definition at line 203 of file G4IT.hh.

204{
205 return fpPreviousIT;
206}

Referenced by G4ITBox::Extract(), G4ITBox::FindIT(), 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}

◆ GetTrack() [1/2]

G4Track * G4IT::GetTrack ( )
inline

Definition at line 218 of file G4IT.hh.

219{
220 return fpTrack;
221}

Referenced by G4ITStepProcessor::FindTransportationStep(), and GetPosition().

◆ GetTrack() [2/2]

const G4Track * G4IT::GetTrack ( ) const
inline

Definition at line 223 of file G4IT.hh.

224{
225 return fpTrack;
226}

◆ GetTrackingInfo()

◆ operator!=()

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

Definition at line 200 of file G4IT.cc.

201{
202 return !(this->operator==(right));
203}
G4bool operator==(const G4IT &right) const
Definition G4IT.cc:191

◆ 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
187 return (GetITType() < right.GetITType());
188
189}
virtual const G4ITType GetITType() const =0
virtual G4bool diff(const G4IT &right) const =0

◆ 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)
std::ostringstream G4ExceptionDescription

◆ operator==()

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

Definition at line 191 of file G4IT.cc.

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

Referenced by operator!=().

◆ operator[]()

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

Definition at line 205 of file G4IT.cc.

206{
207 return fpTrack->GetPosition()[i];
208}

◆ Print()

void G4IT::Print ( ) const
inlineoverridevirtual

Reimplemented from G4VUserTrackInformation.

Definition at line 97 of file G4IT.hh.

98 {
99 ;
100 }

◆ RecordCurrentPositionNTime()

void G4IT::RecordCurrentPositionNTime ( )

Definition at line 218 of file G4IT.cc.

219{
220 if (fpTrack != nullptr)
221 {
222 fpTrackingInformation->RecordCurrentPositionNTime(fpTrack);
223 }
224}
void RecordCurrentPositionNTime(G4Track *)

Referenced by G4IT().

◆ SetITBox()

void G4IT::SetITBox ( G4ITBox * aITBox)
inline

Definition at line 188 of file G4IT.hh.

189{
190 fpITBox = aITBox;
191}

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 }

Referenced by G4FastListNode< OBJECT >::DetachYourSelf(), and G4FastList< OBJECT >::Flag().

◆ SetNext()

void G4IT::SetNext ( G4IT * aIT)
inline

Definition at line 198 of file G4IT.hh.

199{
200 fpNextIT = aIT;
201}

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}

Referenced by G4KDNode< PointT >::~G4KDNode().

◆ 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}

Referenced by G4ITModelProcessor::ComputeTrackReaction().

◆ SetPrevious()

void G4IT::SetPrevious ( G4IT * aIT)
inline

Definition at line 193 of file G4IT.hh.

194{
195 fpPreviousIT = aIT;
196}

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}

◆ TakeOutBox()

void G4IT::TakeOutBox ( )

Definition at line 139 of file G4IT.cc.

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

Referenced by ~G4IT().

Member Data Documentation

◆ fpTrack


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