4 #ifndef __KVGEONODEITERATOR_H
5 #define __KVGEONODEITERATOR_H
8 #include "KVGeoDetectorNode.h"
9 #include "KVGeoDNTrajectory.h"
41 TIter* next_trajectory;
46 void begin_iteration_on_next_trajectory()
const
49 if (current_trajectory ==
nullptr) current_trajectory = iter_on_traj;
50 else current_trajectory =
nullptr;
54 if (current_trajectory) {
59 void get_next_node_on_current_trajectory()
const
61 if (current_trajectory) current_node = current_trajectory->
GetNextNode();
62 else current_node =
nullptr;
68 start_node(
start), current_node(
start), iter_on_traj(trajectory), next_trajectory(new
TIter(
start->GetTrajectories())),
69 current_trajectory(nullptr), exclude_start_node(
kFALSE), iterate_backwards(
kFALSE)
75 begin_iteration_on_next_trajectory();
80 delete next_trajectory;
86 exclude_start_node = u;
91 iterate_backwards = i;
98 get_next_node_on_current_trajectory();
99 if (current_node ==
nullptr) {
100 begin_iteration_on_next_trajectory();
101 get_next_node_on_current_trajectory();
103 if (exclude_start_node && current_node == start_node)
return this->
operator()();
#define ClassDef(name, id)
Base class for KaliVeda framework.
Path taken by particles through multidetector geometry.
KVGeoDetectorNode * GetNextNode() const
void IterateFrom(const KVGeoDetectorNode *node0=nullptr) const
void IterateBackFrom(const KVGeoDetectorNode *node0=nullptr) const
Information on relative positions of detectors & particle trajectories.
Iterate from node to node along trajectories in array geometry.
void IterateBackwards(Bool_t i=kTRUE)
void ResetTrajectory(KVGeoDNTrajectory *trajectory=nullptr)
virtual ~KVGeoNodeIterator()
void ExcludeStartNode(Bool_t u=kTRUE)
KVGeoNodeIterator(KVGeoDetectorNode *start, KVGeoDNTrajectory *trajectory=nullptr)
KVGeoDetectorNode * operator()(void) const
void Reset(KVGeoDetectorNode *start=nullptr, KVGeoDNTrajectory *trajectory=nullptr)