KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVGeoNodeIterator.h
Go to the documentation of this file.
1 
4 #ifndef __KVGEONODEITERATOR_H
5 #define __KVGEONODEITERATOR_H
6 
7 #include "KVBase.h"
8 #include "KVGeoDetectorNode.h"
9 #include "KVGeoDNTrajectory.h"
10 
36 class KVGeoNodeIterator : public KVBase {
44 
46  {
47  if (iter_on_traj) {
49  else current_trajectory = nullptr;
50  }
51  else
53  if (current_trajectory) {
56  }
57  }
59  {
61  else current_node = nullptr;
62  }
63 
64 
65 public:
66  KVGeoNodeIterator(KVGeoDetectorNode* start, KVGeoDNTrajectory* trajectory = nullptr) :
67  start_node(start), current_node(start), iter_on_traj(trajectory), next_trajectory(new TIter(start->GetTrajectories())),
69  {
73 
75  }
76 
78  {
79  delete next_trajectory;
80  }
81 
82  void ExcludeStartNode(Bool_t u = kTRUE)
83  {
86  }
87  void IterateBackwards(Bool_t i = kTRUE)
88  {
91  }
92 
94  {
96 
98  if (current_node == nullptr) {
101  }
102  if (exclude_start_node && current_node == start_node) return this->operator()();
103  return current_node;
104  }
105 
106  void Reset(KVGeoDetectorNode* start = nullptr, KVGeoDNTrajectory* trajectory = nullptr);
107  void ResetTrajectory(KVGeoDNTrajectory* trajectory = nullptr);
108 
109  ClassDef(KVGeoNodeIterator, 0) //Iterator over geometry nodes/trajectories
110 };
111 
112 #endif
const Bool_t kFALSE
bool Bool_t
#define ClassDef(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:135
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.
KVGeoDNTrajectory * current_trajectory
void IterateBackwards(Bool_t i=kTRUE)
KVGeoDetectorNode * start_node
void ResetTrajectory(KVGeoDNTrajectory *trajectory=nullptr)
KVGeoDetectorNode * current_node
void begin_iteration_on_next_trajectory() const
KVGeoDNTrajectory * iter_on_traj
limit iteration to this trajectory, if given
virtual ~KVGeoNodeIterator()
void ExcludeStartNode(Bool_t u=kTRUE)
void get_next_node_on_current_trajectory() const
KVGeoNodeIterator(KVGeoDetectorNode *start, KVGeoDNTrajectory *trajectory=nullptr)
KVGeoDetectorNode * operator()(void) const
void Reset(KVGeoDetectorNode *start=nullptr, KVGeoDNTrajectory *trajectory=nullptr)