Logo ROOT   6.16/01
Reference Guide
TEvePointSet.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, 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 "TEvePointSet.h"
13
14#include "TEveManager.h"
16#include "TEveTrans.h"
17
18#include "TTree.h"
19#include "TTreePlayer.h"
20#include "TF3.h"
21
22#include "TColor.h"
23
24/** \class TEvePointSet
25\ingroup TEve
26TEvePointSet is a render-element holding a collection of 3D points with
27optional per-point TRef and an arbitrary number of integer ids (to
28be used for signal, volume-id, track-id, etc).
29
303D point representation is implemented in base-class TPolyMarker3D.
31Per-point TRef is implemented in base-class TPointSet3D.
32
33By using the TEvePointSelector the points and integer ids can be
34filled directly from a TTree holding the source data.
35Setting of per-point TRef's is not supported.
36
37TEvePointSet is a TEveProjectable: it can be projected by using the
38TEveProjectionManager class.
39*/
40
42
43////////////////////////////////////////////////////////////////////////////////
44/// Constructor.
45
48 TPointSet3D(n_points),
51 TQObject(),
52
53 fTitle (),
54 fIntIds (0),
55 fIntIdsPerPoint (0)
56{
57 fMarkerStyle = 20;
59
60 // Override from TEveElement.
62}
63
64////////////////////////////////////////////////////////////////////////////////
65/// Constructor.
66
67TEvePointSet::TEvePointSet(const char* name, Int_t n_points, ETreeVarType_e tv_type) :
69 TPointSet3D(n_points),
72 TQObject(),
73
74 fTitle (),
75 fIntIds (0),
76 fIntIdsPerPoint (0)
77{
78 fMarkerStyle = 20;
81
82 // Override from TEveElement.
84}
85
86////////////////////////////////////////////////////////////////////////////////
87/// Copy constructor.
88
94 TQObject(),
95
96 fTitle (e.fTitle),
97 fIntIds (e.fIntIds ? new TArrayI(*e.fIntIds) : 0),
98 fIntIdsPerPoint (e.fIntIdsPerPoint)
99{
100}
101
102////////////////////////////////////////////////////////////////////////////////
103/// Destructor.
104
106{
107 delete fIntIds;
108}
109
110////////////////////////////////////////////////////////////////////////////////
111/// Clone points and all point-related information from point-set 'e'.
112
114{
115 // TPolyMarker3D
116 delete [] fP;
117 fN = e.fN;
118 if (fN > 0)
119 {
120 const Int_t nn = 3 * e.fN;
121 fP = new Float_t [nn];
122 for (Int_t i = 0; i < nn; i++) fP[i] = e.fP[i];
123 } else {
124 fP = 0;
125 }
126 fLastPoint = e.fLastPoint;
127
128 // TPointSet3D
129 CopyIds(e);
130
131 // TEvePointSet
132 delete fIntIds;
133 fIntIds = e.fIntIds ? new TArrayI(*e.fIntIds) : 0;
134 fIntIdsPerPoint = e.fIntIdsPerPoint;
135}
136
137////////////////////////////////////////////////////////////////////////////////
138/// Return pointset icon.
139
141{
143}
144
145////////////////////////////////////////////////////////////////////////////////
146/// Drop all data and set-up the data structures to recive new data.
147/// n_points specifies the initial size of the arrays.
148/// n_int_ids specifies the number of integer ids per point.
149
150void TEvePointSet::Reset(Int_t n_points, Int_t n_int_ids)
151{
152 delete [] fP; fP = 0;
153 fN = n_points;
154 if (fN) {
155 fP = new Float_t [3*fN];
156 memset(fP, 0, 3*fN*sizeof(Float_t));
157 }
158 fLastPoint = -1;
159 ClearIds();
160 delete fIntIds; fIntIds = 0;
161 fIntIdsPerPoint = n_int_ids;
163 ResetBBox();
164}
165
166////////////////////////////////////////////////////////////////////////////////
167/// Resizes internal array to allow additional n_points to be stored.
168/// Returns the old size which is also the location where one can
169/// start storing new data.
170/// The caller is *obliged* to fill the new point slots.
171
173{
174 Int_t old_size = Size();
175 Int_t new_size = old_size + n_points;
176 SetPoint(new_size - 1, 0, 0, 0);
177 if (fIntIds)
178 fIntIds->Set(fIntIdsPerPoint * new_size);
179 return old_size;
180}
181
182////////////////////////////////////////////////////////////////////////////////
183/// Assert that size of IntId array is compatible with the size of
184/// the point array.
185
187{
188 Int_t exp_size = GetN()*fIntIdsPerPoint;
189 if (fIntIds->GetSize() < exp_size)
190 fIntIds->Set(exp_size);
191}
192
193////////////////////////////////////////////////////////////////////////////////
194/// Return a pointer to integer ids of point with index p.
195/// Existence of integer id array is checked, 0 is returned if it
196/// does not exist.
197/// Validity of p is *not* checked.
198
200{
201 if (fIntIds)
202 return fIntIds->GetArray() + p*fIntIdsPerPoint;
203 return 0;
204}
205
206////////////////////////////////////////////////////////////////////////////////
207/// Return i-th integer id of point with index p.
208/// Existence of integer id array is checked, kMinInt is returned if
209/// it does not exist.
210/// Validity of p and i is *not* checked.
211
213{
214 if (fIntIds)
215 return * (fIntIds->GetArray() + p*fIntIdsPerPoint + i);
216 return kMinInt;
217}
218
219////////////////////////////////////////////////////////////////////////////////
220/// Set integer ids for the last point that was registered (most
221/// probably via TPolyMarker3D::SetNextPoint(x,y,z)).
222
224{
226}
227
228////////////////////////////////////////////////////////////////////////////////
229/// Set integer ids for point with index n.
230
232{
233 if (!fIntIds) return;
236 for (Int_t i=0; i<fIntIdsPerPoint; ++i)
237 x[i] = ids[i];
238}
239
240////////////////////////////////////////////////////////////////////////////////
241/// Set marker style, propagate to projecteds.
242
244{
245 static const TEveException eh("TEvePointSet::SetMarkerStyle ");
246
247 std::list<TEveProjected*>::iterator pi = fProjectedList.begin();
248 while (pi != fProjectedList.end())
249 {
250 TEvePointSet* pt = dynamic_cast<TEvePointSet*>(*pi);
251 if (pt)
252 {
253 pt->SetMarkerStyle(mstyle);
254 pt->StampObjProps();
255 }
256 ++pi;
257 }
259}
260
261////////////////////////////////////////////////////////////////////////////////
262/// Set marker size, propagate to projecteds.
263
265{
266 static const TEveException eh("TEvePointSet::SetMarkerSize ");
267
268 std::list<TEveProjected*>::iterator pi = fProjectedList.begin();
269 while (pi != fProjectedList.end())
270 {
271 TEvePointSet* pt = dynamic_cast<TEvePointSet*>(*pi);
272 if (pt)
273 {
274 pt->SetMarkerSize(msize);
275 pt->StampObjProps();
276 }
277 ++pi;
278 }
280}
281
282////////////////////////////////////////////////////////////////////////////////
283/// Paint point-set.
284
286{
287 PaintStandard(this);
288}
289
290////////////////////////////////////////////////////////////////////////////////
291/// Initialize point-set for new filling.
292/// subIdNum gives the number of integer ids that can be assigned to
293/// each point.
294
296{
297 if (subIdNum > 0) {
298 fIntIdsPerPoint = subIdNum;
299 if (!fIntIds)
301 else
303 } else {
304 delete fIntIds; fIntIds = 0;
305 fIntIdsPerPoint = 0;
306 }
307}
308
309////////////////////////////////////////////////////////////////////////////////
310/// Called from TEvePointSelector when internal arrays of the tree-selector
311/// are filled up and need to be processed.
312/// Virtual from TEvePointSelectorConsumer.
313
315{
316 static const TEveException eh("TEvePointSet::TakeAction ");
317
318 if(sel == 0)
319 throw(eh + "selector is <null>.");
320
321 Int_t n = sel->GetNfill();
322 Int_t beg = GrowFor(n);
323
324 // printf("TEvePointSet::TakeAction beg=%d n=%d size=%d nsubid=%d dim=%d\n",
325 // beg, n, Size(), sel->GetSubIdNum(), sel->GetDimension());
326
327 Double_t *vx = sel->GetV1(), *vy = sel->GetV2(), *vz = sel->GetV3();
328 Float_t *p = fP + 3*beg;
329
330 switch(fSourceCS) {
331 case kTVT_XYZ:
332 while(n-- > 0) {
333 p[0] = *vx; p[1] = *vy; p[2] = *vz;
334 p += 3;
335 ++vx; ++vy; ++vz;
336 }
337 break;
338 case kTVT_RPhiZ:
339 while(n-- > 0) {
340 p[0] = *vx * TMath::Cos(*vy); p[1] = *vx * TMath::Sin(*vy); p[2] = *vz;
341 p += 3;
342 ++vx; ++vy; ++vz;
343 }
344 break;
345 default:
346 throw(eh + "unknown tree variable type.");
347 }
348
349 if (fIntIds) {
350 Double_t** subarr = new Double_t* [fIntIdsPerPoint];
351 for (Int_t i=0; i<fIntIdsPerPoint; ++i) {
352 subarr[i] = sel->GetVal(sel->GetDimension() - fIntIdsPerPoint + i);
353 if (subarr[i] == 0) {
354 delete[] subarr;
355 throw(eh + "sub-id array not available.");
356 }
357 }
358 Int_t* ids = fIntIds->GetArray() + fIntIdsPerPoint*beg;
359 n = sel->GetNfill();
360 while (n-- > 0) {
361 for (Int_t i=0; i<fIntIdsPerPoint; ++i) {
362 ids[i] = TMath::Nint(*subarr[i]);
363 ++subarr[i];
364 }
365 ids += fIntIdsPerPoint;
366 }
367 delete [] subarr;
368 }
369}
370
371////////////////////////////////////////////////////////////////////////////////
372/// Copy visualization parameters from element el.
373
375{
376 const TEvePointSet* m = dynamic_cast<const TEvePointSet*>(el);
377 if (m)
378 {
380 fOption = m->fOption;
381 }
382
384}
385
386////////////////////////////////////////////////////////////////////////////////
387/// Write visualization parameters.
388
389void TEvePointSet::WriteVizParams(std::ostream& out, const TString& var)
390{
392
394}
395
396////////////////////////////////////////////////////////////////////////////////
397/// Virtual from TEveProjectable, returns TEvePointSetProjected class.
398
400{
402}
403
404////////////////////////////////////////////////////////////////////////////////
405/// Virtual method of base class TPointSet3D. The function call is
406/// invoked with secondary selection in TPointSet3DGL.
407
409{
410 Emit("PointSelected(Int_t)", id);
412}
413
414//==============================================================================
415/** \class TEvePointSetArray
416\ingroup TEve
417An array of point-sets with each point-set playing a role of a bin
418in a histogram. When a new point is added to a TEvePointSetArray,
419an additional separating quantity needs to be specified: it
420determines into which TEvePointSet (bin) the point will actually be
421stored. Underflow and overflow bins are automatically created but
422they are not drawn by default.
423
424By using the TEvePointSelector the points and the separating
425quantities can be filled directly from a TTree holding the source
426data.
427Setting of per-point TRef's is not supported.
428
429After the filling, the range of separating variable can be
430controlled with a slider to choose a sub-set of PointSets that are
431actually shown.
432*/
433
435
436////////////////////////////////////////////////////////////////////////////////
437/// Constructor.
438
440 const char* title) :
441 TEveElement(),
442 TNamed(name, title),
443
444 fBins(0), fDefPointSetCapacity(128), fNBins(0), fLastBin(-1),
445 fMin(0), fCurMin(0), fMax(0), fCurMax(0),
446 fBinWidth(0),
447 fQuantName()
448{
449
451}
452
453////////////////////////////////////////////////////////////////////////////////
454/// Destructor: deletes the fBins array. Actual removal of
455/// elements done by TEveElement.
456
458{
459 // printf("TEvePointSetArray::~TEvePointSetArray()\n");
460 delete [] fBins; fBins = 0;
461}
462
463////////////////////////////////////////////////////////////////////////////////
464/// Virtual from TEveElement, provide bin management.
465
467{
468 for (Int_t i=0; i<fNBins; ++i) {
469 if (fBins[i] == el) {
470 fBins[i] = 0;
471 break;
472 }
473 }
474}
475
476////////////////////////////////////////////////////////////////////////////////
477/// Virtual from TEveElement, provide bin management.
478
480{
481 delete [] fBins; fBins = 0; fLastBin = -1;
482}
483
484////////////////////////////////////////////////////////////////////////////////
485/// Set marker color, propagate to children.
486
488{
489 static const TEveException eh("TEvePointSetArray::SetMarkerColor ");
490
491 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
492 TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject(eh));
493 if (m && m->GetMarkerColor() == fMarkerColor)
494 m->SetMarkerColor(tcolor);
495 }
497}
498
499////////////////////////////////////////////////////////////////////////////////
500/// Set marker style, propagate to children.
501
503{
504 static const TEveException eh("TEvePointSetArray::SetMarkerStyle ");
505
506 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
507 TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject(eh));
508 if (m && m->GetMarkerStyle() == fMarkerStyle)
509 m->SetMarkerStyle(mstyle);
510 }
512}
513
514////////////////////////////////////////////////////////////////////////////////
515/// Set marker size, propagate to children.
516
518{
519 static const TEveException eh("TEvePointSetArray::SetMarkerSize ");
520
521 for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
522 TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject(eh));
523 if (m && m->GetMarkerSize() == fMarkerSize)
524 m->SetMarkerSize(msize);
525 }
527}
528
529////////////////////////////////////////////////////////////////////////////////
530/// Called from TEvePointSelector when internal arrays of the tree-selector
531/// are filled up and need to be processed.
532/// Virtual from TEvePointSelectorConsumer.
533
535{
536 static const TEveException eh("TEvePointSetArray::TakeAction ");
537
538 if (sel == 0)
539 throw eh + "selector is <null>.";
540
541 Int_t n = sel->GetNfill();
542
543 // printf("TEvePointSetArray::TakeAction n=%d\n", n);
544
545 Double_t *vx = sel->GetV1(), *vy = sel->GetV2(), *vz = sel->GetV3();
546 Double_t *qq = sel->GetV4();
547
548 if (qq == 0)
549 throw eh + "requires 4-d varexp.";
550
551 switch (fSourceCS)
552 {
553 case kTVT_XYZ:
554 {
555 while (n-- > 0)
556 {
557 Fill(*vx, *vy, *vz, *qq);
558 ++vx; ++vy; ++vz; ++qq;
559 }
560 break;
561 }
562 case kTVT_RPhiZ:
563 {
564 while (n-- > 0)
565 {
566 Fill(*vx * TMath::Cos(*vy), *vx * TMath::Sin(*vy), *vz, *qq);
567 ++vx; ++vy; ++vz; ++qq;
568 }
569 break;
570 }
571 default:
572 {
573 throw eh + "unknown tree variable type.";
574 }
575 }
576}
577
578////////////////////////////////////////////////////////////////////////////////
579/// Get the total number of filled points.
580/// 'under' and 'over' flags specify if under/overflow channels
581/// should be added to the sum.
582
584{
585 Int_t size = 0;
586 const Int_t min = under ? 0 : 1;
587 const Int_t max = over ? fNBins : fNBins - 1;
588 for (Int_t i = min; i < max; ++i)
589 {
590 if (fBins[i])
591 size += fBins[i]->Size();
592 }
593 return size;
594}
595
596////////////////////////////////////////////////////////////////////////////////
597/// Initialize internal point-sets with given binning parameters.
598/// The actual number of bins is nbins+2, bin 0 corresponding to
599/// underflow and bin nbin+1 to owerflow pointset.
600
601void TEvePointSetArray::InitBins(const char* quant_name,
602 Int_t nbins, Double_t min, Double_t max)
603{
604 static const TEveException eh("TEvePointSetArray::InitBins ");
605
606 if (nbins < 1) throw eh + "nbins < 1.";
607 if (min > max) throw eh + "min > max.";
608
610
611 fQuantName = quant_name;
612 fNBins = nbins + 2; // under/overflow
613 fLastBin = -1;
614 fMin = fCurMin = min;
615 fMax = fCurMax = max;
616 fBinWidth = (fMax - fMin)/(fNBins - 2);
617
618 fBins = new TEvePointSet* [fNBins];
619
620 for (Int_t i = 0; i < fNBins; ++i)
621 {
622 fBins[i] = new TEvePointSet
623 (Form("Slice %d [%4.3lf, %4.3lf]", i, fMin + (i-1)*fBinWidth, fMin + i*fBinWidth),
628 AddElement(fBins[i]);
629 }
630
631 fBins[0]->SetName("Underflow");
633
634 fBins[fNBins-1]->SetName("Overflow");
636}
637
638////////////////////////////////////////////////////////////////////////////////
639/// Add a new point. Appropriate point-set will be chosen based on
640/// the value of the separating quantity 'quant'.
641/// If the selected bin does not have an associated TEvePointSet
642/// the point is discarded and false is returned.
643
645{
646 fLastBin = TMath::FloorNint((quant - fMin)/fBinWidth) + 1;
647
648 if (fLastBin < 0)
649 {
650 fLastBin = 0;
651 }
652 else if (fLastBin > fNBins - 1)
653 {
654 fLastBin = fNBins - 1;
655 }
656
657 if (fBins[fLastBin] != 0)
658 {
660 return kTRUE;
661 }
662 else
663 {
664 return kFALSE;
665 }
666}
667
668////////////////////////////////////////////////////////////////////////////////
669/// Set external object id of the last added point.
670
672{
673 if (fLastBin >= 0)
675}
676
677////////////////////////////////////////////////////////////////////////////////
678/// Call this after all the points have been filled.
679/// At this point we can calculate bounding-boxes of individual
680/// point-sets.
681
683{
684 for (Int_t i=0; i<fNBins; ++i)
685 {
686 if (fBins[i] != 0)
687 {
688 fBins[i]->SetTitle(Form("N=%d", fBins[i]->Size()));
689 fBins[i]->ComputeBBox();
690 }
691 }
692 fLastBin = -1;
693}
694
695////////////////////////////////////////////////////////////////////////////////
696/// Propagate id-object ownership to children.
697
699{
700 for (Int_t i=0; i<fNBins; ++i)
701 {
702 if (fBins[i] != 0)
703 fBins[i]->SetOwnIds(o);
704 }
705}
706
707////////////////////////////////////////////////////////////////////////////////
708/// Set active range of the separating quantity.
709/// Appropriate point-sets are tagged for rendering.
710/// Over/underflow point-sets are left as they were.
711
713{
714 using namespace TMath;
715
716 fCurMin = min; fCurMax = max;
717 Int_t low_b = Max(0, FloorNint((min-fMin)/fBinWidth)) + 1;
718 Int_t high_b = Min(fNBins-2, CeilNint ((max-fMin)/fBinWidth));
719
720 for (Int_t i = 1; i < fNBins - 1; ++i)
721 {
722 if (fBins[i] != 0)
723 fBins[i]->SetRnrSelf(i>=low_b && i<=high_b);
724 }
725}
726
727/** \class TEvePointSetProjected
728\ingroup TEve
729Projected copy of a TEvePointSet.
730*/
732
733////////////////////////////////////////////////////////////////////////////////
734/// Default contructor.
735
737 TEvePointSet (),
739{
740}
741
742////////////////////////////////////////////////////////////////////////////////
743/// Set projection manager and projection model.
744/// Virtual from TEveProjected.
745
748{
750 CopyVizParams(dynamic_cast<TEveElement*>(model));
751}
752
753////////////////////////////////////////////////////////////////////////////////
754/// Set depth (z-coordinate) of the projected points.
755
757{
758 SetDepthCommon(d, this, fBBox);
759
760 Int_t n = Size();
761 Float_t *p = GetP() + 2;
762 for (Int_t i = 0; i < n; ++i, p+=3)
763 *p = fDepth;
764}
765
766////////////////////////////////////////////////////////////////////////////////
767/// Re-apply the projection.
768/// Virtual from TEveProjected.
769
771{
773 TEvePointSet &ps = * dynamic_cast<TEvePointSet*>(fProjectable);
774 TEveTrans *tr = ps.PtrMainTrans(kFALSE);
775
776 Int_t n = ps.Size();
777 Reset(n);
778 fLastPoint = n - 1;
779 Float_t *o = ps.GetP(), *p = GetP();
780 for (Int_t i = 0; i < n; ++i, o+=3, p+=3)
781 {
782 proj.ProjectPointfv(tr, o, p, fDepth);
783 }
784}
785
786////////////////////////////////////////////////////////////////////////////////
787/// Virtual method of base class TPointSet3D.
788/// Forward to projectable.
789
791{
792 TEvePointSet *ps = dynamic_cast<TEvePointSet*>(fProjectable);
793 ps->PointSelected(id);
794}
void Class()
Definition: Class.C:29
#define d(i)
Definition: RSha256.hxx:102
#define e(i)
Definition: RSha256.hxx:103
const Int_t kMinInt
Definition: RtypesCore.h:100
int Int_t
Definition: RtypesCore.h:41
float Size_t
Definition: RtypesCore.h:83
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
short Color_t
Definition: RtypesCore.h:79
short Style_t
Definition: RtypesCore.h:76
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassImp(name)
Definition: Rtypes.h:363
Binding & operator=(OUT(*fun)(void))
char * Form(const char *fmt,...)
Array of integers (32 bits per element).
Definition: TArrayI.h:27
void Set(Int_t n)
Set size of this array to n ints.
Definition: TArrayI.cxx:105
const Int_t * GetArray() const
Definition: TArrayI.h:43
Int_t GetSize() const
Definition: TArray.h:47
void ResetBBox()
Definition: TAttBBox.h:46
Float_t * fBBox
Definition: TAttBBox.h:20
Marker Attributes class.
Definition: TAttMarker.h:19
virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
Save line attributes as C++ statement(s) on output stream out.
Definition: TAttMarker.cxx:245
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition: TAttMarker.h:38
Color_t fMarkerColor
Marker color.
Definition: TAttMarker.h:22
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition: TAttMarker.h:40
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition: TAttMarker.h:41
Size_t fMarkerSize
Marker size.
Definition: TAttMarker.h:24
Style_t fMarkerStyle
Marker style.
Definition: TAttMarker.h:23
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:75
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:34
virtual void AddElement(TEveElement *el)
Add el to the list of children.
List_t fChildren
Definition: TEveElement.h:79
virtual void RemoveElements()
Remove all elements.
void SetMainColorPtr(Color_t *color)
Definition: TEveElement.h:267
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
static const TGPicture * fgListTreeIcons[9]
Definition: TEveElement.h:63
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write-out visual parameters for this object.
List_t::iterator List_i
Definition: TEveElement.h:70
virtual void PaintStandard(TObject *id)
Paint object – a generic implementation for EVE elements.
virtual Bool_t SetRnrSelf(Bool_t rnr)
Set render state of this element, i.e.
Bool_t fPickable
Definition: TEveElement.h:310
Exception class thrown by TEve classes and macros.
Definition: TEveUtil.h:103
TEvePointSelectorConsumer is a virtual base for classes that can be filled from TTree data via the TE...
Definition: TEveTreeTools.h:46
ETreeVarType_e fSourceCS
Definition: TEveTreeTools.h:51
TEvePointSelector is a sub-class of TSelectorDraw for direct extraction of point-like data from a Tre...
Definition: TEveTreeTools.h:67
An array of point-sets with each point-set playing a role of a bin in a histogram.
Definition: TEvePointSet.h:111
virtual ~TEvePointSetArray()
Destructor: deletes the fBins array.
virtual void SetMarkerSize(Size_t msize=1)
Set marker size, propagate to children.
void SetRange(Double_t min, Double_t max)
Set active range of the separating quantity.
TEvePointSet ** fBins
Definition: TEvePointSet.h:118
Double_t fMin
Index of the last filled TEvePointSet.
Definition: TEvePointSet.h:122
virtual void SetMarkerColor(Color_t tcolor=1)
Set marker color, propagate to children.
void CloseBins()
Call this after all the points have been filled.
virtual void RemoveElementsLocal()
Virtual from TEveElement, provide bin management.
void InitBins(const char *quant_name, Int_t nbins, Double_t min, Double_t max)
Initialize internal point-sets with given binning parameters.
virtual void TakeAction(TEvePointSelector *)
Called from TEvePointSelector when internal arrays of the tree-selector are filled up and need to be ...
virtual Int_t Size(Bool_t under=kFALSE, Bool_t over=kFALSE) const
Get the total number of filled points.
TEvePointSetArray(const TEvePointSetArray &)
virtual void SetMarkerStyle(Style_t mstyle=1)
Set marker style, propagate to children.
void SetPointId(TObject *id)
Set external object id of the last added point.
Bool_t Fill(Double_t x, Double_t y, Double_t z, Double_t quant)
Add a new point.
Int_t fDefPointSetCapacity
Definition: TEvePointSet.h:119
void SetOwnIds(Bool_t o)
Propagate id-object ownership to children.
virtual void RemoveElementLocal(TEveElement *el)
Virtual from TEveElement, provide bin management.
Projected copy of a TEvePointSet.
Definition: TEvePointSet.h:172
virtual void PointSelected(Int_t id)
Virtual method of base class TPointSet3D.
virtual void UpdateProjection()
Re-apply the projection.
TEvePointSetProjected()
Default contructor.
virtual void SetDepthLocal(Float_t d)
Set depth (z-coordinate) of the projected points.
virtual void SetProjection(TEveProjectionManager *proj, TEveProjectable *model)
Set projection manager and projection model.
TEvePointSet is a render-element holding a collection of 3D points with optional per-point TRef and a...
Definition: TEvePointSet.h:36
virtual void InitFill(Int_t subIdNum)
Initialize point-set for new filling.
void AssertIntIdsSize()
Assert that size of IntId array is compatible with the size of the point array.
virtual TClass * ProjectedClass(const TEveProjection *p) const
Virtual from TEveProjectable, returns TEvePointSetProjected class.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set marker style, propagate to projecteds.
virtual const TGPicture * GetListTreeIcon(Bool_t open=kFALSE)
Return pointset icon.
virtual void TakeAction(TEvePointSelector *)
Called from TEvePointSelector when internal arrays of the tree-selector are filled up and need to be ...
void SetPointIntIds(Int_t *ids)
Set integer ids for the last point that was registered (most probably via TPolyMarker3D::SetNextPoint...
virtual void ClonePoints(const TEvePointSet &e)
Clone points and all point-related information from point-set 'e'.
Int_t GetPointIntId(Int_t p, Int_t i) const
Return i-th integer id of point with index p.
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
virtual void SetMarkerColor(Color_t col)
Set the marker color.
Definition: TEvePointSet.h:81
TArrayI * fIntIds
Definition: TEvePointSet.h:44
virtual void SetTitle(const char *t)
Definition: TEvePointSet.h:69
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write visualization parameters.
void Reset(Int_t n_points=0, Int_t n_int_ids=0)
Drop all data and set-up the data structures to recive new data.
Int_t GrowFor(Int_t n_points)
Resizes internal array to allow additional n_points to be stored.
virtual ~TEvePointSet()
Destructor.
virtual void Paint(Option_t *option="")
Paint point-set.
virtual void SetMarkerSize(Size_t msize=1)
Set marker size, propagate to projecteds.
TEvePointSet(Int_t n_points=0, ETreeVarType_e tv_type=kTVT_XYZ)
Constructor.
virtual void PointSelected(Int_t id)
Virtual method of base class TPointSet3D.
Int_t fIntIdsPerPoint
Definition: TEvePointSet.h:45
Int_t * GetPointIntIds(Int_t p) const
Return a pointer to integer ids of point with index p.
Abstract base-class for non-linear projectable objects.
ProjList_t fProjectedList
Abstract base class for classes that hold results of a non-linear projection transformation.
TEveProjectable * fProjectable
TEveProjectionManager * fManager
virtual void SetProjection(TEveProjectionManager *mng, TEveProjectable *model)
Sets projection manager and reference in the projectable object.
void SetDepthCommon(Float_t d, TEveElement *el, Float_t *bbox)
Utility function to update the z-values of the bounding-box.
Manager class for steering of projections and managing projected objects.
TEveProjection * GetProjection()
Base-class for non-linear projections.
void ProjectPointfv(Float_t *v, Float_t d)
Project float array.
TEveTrans is a 4x4 transformation matrix for homogeneous coordinates stored internally in a column-ma...
Definition: TEveTrans.h:27
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Mother of all ROOT objects.
Definition: TObject.h:37
TPolyMarker3D using TPointSet3DGL for direct OpenGL rendering.
Definition: TPointSet3D.h:22
virtual void ComputeBBox()
Compute the bounding box of this points set.
Definition: TPointSet3D.cxx:90
virtual void PointSelected(Int_t n)
This virtual method is called from TPointSet3DGL when a point is selected.
void SetOwnIds(Bool_t o)
Definition: TPointSet3D.h:52
void ClearIds()
Clears the id-array. If ids are owned the TObjects are deleted.
void CopyIds(const TPointSet3D &t)
Copy id objects from point-set 't'.
Definition: TPointSet3D.cxx:61
void SetPointId(TObject *id)
Set id of last point.
void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
virtual Int_t Size() const
Definition: TPolyMarker3D.h:73
virtual Int_t GetN() const
Definition: TPolyMarker3D.h:58
TString fOption
Definition: TPolyMarker3D.h:37
virtual void SetName(const char *name)
Change (i.e.
virtual Float_t * GetP() const
Definition: TPolyMarker3D.h:59
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
Float_t * fP
Definition: TPolyMarker3D.h:36
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition: TQObject.h:49
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:165
virtual Double_t * GetV4() const
virtual Double_t * GetV2() const
virtual Double_t * GetV1() const
virtual Int_t GetDimension() const
Definition: TSelectorDraw.h:80
virtual Double_t * GetVal(Int_t i) const
Return the last values corresponding to the i-th component of the formula being processed (where the ...
virtual Double_t * GetV3() const
virtual Int_t GetNfill() const
Definition: TSelectorDraw.h:84
Basic string class.
Definition: TString.h:131
TPaveText * pt
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
static constexpr double pi
static constexpr double ps
TMath.
Definition: TMathBase.h:35
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Definition: TMath.h:701
Short_t Max(Short_t a, Short_t b)
Definition: TMathBase.h:212
Int_t FloorNint(Double_t x)
Definition: TMath.h:695
Int_t CeilNint(Double_t x)
Definition: TMath.h:687
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:180
Double_t Cos(Double_t)
Definition: TMath.h:629
Double_t Sin(Double_t)
Definition: TMath.h:625
auto * m
Definition: textangle.C:8