Logo ROOT   6.12/07
Reference Guide
TEveCalo.cxx
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Matevz Tadel 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 "TEveCalo.h"
13 #include "TEveCaloData.h"
14 #include "TEveProjections.h"
15 #include "TEveProjectionManager.h"
16 #include "TEveRGBAPalette.h"
17 #include "TEveText.h"
18 #include "TEveTrans.h"
19 
20 #include "TClass.h"
21 #include "TMathBase.h"
22 #include "TMath.h"
23 #include "TAxis.h"
24 
25 #include "TGLUtil.h"
26 
27 #include <cassert>
28 
29 /** \class TEveCaloViz
30 \ingroup TEve
31 Base class for calorimeter data visualization.
32 See TEveCalo2D and TEveCalo3D for concrete implementations.
33 */
34 
36 
37 ////////////////////////////////////////////////////////////////////////////////
38 
39 TEveCaloViz::TEveCaloViz(TEveCaloData* data, const char* n, const char* t) :
40  TEveElement(),
41  TNamed(n, t),
43 
44  fData(0),
45  fCellIdCacheOK(kFALSE),
46 
47  fEtaMin(-10),
48  fEtaMax(10),
49 
50  fPhi(0.),
51  fPhiOffset(TMath::Pi()),
52 
53  fAutoRange(kTRUE),
54 
55  fBarrelRadius(-1.f),
56  fEndCapPosF(-1.f),
57  fEndCapPosB(-1.f),
58 
59  fPlotEt(kTRUE),
60 
61  fMaxTowerH(100),
62  fScaleAbs(kFALSE),
63  fMaxValAbs(100),
64 
65  fValueIsColor(kFALSE),
66  fPalette(0)
67 {
68  // Constructor.
69 
70  fPickable = kTRUE;
71  SetElementNameTitle(n, t);
72  SetData(data);
73 }
74 
75 ////////////////////////////////////////////////////////////////////////////////
76 /// Destructor.
77 
79 {
81 }
82 
83 ////////////////////////////////////////////////////////////////////////////////
84 /// Get threshold for given slice.
85 
87 {
88  return fData->RefSliceInfo(slice).fThreshold;
89 }
90 
91 ////////////////////////////////////////////////////////////////////////////////
92 /// Management of selection state and ownership of selected cell list
93 /// is done in TEveCaloData. This is a reason selection is forwarded to it.
94 
96 {
97  return fData;
98 }
99 
100 ////////////////////////////////////////////////////////////////////////////////
101 /// Management of selection state and ownership of selected cell list
102 /// is done in TEveCaloData. We still want GUI editor to display
103 /// concrete calo-viz object.
104 
106 {
107  return this;
108 }
109 
110 ////////////////////////////////////////////////////////////////////////////////
111 /// Set threshold for given slice.
112 
114 {
115  fData->SetSliceThreshold(slice, val);
116 }
117 
118 ////////////////////////////////////////////////////////////////////////////////
119 /// Get slice color from data.
120 
122 {
123  return fData->RefSliceInfo(slice).fColor;
124 }
125 
126 ////////////////////////////////////////////////////////////////////////////////
127 /// Set slice color in data.
128 
130 {
131  fData->SetSliceColor(slice, col);
132 }
133 
134 ////////////////////////////////////////////////////////////////////////////////
135 /// Set eta range.
136 
138 {
139  fEtaMin=l;
140  fEtaMax=u;
141 
143 }
144 
145 ////////////////////////////////////////////////////////////////////////////////
146 /// Set E/Et plot.
147 
149 {
150  fPlotEt=isEt;
151  if (fPalette)
153 
155 }
156 
157 ////////////////////////////////////////////////////////////////////////////////
158 
160 {
161  // Get maximum plotted value.
162 
163  return fData->GetMaxVal(fPlotEt);
164 
165 }
166 
167 ////////////////////////////////////////////////////////////////////////////////
168 /// Set phi range.
169 
171 {
172  using namespace TMath;
173 
174  fPhi = phi;
175  fPhiOffset = rng;
176 
178 }
179 
180 ////////////////////////////////////////////////////////////////////////////////
181 /// Get transition angle between barrel and end-cap cells, assuming fEndCapPosF = -fEndCapPosB.
182 
184 {
186 }
187 
188 ////////////////////////////////////////////////////////////////////////////////
189 /// Get transition eta between barrel and end-cap cells, assuming fEndCapPosF = -fEndCapPosB.
190 
192 {
193  using namespace TMath;
194  Float_t t = GetTransitionTheta()*0.5f;
195  return -Log(Tan(t));
196 }
197 
198 ////////////////////////////////////////////////////////////////////////////////
199 /// Get transition angle between barrel and forward end-cap cells.
200 
202 {
204 }
205 
206 ////////////////////////////////////////////////////////////////////////////////
207 /// Get transition eta between barrel and forward end-cap cells.
208 
210 {
211  using namespace TMath;
213  return -Log(Tan(t));
214 }
215 
216 ////////////////////////////////////////////////////////////////////////////////
217 /// Get transition angle between barrel and backward end-cap cells.
218 
220 {
222 }
223 
224 ////////////////////////////////////////////////////////////////////////////////
225 /// Get transition eta between barrel and backward end-cap cells.
226 
228 {
229  using namespace TMath;
231  //negative theta means negative eta
232  return Log(-Tan(t));
233 }
234 
235 
236 ////////////////////////////////////////////////////////////////////////////////
237 /// Set calorimeter event data.
238 
240 {
241 
242  if (data == fData) return;
243  if (fData) fData->RemoveElement(this);
244  fData = data;
245  if (fData)
246  {
247  fData->AddElement(this);
248  DataChanged();
249  }
250 }
251 
252 ////////////////////////////////////////////////////////////////////////////////
253 /// Update setting and cache on data changed.
254 /// Called from TEvecaloData::BroadcastDataChange()
255 
257 {
258  Double_t min, max, delta;
259 
260  fData->GetEtaLimits(min, max);
261  if (fAutoRange) {
262  fEtaMin = min;
263  fEtaMax = max;
264  } else {
265  if (fEtaMin < min) fEtaMin = min;
266  if (fEtaMax > max) fEtaMax = max;
267  }
268 
269  fData->GetPhiLimits(min, max);
270  delta = 0.5*(max - min);
271  if (fAutoRange || fPhi < min || fPhi > max) {
272  fPhi = 0.5*(max + min);
273  fPhiOffset = delta;
274  } else {
275  if (fPhiOffset > delta) fPhiOffset = delta;
276  }
277 
278  if (fPalette)
279  {
281  fPalette->SetLimits(0, hlimit);
282  fPalette->SetMin(0);
283  fPalette->SetMax(hlimit);
284  }
285 
287 }
288 
289 ////////////////////////////////////////////////////////////////////////////////
290 /// Assert cell id cache is ok.
291 /// Returns true if the cache has been updated.
292 
294 {
295  TEveCaloViz* cv = const_cast<TEveCaloViz*>(this);
296  if (!fCellIdCacheOK) {
297  cv->BuildCellIdCache();
298  return kTRUE;
299  } else {
300  return kFALSE;
301  }
302 }
303 
304 ////////////////////////////////////////////////////////////////////////////////
305 /// Returns true if given cell is in the ceta phi range.
306 
308 {
309  if (cellData.EtaMin() >= fEtaMin && cellData.EtaMax() <= fEtaMax)
310  {
312  (fPhi-fPhiOffset, fPhi+fPhiOffset, cellData.PhiMin(), cellData.PhiMax()))
313  return kTRUE;
314  }
315  return kFALSE;
316 }
317 
318 ////////////////////////////////////////////////////////////////////////////////
319 /// Assign parameters from given model.
320 
322 {
323  SetData(m->fData);
324 
325  fEtaMin = m->fEtaMin;
326  fEtaMax = m->fEtaMax;
327 
328  fPhi = m->fPhi;
329  fPhiOffset = m->fPhiOffset;
330 
334 
335  if (m->fPalette)
336  {
337  TEveRGBAPalette& mp = * m->fPalette;
338  if (fPalette) fPalette->DecRefCount();
341  }
342 }
343 
344 ////////////////////////////////////////////////////////////////////////////////
345 /// Set TEveRGBAPalette object pointer.
346 
348 {
349  if ( fPalette == p) return;
350  if (fPalette) fPalette->DecRefCount();
351  fPalette = p;
352  if (fPalette) fPalette->IncRefCount();
353 }
354 
355 ////////////////////////////////////////////////////////////////////////////////
356 /// Get transformation factor from E/Et to height
357 
359 {
360  if (fScaleAbs)
361  {
362  return fMaxTowerH/fMaxValAbs;
363  }
364  else
365  {
366  if (fData->Empty())
367  return 1;
368 
370  }
371 }
372 
373 ////////////////////////////////////////////////////////////////////////////////
374 /// Make sure the TEveRGBAPalette pointer is not null.
375 /// If it is not set, a new one is instantiated and the range is set
376 /// to current min/max signal values.
377 
379 {
380  if (fPalette == 0) {
383 
385  fPalette->SetLimits(0, hlimit);
386  fPalette->SetMin(0);
387  fPalette->SetMax(hlimit);
388 
389  }
390  return fPalette;
391 }
392 
393 ////////////////////////////////////////////////////////////////////////////////
394 /// Paint this object. Only direct rendering is supported.
395 
396 void TEveCaloViz::Paint(Option_t* /*option*/)
397 {
398  if (fData)
399  {
400  PaintStandard(this);
401  }
402 }
403 
404 ////////////////////////////////////////////////////////////////////////////////
405 /// Virtual from TEveProjectable, returns TEveCalo2D class.
406 
408 {
409  return TEveCalo2D::Class();
410 }
411 
412 ////////////////////////////////////////////////////////////////////////////////
413 /// Set color and height for a given value and slice using slice color or TEveRGBAPalette.
414 
415 void TEveCaloViz::SetupColorHeight(Float_t value, Int_t slice, Float_t& outH) const
416 {
417  if (fValueIsColor)
418  {
420  UChar_t c[4];
421  fPalette->ColorFromValue((Int_t)value, c);
422  c[3] = fData->GetSliceTransparency(slice);
424  }
425  else
426  {
428  outH = GetValToHeight()*value;
429  }
430 }
431 
432 /** \class TEveCalo3D
433 \ingroup TEve
434 Visualization of a calorimeter event data in 3D.
435 */
436 
438 
439 ////////////////////////////////////////////////////////////////////////////////
440 /// Constructor.
441 
442 TEveCalo3D::TEveCalo3D(TEveCaloData* d, const char* n, const char* t):
443  TEveCaloViz(d, n, t),
444 
445  fRnrEndCapFrame (kTRUE),
446  fRnrBarrelFrame (kTRUE),
447  fFrameWidth (0.5),
448  fFrameColor (kGray+1),
449  fFrameTransparency (80)
450 {
454 }
455 
456 ////////////////////////////////////////////////////////////////////////////////
457 /// Build list of drawn cell IDs. See TEveCalo3DGL::DirectDraw().
458 
460 {
461  fCellList.clear();
462 
465 }
466 
467 ////////////////////////////////////////////////////////////////////////////////
468 /// Fill bounding-box information of the base-class TAttBBox (virtual method).
469 /// If member 'TEveFrameBox* fFrame' is set, frame's corners are used as bbox.
470 
472 {
473  BBoxInit();
474 
475  Float_t th = (fData) ? GetValToHeight() * fData->GetMaxVal(fPlotEt) : 0;
476 
477  fBBox[0] = -fBarrelRadius - th;
478  fBBox[1] = fBarrelRadius + th;
479  fBBox[2] = fBBox[0];
480  fBBox[3] = fBBox[1];
481  fBBox[4] = fEndCapPosB - th;
482  fBBox[5] = fEndCapPosF + th;
483 }
484 
485 /** \class TEveCalo2D
486 \ingroup TEve
487 Visualization of a calorimeter event data in 2D.
488 */
489 
491 
492 ////////////////////////////////////////////////////////////////////////////////
493 /// Constructor.
494 
495 TEveCalo2D::TEveCalo2D(const char* n, const char* t):
496  TEveCaloViz(0, n, t),
497  TEveProjected(),
498  fOldProjectionType(TEveProjection::kPT_Unknown),
499  fMaxESumBin( 0),
500  fMaxEtSumBin(0)
501 {
502 }
503 
504 ////////////////////////////////////////////////////////////////////////////////
505 /// Destructor.
506 
508 {
510  UInt_t n;
511 
512  // clear selected cell ids
513  n = fCellListsSelected.size();
514  for(UInt_t i = 0; i < n; ++i) {
515  cids = fCellListsSelected[i];
516  if (cids) {
517  cids->clear(); delete cids;
518  }
519  }
520  fCellListsSelected.clear();
521 
522  // clear all cell dds
523  n = fCellLists.size();
524  for(UInt_t i = 0; i < n; ++i) {
525  cids = fCellLists[i];
526  if (cids) {
527  cids->clear(); delete cids;
528  }
529  }
530  fCellLists.clear();
531 }
532 
533 ////////////////////////////////////////////////////////////////////////////////
534 /// This is virtual method from base-class TEveProjected.
535 
537 {
539  {
542  }
543  ComputeBBox();
544 }
545 
546 ////////////////////////////////////////////////////////////////////////////////
547 /// Set projection manager and model object.
548 
550 {
551  TEveProjected::SetProjection(mng, model);
552  TEveCaloViz* viz = dynamic_cast<TEveCaloViz*>(model);
554 }
555 
556 ////////////////////////////////////////////////////////////////////////////////
557 /// Build lists of drawn cell IDs. See TEveCalo2DGL::DirecDraw().
558 
560 {
561  // clear old cache
562  for (vBinCells_i it = fCellLists.begin(); it != fCellLists.end(); it++)
563  {
564  if (*it)
565  {
566  (*it)->clear();
567  delete *it;
568  }
569  }
570  fCellLists.clear();
571  fCellLists.push_back(0);
572 
574  TEveCaloData::vCellId_t* clv; // ids per phi bin in r-phi projection else ids per eta bins in rho-z projection
575 
576  Bool_t isRPhi = (pt == TEveProjection::kPT_RPhi);
577 
578  const TAxis* axis = isRPhi ? fData->GetPhiBins() : fData->GetEtaBins();
579  Int_t nBins = axis->GetNbins();
580 
581  Float_t min, max;
582  if (isRPhi)
583  {
584  min = GetPhiMin() - fData->GetEps();
585  max = GetPhiMax() + fData->GetEps();
586  for (Int_t ibin = 1; ibin <= nBins; ++ibin) {
587  clv = 0;
589  (min, max, axis->GetBinLowEdge(ibin), axis->GetBinUpEdge(ibin)))
590  {
591  clv = new TEveCaloData::vCellId_t();
592  fData->GetCellList(GetEta(), GetEtaRng(), axis->GetBinCenter(ibin), axis->GetBinWidth(ibin), *clv);
593  if (!clv->size()) {
594  delete clv; clv = 0;
595  }
596  }
597  fCellLists.push_back(clv);
598  }
599  }
600  else
601  {
602  min = GetEtaMin() - fData->GetEps();
603  max = GetEtaMax() + fData->GetEps();
604  for (Int_t ibin = 1; ibin <= nBins; ++ibin) {
605  clv = 0;
606  Float_t low = axis->GetBinLowEdge(ibin);
607  Float_t up = axis->GetBinUpEdge(ibin) ;
608  if (low >= min && up <= max)
609  {
610  clv = new TEveCaloData::vCellId_t();
611  fData->GetCellList(axis->GetBinCenter(ibin), axis->GetBinWidth(ibin), fPhi, GetPhiRng(), *clv);
612  if (!clv->size()) {
613  delete clv; clv = 0;
614  }
615  }
616  fCellLists.push_back(clv);
617  }
618  }
619 
620  // cache max bin sum for auto scale
621  if (!fScaleAbs)
622  {
623  fMaxESumBin = 0;
624  fMaxEtSumBin = 0;
625  Float_t sumE = 0;
626  Float_t sumEt = 0;
627  TEveCaloData::CellData_t cellData;
628  for (Int_t ibin = 1; ibin <= nBins; ++ibin) {
629  TEveCaloData::vCellId_t* cids = fCellLists[ibin];
630  if (cids)
631  {
632  sumE = 0; sumEt = 0;
633  for (TEveCaloData::vCellId_i it = cids->begin(); it != cids->end(); it++)
634  {
635  fData->GetCellData(*it, cellData);
636  sumE += cellData.Value(kFALSE);
637  sumEt += cellData.Value(kTRUE);
638  }
641  }
642  }
643  ComputeBBox();
644  }
645 
647 }
648 
649 ////////////////////////////////////////////////////////////////////////////////
650 /// Sort selected cells in eta or phi bins for selection and highlight.
651 
653 {
656 }
657 
658 ////////////////////////////////////////////////////////////////////////////////
659 /// Sort selected cells in eta or phi bins.
660 
661 void TEveCalo2D::CellSelectionChangedInternal(TEveCaloData::vCellId_t& inputCells, std::vector<TEveCaloData::vCellId_t*>& outputCellLists)
662 {
664  const TAxis* axis = isRPhi ? fData->GetPhiBins() : fData->GetEtaBins();
665 
666  // clear old cache
667  for (vBinCells_i it = outputCellLists.begin(); it != outputCellLists.end(); it++)
668  {
669  if (*it)
670  {
671  (*it)->clear();
672  delete *it;
673  }
674  }
675  outputCellLists.clear();
676  UInt_t nBins = axis->GetNbins();
677  outputCellLists.resize(nBins+1);
678  for (UInt_t b = 0; b <= nBins; ++b)
679  outputCellLists[b] = 0;
680 
681  for(UInt_t bin = 1; bin <= nBins; ++bin)
682  {
683  TEveCaloData::vCellId_t* idsInBin = fCellLists[bin];
684  if (!idsInBin)
685  continue;
686 
687  for (TEveCaloData::vCellId_i i = idsInBin->begin(); i != idsInBin->end(); i++)
688  {
689  for (TEveCaloData::vCellId_i j = inputCells.begin(); j != inputCells.end(); j++)
690  {
691  if( (*i).fTower == (*j).fTower && (*i).fSlice == (*j).fSlice)
692  {
693  if (!outputCellLists[bin])
694  outputCellLists[bin] = new TEveCaloData::vCellId_t();
695 
696  outputCellLists[bin]->push_back(TEveCaloData::CellId_t((*i).fTower, (*i).fSlice, (*i).fFraction));
697  }
698  }
699  }
700  }
701 }
702 
703 ////////////////////////////////////////////////////////////////////////////////
704 /// Set absolute scale in projected calorimeter.
705 
707 {
710 }
711 
712 ////////////////////////////////////////////////////////////////////////////////
713 /// Virtual function of TEveCaloViz.
714 /// Get transformation factor from E/Et to height.
715 
717 {
719 
720  if (fScaleAbs)
721  {
722  return fMaxTowerH/fMaxValAbs;
723  }
724  else
725  {
726  if (fData->Empty())
727  return 1;
728 
729  if (fPlotEt)
730  return fMaxTowerH/fMaxEtSumBin;
731  else
732  return fMaxTowerH/fMaxESumBin;
733  }
734 }
735 
736 ////////////////////////////////////////////////////////////////////////////////
737 /// Fill bounding-box information of the base-class TAttBBox (virtual method).
738 /// If member 'TEveFrameBox* fFrame' is set, frame's corners are used as bbox.
739 
741 {
742  BBoxZero();
743 
744  Float_t x, y, z;
745  Float_t th = fMaxTowerH ;
746  Float_t r = fBarrelRadius + th;
747 
748  x = r, y = 0, z = 0;
750  BBoxCheckPoint(x, y, z);
751  x = -r, y = 0, z = 0;
753  BBoxCheckPoint(x, y, z);
754 
755  x = 0, y = 0, z = fEndCapPosF + th;
757  BBoxCheckPoint(x, y, z);
758  x = 0, y = 0, z = fEndCapPosB - th;
760  BBoxCheckPoint(x, y, z);
761 
762  x = 0, y = r, z = 0;
764  BBoxCheckPoint(x, y, z);
765  x = 0, y = -r, z = 0;
767  BBoxCheckPoint(x, y, z);
768 }
769 
770 
771 /** \class TEveCaloLego
772 \ingroup TEve
773 Visualization of calorimeter data as eta/phi histogram.
774 */
775 
777 
778 ////////////////////////////////////////////////////////////////////////////////
779 /// Constructor.
780 
781 TEveCaloLego::TEveCaloLego(TEveCaloData* d, const char* n, const char* t):
782  TEveCaloViz(d, n, t),
783 
784  fFontColor(-1),
785  fGridColor(-1),
786  fPlaneColor(kRed-5),
787  fPlaneTransparency(60),
788 
789  fNZSteps(6),
790  fZAxisStep(0.f),
791 
792  fAutoRebin(kTRUE),
793 
794  fPixelsPerBin(12),
795  fNormalizeRebin(kFALSE),
796 
797  fProjection(kAuto),
798  f2DMode(kValSize),
799  fBoxMode(kBack),
800 
801  fDrawHPlane(kFALSE),
802  fHPlaneVal(0),
803 
804  fHasFixedHeightIn2DMode(kFALSE),
805  fFixedHeightValIn2DMode(0.f),
806 
807  fDrawNumberCellPixels(18), // draw numbers on cell above 30 pixels
808  fCellPixelFontSize(12) // size of cell fonts in pixels
809 {
810  fMaxTowerH = 1;
811  SetElementNameTitle("TEveCaloLego", "TEveCaloLego");
812 }
813 
814 ////////////////////////////////////////////////////////////////////////////////
815 // Set data.
816 
818 {
819  TEveCaloViz::SetData(data);
820 }
821 
822 ////////////////////////////////////////////////////////////////////////////////
823 /// Build list of drawn cell IDs. For more information see TEveCaloLegoGL:DirectDraw().
824 
826 {
827  fCellList.clear();
828 
831 }
832 
833 ////////////////////////////////////////////////////////////////////////////////
834 /// Fill bounding-box information of the base-class TAttBBox (virtual method).
835 /// If member 'TEveFrameBox* fFrame' is set, frame's corners are used as bbox.
836 
838 {
839 
840  // fBBox = Float_t[6] X(min,max), Y(min,max), Z(min,max)
841 
842  BBoxZero();
843 
844  Float_t ex = 1.2; // 20% offset for axis labels
845 
846  Float_t a = 0.5*ex;
847 
848  fBBox[0] = -a;
849  fBBox[1] = a;
850  fBBox[2] = -a;
851  fBBox[3] = a;
852 
853  // scaling is relative to shortest XY axis
854  Double_t em, eM, pm, pM;
855  fData->GetEtaLimits(em, eM);
856  fData->GetPhiLimits(pm, pM);
857  Double_t r = (eM-em)/(pM-pm);
858  if (r<1)
859  {
860  fBBox[2] /= r;
861  fBBox[3] /= r;
862  }
863  else
864  {
865  fBBox[0] *= r;
866  fBBox[1] *= r;
867  }
868 
869  fBBox[4] = 0;
870  if (fScaleAbs && !fData->Empty())
871  fBBox[5] = GetMaxVal()*GetValToHeight();
872  else
873  fBBox[5] = fMaxTowerH;
874 }
TEveRGBAPalette * AssertPalette()
Make sure the TEveRGBAPalette pointer is not null.
Definition: TEveCalo.cxx:378
Abstract base class for classes that hold results of a non-linear projection transformation.
EPType_e GetType() const
vCellId_t & GetCellsSelected()
Definition: TEveCaloData.h:188
TEveProjection::EPType_e fOldProjectionType
Definition: TEveCalo.h:212
A generic, speed-optimised mapping from value to RGBA color supporting different wrapping and range t...
Float_t GetEta() const
Definition: TEveCalo.h:135
A central manager for calorimeter event data.
Definition: TEveCaloData.h:26
Float_t GetPhi() const
Definition: TEveCalo.h:143
virtual TAxis * GetEtaBins() const
Definition: TEveCaloData.h:218
void SetEta(Float_t l, Float_t u)
Set eta range.
Definition: TEveCalo.cxx:137
std::vector< CellId_t >::iterator vCellId_i
Definition: TEveCaloData.h:147
auto * m
Definition: textangle.C:8
Float_t fMaxTowerH
Definition: TEveCalo.h:56
SliceInfo_t & RefSliceInfo(Int_t s)
Definition: TEveCaloData.h:203
void SetPalette(TEveRGBAPalette *p)
Set TEveRGBAPalette object pointer.
Definition: TEveCalo.cxx:347
static void ColorTransparency(Color_t color_index, Char_t transparency=0)
Set color from color_index and ROOT-style transparency (default 0).
Definition: TGLUtil.cxx:1702
TEveCalo3D(const TEveCalo3D &)
Double_t Log(Double_t x)
Definition: TMath.h:648
Bool_t GetInterpolate() const
void SetPlotEt(Bool_t x)
Set E/Et plot.
Definition: TEveCalo.cxx:148
Bool_t fValueIsColor
Definition: TEveCalo.h:60
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
virtual void SetScaleAbs(Bool_t)
Set absolute scale in projected calorimeter.
Definition: TEveCalo.cxx:706
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
Definition: TAxis.cxx:504
Definition: Rtypes.h:59
void SetDataSliceColor(Int_t slice, Color_t col)
Set slice color in data.
Definition: TEveCalo.cxx:129
Bool_t fPickable
Definition: TEveElement.h:310
virtual TEveElement * ForwardSelection()
Management of selection state and ownership of selected cell list is done in TEveCaloData.
Definition: TEveCalo.cxx:95
void SetPhiWithRng(Float_t x, Float_t r)
Set phi range.
Definition: TEveCalo.cxx:170
Bool_t fCanEditMainColor
Definition: TEveElement.h:92
Definition: Rtypes.h:58
Float_t GetPhiMax() const
Definition: TEveCalo.h:145
TEveCaloLego(const TEveCaloLego &)
Float_t GetTransitionEtaBackward() const
Get transition eta between barrel and backward end-cap cells.
Definition: TEveCalo.cxx:227
static Bool_t IsU1IntervalOverlappingByMinMax(Float_t minM, Float_t maxM, Float_t minQ, Float_t maxQ)
Return true if interval Q is overlapping within interval M for U1 variables.
Definition: TEveUtil.cxx:367
Float_t fBarrelRadius
Definition: TEveCalo.h:50
virtual void PaintStandard(TObject *id)
Paint object – a generic implementation for EVE elements.
TEveCaloViz(const TEveCaloViz &)
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TEveCaloData::vCellId_t fCellList
Definition: TEveCalo.h:164
Char_t GetSliceTransparency(Int_t slice) const
Get transparency for given slice.
virtual void SetProjection(TEveProjectionManager *mng, TEveProjectable *model)
Sets projection manager and reference in the projectable object.
Float_t GetTransitionThetaBackward() const
Get transition angle between barrel and backward end-cap cells.
Definition: TEveCalo.cxx:219
Float_t PhiMin() const
Definition: TEveCaloData.h:95
virtual void BuildCellIdCache()=0
void SetSliceColor(Int_t slice, Color_t col)
Set color for given slice.
virtual void UpdateProjection()
This is virtual method from base-class TEveProjected.
Definition: TEveCalo.cxx:536
Float_t fEndCapPosB
Definition: TEveCalo.h:52
Float_t * fBBox
Definition: TAttBBox.h:20
Float_t GetEtaRng() const
Definition: TEveCalo.h:138
Float_t fMaxValAbs
Definition: TEveCalo.h:58
Bool_t fCellIdCacheOK
Definition: TEveCalo.h:40
virtual void ComputeBBox()
Fill bounding-box information of the base-class TAttBBox (virtual method).
Definition: TEveCalo.cxx:837
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Definition: TAxis.cxx:514
Float_t fMaxESumBin
Definition: TEveCalo.h:221
Float_t GetEtaMin() const
Definition: TEveCalo.h:136
Int_t GetMinVal() const
virtual void RemoveElement(TEveElement *el)
Remove el from the list of children.
std::vector< TEveCaloData::vCellId_t * > fCellListsSelected
Definition: TEveCalo.h:218
void IncRefCount()
Definition: TEveUtil.h:175
Color_t * fMainColorPtr
Definition: TEveElement.h:97
virtual void GetCellList(Float_t etaMin, Float_t etaMax, Float_t phi, Float_t phiRng, vCellId_t &out) const =0
void BBoxCheckPoint(Float_t x, Float_t y, Float_t z)
Definition: TAttBBox.h:58
Double_t x[n]
Definition: legend1.C:17
virtual void ProjectPoint(Float_t &x, Float_t &y, Float_t &z, Float_t d, EPProc_e p=kPP_Full)=0
Float_t EtaMax() const
Definition: TEveCaloData.h:91
Visualization of a calorimeter event data in 2D.
Definition: TEveCalo.h:199
Bool_t fCanEditMainTransparency
Definition: TEveElement.h:93
void Class()
Definition: Class.C:29
you should not use this method at all Int_t Int_t Double_t Double_t em
Definition: TRolke.cxx:630
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Bool_t Empty() const
Definition: TEveCaloData.h:216
Float_t GetPhiMin() const
Definition: TEveCalo.h:144
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
Definition: TAxis.cxx:464
virtual void SetScaleAbs(Bool_t x)
Definition: TEveCalo.h:84
Float_t fPlotEt
Definition: TEveCalo.h:54
Base-class for non-linear projections.
std::vector< CellId_t > vCellId_t
Definition: TEveCaloData.h:146
const UChar_t * ColorFromValue(Int_t val) const
Bool_t fAutoRange
Definition: TEveCalo.h:48
virtual void GetPhiLimits(Double_t &min, Double_t &max) const =0
Float_t GetTransitionTheta() const
Get transition angle between barrel and end-cap cells, assuming fEndCapPosF = -fEndCapPosB.
Definition: TEveCalo.cxx:183
virtual ~TEveCaloViz()
Destructor.
Definition: TEveCalo.cxx:78
Manager class for steering of projections and managing projected objects.
short Color_t
Definition: RtypesCore.h:79
virtual void CellSelectionChanged()
Sort selected cells in eta or phi bins for selection and highlight.
Definition: TEveCalo.cxx:652
Float_t GetTransitionThetaForward() const
Get transition angle between barrel and forward end-cap cells.
Definition: TEveCalo.cxx:201
Float_t PhiMax() const
Definition: TEveCaloData.h:96
Double_t fEtaMin
Definition: TEveCalo.h:42
void SetDataSliceThreshold(Int_t slice, Float_t val)
Set threshold for given slice.
Definition: TEveCalo.cxx:113
TEveCalo2D(const TEveCalo2D &)
Abstract base-class for non-linear projectable objects.
virtual ~TEveCalo2D()
Destructor.
Definition: TEveCalo.cxx:507
void SetDefaultColor(Color_t ci)
Set default color.
std::vector< TEveCaloData::vCellId_t * > fCellLists
Definition: TEveCalo.h:216
virtual void BuildCellIdCache()
Build list of drawn cell IDs. See TEveCalo3DGL::DirectDraw().
Definition: TEveCalo.cxx:459
void SetMin(Int_t min)
Set current min value.
TPaveText * pt
ROOT::R::TRInterface & r
Definition: Object.C:4
Class to manage histogram axis.
Definition: TAxis.h:30
void InvalidateCellIdCache()
Definition: TEveCalo.h:92
Float_t GetTransitionEtaForward() const
Get transition eta between barrel and forward end-cap cells.
Definition: TEveCalo.cxx:209
Float_t GetTransitionEta() const
Get transition eta between barrel and end-cap cells, assuming fEndCapPosF = -fEndCapPosB.
Definition: TEveCalo.cxx:191
double Pi()
Mathematical constants.
Definition: Math.h:90
auto * a
Definition: textangle.C:12
virtual void SetElementNameTitle(const char *name, const char *title)
Virtual function for setting of name and title of render element.
TEveProjectionManager * fManager
virtual void BuildCellIdCache()
Build lists of drawn cell IDs. See TEveCalo2DGL::DirecDraw().
Definition: TEveCalo.cxx:559
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual Float_t GetValToHeight() const
Virtual function of TEveCaloViz.
Definition: TEveCalo.cxx:716
void BBoxZero(Float_t epsilon=0, Float_t x=0, Float_t y=0, Float_t z=0)
Create cube of volume (2*epsilon)^3 at (x,y,z).
Definition: TAttBBox.cxx:42
TEveCaloData::vCellId_t fCellList
Definition: TEveCalo.h:264
Color_t GetDefaultColor() const
virtual void GetCellData(const CellId_t &id, CellData_t &data) const =0
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:75
void SetMax(Int_t max)
Set current max value.
virtual void AddElement(TEveElement *el)
Add el to the list of children.
Int_t GetMaxVal() const
Double_t fPhi
Definition: TEveCalo.h:45
vCellId_t & GetCellsHighlighted()
Definition: TEveCaloData.h:189
Float_t GetDataSliceThreshold(Int_t slice) const
Get threshold for given slice.
Definition: TEveCalo.cxx:86
void CellSelectionChangedInternal(TEveCaloData::vCellId_t &cells, std::vector< TEveCaloData::vCellId_t *> &cellLists)
Sort selected cells in eta or phi bins.
Definition: TEveCalo.cxx:661
const Bool_t kFALSE
Definition: RtypesCore.h:88
TEveProjection * GetProjection()
Visualization of calorimeter data as eta/phi histogram.
Definition: TEveCalo.h:249
void SetupColorHeight(Float_t value, Int_t slice, Float_t &height) const
Set color and height for a given value and slice using slice color or TEveRGBAPalette.
Definition: TEveCalo.cxx:415
#define ClassImp(name)
Definition: Rtypes.h:359
std::vector< TEveCaloData::vCellId_t * >::iterator vBinCells_i
Definition: TEveCalo.h:206
double Double_t
Definition: RtypesCore.h:55
std::vector< TEveCaloData::vCellId_t * > fCellListsHighlighted
Definition: TEveCalo.h:219
Float_t GetEtaMax() const
Definition: TEveCalo.h:137
Color_t GetSliceColor(Int_t slice) const
Get color for given slice.
virtual void ComputeBBox()
Fill bounding-box information of the base-class TAttBBox (virtual method).
Definition: TEveCalo.cxx:740
Double_t y[n]
Definition: legend1.C:17
virtual void BuildCellIdCache()
Build list of drawn cell IDs. For more information see TEveCaloLegoGL:DirectDraw().
Definition: TEveCalo.cxx:825
static Bool_t IsU1IntervalContainedByMinMax(Float_t minM, Float_t maxM, Float_t minQ, Float_t maxQ)
Return true if interval Q is contained within interval M for U1 variables.
Definition: TEveUtil.cxx:346
Base class for calorimeter data visualization.
Definition: TEveCalo.h:26
void DataChanged()
Update setting and cache on data changed.
Definition: TEveCalo.cxx:256
Bool_t CellInEtaPhiRng(TEveCaloData::CellData_t &) const
Returns true if given cell is in the ceta phi range.
Definition: TEveCalo.cxx:307
virtual TAxis * GetPhiBins() const
Definition: TEveCaloData.h:221
virtual Float_t GetEps() const
Definition: TEveCaloData.h:224
virtual void SetData(TEveCaloData *d)
Definition: TEveCalo.cxx:817
Double_t fPhiOffset
Definition: TEveCalo.h:46
Bool_t AssertCellIdCache() const
Assert cell id cache is ok.
Definition: TEveCalo.cxx:293
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
virtual void GetEtaLimits(Double_t &min, Double_t &max) const =0
virtual TClass * ProjectedClass(const TEveProjection *p) const
Virtual from TEveProjectable, returns TEveCalo2D class.
Definition: TEveCalo.cxx:407
Float_t GetMaxVal() const
Definition: TEveCalo.cxx:159
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
Definition: TAxis.cxx:526
void SetLimits(Int_t low, Int_t high)
Set low/high limits on signal value.
auto * l
Definition: textangle.C:4
Short_t Max(Short_t a, Short_t b)
Definition: TMathBase.h:200
Float_t GetPhiRng() const
Definition: TEveCalo.h:146
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
Float_t fEndCapPosF
Definition: TEveCalo.h:51
Cell data inner structure.
Definition: TEveCaloData.h:114
Color_t GetDataSliceColor(Int_t slice) const
Get slice color from data.
Definition: TEveCalo.cxx:121
void AssignCaloVizParameters(TEveCaloViz *cv)
Assign parameters from given model.
Definition: TEveCalo.cxx:321
void type_of_call hlimit(const int &)
Visualization of a calorimeter event data in 3D.
Definition: TEveCalo.h:156
unsigned char UChar_t
Definition: RtypesCore.h:34
void SetData(TEveCaloData *d)
Set calorimeter event data.
Definition: TEveCalo.cxx:239
TEveRGBAPalette * fPalette
Definition: TEveCalo.h:61
Int_t GetNbins() const
Definition: TAxis.h:121
void DecRefCount()
Definition: TEveUtil.h:176
virtual void SetProjection(TEveProjectionManager *proj, TEveProjectable *model)
Set projection manager and model object.
Definition: TEveCalo.cxx:549
Color_t fFrameColor
Definition: TEveCalo.h:170
Float_t Value(Bool_t) const
Return energy value associated with the cell, usually Et.
virtual Float_t GetMaxVal(Bool_t et) const
Definition: TEveCaloData.h:215
void SetSliceThreshold(Int_t slice, Float_t threshold)
Set threshold for given slice.
TEveCaloData * fData
Definition: TEveCalo.h:39
const Bool_t kTRUE
Definition: RtypesCore.h:87
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:33
Double_t ex[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
void BBoxInit(Float_t infinity=1e6)
Dynamic Float_t[6] X(min,max), Y(min,max), Z(min,max)
Definition: TAttBBox.cxx:29
Float_t EtaMin() const
Definition: TEveCaloData.h:90
Int_t CeilNint(Double_t x)
Definition: TMath.h:596
virtual Float_t GetValToHeight() const
Get transformation factor from E/Et to height.
Definition: TEveCalo.cxx:358
Double_t Tan(Double_t)
Definition: TMath.h:553
Float_t fMaxEtSumBin
Definition: TEveCalo.h:222
static void Color4ubv(const UChar_t *rgba)
Wrapper for glColor4ubv.
Definition: TGLUtil.cxx:1740
Bool_t fScaleAbs
Definition: TEveCalo.h:57
virtual void ComputeBBox()
Fill bounding-box information of the base-class TAttBBox (virtual method).
Definition: TEveCalo.cxx:471
Double_t fEtaMax
Definition: TEveCalo.h:43
virtual TEveElement * ForwardEdit()
Management of selection state and ownership of selected cell list is done in TEveCaloData.
Definition: TEveCalo.cxx:105
virtual void Paint(Option_t *option="")
Paint this object. Only direct rendering is supported.
Definition: TEveCalo.cxx:396
Double_t ATan(Double_t)
Definition: TMath.h:577