1 #include "KV3DGeoTrack.h"
6 #include "TPolyMarker3D.h"
26 TPolyLine3D(tr->GetNpoints()),
31 SetLineColor(Color());
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]);
52 return TPolyLine3D::DistancetoPrimitive(px, py);
62 gPad->SetCursor(kCross);
63 fTrack->ExecuteEvent(event, px, py);
72 return fTrack->GetName();
81 return fTrack->GetObjectInfo(px, py);
92 TPolyMarker3D* pm =
new TPolyMarker3D(1, 4);
93 Float_t* coords = &(GetP()[3 * GetLastPoint()]);
94 pm->SetPoint(0, coords[0], coords[1], coords[2]);
95 pm->SetMarkerColor(GetLineColor());
96 pm->SetMarkerSize(0.5);
99 TPolyLine3D::Draw(option);
107 Int_t KV3DGeoTrack::Color()
111 if (fZ == 0)
return kBlue;
112 else if (fZ == 1)
return kRed;
113 if (fZ == 2)
return kGreen;
115 if (fZ < 10)
return kMagenta;
116 if (fZ < 20)
return kCyan;
117 if (fZ < 30)
return kOrange;
Visualise particle trajectories through array geometry.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Text_t * GetObjectInfo(Int_t px, Int_t py) const override
void Draw(Option_t *option="") override
Override Draw to add a TPolyMarker3D at the end of the track.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
const Text_t * GetName() const override