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////////////////////////////////////////////////////////////////////////////////
37/// Default constructor.
38
40{
41 fPointsSize = 0;
42 fNpoints = 0;
43 fPoints = nullptr;
44}
45
46////////////////////////////////////////////////////////////////////////////////
47/// Constructor.
48
50 : TVirtualGeoTrack(id, pdgcode, parent, particle)
51{
52 fPointsSize = 0;
53 fNpoints = 0;
54 fPoints = nullptr;
55 if (fParent == nullptr) {
58 SetMarkerSize(0.6);
59 SetLineColor(2);
60 SetLineWidth(2);
61 } else {
64 SetMarkerSize(0.6);
65 SetLineColor(4);
66 SetLineWidth(2);
67 }
68}
69
70////////////////////////////////////////////////////////////////////////////////
71/// Destructor.
72
74{
75 if (fPoints)
76 delete[] fPoints;
77 // if (gPad) gPad->GetListOfPrimitives()->Remove(this);
78}
79
80////////////////////////////////////////////////////////////////////////////////
81/// Add a daughter track to this.
82
92
93////////////////////////////////////////////////////////////////////////////////
94/// Add a daughter and return its index.
95
97{
98 if (!fTracks)
99 fTracks = new TObjArray(1);
102 other->SetParent(this);
103 return index;
104}
105
106////////////////////////////////////////////////////////////////////////////////
107/// Draw animation of this track
108
110{
111 if (tmin < 0 || tmin >= tmax || nframes < 1)
112 return;
115 if (!gPad) {
117 }
118 TList *list = gPad->GetListOfPrimitives();
119 TIter next(list);
120 TObject *obj;
121 while ((obj = next())) {
122 if (!strcmp(obj->ClassName(), "TGeoTrack"))
123 list->Remove(obj);
124 }
125 Double_t dt = (tmax - tmin) / Double_t(nframes);
126 Double_t delt = 2E-9;
127 Double_t t = tmin;
131
132 TString opt(option);
133 if (opt.Contains("/G"))
134 geomanim = kTRUE;
135 if (opt.Contains("/S"))
136 issave = kTRUE;
137
139 Double_t *box = p->GetViewBox();
140 box[0] = box[1] = box[2] = 0;
141 box[3] = box[4] = box[5] = 100;
143 Draw(opt.Data());
144 Double_t start[6] = {0, 0, 0, 0, 0, 0};
145 Double_t end[6] = {0, 0, 0, 0, 0, 0};
146 Int_t i, j;
147 Double_t dlat = 0, dlong = 0, dpsi = 0;
148 Double_t dd[6] = {0, 0, 0, 0, 0, 0};
149 if (geomanim) {
150 p->EstimateCameraMove(tmin + 5 * dt, tmin + 15 * dt, start, end);
151 for (i = 0; i < 3; i++) {
152 start[i + 3] = 20 + 1.3 * start[i + 3];
153 end[i + 3] = 20 + 0.9 * end[i + 3];
154 }
155 for (i = 0; i < 6; i++) {
156 dd[i] = (end[i] - start[i]) / 10.;
157 }
158 memcpy(box, start, 6 * sizeof(Double_t));
159 p->GetViewAngles(dlong, dlat, dpsi);
160 dlong = (-206 - dlong) / Double_t(nframes);
161 dlat = (126 - dlat) / Double_t(nframes);
162 dpsi = (75 - dpsi) / Double_t(nframes);
163 p->GrabFocus();
164 }
165
166 for (i = 0; i < nframes; i++) {
167 if (t - delt < 0)
169 else
171 if (geomanim) {
172 for (j = 0; j < 6; j++)
173 box[j] += dd[j];
174 p->GrabFocus(1, dlong, dlat, dpsi);
175 } else {
176 gPad->Modified();
177 gPad->Update();
178 }
179 if (issave) {
180 fname = TString::Format("anim%04d.gif", i);
181 gPad->Print(fname);
182 }
183 t += dt;
184 }
186}
187
188////////////////////////////////////////////////////////////////////////////////
189/// Add a point on the track.
190
192{
193 if (!fPoints) {
194 fPointsSize = 16;
196 } else {
197 if (fNpoints >= fPointsSize) {
198 Double_t *temp = new Double_t[2 * fPointsSize];
199 memcpy(temp, fPoints, fNpoints * sizeof(Double_t));
200 fPointsSize *= 2;
201 delete[] fPoints;
202 fPoints = temp;
203 }
204 }
205 fPoints[fNpoints++] = x;
206 fPoints[fNpoints++] = y;
207 fPoints[fNpoints++] = z;
208 fPoints[fNpoints++] = t;
209}
210
211////////////////////////////////////////////////////////////////////////////////
212/// How-to-browse for a track.
213
215{
216 if (!b)
217 return;
218 Int_t nd = GetNdaughters();
219 if (!nd) {
220 b->Add(this);
221 return;
222 }
223 for (Int_t i = 0; i < nd; i++)
224 b->Add(GetDaughter(i));
225}
226
227////////////////////////////////////////////////////////////////////////////////
228/// Returns distance to track primitive for picking.
229
231{
232 const Int_t inaxis = 7;
233 const Int_t maxdist = 5;
234 Int_t dist = 9999;
235
236 Int_t puxmin = gPad->XtoAbsPixel(gPad->GetUxmin());
237 Int_t puymin = gPad->YtoAbsPixel(gPad->GetUymin());
238 Int_t puxmax = gPad->XtoAbsPixel(gPad->GetUxmax());
239 Int_t puymax = gPad->YtoAbsPixel(gPad->GetUymax());
240
241 // return if point is not in the user area
242 if (px < puxmin - inaxis)
243 return dist;
244 if (py > puymin + inaxis)
245 return dist;
246 if (px > puxmax + inaxis)
247 return dist;
248 if (py < puymax - inaxis)
249 return dist;
250
251 TView *view = gPad->GetView();
252 if (!view)
253 return dist;
254 Int_t imin, imax;
255 if (TObject::TestBit(kGeoPDrawn) && Size(imin, imax) >= 2) {
256 Int_t i, dsegment;
257 Double_t x1, y1, x2, y2;
258 Double_t xndc[3];
259 Int_t np = fNpoints >> 2;
260 if (imin < 0)
261 imin = 0;
262 if (imax > np - 1)
263 imax = np - 1;
264 for (i = imin; i < imax; i++) {
265 view->WCtoNDC(&fPoints[i << 2], xndc);
266 x1 = xndc[0];
267 y1 = xndc[1];
268 view->WCtoNDC(&fPoints[(i + 1) << 2], xndc);
269 x2 = xndc[0];
270 y2 = xndc[1];
271 dsegment = DistancetoLine(px, py, x1, y1, x2, y2);
272 // printf("%i: dseg=%i\n", i, dsegment);
273 if (dsegment < dist) {
274 dist = dsegment;
275 if (dist < maxdist) {
276 gPad->SetSelected(this);
277 return 0;
278 }
279 }
280 }
281 }
282 // check now daughters
283 Int_t nd = GetNdaughters();
284 if (!nd)
285 return dist;
287 for (Int_t id = 0; id < nd; id++) {
288 track = (TGeoTrack *)GetDaughter(id);
289 dist = track->DistancetoPrimitive(px, py);
290 if (dist < maxdist)
291 return 0;
292 }
293 return dist;
294}
295
296////////////////////////////////////////////////////////////////////////////////
297/// Draw this track over-imposed on a geometry, according to option.
298/// Options (case sensitive):
299/// - default : track without daughters
300/// - /D : track and first level descendents only
301/// - /* : track and all descendents
302/// - /Ntype : descendents of this track with particle name matching input type.
303///
304/// Options can appear only once but can be combined : e.g. Draw("/D /Npion-")
305///
306/// Time range for visible track segments can be set via TGeoManager::SetTminTmax()
307
309{
310 if (!gPad)
312 char *opt1 = Compress(option); // we will have to delete this ?
313 TString opt(opt1);
318 if (opt.Contains("/D")) {
321 }
322 if (opt.Contains("/*")) {
323 is_all = kTRUE;
325 }
326 if (opt.Contains("/N")) {
327 is_type = kTRUE;
328 Int_t ist = opt.Index("/N") + 2;
329 Int_t ilast = opt.Index("/", ist);
330 if (ilast < 0)
331 ilast = opt.Length();
332 TString type = opt(ist, ilast - ist);
334 }
336 AppendPad("SAME");
338 gPad->Modified();
339 gPad->Update();
340 }
341 delete[] opt1;
342 return;
343}
344
345///////////////////////////////////////////////////////////////////////////////
346/// Event treatment.
347
348void TGeoTrack::ExecuteEvent(Int_t /*event*/, Int_t /*px*/, Int_t /*py*/)
349{
350 if (!gPad)
351 return;
352 gPad->SetCursor(kHand);
353}
354
355////////////////////////////////////////////////////////////////////////////////
356/// Get some info about the track.
357
358char *TGeoTrack::GetObjectInfo(Int_t /*px*/, Int_t /*py*/) const
359{
360 static TString info;
361 Double_t x = 0, y = 0, z = 0, t = 0;
362 GetPoint(0, x, y, z, t);
363 info = TString::Format("%s (%g, %g, %g) tof=%g", GetName(), x, y, z, t);
364 return (char *)info.Data();
365}
366
367////////////////////////////////////////////////////////////////////////////////
368/// Get coordinates for point I on the track.
369
371{
372 Int_t np = fNpoints >> 2;
373 if (i < 0 || i >= np) {
374 Error("GetPoint", "no point %i, indmax=%d", i, np - 1);
375 return -1;
376 }
377 Int_t icrt = 4 * i;
378 x = fPoints[icrt];
379 y = fPoints[icrt + 1];
380 z = fPoints[icrt + 2];
381 t = fPoints[icrt + 3];
382 return i;
383}
384
385////////////////////////////////////////////////////////////////////////////////
386/// Return the pointer to the array of points starting with index I.
387
389{
390 if (!fNpoints)
391 return nullptr;
392 return (&fPoints[i << 2]);
393}
394
395////////////////////////////////////////////////////////////////////////////////
396/// Return the index of point on track having closest TOF smaller than
397/// the input value. Output POINT is filled with the interpolated value.
398
400{
401 Int_t np = fNpoints >> 2;
402 if (istart > (np - 2))
403 return (np - 1);
405 if (ip < 0 || ip > (np - 2))
406 return ip;
407 // point in segment (ip, ip+1) where 0<=ip<fNpoints-1
408 Int_t i;
409 Int_t j = ip << 2;
410 Int_t k = (ip + 1) << 2;
411 Double_t dt = tof - fPoints[j + 3];
412 Double_t ddt = fPoints[k + 3] - fPoints[j + 3];
413 for (i = 0; i < 3; i++)
414 point[i] = fPoints[j + i] + (fPoints[k + i] - fPoints[j + i]) * dt / ddt;
415 return ip;
416}
417
418////////////////////////////////////////////////////////////////////////////////
419/// Paint this track (and descendents) with current attributes.
420
422{
429 if (is_type) {
430 const char *type = gGeoManager->GetParticleName();
431 if (strlen(type) && strcmp(type, GetName()))
433 }
434 if (match_type) {
435 if (is_default || is_onelevel || is_all)
437 }
438 // paint now daughters
439 Int_t nd = GetNdaughters();
440 if (!nd || is_default)
441 return;
443 for (Int_t i = 0; i < nd; i++) {
445 if (track->IsInTimeRange()) {
446 track->SetBits(is_default, kFALSE, is_all, is_type);
447 track->Paint(option);
448 }
449 }
450}
451
452////////////////////////////////////////////////////////////////////////////////
453/// Paint track and daughters.
454
456{
462 if (is_type) {
463 const char *type = gGeoManager->GetParticleName();
464 if (strlen(type) && strcmp(type, GetName()))
466 }
467 if (match_type) {
468 if (is_default || is_onelevel || is_all)
469 PaintCollectTrack(time, box);
470 }
471 // loop now daughters
472 Int_t nd = GetNdaughters();
473 if (!nd || is_default)
474 return;
476 for (Int_t i = 0; i < nd; i++) {
478 if (track)
479 track->PaintCollect(time, box);
480 }
481}
482
483////////////////////////////////////////////////////////////////////////////////
484/// Paint just this track.
485
487{
489 if (!painter)
490 return;
491 Int_t np = fNpoints >> 2;
492 Double_t point[3], local[3];
494 Int_t ip = GetPoint(time, point);
495 if (ip >= 0 && ip < np - 1) {
496 if (convert)
498 else
499 memcpy(local, point, 3 * sizeof(Double_t));
500 painter->AddTrackPoint(local, box);
501 }
502}
503
504////////////////////////////////////////////////////////////////////////////////
505/// Paint current point of the track as marker.
506
508{
509 TPoint p;
510 Double_t xndc[3];
511 TView *view = gPad->GetView();
512 if (!view)
513 return;
514 view->WCtoNDC(point, xndc);
515 if (xndc[0] < gPad->GetX1() || xndc[0] > gPad->GetX2())
516 return;
517 if (xndc[1] < gPad->GetY1() || xndc[1] > gPad->GetY2())
518 return;
519 p.fX = gPad->XtoPixel(xndc[0]);
520 p.fY = gPad->YtoPixel(xndc[1]);
522 gVirtualX->DrawPolyMarker(1, &p);
523}
524
525////////////////////////////////////////////////////////////////////////////////
526/// Paint this track with its current attributes.
527
529{
530 // Check whether there is some 3D view class for this TPad
531 // TPadView3D *view3D = (TPadView3D*)gPad->GetView3D();
532 // if (view3D) view3D->PaintGeoTrack(this,option); // to be implemented
533
534 // Check if option is 'x3d'. NOTE: This is a simple checking
535 // but since there is no other
536 // options yet, this works fine.
537 TString opt(option);
538 opt.ToLower();
540 if (opt.Contains("x"))
541 return;
542 Int_t np = fNpoints >> 2;
543 Int_t imin = 0;
544 Int_t imax = np - 1;
545 Int_t ip;
546 Double_t start[3] = {0., 0., 0.};
547 Double_t end[3] = {0., 0., 0.};
548 Double_t seg[6] = {0., 0., 0., 0., 0., 0.};
550 Double_t tmin = 0., tmax = 0.;
551 Bool_t is_time = gGeoManager->GetTminTmax(tmin, tmax);
552 if (is_time) {
553 imin = GetPoint(tmin, start);
554 if (imin >= 0 && imin < np - 1) {
555 // we have a starting point -> find ending point
556 imax = GetPoint(tmax, end, imin);
557 if (imax < np - 1) {
558 // we also have an ending point -> check if on the same segment with imin
559 if (imax == imin) {
560 // paint the virtual segment between the 2 points
562 if (convert) {
563 gGeoManager->MasterToTop(start, &seg[0]);
564 gGeoManager->MasterToTop(end, &seg[3]);
565 gPad->PaintLine3D(&seg[0], &seg[3]);
566 } else {
567 gPad->PaintLine3D(start, end);
568 }
569 } else {
570 // paint the starting, ending and connecting segments
572 if (convert) {
573 gGeoManager->MasterToTop(start, &seg[0]);
574 gGeoManager->MasterToTop(&fPoints[(imin + 1) << 2], &seg[3]);
575 gPad->PaintLine3D(&seg[0], &seg[3]);
576 gGeoManager->MasterToTop(&fPoints[imax << 2], &seg[0]);
577 gGeoManager->MasterToTop(end, &seg[3]);
578 gPad->PaintLine3D(&seg[0], &seg[3]);
579 for (ip = imin + 1; ip < imax; ip++) {
580 gGeoManager->MasterToTop(&fPoints[ip << 2], &seg[0]);
581 gGeoManager->MasterToTop(&fPoints[(ip + 1) << 2], &seg[3]);
582 gPad->PaintLine3D(&seg[0], &seg[3]);
583 }
584 } else {
585 gPad->PaintLine3D(start, &fPoints[(imin + 1) << 2]);
586 gPad->PaintLine3D(&fPoints[imax << 2], end);
587 for (ip = imin + 1; ip < imax; ip++) {
588 gPad->PaintLine3D(&fPoints[ip << 2], &fPoints[(ip + 1) << 2]);
589 }
590 }
591 }
592 if (convert) {
593 gGeoManager->MasterToTop(end, &seg[0]);
594 PaintMarker(&seg[0]);
595 } else {
596 PaintMarker(end);
597 }
598 } else {
600 if (convert) {
601 gGeoManager->MasterToTop(start, &seg[0]);
602 gGeoManager->MasterToTop(&fPoints[(imin + 1) << 2], &seg[3]);
603 gPad->PaintLine3D(&seg[0], &seg[3]);
604 for (ip = imin + 1; ip < np - 2; ip++) {
605 gGeoManager->MasterToTop(&fPoints[ip << 2], &seg[0]);
606 gGeoManager->MasterToTop(&fPoints[(ip + 1) << 2], &seg[3]);
607 gPad->PaintLine3D(&seg[0], &seg[3]);
608 }
609 } else {
610 gPad->PaintLine3D(start, &fPoints[(imin + 1) << 2]);
611 for (ip = imin + 1; ip < np - 2; ip++) {
612 gPad->PaintLine3D(&fPoints[ip << 2], &fPoints[(ip + 1) << 2]);
613 }
614 }
615 }
616 } else {
617 imax = GetPoint(tmax, end);
618 if (imax < 0 || imax >= (np - 1))
619 return;
620 // we have to draw just the end of the track
622 if (convert) {
623 for (ip = 0; ip < imax - 1; ip++) {
624 gGeoManager->MasterToTop(&fPoints[ip << 2], &seg[0]);
625 gGeoManager->MasterToTop(&fPoints[(ip + 1) << 2], &seg[3]);
626 gPad->PaintLine3D(&seg[0], &seg[3]);
627 }
628 } else {
629 for (ip = 0; ip < imax - 1; ip++) {
630 gPad->PaintLine3D(&fPoints[ip << 2], &fPoints[(ip + 1) << 2]);
631 }
632 }
633 if (convert) {
634 gGeoManager->MasterToTop(&fPoints[imax << 2], &seg[0]);
635 gGeoManager->MasterToTop(end, &seg[3]);
636 gPad->PaintLine3D(&seg[0], &seg[3]);
637 PaintMarker(&seg[3]);
638 } else {
639 gPad->PaintLine3D(&fPoints[imax << 2], end);
640 PaintMarker(end);
641 }
642 }
644 return;
645 }
646
647 // paint all segments from track
649 TAttLine::Modify(); // change attributes if necessary
650 for (ip = imin; ip < imax; ip++) {
651 gPad->PaintLine3D(&fPoints[ip << 2], &fPoints[(ip + 1) << 2]);
652 }
653}
654
655////////////////////////////////////////////////////////////////////////////////
656/// Print some info about the track.
657
658void TGeoTrack::Print(Option_t * /*option*/) const
659{
660 Int_t np = fNpoints >> 2;
661 printf(" TGeoTrack%6i : %s ===============================\n", fId, GetName());
662 printf(" parent =%6i nd =%3i\n", (fParent) ? fParent->GetId() : -1, GetNdaughters());
663 Double_t x = 0, y = 0, z = 0, t = 0;
664 GetPoint(0, x, y, z, t);
665 printf(" production vertex : (%g, %g, %g) at tof=%g\n", x, y, z, t);
666 GetPoint(np - 1, x, y, z, t);
667 printf(" Npoints =%6i, last : (%g, %g, %g) at tof=%g\n\n", np, x, y, z, t);
668}
669
670////////////////////////////////////////////////////////////////////////////////
671/// Return the number of points within the time interval specified by
672/// TGeoManager class and the corresponding indices.
673
675{
676 Double_t tmin, tmax;
677 Int_t np = fNpoints >> 2;
678 imin = 0;
679 imax = np - 1;
680 Int_t size = np;
681 if (!gGeoManager->GetTminTmax(tmin, tmax))
682 return size;
683 imin = SearchPoint(tmin);
684 imax = SearchPoint(tmax, imin);
685 return (imax - imin + 1);
686}
687
688////////////////////////////////////////////////////////////////////////////////
689/// Search index of track point having the closest time tag smaller than
690/// TIME. Optional start index can be provided.
691
693{
695 Int_t np = fNpoints >> 2;
696 nabove = np + 1;
697 nbelow = istart;
698 while (nabove - nbelow > 1) {
699 middle = (nabove + nbelow) / 2;
700 midloc = ((middle - 1) << 2) + 3;
701 if (time == fPoints[midloc])
702 return middle - 1;
703 if (time < fPoints[midloc])
704 nabove = middle;
705 else
706 nbelow = middle;
707 }
708 return (nbelow - 1);
709}
710
711////////////////////////////////////////////////////////////////////////////////
712/// Set drawing bits for this track
713
721
722////////////////////////////////////////////////////////////////////////////////
723/// Returns 3D size for the track.
724
725void TGeoTrack::Sizeof3D() const {}
726
727////////////////////////////////////////////////////////////////////////////////
728/// Reset data for this track.
729
731{
732 fNpoints = 0;
733 fPointsSize = 0;
734 if (fTracks) {
735 fTracks->Delete();
736 delete fTracks;
737 }
738 fTracks = nullptr;
739 if (fPoints)
740 delete[] fPoints;
741 fPoints = nullptr;
742}
@ kHand
Definition GuiTypes.h:374
#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:337
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:39
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition TAttMarker.h:46
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:83
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:73
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:39
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:41
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:202
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:864
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1071
Basic string class.
Definition TString.h:138
Ssiz_t Length() const
Definition TString.h:425
void ToLower()
Change string to lower-case.
Definition TString.cxx:1189
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:640
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition TString.h:659
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()