KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KV3DGeoTrack.cpp
1#include "KV3DGeoTrack.h"
2
3#include "TPad.h"
4#include "TView.h"
5#include "KVNucleus.h"
6#include "TPolyMarker3D.h"
7
9
10
11
12
15 fIndex(0),
16 fTrack(nullptr),
17 fNuc()
18{
19}
20
21
22
24
26 TPolyLine3D(tr->GetNpoints()),
27 fIndex(0),
28 fTrack(tr),
29 fNuc(tr->GetName())
30{
32 for (int n = 0; n < tr->GetNpoints(); n++) {
33 const Double_t* point = tr->GetPoint(n);
34 SetPoint(n, point[0], point[1], point[2]);
35 }
36}
37
38
39
41
45
46
47
49
54
55
56
58
60{
61
62 gPad->SetCursor(kCross);
63 fTrack->ExecuteEvent(event, px, py);
64}
65
66
67
69
71{
72 return fTrack->GetName();
73}
74
75
76
78
80{
81 return fTrack->GetObjectInfo(px, py);
82}
83
84
85
88
90{
91 // Override Draw to add a TPolyMarker3D at the end of the track
92 TPolyMarker3D* pm = new TPolyMarker3D(1, 4);
93 Float_t* coords = &(GetP()[3 * GetLastPoint()]);
94 pm->SetPoint(0, coords[0], coords[1], coords[2]);
96 pm->SetMarkerSize(0.5);
97 pm->Draw(option);
98 pm->SetName(GetName());
100}
101
102
103
104
106
108{
109 SetLineWidth(2);
110 Int_t fZ = GetZ();
111 if (fZ == 0) return kBlue;
112 else if (fZ == 1) return kRed;
113 if (fZ == 2) return kGreen;
114 SetLineWidth(4);
115 if (fZ < 10) return kMagenta;
116 if (fZ < 20) return kCyan;
117 if (fZ < 30) return kOrange;
118 SetLineWidth(6);
119 return kGray;
120}
121
122
123
int Int_t
kCross
char Text_t
float Float_t
double Double_t
const char Option_t
kGray
kRed
kOrange
kGreen
kMagenta
kCyan
kBlue
Option_t Option_t option
#define gPad
Visualise particle trajectories through array geometry.
virtual ~KV3DGeoTrack()
virtual const Text_t * GetName() const
Int_t GetZ() const
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual Text_t * GetObjectInfo(Int_t px, Int_t py) const
TVirtualGeoTrack * fTrack
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
void Draw(Option_t *option="")
Override Draw to add a TPolyMarker3D at the end of the track.
virtual Color_t GetLineColor() const
virtual void SetLineWidth(Width_t lwidth)
virtual void SetLineColor(Color_t lcolor)
virtual void SetMarkerColor(Color_t mcolor=1)
virtual void SetMarkerSize(Size_t msize=1)
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual char * GetObjectInfo(Int_t px, Int_t py) const
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
Int_t GetLastPoint() const
Float_t * GetP() const
void Draw(Option_t *option="") override
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z)
virtual void SetName(const char *name)
void Draw(Option_t *option="") override
virtual Int_t GetNpoints() const=0
virtual const Double_t * GetPoint(Int_t i) const=0
const char * GetName() const override
const Int_t n
ClassImp(TPyArg)
size_t fIndex