star-travex
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TStiKalmanTrack.cxx
Go to the documentation of this file.
2 
3 #include "StEvent/StEnumerations.h"
4 #include "Sti/StiKalmanTrackNode.h"
5 #include "StiRootIO/TStiEvent.h"
6 
7 
9 
10 
11 TStiKalmanTrack::TStiKalmanTrack() : TObject(),
12  fEvent(nullptr), fNodes(), fEnergyLosses(0)
13 {
14 }
15 
16 
18  fEvent(event), fNodes(), fEnergyLosses(0)
19 {
20 }
21 
22 
23 TStiKalmanTrack::TStiKalmanTrack(const StiKalmanTrack& stiKTrack, TStiEvent* event) :
24  TStiKalmanTrack(event)
25 {
26  // Loop over track nodes
27  for (const StiKalmanTrackNode& stiNode : stiKTrack)
28  {
29  if (fEvent && fEvent->AcceptTrackNode(stiNode) ) {
30  fNodes.insert( TStiKalmanTrackNode(stiNode, this) );
31  }
32 
33  fEnergyLosses += stiNode.getEnergyLosses();
34  }
35 }
36 
37 
38 std::pair<std::set<TStiHit>::iterator, bool> TStiKalmanTrack::AddToParentEvent(const TStiHit& stiHit)
39 {
40  std::pair<std::set<TStiHit>::iterator, bool> dummy;
41  dummy.second = false;
42 
43  return fEvent ? fEvent->InsertStiHit(stiHit) : dummy;
44 }
45 
46 
47 const TStiKalmanTrackNode& TStiKalmanTrack::GetDcaNode() const { return *fNodes.begin(); }
48 
50 
51 
52 void TStiKalmanTrack::Print(Option_t *opt) const
53 {
54  Info("Print", "fEnergyLosses: %f\n", fEnergyLosses);
55 
56  int nodeIdx = 0;
57 
58  for (const TStiKalmanTrackNode& iNode : fNodes)
59  {
60  Info("Print", "node index: %d\n", nodeIdx);
61  iNode.Print();
62  nodeIdx++;
63  }
64 }
65 
66 
71 void TStiKalmanTrack::FindClosestHits(const std::set<TStiHit>& stiHits)
72 {
73  for (const auto& node : fNodes)
74  {
75  node.FindClosestHit(stiHits);
76  }
77 }
78 
79 
84 void TStiKalmanTrack::FindCandidateHits(const std::set<TStiHit>& stiHits)
85 {
86  for (const auto& node : fNodes)
87  {
88  node.FindCandidateHits(stiHits);
89  }
90 }
91 
92 
94 {
95  for (const auto& node : fNodes)
96  {
97  node.AssignClosestCandidateHit();
98  }
99 }
void AssignClosestCandidateHit()
TStiEvent * fEvent
Pointer to mother event containing this track.
void FindClosestHits(const std::set< TStiHit > &stiHits)
For each node of this track finds the hit closest to the mean track projection, i.e.
bool AcceptTrackNode(const StiKalmanTrackNode &node) const
Definition: TStiEvent.cxx:34
ClassImp(TStiKalmanTrack) TStiKalmanTrack
double GetEnergyLosses() const
virtual void Print(Option_t *opt="") const
const TStiKalmanTrackNode & GetDcaNode() const
std::pair< std::set< TStiHit >::iterator, bool > AddToParentEvent(const TStiHit &stiHit)
void FindCandidateHits(const std::set< TStiHit > &stiHits)
For each node of this track finds hits in some proximity to the mean track projection.
std::pair< std::set< TStiHit >::iterator, bool > InsertStiHit(const TStiHit &stiHit)
Definition: TStiEvent.h:34
double fEnergyLosses
Total track energy lost in all volumes.
std::set< TStiKalmanTrackNode > fNodes