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