travex
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Track.cxx
Go to the documentation of this file.
1 #include "travex/Event.h"
2 #include "travex/Hit.h"
3 #include "travex/Track.h"
4 #include "travex/TrackNode.h"
5 
6 
7 
11 tvx::Track::Track() : TObject(),
12  fEvent(nullptr),
13  fNodes(),
14  fEnergyLosses(0)
15 {
16 }
17 
18 
22 tvx::Track::Track(Event* event) : TObject(),
23  fEvent(event), fNodes(), fEnergyLosses(0)
24 {
25 }
26 
27 
29 {
30  std::pair<std::set<tvx::Hit>::iterator, bool> dummy;
31  dummy.second = false;
32 
33  return fEvent ? fEvent->AddHit(stiHit) : dummy;
34 }
35 
36 
37 void tvx::Track::Print(Option_t *opt) const
38 {
39  Info("Print", "fEnergyLosses: %f\n", fEnergyLosses);
40 
41  int nodeIdx = 0;
42 
43  for (const TrackNode& iNode : fNodes)
44  {
45  Info("Print", "node index: %d\n", nodeIdx);
46  iNode.Print();
47  nodeIdx++;
48  }
49 }
std::pair< typename std::set< Hit >::iterator, bool > AddHitResult_t
Definition: GenericEvent.h:21
Track()
Constructs an orphan empty Track not associated with any Event.
Definition: Track.cxx:11
virtual AddHitResult_t AddToParentEvent(const Hit &hit)
Definition: Track.cxx:28
A simple class to contain basic properties of a hit registered by an active material in a detector...
Definition: Hit.h:21
A simple persistent event container holding collections of tracks and hits.
Definition: Event.h:22
virtual void Print(Option_t *opt="") const
Definition: Track.cxx:37