Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoTrack.cxx
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Andrei Gheata 2003/04/10
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "TBrowser.h"
13#include "TPoint.h"
14#include "TVirtualPad.h"
15#include "TView.h"
16#include "TGeoManager.h"
17#include "TVirtualGeoPainter.h"
18#include "TGeoTrack.h"
19
20/** \class TGeoTrack
21\ingroup Geometry_painter
22
23\deprecated
24Use of TGeoTrack is deprecated. For the event display please switch to TEve (using TEveTracks
25or TEvePointSet to display tracks specifically) or to [REve](https://root.cern/doc/master/tracks_8C_source.html).
26
27Class for user-defined tracks attached to a geometry.
28Tracks are 3D objects made of points and they store a
29pointer to a TParticle. The geometry manager holds a list
30of all tracks that will be deleted on destruction of
31gGeoManager.
32*/
33
34////////////////////////////////////////////////////////////////////////////////
35/// Default constructor.
36
38{
39 fPointsSize = 0;
40 fNpoints = 0;
41 fPoints = nullptr;
42}
43
44////////////////////////////////////////////////////////////////////////////////
45/// Constructor.
46
48 : TVirtualGeoTrack(id, pdgcode, parent, particle)
49{
50 fPointsSize = 0;
51 fNpoints = 0;
52 fPoints = nullptr;
53 if (fParent == nullptr) {
56 SetMarkerSize(0.6);
57 SetLineColor(2);
58 SetLineWidth(2);
59 } else {
62 SetMarkerSize(0.6);
63 SetLineColor(4);
64 SetLineWidth(2);
65 }
66}
67
68////////////////////////////////////////////////////////////////////////////////
69/// Destructor.
70
72{
73 if (fPoints)
74 delete[] fPoints;
75 // if (gPad) gPad->GetListOfPrimitives()->Remove(this);
76}
77
78////////////////////////////////////////////////////////////////////////////////
79/// Add a daughter track to this.
80
82{
83 if (!fTracks)
84 fTracks = new TObjArray(1);
86 TGeoTrack *daughter = new TGeoTrack(id, pdgcode, this, particle);
87 fTracks->AddAtAndExpand(daughter, index);
88 return daughter;
89}
90
91////////////////////////////////////////////////////////////////////////////////
92/// Add a daughter and return its index.
93
95{
96 if (!fTracks)
97 fTracks = new TObjArray(1);
100 other->SetParent(this);
101 return index;
102}
103
104////////////////////////////////////////////////////////////////////////////////
105/// Draw animation of this track
106
108{
109 if (tmin < 0 || tmin >= tmax || nframes < 1)
110 return;
113 if (!gPad) {
115 }
116 TList *list = gPad->GetListOfPrimitives();
117 TIter next(list);
118 TObject *obj;
119 while ((obj = next())) {
120 if (!strcmp(obj->ClassName(), "TGeoTrack"))
121 list->Remove(obj);
122 }
123 Double_t dt = (tmax - tmin) / Double_t(nframes);
124 Double_t delt = 2E-9;
125 Double_t t = tmin;
126 Bool_t geomanim = kFALSE;
127 Bool_t issave = kFALSE;
128 TString fname;
129
130 TString opt(option);
131 if (opt.Contains("/G"))
132 geomanim = kTRUE;
133 if (opt.Contains("/S"))
134 issave = kTRUE;
135
137 Double_t *box = p->GetViewBox();
138 box[0] = box[1] = box[2] = 0;
139 box[3] = box[4] = box[5] = 100;
141 Draw(opt.Data());
142 Double_t start[6] = {0, 0, 0, 0, 0, 0};
143 Double_t end[6] = {0, 0, 0, 0, 0, 0};
144 Int_t i, j;
145 Double_t dlat = 0, dlong = 0, dpsi = 0;
146 Double_t dd[6] = {0, 0, 0, 0, 0, 0};
147 if (geomanim) {
148 p->EstimateCameraMove(tmin + 5 * dt, tmin + 15 * dt, start, end);
149 for (i = 0; i < 3; i++) {
150 start[i + 3] = 20 + 1.3 * start[i + 3];
151 end[i + 3] = 20 + 0.9 * end[i + 3];
152 }
153 for (i = 0; i < 6; i++) {
154 dd[i] = (end[i] - start[i]) / 10.;
155 }
156 memcpy(box, start, 6 * sizeof(Double_t));
157 p->GetViewAngles(dlong, dlat, dpsi);
158 dlong = (-206 - dlong) / Double_t(nframes);
159 dlat = (126 - dlat) / Double_t(nframes);
160 dpsi = (75 - dpsi) / Double_t(nframes);
161 p->GrabFocus();
162 }
163
164 for (i = 0; i < nframes; i++) {
165 if (t - delt < 0)
167 else
168 gGeoManager->SetTminTmax(t - delt, t);
169 if (geomanim) {
170 for (j = 0; j < 6; j++)
171 box[j] += dd[j];
172 p->GrabFocus(1, dlong, dlat, dpsi);
173 } else {
174 gPad->Modified();
175 gPad->Update();
176 }
177 if (issave) {
178 fname = TString::Format("anim%04d.gif", i);
179 gPad->Print(fname);
180 }
181 t += dt;
182 }
184}
185
186////////////////////////////////////////////////////////////////////////////////
187/// Add a point on the track.
188
190{
191 if (!fPoints) {
192 fPointsSize = 16;
194 } else {
195 if (fNpoints >= fPointsSize) {
196 Double_t *temp = new Double_t[2 * fPointsSize];
197 memcpy(temp, fPoints, fNpoints * sizeof(Double_t));
198 fPointsSize *= 2;
199 delete[] fPoints;
200 fPoints = temp;
201 }
202 }
203 fPoints[fNpoints++] = x;
204 fPoints[fNpoints++] = y;
205 fPoints[fNpoints++] = z;
206 fPoints[fNpoints++] = t;
207}
208
209////////////////////////////////////////////////////////////////////////////////
210/// How-to-browse for a track.
211
213{
214 if (!b)
215 return;
216 Int_t nd = GetNdaughters();
217 if (!nd) {
218 b->Add(this);
219 return;
220 }
221 for (Int_t i = 0; i < nd; i++)
222 b->Add(GetDaughter(i));
223}
224
225////////////////////////////////////////////////////////////////////////////////
226/// Returns distance to track primitive for picking.
227
229{
230 const Int_t inaxis = 7;
231 const Int_t maxdist = 5;
232 Int_t dist = 9999;
233
234 Int_t puxmin = gPad->XtoAbsPixel(gPad->GetUxmin());
235 Int_t puymin = gPad->YtoAbsPixel(gPad->GetUymin());
236 Int_t puxmax = gPad->XtoAbsPixel(gPad->GetUxmax());
237 Int_t puymax = gPad->YtoAbsPixel(gPad->GetUymax());
238
239 // return if point is not in the user area
240 if (px < puxmin - inaxis)
241 return dist;
242 if (py > puymin + inaxis)
243 return dist;
244 if (px > puxmax + inaxis)
245 return dist;
246 if (py < puymax - inaxis)
247 return dist;
248
249 TView *view = gPad->GetView();
250 if (!view)
251 return dist;
252 Int_t imin, imax;
253 if (TObject::TestBit(kGeoPDrawn) && Size(imin, imax) >= 2) {
254 Int_t i, dsegment;
255 Double_t x1, y1, x2, y2;
256 Double_t xndc[3];
257 Int_t np = fNpoints >> 2;
258 if (imin < 0)
259 imin = 0;
260 if (imax > np - 1)
261 imax = np - 1;
262 for (i = imin; i < imax; i++) {
263 view->WCtoNDC(&fPoints[i << 2], xndc);
264 x1 = xndc[0];
265 y1 = xndc[1];
266 view->WCtoNDC(&fPoints[(i + 1) << 2], xndc);
267 x2 = xndc[0];
268 y2 = xndc[1];
269 dsegment = DistancetoLine(px, py, x1, y1, x2, y2);
270 // printf("%i: dseg=%i\n", i, dsegment);
271 if (dsegment < dist) {
272 dist = dsegment;
273 if (dist < maxdist) {
274 gPad->SetSelected(this);
275 return 0;
276 }
277 }
278 }
279 }
280 // check now daughters
281 Int_t nd = GetNdaughters();
282 if (!nd)
283 return dist;
284 TGeoTrack *track;
285 for (Int_t id = 0; id < nd; id++) {
286 track = (TGeoTrack *)GetDaughter(id);
287 dist = track->DistancetoPrimitive(px, py);
288 if (dist < maxdist)
289 return 0;
290 }
291 return dist;
292}
293
294////////////////////////////////////////////////////////////////////////////////
295/// Draw this track over-imposed on a geometry, according to option.
296/// Options (case sensitive):
297/// - default : track without daughters
298/// - /D : track and first level descendents only
299/// - /* : track and all descendents
300/// - /Ntype : descendents of this track with particle name matching input type.
301///
302/// Options can appear only once but can be combined : e.g. Draw("/D /Npion-")
303///
304/// Time range for visible track segments can be set via TGeoManager::SetTminTmax()
305
307{
308 if (!gPad)
310 char *opt1 = Compress(option); // we will have to delete this ?
311 TString opt(opt1);
312 Bool_t is_default = kTRUE;
313 Bool_t is_onelevel = kFALSE;
314 Bool_t is_all = kFALSE;
315 Bool_t is_type = kFALSE;
316 if (opt.Contains("/D")) {
317 is_onelevel = kTRUE;
318 is_default = kFALSE;
319 }
320 if (opt.Contains("/*")) {
321 is_all = kTRUE;
322 is_default = kFALSE;
323 }
324 if (opt.Contains("/N")) {
325 is_type = kTRUE;
326 Int_t ist = opt.Index("/N") + 2;
327 Int_t ilast = opt.Index("/", ist);
328 if (ilast < 0)
329 ilast = opt.Length();
330 TString type = opt(ist, ilast - ist);
332 }
333 SetBits(is_default, is_onelevel, is_all, is_type);
334 AppendPad("SAME");
336 gPad->Modified();
337 gPad->Update();
338 }
339 delete[] opt1;
340 return;
341}
342
343///////////////////////////////////////////////////////////////////////////////
344/// Event treatment.
345
346void TGeoTrack::ExecuteEvent(Int_t /*event*/, Int_t /*px*/, Int_t /*py*/)
347{
348 if (!gPad)
349 return;
350 gPad->SetCursor(kHand);
351}
352
353////////////////////////////////////////////////////////////////////////////////
354/// Get some info about the track.
355
356char *TGeoTrack::GetObjectInfo(Int_t /*px*/, Int_t /*py*/) const
357{
358 static TString info;
359 Double_t x = 0, y = 0, z = 0, t = 0;
360 GetPoint(0, x, y, z, t);
361 info = TString::Format("%s (%g, %g, %g) tof=%g", GetName(), x, y, z, t);
362 return (char *)info.Data();
363}
364
365////////////////////////////////////////////////////////////////////////////////
366/// Get coordinates for point I on the track.
367
369{
370 Int_t np = fNpoints >> 2;
371 if (i < 0 || i >= np) {
372 Error("GetPoint", "no point %i, indmax=%d", i, np - 1);
373 return -1;
374 }
375 Int_t icrt = 4 * i;
376 x = fPoints[icrt];
377 y = fPoints[icrt + 1];
378 z = fPoints[icrt + 2];
379 t = fPoints[icrt + 3];
380 return i;
381}
382
383////////////////////////////////////////////////////////////////////////////////
384/// Return the pointer to the array of points starting with index I.
385
387{
388 if (!fNpoints)
389 return nullptr;
390 return (&fPoints[i << 2]);
391}
392
393////////////////////////////////////////////////////////////////////////////////
394/// Return the index of point on track having closest TOF smaller than
395/// the input value. Output POINT is filled with the interpolated value.
396
398{
399 Int_t np = fNpoints >> 2;
400 if (istart > (np - 2))
401 return (np - 1);
402 Int_t ip = SearchPoint(tof, istart);
403 if (ip < 0 || ip > (np - 2))
404 return ip;
405 // point in segment (ip, ip+1) where 0<=ip<fNpoints-1
406 Int_t i;
407 Int_t j = ip << 2;
408 Int_t k = (ip + 1) << 2;
409 Double_t dt = tof - fPoints[j + 3];
410 Double_t ddt = fPoints[k + 3] - fPoints[j + 3];
411 for (i = 0; i < 3; i++)
412 point[i] = fPoints[j + i] + (fPoints[k + i] - fPoints[j + i]) * dt / ddt;
413 return ip;
414}
415
416////////////////////////////////////////////////////////////////////////////////
417/// Paint this track (and descendents) with current attributes.
418
420{
425 Bool_t match_type = kTRUE;
427 if (is_type) {
428 const char *type = gGeoManager->GetParticleName();
429 if (strlen(type) && strcmp(type, GetName()))
430 match_type = kFALSE;
431 }
432 if (match_type) {
433 if (is_default || is_onelevel || is_all)
435 }
436 // paint now daughters
437 Int_t nd = GetNdaughters();
438 if (!nd || is_default)
439 return;
440 TGeoTrack *track;
441 for (Int_t i = 0; i < nd; i++) {
442 track = (TGeoTrack *)GetDaughter(i);
443 if (track->IsInTimeRange()) {
444 track->SetBits(is_default, kFALSE, is_all, is_type);
445 track->Paint(option);
446 }
447 }
448}
449
450////////////////////////////////////////////////////////////////////////////////
451/// Paint track and daughters.
452
454{
459 Bool_t match_type = kTRUE;
460 if (is_type) {
461 const char *type = gGeoManager->GetParticleName();
462 if (strlen(type) && strcmp(type, GetName()))
463 match_type = kFALSE;
464 }
465 if (match_type) {
466 if (is_default || is_onelevel || is_all)
467 PaintCollectTrack(time, box);
468 }
469 // loop now daughters
470 Int_t nd = GetNdaughters();
471 if (!nd || is_default)
472 return;
473 TGeoTrack *track;
474 for (Int_t i = 0; i < nd; i++) {
475 track = (TGeoTrack *)GetDaughter(i);
476 if (track)
477 track->PaintCollect(time, box);
478 }
479}
480
481////////////////////////////////////////////////////////////////////////////////
482/// Paint just this track.
483
485{
487 if (!painter)
488 return;
489 Int_t np = fNpoints >> 2;
490 Double_t point[3], local[3];
492 Int_t ip = GetPoint(time, point);
493 if (ip >= 0 && ip < np - 1) {
494 if (convert)
495 gGeoManager->MasterToTop(point, local);
496 else
497 memcpy(local, point, 3 * sizeof(Double_t));
498 painter->AddTrackPoint(local, box);
499 }
500}
501
502////////////////////////////////////////////////////////////////////////////////
503/// Paint current point of the track as marker.
504
506{
507 Double_t xndc[3];
508 TView *view = gPad->GetView();
509 if (!view)
510 return;
511 view->WCtoNDC(point, xndc);
512 if (xndc[0] < gPad->GetX1() || xndc[0] > gPad->GetX2())
513 return;
514 if (xndc[1] < gPad->GetY1() || xndc[1] > gPad->GetY2())
515 return;
516
517 Double_t px = xndc[0];
518 Double_t py = xndc[1];
519
521 gPad->PaintPolyMarker(1, &px, &py);
522}
523
524////////////////////////////////////////////////////////////////////////////////
525/// Paint this track with its current attributes.
526
528{
529 // Check whether there is some 3D view class for this TPad
530 // TPadView3D *view3D = (TPadView3D*)gPad->GetView3D();
531 // if (view3D) view3D->PaintGeoTrack(this,option); // to be implemented
532
534 Int_t np = fNpoints >> 2;
535 Int_t imin = 0;
536 Int_t imax = np - 1;
537 Int_t ip;
538 Double_t start[3] = {0., 0., 0.};
539 Double_t end[3] = {0., 0., 0.};
540 Double_t seg[6] = {0., 0., 0., 0., 0., 0.};
542 Double_t tmin = 0., tmax = 0.;
543 Bool_t is_time = gGeoManager->GetTminTmax(tmin, tmax);
544 if (is_time) {
545 imin = GetPoint(tmin, start);
546 if (imin >= 0 && imin < np - 1) {
547 // we have a starting point -> find ending point
548 imax = GetPoint(tmax, end, imin);
549 if (imax < np - 1) {
550 // we also have an ending point -> check if on the same segment with imin
551 if (imax == imin) {
552 // paint the virtual segment between the 2 points
554 if (convert) {
555 gGeoManager->MasterToTop(start, &seg[0]);
556 gGeoManager->MasterToTop(end, &seg[3]);
557 gPad->PaintLine3D(&seg[0], &seg[3]);
558 } else {
559 gPad->PaintLine3D(start, end);
560 }
561 } else {
562 // paint the starting, ending and connecting segments
564 if (convert) {
565 gGeoManager->MasterToTop(start, &seg[0]);
566 gGeoManager->MasterToTop(&fPoints[(imin + 1) << 2], &seg[3]);
567 gPad->PaintLine3D(&seg[0], &seg[3]);
568 gGeoManager->MasterToTop(&fPoints[imax << 2], &seg[0]);
569 gGeoManager->MasterToTop(end, &seg[3]);
570 gPad->PaintLine3D(&seg[0], &seg[3]);
571 for (ip = imin + 1; ip < imax; ip++) {
572 gGeoManager->MasterToTop(&fPoints[ip << 2], &seg[0]);
573 gGeoManager->MasterToTop(&fPoints[(ip + 1) << 2], &seg[3]);
574 gPad->PaintLine3D(&seg[0], &seg[3]);
575 }
576 } else {
577 gPad->PaintLine3D(start, &fPoints[(imin + 1) << 2]);
578 gPad->PaintLine3D(&fPoints[imax << 2], end);
579 for (ip = imin + 1; ip < imax; ip++) {
580 gPad->PaintLine3D(&fPoints[ip << 2], &fPoints[(ip + 1) << 2]);
581 }
582 }
583 }
584 if (convert) {
585 gGeoManager->MasterToTop(end, &seg[0]);
586 PaintMarker(&seg[0]);
587 } else {
588 PaintMarker(end);
589 }
590 } else {
592 if (convert) {
593 gGeoManager->MasterToTop(start, &seg[0]);
594 gGeoManager->MasterToTop(&fPoints[(imin + 1) << 2], &seg[3]);
595 gPad->PaintLine3D(&seg[0], &seg[3]);
596 for (ip = imin + 1; ip < np - 2; ip++) {
597 gGeoManager->MasterToTop(&fPoints[ip << 2], &seg[0]);
598 gGeoManager->MasterToTop(&fPoints[(ip + 1) << 2], &seg[3]);
599 gPad->PaintLine3D(&seg[0], &seg[3]);
600 }
601 } else {
602 gPad->PaintLine3D(start, &fPoints[(imin + 1) << 2]);
603 for (ip = imin + 1; ip < np - 2; ip++) {
604 gPad->PaintLine3D(&fPoints[ip << 2], &fPoints[(ip + 1) << 2]);
605 }
606 }
607 }
608 } else {
609 imax = GetPoint(tmax, end);
610 if (imax < 0 || imax >= (np - 1))
611 return;
612 // we have to draw just the end of the track
614 if (convert) {
615 for (ip = 0; ip < imax - 1; ip++) {
616 gGeoManager->MasterToTop(&fPoints[ip << 2], &seg[0]);
617 gGeoManager->MasterToTop(&fPoints[(ip + 1) << 2], &seg[3]);
618 gPad->PaintLine3D(&seg[0], &seg[3]);
619 }
620 } else {
621 for (ip = 0; ip < imax - 1; ip++) {
622 gPad->PaintLine3D(&fPoints[ip << 2], &fPoints[(ip + 1) << 2]);
623 }
624 }
625 if (convert) {
626 gGeoManager->MasterToTop(&fPoints[imax << 2], &seg[0]);
627 gGeoManager->MasterToTop(end, &seg[3]);
628 gPad->PaintLine3D(&seg[0], &seg[3]);
629 PaintMarker(&seg[3]);
630 } else {
631 gPad->PaintLine3D(&fPoints[imax << 2], end);
632 PaintMarker(end);
633 }
634 }
636 return;
637 }
638
639 // paint all segments from track
641 TAttLine::Modify(); // change attributes if necessary
642 for (ip = imin; ip < imax; ip++) {
643 gPad->PaintLine3D(&fPoints[ip << 2], &fPoints[(ip + 1) << 2]);
644 }
645}
646
647////////////////////////////////////////////////////////////////////////////////
648/// Print some info about the track.
649
650void TGeoTrack::Print(Option_t * /*option*/) const
651{
652 Int_t np = fNpoints >> 2;
653 printf(" TGeoTrack%6i : %s ===============================\n", fId, GetName());
654 printf(" parent =%6i nd =%3i\n", (fParent) ? fParent->GetId() : -1, GetNdaughters());
655 Double_t x = 0, y = 0, z = 0, t = 0;
656 GetPoint(0, x, y, z, t);
657 printf(" production vertex : (%g, %g, %g) at tof=%g\n", x, y, z, t);
658 GetPoint(np - 1, x, y, z, t);
659 printf(" Npoints =%6i, last : (%g, %g, %g) at tof=%g\n\n", np, x, y, z, t);
660}
661
662////////////////////////////////////////////////////////////////////////////////
663/// Return the number of points within the time interval specified by
664/// TGeoManager class and the corresponding indices.
665
667{
668 Double_t tmin, tmax;
669 Int_t np = fNpoints >> 2;
670 imin = 0;
671 imax = np - 1;
672 Int_t size = np;
673 if (!gGeoManager->GetTminTmax(tmin, tmax))
674 return size;
675 imin = SearchPoint(tmin);
676 imax = SearchPoint(tmax, imin);
677 return (imax - imin + 1);
678}
679
680////////////////////////////////////////////////////////////////////////////////
681/// Search index of track point having the closest time tag smaller than
682/// TIME. Optional start index can be provided.
683
685{
686 Int_t nabove, nbelow, middle, midloc;
687 Int_t np = fNpoints >> 2;
688 nabove = np + 1;
689 nbelow = istart;
690 while (nabove - nbelow > 1) {
691 middle = (nabove + nbelow) / 2;
692 midloc = ((middle - 1) << 2) + 3;
693 if (time == fPoints[midloc])
694 return middle - 1;
695 if (time < fPoints[midloc])
696 nabove = middle;
697 else
698 nbelow = middle;
699 }
700 return (nbelow - 1);
701}
702
703////////////////////////////////////////////////////////////////////////////////
704/// Set drawing bits for this track
705
706void TGeoTrack::SetBits(Bool_t is_default, Bool_t is_onelevel, Bool_t is_all, Bool_t is_type)
707{
708 TObject::SetBit(kGeoPDefault, is_default);
709 TObject::SetBit(kGeoPOnelevel, is_onelevel);
711 TObject::SetBit(kGeoPType, is_type);
712}
713
714////////////////////////////////////////////////////////////////////////////////
715/// Returns 3D size for the track.
716
717void TGeoTrack::Sizeof3D() const {}
718
719////////////////////////////////////////////////////////////////////////////////
720/// Reset data for this track.
721
723{
724 fNpoints = 0;
725 fPointsSize = 0;
726 if (fTracks) {
727 fTracks->Delete();
728 delete fTracks;
729 }
730 fTracks = nullptr;
731 if (fPoints)
732 delete[] fPoints;
733 fPoints = nullptr;
734}
@ kHand
Definition GuiTypes.h:375
#define b(i)
Definition RSha256.hxx:100
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
constexpr Bool_t kFALSE
Definition RtypesCore.h:109
double Double_t
Double 8 bytes.
Definition RtypesCore.h:74
constexpr Bool_t kTRUE
Definition RtypesCore.h:108
const char Option_t
Option string (const char)
Definition RtypesCore.h:81
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Option_t Option_t SetLineWidth
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t SetLineColor
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t SetMarkerStyle
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char y1
R__EXTERN TGeoManager * gGeoManager
char * Compress(const char *str)
Remove all blanks from the string str.
Definition TString.cxx:2654
#define gPad
virtual void Modify()
Change current line attributes if necessary.
Definition TAttLine.cxx:246
Int_t DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
Compute distance from point px,py to a line.
Definition TAttLine.cxx:210
virtual void ModifyOn(TVirtualPad &pad)
Change current marker attributes if necessary on specified pad.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
void SetParticleName(const char *pname)
TGeoVolume * GetMasterVolume() const
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
void SetVisLevel(Int_t level=3)
set default level down to which visualization is performed
void SetAnimateTracks(Bool_t flag=kTRUE)
Bool_t GetTminTmax(Double_t &tmin, Double_t &tmax) const
Get time cut for drawing tracks.
const char * GetParticleName() const
void SetTminTmax(Double_t tmin=0, Double_t tmax=999)
Set time cut interval for drawing tracks.
Bool_t IsAnimatingTracks() const
TGeoVolume * GetTopVolume() const
void MasterToTop(const Double_t *master, Double_t *top) const
Convert coordinates from master volume frame to top.
Int_t fPointsSize
Definition TGeoTrack.h:37
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Returns distance to track primitive for picking.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Event treatment.
virtual void Sizeof3D() const
Returns 3D size for the track.
Int_t Size(Int_t &imin, Int_t &imax)
Return the number of points within the time interval specified by TGeoManager class and the correspon...
Int_t SearchPoint(Double_t time, Int_t istart=0) const
Search index of track point having the closest time tag smaller than TIME.
TVirtualGeoTrack * AddDaughter(Int_t id, Int_t pdgcode, TObject *particle=nullptr) override
Add a daughter track to this.
Definition TGeoTrack.cxx:81
void SetBits(Bool_t is_default=kTRUE, Bool_t is_onelevel=kFALSE, Bool_t is_all=kFALSE, Bool_t is_type=kFALSE)
Set drawing bits for this track.
Int_t GetPoint(Int_t i, Double_t &x, Double_t &y, Double_t &z, Double_t &t) const override
Get coordinates for point I on the track.
~TGeoTrack() override
Destructor.
Definition TGeoTrack.cxx:71
void Paint(Option_t *option="") override
Paint this track (and descendents) with current attributes.
void Browse(TBrowser *b) override
How-to-browse for a track.
Double_t * fPoints
Definition TGeoTrack.h:39
void PaintCollect(Double_t time, Double_t *box) override
Paint track and daughters.
TGeoTrack()
Default constructor.
Definition TGeoTrack.cxx:37
void PaintMarker(Double_t *point, Option_t *option="")
Paint current point of the track as marker.
void ResetTrack() override
Reset data for this track.
@ kGeoPDefault
Definition TGeoTrack.h:29
@ kGeoPOnelevel
Definition TGeoTrack.h:30
@ kGeoPAllDaughters
Definition TGeoTrack.h:31
void PaintTrack(Option_t *option="") override
Paint this track with its current attributes.
virtual void AnimateTrack(Double_t tmin=0, Double_t tmax=5E-8, Double_t nframes=200, Option_t *option="/*")
Draw animation of this track.
void PaintCollectTrack(Double_t time, Double_t *box) override
Paint just this track.
void Draw(Option_t *option="") override
Draw this track over-imposed on a geometry, according to option.
void AddPoint(Double_t x, Double_t y, Double_t z, Double_t t) override
Add a point on the track.
char * GetObjectInfo(Int_t px, Int_t py) const override
Get some info about the track.
void Print(Option_t *option="") const override
Print some info about the track.
Int_t fNpoints
Definition TGeoTrack.h:38
void Draw(Option_t *option="") override
draw top volume according to option
A doubly linked list.
Definition TList.h:38
An array of TObjects.
Definition TObjArray.h:31
Int_t GetEntriesFast() const
Definition TObjArray.h:58
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
void Delete(Option_t *option="") override
Remove all objects from the array AND delete all heap based objects.
Mother of all ROOT objects.
Definition TObject.h:42
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:204
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:226
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Definition TObject.cxx:203
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:886
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1096
Basic string class.
Definition TString.h:137
Ssiz_t Length() const
Definition TString.h:426
const char * Data() const
Definition TString.h:385
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2460
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:642
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition TString.h:661
See TView3D.
Definition TView.h:25
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
Abstract class for geometry painters.
virtual void AddTrackPoint(Double_t *point, Double_t *box, Bool_t reset=kFALSE)=0
Base class for user-defined tracks attached to a geometry.
Int_t GetId() const
TVirtualGeoTrack * fParent
void SetParent(TVirtualGeoTrack *parent)
TVirtualGeoTrack * GetDaughter(Int_t index) const
Bool_t IsInTimeRange() const
True if track TOF range overlaps with time interval of TGeoManager.
const char * GetName() const override
Get the PDG name.
Int_t GetNdaughters() const
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition fillpatterns.C:1
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
th1 Draw()