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 "TVirtualX.h"
16#include "TView.h"
17#include "TGeoManager.h"
18#include "TVirtualGeoPainter.h"
19#include "TGeoTrack.h"
20
21/** \class TGeoTrack
22\ingroup Geometry_painter
23
24\deprecated
25Use of TGeoTrack is deprecated. For the event display please switch to TEve (using TEveTracks
26or TEvePointSet to display tracks specifically) or to [REve](https://root.cern/doc/master/tracks_8C_source.html).
27
28Class for user-defined tracks attached to a geometry.
29Tracks are 3D objects made of points and they store a
30pointer to a TParticle. The geometry manager holds a list
31of all tracks that will be deleted on destruction of
32gGeoManager.
33*/
34
35////////////////////////////////////////////////////////////////////////////////
36/// Default constructor.
37
39{
40 fPointsSize = 0;
41 fNpoints = 0;
42 fPoints = nullptr;
43}
44
45////////////////////////////////////////////////////////////////////////////////
46/// Constructor.
47
49 : TVirtualGeoTrack(id, pdgcode, parent, particle)
50{
51 fPointsSize = 0;
52 fNpoints = 0;
53 fPoints = nullptr;
54 if (fParent == nullptr) {
57 SetMarkerSize(0.6);
58 SetLineColor(2);
59 SetLineWidth(2);
60 } else {
63 SetMarkerSize(0.6);
64 SetLineColor(4);
65 SetLineWidth(2);
66 }
67}
68
69////////////////////////////////////////////////////////////////////////////////
70/// Destructor.
71
73{
74 if (fPoints)
75 delete[] fPoints;
76 // if (gPad) gPad->GetListOfPrimitives()->Remove(this);
77}
78
79////////////////////////////////////////////////////////////////////////////////
80/// Add a daughter track to this.
81
91
92////////////////////////////////////////////////////////////////////////////////
93/// Add a daughter and return its index.
94
96{
97 if (!fTracks)
98 fTracks = new TObjArray(1);
101 other->SetParent(this);
102 return index;
103}
104
105////////////////////////////////////////////////////////////////////////////////
106/// Draw animation of this track
107
109{
110 if (tmin < 0 || tmin >= tmax || nframes < 1)
111 return;
114 if (!gPad) {
116 }
117 TList *list = gPad->GetListOfPrimitives();
118 TIter next(list);
119 TObject *obj;
120 while ((obj = next())) {
121 if (!strcmp(obj->ClassName(), "TGeoTrack"))
122 list->Remove(obj);
123 }
124 Double_t dt = (tmax - tmin) / Double_t(nframes);
125 Double_t delt = 2E-9;
126 Double_t t = tmin;
130
131 TString opt(option);
132 if (opt.Contains("/G"))
133 geomanim = kTRUE;
134 if (opt.Contains("/S"))
135 issave = kTRUE;
136
138 Double_t *box = p->GetViewBox();
139 box[0] = box[1] = box[2] = 0;
140 box[3] = box[4] = box[5] = 100;
142 Draw(opt.Data());
143 Double_t start[6] = {0, 0, 0, 0, 0, 0};
144 Double_t end[6] = {0, 0, 0, 0, 0, 0};
145 Int_t i, j;
146 Double_t dlat = 0, dlong = 0, dpsi = 0;
147 Double_t dd[6] = {0, 0, 0, 0, 0, 0};
148 if (geomanim) {
149 p->EstimateCameraMove(tmin + 5 * dt, tmin + 15 * dt, start, end);
150 for (i = 0; i < 3; i++) {
151 start[i + 3] = 20 + 1.3 * start[i + 3];
152 end[i + 3] = 20 + 0.9 * end[i + 3];
153 }
154 for (i = 0; i < 6; i++) {
155 dd[i] = (end[i] - start[i]) / 10.;
156 }
157 memcpy(box, start, 6 * sizeof(Double_t));
158 p->GetViewAngles(dlong, dlat, dpsi);
159 dlong = (-206 - dlong) / Double_t(nframes);
160 dlat = (126 - dlat) / Double_t(nframes);
161 dpsi = (75 - dpsi) / Double_t(nframes);
162 p->GrabFocus();
163 }
164
165 for (i = 0; i < nframes; i++) {
166 if (t - delt < 0)
168 else
170 if (geomanim) {
171 for (j = 0; j < 6; j++)
172 box[j] += dd[j];
173 p->GrabFocus(1, dlong, dlat, dpsi);
174 } else {
175 gPad->Modified();
176 gPad->Update();
177 }
178 if (issave) {
179 fname = TString::Format("anim%04d.gif", i);
180 gPad->Print(fname);
181 }
182 t += dt;
183 }
185}
186
187////////////////////////////////////////////////////////////////////////////////
188/// Add a point on the track.
189
191{
192 if (!fPoints) {
193 fPointsSize = 16;
195 } else {
196 if (fNpoints >= fPointsSize) {
197 Double_t *temp = new Double_t[2 * fPointsSize];
198 memcpy(temp, fPoints, fNpoints * sizeof(Double_t));
199 fPointsSize *= 2;
200 delete[] fPoints;
201 fPoints = temp;
202 }
203 }
204 fPoints[fNpoints++] = x;
205 fPoints[fNpoints++] = y;
206 fPoints[fNpoints++] = z;
207 fPoints[fNpoints++] = t;
208}
209
210////////////////////////////////////////////////////////////////////////////////
211/// How-to-browse for a track.
212
214{
215 if (!b)
216 return;
217 Int_t nd = GetNdaughters();
218 if (!nd) {
219 b->Add(this);
220 return;
221 }
222 for (Int_t i = 0; i < nd; i++)
223 b->Add(GetDaughter(i));
224}
225
226////////////////////////////////////////////////////////////////////////////////
227/// Returns distance to track primitive for picking.
228
230{
231 const Int_t inaxis = 7;
232 const Int_t maxdist = 5;
233 Int_t dist = 9999;
234
235 Int_t puxmin = gPad->XtoAbsPixel(gPad->GetUxmin());
236 Int_t puymin = gPad->YtoAbsPixel(gPad->GetUymin());
237 Int_t puxmax = gPad->XtoAbsPixel(gPad->GetUxmax());
238 Int_t puymax = gPad->YtoAbsPixel(gPad->GetUymax());
239
240 // return if point is not in the user area
241 if (px < puxmin - inaxis)
242 return dist;
243 if (py > puymin + inaxis)
244 return dist;
245 if (px > puxmax + inaxis)
246 return dist;
247 if (py < puymax - inaxis)
248 return dist;
249
250 TView *view = gPad->GetView();
251 if (!view)
252 return dist;
253 Int_t imin, imax;
254 if (TObject::TestBit(kGeoPDrawn) && Size(imin, imax) >= 2) {
255 Int_t i, dsegment;
256 Double_t x1, y1, x2, y2;
257 Double_t xndc[3];
258 Int_t np = fNpoints >> 2;
259 if (imin < 0)
260 imin = 0;
261 if (imax > np - 1)
262 imax = np - 1;
263 for (i = imin; i < imax; i++) {
264 view->WCtoNDC(&fPoints[i << 2], xndc);
265 x1 = xndc[0];
266 y1 = xndc[1];
267 view->WCtoNDC(&fPoints[(i + 1) << 2], xndc);
268 x2 = xndc[0];
269 y2 = xndc[1];
270 dsegment = DistancetoLine(px, py, x1, y1, x2, y2);
271 // printf("%i: dseg=%i\n", i, dsegment);
272 if (dsegment < dist) {
273 dist = dsegment;
274 if (dist < maxdist) {
275 gPad->SetSelected(this);
276 return 0;
277 }
278 }
279 }
280 }
281 // check now daughters
282 Int_t nd = GetNdaughters();
283 if (!nd)
284 return dist;
286 for (Int_t id = 0; id < nd; id++) {
287 track = (TGeoTrack *)GetDaughter(id);
288 dist = track->DistancetoPrimitive(px, py);
289 if (dist < maxdist)
290 return 0;
291 }
292 return dist;
293}
294
295////////////////////////////////////////////////////////////////////////////////
296/// Draw this track over-imposed on a geometry, according to option.
297/// Options (case sensitive):
298/// - default : track without daughters
299/// - /D : track and first level descendents only
300/// - /* : track and all descendents
301/// - /Ntype : descendents of this track with particle name matching input type.
302///
303/// Options can appear only once but can be combined : e.g. Draw("/D /Npion-")
304///
305/// Time range for visible track segments can be set via TGeoManager::SetTminTmax()
306
308{
309 if (!gPad)
311 char *opt1 = Compress(option); // we will have to delete this ?
312 TString opt(opt1);
317 if (opt.Contains("/D")) {
320 }
321 if (opt.Contains("/*")) {
322 is_all = kTRUE;
324 }
325 if (opt.Contains("/N")) {
326 is_type = kTRUE;
327 Int_t ist = opt.Index("/N") + 2;
328 Int_t ilast = opt.Index("/", ist);
329 if (ilast < 0)
330 ilast = opt.Length();
331 TString type = opt(ist, ilast - ist);
333 }
335 AppendPad("SAME");
337 gPad->Modified();
338 gPad->Update();
339 }
340 delete[] opt1;
341 return;
342}
343
344///////////////////////////////////////////////////////////////////////////////
345/// Event treatment.
346
347void TGeoTrack::ExecuteEvent(Int_t /*event*/, Int_t /*px*/, Int_t /*py*/)
348{
349 if (!gPad)
350 return;
351 gPad->SetCursor(kHand);
352}
353
354////////////////////////////////////////////////////////////////////////////////
355/// Get some info about the track.
356
357char *TGeoTrack::GetObjectInfo(Int_t /*px*/, Int_t /*py*/) const
358{
359 static TString info;
360 Double_t x = 0, y = 0, z = 0, t = 0;
361 GetPoint(0, x, y, z, t);
362 info = TString::Format("%s (%g, %g, %g) tof=%g", GetName(), x, y, z, t);
363 return (char *)info.Data();
364}
365
366////////////////////////////////////////////////////////////////////////////////
367/// Get coordinates for point I on the track.
368
370{
371 Int_t np = fNpoints >> 2;
372 if (i < 0 || i >= np) {
373 Error("GetPoint", "no point %i, indmax=%d", i, np - 1);
374 return -1;
375 }
376 Int_t icrt = 4 * i;
377 x = fPoints[icrt];
378 y = fPoints[icrt + 1];
379 z = fPoints[icrt + 2];
380 t = fPoints[icrt + 3];
381 return i;
382}
383
384////////////////////////////////////////////////////////////////////////////////
385/// Return the pointer to the array of points starting with index I.
386
388{
389 if (!fNpoints)
390 return nullptr;
391 return (&fPoints[i << 2]);
392}
393
394////////////////////////////////////////////////////////////////////////////////
395/// Return the index of point on track having closest TOF smaller than
396/// the input value. Output POINT is filled with the interpolated value.
397
399{
400 Int_t np = fNpoints >> 2;
401 if (istart > (np - 2))
402 return (np - 1);
404 if (ip < 0 || ip > (np - 2))
405 return ip;
406 // point in segment (ip, ip+1) where 0<=ip<fNpoints-1
407 Int_t i;
408 Int_t j = ip << 2;
409 Int_t k = (ip + 1) << 2;
410 Double_t dt = tof - fPoints[j + 3];
411 Double_t ddt = fPoints[k + 3] - fPoints[j + 3];
412 for (i = 0; i < 3; i++)
413 point[i] = fPoints[j + i] + (fPoints[k + i] - fPoints[j + i]) * dt / ddt;
414 return ip;
415}
416
417////////////////////////////////////////////////////////////////////////////////
418/// Paint this track (and descendents) with current attributes.
419
421{
428 if (is_type) {
429 const char *type = gGeoManager->GetParticleName();
430 if (strlen(type) && strcmp(type, GetName()))
432 }
433 if (match_type) {
434 if (is_default || is_onelevel || is_all)
436 }
437 // paint now daughters
438 Int_t nd = GetNdaughters();
439 if (!nd || is_default)
440 return;
442 for (Int_t i = 0; i < nd; i++) {
444 if (track->IsInTimeRange()) {
445 track->SetBits(is_default, kFALSE, is_all, is_type);
446 track->Paint(option);
447 }
448 }
449}
450
451////////////////////////////////////////////////////////////////////////////////
452/// Paint track and daughters.
453
455{
461 if (is_type) {
462 const char *type = gGeoManager->GetParticleName();
463 if (strlen(type) && strcmp(type, GetName()))
465 }
466 if (match_type) {
467 if (is_default || is_onelevel || is_all)
468 PaintCollectTrack(time, box);
469 }
470 // loop now daughters
471 Int_t nd = GetNdaughters();
472 if (!nd || is_default)
473 return;
475 for (Int_t i = 0; i < nd; i++) {
477 if (track)
478 track->PaintCollect(time, box);
479 }
480}
481
482////////////////////////////////////////////////////////////////////////////////
483/// Paint just this track.
484
486{
488 if (!painter)
489 return;
490 Int_t np = fNpoints >> 2;
491 Double_t point[3], local[3];
493 Int_t ip = GetPoint(time, point);
494 if (ip >= 0 && ip < np - 1) {
495 if (convert)
497 else
498 memcpy(local, point, 3 * sizeof(Double_t));
499 painter->AddTrackPoint(local, box);
500 }
501}
502
503////////////////////////////////////////////////////////////////////////////////
504/// Paint current point of the track as marker.
505
507{
508 TPoint p;
509 Double_t xndc[3];
510 TView *view = gPad->GetView();
511 if (!view)
512 return;
513 view->WCtoNDC(point, xndc);
514 if (xndc[0] < gPad->GetX1() || xndc[0] > gPad->GetX2())
515 return;
516 if (xndc[1] < gPad->GetY1() || xndc[1] > gPad->GetY2())
517 return;
518 p.fX = gPad->XtoPixel(xndc[0]);
519 p.fY = gPad->YtoPixel(xndc[1]);
521 gVirtualX->DrawPolyMarker(1, &p);
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{
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
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:108
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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:2578
#define gPad
#define gVirtualX
Definition TVirtualX.h:368
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 Modify()
Change current marker attributes if necessary.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition TAttMarker.h:41
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition TAttMarker.h:48
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:82
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:72
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:38
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:224
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Definition TObject.cxx:201
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:885
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1095
Basic string class.
Definition TString.h:138
Ssiz_t Length() const
Definition TString.h:425
const char * Data() const
Definition TString.h:384
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:2384
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:641
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition TString.h:660
See TView3D.
Definition TView.h:25
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
Abstract class for geometry painters.
Base class for user-defined tracks attached to a geometry.
Int_t GetId() const
TVirtualGeoTrack * fParent
TVirtualGeoTrack * GetDaughter(Int_t index) const
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()