ROOT  6.06/09
Reference Guide
TEveCalo2DGL.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 "TEveCalo2DGL.h"
13 #include "TEveCalo.h"
14 #include "TEveProjections.h"
15 #include "TEveProjectionManager.h"
16 #include "TEveRGBAPalette.h"
17 
18 #include "TGLRnrCtx.h"
19 #include "TGLPhysicalShape.h"
20 #include "TGLSelectRecord.h"
21 #include "TGLIncludes.h"
22 #include "TGLUtil.h"
23 #include "TAxis.h"
24 
25 /** \class TEveCalo2DGL
26 \ingroup TEve
27 OpenGL renderer class for TEveCalo2D.
28 */
29 
31 
32 ////////////////////////////////////////////////////////////////////////////////
33 /// Constructor.
34 
36  TGLObject(),
37  fM(0)
38 {
39  // fDLCache = kFALSE; // Disable display list.
41 }
42 
43 ////////////////////////////////////////////////////////////////////////////////
44 /// Set model object.
45 
47 {
48  fM = SetModelDynCast<TEveCalo2D>(obj);
49  return kTRUE;
50 }
51 
52 ////////////////////////////////////////////////////////////////////////////////
53 /// Set bounding box.
54 
56 {
57  SetAxisAlignedBBox(((TEveCalo2D*)fExternalObj)->AssertBBox());
58 }
59 
60 ////////////////////////////////////////////////////////////////////////////////
61 /// Is current projection type RPhi
62 
64 {
66 }
67 
68 ////////////////////////////////////////////////////////////////////////////////
69 /// Calculate vertices for the calorimeter cell in RPhi projection.
70 /// Returns outside radius of the tower.
71 
73  Float_t towerH, Float_t offset) const
74 {
75  using namespace TMath;
76 
77  Float_t r1 = fM->fBarrelRadius + offset;
78  Float_t r2 = r1 + towerH;
79 
80  Float_t pnts[8];
81 
82  pnts[0] = r1*Cos(phiMin); pnts[1] = r1*Sin(phiMin);
83  pnts[2] = r2*Cos(phiMin); pnts[3] = r2*Sin(phiMin);
84  pnts[4] = r2*Cos(phiMax); pnts[5] = r2*Sin(phiMax);
85  pnts[6] = r1*Cos(phiMax); pnts[7] = r1*Sin(phiMax);
86 
87  Float_t x, y, z;
88  glBegin(GL_QUADS);
89  for (Int_t i = 0; i < 4; ++i)
90  {
91  x = pnts[2*i];
92  y = pnts[2*i+1];
93  z = 0.f;
95  glVertex3f(x, y, z);
96  }
97  glEnd();
98 }
99 
100 ////////////////////////////////////////////////////////////////////////////////
101 /// Draw calorimeter cells in RPhi projection.
102 
104 {
105  TEveCaloData* data = fM->GetData();
106  Int_t nSlices = data->GetNSlices();
107  Float_t *sliceVal = new Float_t[nSlices];
108  TEveCaloData::CellData_t cellData;
109  Float_t towerH;
110 
111  UInt_t nPhi = data->GetPhiBins()->GetNbins();
112  TAxis* axis = data->GetPhiBins();
113  for(UInt_t phiBin = 1; phiBin <= nPhi; ++phiBin)
114  {
115  if (cellLists[phiBin] )
116  {
117  // reset values
118  Float_t off = 0;
119  for (Int_t s=0; s<nSlices; ++s)
120  sliceVal[s] = 0;
121 
122  // sum eta cells
123  TEveCaloData::vCellId_t* cids = cellLists[phiBin];
124  for (TEveCaloData::vCellId_i it = cids->begin(); it != cids->end(); it++)
125  {
126  data->GetCellData(*it, cellData);
127  sliceVal[(*it).fSlice] += cellData.Value(fM->fPlotEt)*(*it).fFraction;
128  }
129 
130  if (rnrCtx.SecSelection()) {
131  glLoadName(phiBin); // set name-stack phi bin
132  glPushName(0);
133  }
134  for (Int_t s = 0; s < nSlices; ++s)
135  {
136  if (rnrCtx.SecSelection()) glLoadName(s); // set name-stack slice
137  fM->SetupColorHeight(sliceVal[s], s, towerH);
138  MakeRPhiCell(axis->GetBinLowEdge(phiBin), axis->GetBinUpEdge(phiBin), towerH, off);
139  off += towerH;
140  }
141  if (rnrCtx.SecSelection()) glPopName(); // slice
142  }
143  }
144 
145  delete [] sliceVal;
146 }
147 
148 ////////////////////////////////////////////////////////////////////////////////
149 /// Draw selected calorimeter cells in RPhi projection.
150 
151 void TEveCalo2DGL::DrawRPhiHighlighted(std::vector<TEveCaloData::vCellId_t*>& cellLists) const
152 {
153  static const TEveException eh("TEveCalo2DGL::DrawRPhiHighlighted ");
154 
155  TEveCaloData* data = fM->fData;
156  TEveCaloData::CellData_t cellData;
157  Int_t nSlices = data->GetNSlices();
158  UInt_t nPhiBins = data->GetPhiBins()->GetNbins();
159  Float_t *sliceVal = new Float_t[nSlices];
160  Float_t *sliceValRef = new Float_t[nSlices];
161  Float_t towerH, towerHRef;
162 
163  TAxis* axis = data->GetPhiBins();
164  for(UInt_t phiBin = 1; phiBin <= nPhiBins; ++phiBin)
165  {
166  if (cellLists[phiBin])
167  {
168  if (!fM->fCellLists[phiBin])
169  throw eh + "selected cell not in cell list cache.";
170 
171  Float_t off = 0;
172  // selected eta sum
173  for (Int_t s=0; s<nSlices; ++s) sliceVal[s] = 0;
174  TEveCaloData::vCellId_t& cids = *(cellLists[phiBin]);
175  for (TEveCaloData::vCellId_i i=cids.begin(); i!=cids.end(); i++) {
176  data->GetCellData((*i), cellData);
177  sliceVal[i->fSlice] += cellData.Value(fM->fPlotEt)*(*i).fFraction;
178  }
179  // referenced eta sum
180  for (Int_t s=0; s<nSlices; ++s) sliceValRef[s] = 0;
181  TEveCaloData::vCellId_t& cidsRef = *(fM->fCellLists[phiBin]);
182  for (TEveCaloData::vCellId_i i=cidsRef.begin(); i!=cidsRef.end(); i++) {
183  data->GetCellData(*i, cellData);
184  sliceValRef[i->fSlice] += cellData.Value(fM->fPlotEt)*(*i).fFraction;
185  }
186  // draw
187  for (Int_t s = 0; s < nSlices; ++s) {
188  fM->SetupColorHeight(sliceValRef[s], s, towerHRef);
189  if (sliceVal[s] > 0)
190  {
191  fM->SetupColorHeight(sliceVal[s], s, towerH);
192  MakeRPhiCell(axis->GetBinLowEdge(phiBin), axis->GetBinUpEdge(phiBin), towerH, off);
193  }
194  off += towerHRef;
195  }
196  }
197  }
198 
199  delete [] sliceVal;
200  delete [] sliceValRef;
201 }
202 
203 ////////////////////////////////////////////////////////////////////////////////
204 /// Draw cell in RhoZ projection.
205 
207  Float_t& offset, Bool_t isBarrel, Bool_t phiPlus, Float_t towerH) const
208 {
209  using namespace TMath;
210 
211  Float_t pnts[8];
212 
213  Float_t sin1 = Sin(thetaMin);
214  Float_t cos1 = Cos(thetaMin);
215  Float_t sin2 = Sin(thetaMax);
216  Float_t cos2 = Cos(thetaMax);
217 
218  if (isBarrel)
219  {
220  Float_t r1 = fM->fBarrelRadius/Abs(Sin(0.5f*(thetaMin+thetaMax))) + offset;
221  Float_t r2 = r1 + towerH;
222 
223  pnts[0] = r1*sin1; pnts[1] = r1*cos1;
224  pnts[2] = r2*sin1; pnts[3] = r2*cos1;
225  pnts[4] = r2*sin2; pnts[5] = r2*cos2;
226  pnts[6] = r1*sin2; pnts[7] = r1*cos2;
227  }
228  else
229  {
230  // endcap
232  // uses a different theta definition than GetTransitionThetaBackward(), so we need a conversion
234  if (thetaMax >= transThetaB)
235  zE = Abs(fM->GetBackwardEndCapPos());
236  Float_t r1 = zE/Abs(Cos(0.5f*(thetaMin+thetaMax))) + offset;
237  Float_t r2 = r1 + towerH;
238 
239  pnts[0] = r1*sin1; pnts[1] = r1*cos1;
240  pnts[2] = r2*sin1; pnts[3] = r2*cos1;
241  pnts[4] = r2*sin2; pnts[5] = r2*cos2;
242  pnts[6] = r1*sin2; pnts[7] = r1*cos2;
243  }
244 
245  glBegin(GL_QUADS);
246  Float_t x, y, z;
247  for (Int_t i = 0; i < 4; ++i)
248  {
249  x = 0.f;
250  y = phiPlus ? Abs(pnts[2*i]) : -Abs(pnts[2*i]);
251  z = pnts[2*i+1];
252  fM->fManager->GetProjection()->ProjectPoint(x, y, z, fM->fDepth);
253  glVertex3f(x, y, z);
254  }
255  glEnd();
256 }
257 
258 ////////////////////////////////////////////////////////////////////////////////
259 /// Draw calorimeter in RhoZ projection.
260 
262 {
263  TEveCaloData* data = fM->GetData();
264  Int_t nSlices = data->GetNSlices();
265 
266  TEveCaloData::CellData_t cellData;
267  Float_t *sliceValsUp = new Float_t[nSlices];
268  Float_t *sliceValsLow = new Float_t[nSlices];
269  Bool_t isBarrel;
270  Float_t towerH;
271  Float_t transEtaF = fM->GetTransitionEtaForward();
272  Float_t transEtaB = fM->GetTransitionEtaBackward();
273 
274  TAxis* axis = data->GetEtaBins();
275  UInt_t nEta = axis->GetNbins();
276  for (UInt_t etaBin = 1; etaBin <= nEta; ++etaBin)
277  {
278  if (cellLists[etaBin] )
279  {
280  assert(fM->fCellLists[etaBin]);
281  Float_t etaMin = axis->GetBinLowEdge(etaBin);
282  Float_t etaMax = axis->GetBinUpEdge(etaBin);
283  Float_t thetaMin = TEveCaloData::EtaToTheta(etaMax);
284  Float_t thetaMax = TEveCaloData::EtaToTheta(etaMin);
285 
286  // clear
287  Float_t offUp = 0;
288  Float_t offLow = 0;
289  for (Int_t s = 0; s < nSlices; ++s) {
290  sliceValsUp [s] = 0;
291  sliceValsLow[s] = 0;
292  }
293  // values
294  TEveCaloData::vCellId_t* cids = cellLists[etaBin];
295  for (TEveCaloData::vCellId_i it = cids->begin(); it != cids->end(); ++it)
296  {
297  data->GetCellData(*it, cellData);
298  if (cellData.IsUpperRho())
299  sliceValsUp [it->fSlice] += cellData.Value(fM->fPlotEt)*(*it).fFraction;
300  else
301  sliceValsLow[it->fSlice] += cellData.Value(fM->fPlotEt)*(*it).fFraction;
302  }
303 
304  isBarrel = !(etaMax > 0 && etaMax > transEtaF) && !(etaMin < 0 && etaMin < transEtaB);
305 
306  // draw
307  if (rnrCtx.SecSelection()) glLoadName(etaBin); // name-stack eta bin
308  if (rnrCtx.SecSelection()) glPushName(0);
309 
310  for (Int_t s = 0; s < nSlices; ++s)
311  {
312  if (rnrCtx.SecSelection()) glLoadName(s); // name-stack slice
313  if (rnrCtx.SecSelection()) glPushName(0);
314  // phi +
315  if (sliceValsUp[s])
316  {
317  if (rnrCtx.SecSelection()) glLoadName(1); // name-stack phi sign
318  fM->SetupColorHeight(sliceValsUp[s], s, towerH);
319  MakeRhoZCell(thetaMin, thetaMax, offUp, isBarrel, kTRUE , towerH);
320  offUp += towerH;
321  }
322  // phi -
323  if (sliceValsLow[s])
324  {
325  if (rnrCtx.SecSelection()) glLoadName(0); // name-stack phi sign
326  fM->SetupColorHeight(sliceValsLow[s], s, towerH);
327  MakeRhoZCell(thetaMin, thetaMax, offLow, isBarrel, kFALSE , towerH);
328  offLow += towerH;
329  }
330  if (rnrCtx.SecSelection()) glPopName(); // phi sign is pos
331  }
332  //
333  if (rnrCtx.SecSelection()) glPopName(); // slice
334  }
335  }
336 
337  delete [] sliceValsUp;
338  delete [] sliceValsLow;
339 }
340 
341 ////////////////////////////////////////////////////////////////////////////////
342 /// Draw selected calorimeter cells in RhoZ projection.
343 
344 void TEveCalo2DGL::DrawRhoZHighlighted(std::vector<TEveCaloData::vCellId_t*>& cellLists) const
345 {
346  static const TEveException eh("TEveCalo2DGL::DrawRhoZHighlighted ");
347 
348  TEveCaloData* data = fM->GetData();
349  TAxis* axis = data->GetEtaBins();
350  UInt_t nEtaBins = axis->GetNbins();
351  Int_t nSlices = data->GetNSlices();
352  Float_t transEtaF = fM->GetTransitionEtaForward();
353  Float_t transEtaB = fM->GetTransitionEtaBackward();
354 
355  Float_t *sliceValsUp = new Float_t[nSlices];
356  Float_t *sliceValsLow = new Float_t[nSlices];
357  Float_t *sliceValsUpRef = new Float_t[nSlices];
358  Float_t *sliceValsLowRef = new Float_t[nSlices];
359 
360  Bool_t isBarrel;
361  Float_t towerH, towerHRef, offUp, offLow;
362  TEveCaloData::CellData_t cellData;
363 
364  for (UInt_t etaBin = 1; etaBin <= nEtaBins; ++etaBin)
365  {
366  if (cellLists[etaBin])
367  {
368  if (!fM->fCellLists[etaBin])
369  throw(eh + "selected cell not in cell list cache.");
370 
371  offUp = 0; offLow =0;
372  // selected phi sum
373  for (Int_t s = 0; s < nSlices; ++s) {
374  sliceValsUp[s] = 0; sliceValsLow[s] = 0;
375  }
376  TEveCaloData::vCellId_t& cids = *(cellLists[etaBin]);
377  for (TEveCaloData::vCellId_i i=cids.begin(); i!=cids.end(); i++) {
378  data->GetCellData(*i, cellData);
379  if (cellData.IsUpperRho())
380  sliceValsUp [i->fSlice] += cellData.Value(fM->fPlotEt)*(*i).fFraction;
381  else
382  sliceValsLow[i->fSlice] += cellData.Value(fM->fPlotEt)*(*i).fFraction;
383  }
384 
385  // reference phi sum
386  for (Int_t s = 0; s < nSlices; ++s)
387  {
388  sliceValsUpRef[s] = 0; sliceValsLowRef[s] = 0;
389  }
390  TEveCaloData::vCellId_t& cidsRef = *(fM->fCellLists[etaBin]);
391  for (TEveCaloData::vCellId_i i=cidsRef.begin(); i!=cidsRef.end(); i++)
392  {
393  data->GetCellData(*i, cellData);
394  if (cellData.IsUpperRho())
395  sliceValsUpRef [i->fSlice] += cellData.Value(fM->fPlotEt)*(*i).fFraction;
396  else
397  sliceValsLowRef[i->fSlice] += cellData.Value(fM->fPlotEt)*(*i).fFraction;
398  }
399 
400  Float_t bincenterEta = axis->GetBinCenter(etaBin);
401  isBarrel = !(bincenterEta > 0 && bincenterEta > transEtaF) && !(bincenterEta < 0 && bincenterEta < transEtaB);
402 
403  for (Int_t s = 0; s < nSlices; ++s)
404  {
405  Float_t thetaMin = TEveCaloData::EtaToTheta(axis->GetBinUpEdge(etaBin));
406  Float_t thetaMax = TEveCaloData::EtaToTheta(axis->GetBinLowEdge(etaBin));
407  // phi +
408  fM->SetupColorHeight(sliceValsUpRef[s], s, towerHRef);
409  if (sliceValsUp[s] > 0) {
410  fM->SetupColorHeight(sliceValsUp[s], s, towerH);
411  MakeRhoZCell(thetaMin, thetaMax, offUp, isBarrel, kTRUE , towerH);
412  }
413  offUp += towerHRef;
414 
415  // phi -
416  fM->SetupColorHeight(sliceValsLowRef[s], s, towerHRef);
417  if (sliceValsLow[s] > 0) {
418  fM->SetupColorHeight(sliceValsLow[s], s, towerH);
419  MakeRhoZCell(thetaMin, thetaMax, offLow, isBarrel, kFALSE , towerH);
420  }
421  offLow += towerHRef;
422  } // slices
423  } // if eta bin
424  } //eta bin
425 
426  delete [] sliceValsUp;
427  delete [] sliceValsLow;
428  delete [] sliceValsUpRef;
429  delete [] sliceValsLowRef;
430 }
431 
432 ////////////////////////////////////////////////////////////////////////////////
433 /// Render with OpenGL.
434 
436 {
437  TGLCapabilitySwitch light_off(GL_LIGHTING, kFALSE);
438  TGLCapabilitySwitch cull_off (GL_CULL_FACE, kFALSE);
439 
440  glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT);
441  glEnable(GL_BLEND);
442  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
443 
444  if (fM->fCellIdCacheOK == kFALSE)
445  fM->BuildCellIdCache();
446 
447  fM->AssertPalette();
448 
449  if (rnrCtx.SecSelection()) glPushName(0);
450  if (IsRPhi())
451  DrawRPhi(rnrCtx, fM->fCellLists);
452  else
453  DrawRhoZ(rnrCtx, fM->fCellLists);
454  if (rnrCtx.SecSelection()) glPopName();
455  glPopAttrib();
456 }
457 
458 ////////////////////////////////////////////////////////////////////////////////
459 /// Draw towers in highlight mode.
460 
461 void TEveCalo2DGL::DrawHighlight(TGLRnrCtx& rnrCtx, const TGLPhysicalShape* /*pshp*/, Int_t /*lvl*/) const
462 {
463  static const TEveException eh("TEveCalo2DGL::DrawHighlight ");
464 
465  if (fM->fData->GetCellsSelected().empty() && fM->fData->GetCellsHighlighted().empty())
466  {
467  return;
468  }
469 
470  TGLCapabilitySwitch cull_off (GL_CULL_FACE, kFALSE);
471 
473  try
474  {
475  if (!fM->fData->GetCellsHighlighted().empty())
476  {
477  glColor4ubv(rnrCtx.ColorSet().Selection(3).CArr());
478 
479  if (IsRPhi())
481  else
483  }
484  if (!fM->fData->GetCellsSelected().empty())
485  {
486  glColor4ubv(rnrCtx.ColorSet().Selection(1).CArr());
487  if (IsRPhi())
489  else
491 
492  }
493  }
494  catch (TEveException& exc)
495  {
496  Warning(eh, "%s", exc.what());
497  }
499 }
500 
501 ////////////////////////////////////////////////////////////////////////////////
502 /// Processes tower selection in eta bin or phi bin.
503 /// Virtual function from TGLogicalShape. Called from TGLViewer.
504 
506 {
508  if (rec.GetN() > 2)
509  {
510  Int_t bin = rec.GetItem(1);
511  Int_t slice = rec.GetItem(2);
512  for (TEveCaloData::vCellId_i it = fM->fCellLists[bin]->begin();
513  it != fM->fCellLists[bin]->end(); ++it)
514  {
515  if ((*it).fSlice == slice)
516  {
517  if (IsRPhi())
518  {
519  sel.push_back(*it);
520  }
521  else
522  {
523  assert(rec.GetN() > 3);
524  Bool_t is_upper = (rec.GetItem(3) == 1);
526  fM->fData->GetCellData(*it, cd);
527  if ((is_upper && cd.IsUpperRho()) || (!is_upper && !cd.IsUpperRho()))
528  sel.push_back(*it);
529  }
530  }
531  }
532  }
533  fM->fData->ProcessSelection(sel, rec);
534 }
TEveRGBAPalette * AssertPalette()
Make sure the TEveRGBAPalette pointer is not null.
Definition: TEveCalo.cxx:378
Bool_t IsUpperRho() const
Definition: TEveCaloData.h:105
vCellId_t & GetCellsSelected()
Definition: TEveCaloData.h:188
const UChar_t * CArr() const
Definition: TGLUtil.h:803
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition: TGLRnrCtx.h:40
virtual TAxis * GetPhiBins() const
Definition: TEveCaloData.h:221
A central manager for calorimeter event data.
Definition: TEveCaloData.h:26
std::vector< CellId_t >::iterator vCellId_i
Definition: TEveCaloData.h:147
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
#define assert(cond)
Definition: unittest.h:542
Float_t GetForwardEndCapPos() const
Definition: TEveCalo.h:102
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
Definition: TAxis.cxx:489
void MakeRhoZCell(Float_t thetaMin, Float_t thetaMax, Float_t &offset, Bool_t isBarrel, Bool_t phiPlus, Float_t towerH) const
Draw cell in RhoZ projection.
Float_t fBarrelRadius
Definition: TEveCalo.h:50
void SetAxisAlignedBBox(Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax, Float_t zmin, Float_t zmax)
Set axis-aligned bounding-box.
Definition: TGLObject.cxx:86
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
T etaMax()
Function providing the maximum possible value of pseudorapidity for a non-zero rho, in the Scalar type with the largest dynamic range.
Definition: etaMax.h:50
const Bool_t kFALSE
Definition: Rtypes.h:92
EPType_e GetType() const
Short_t Abs(Short_t d)
Definition: TMathBase.h:110
Bool_t fCellIdCacheOK
Definition: TEveCalo.h:40
virtual void DrawHighlight(TGLRnrCtx &rnrCtx, const TGLPhysicalShape *ps, Int_t lvl=-1) const
Draw towers in highlight mode.
Concrete physical shape - a GL drawable.
std::vector< TEveCaloData::vCellId_t * > fCellListsSelected
Definition: TEveCalo.h:218
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
Visualization of a calorimeter event data in 2D.
Definition: TEveCalo.h:199
static Float_t EtaToTheta(Float_t eta)
Int_t GetNSlices() const
Definition: TEveCaloData.h:202
void DrawRhoZ(TGLRnrCtx &rnrCtx, TEveCalo2D::vBinCells_t &) const
Draw calorimeter in RhoZ projection.
void MakeRPhiCell(Float_t phiMin, Float_t phiMax, Float_t towerH, Float_t offset) const
Calculate vertices for the calorimeter cell in RPhi projection.
Base-class for direct OpenGL renderers.
Definition: TGLObject.h:21
Float_t fPlotEt
Definition: TEveCalo.h:54
std::vector< CellId_t > vCellId_t
Definition: TEveCaloData.h:146
static UInt_t LockColor()
Prevent further color changes.
Definition: TGLUtil.cxx:1630
static UInt_t UnlockColor()
Allow color changes.
Definition: TGLUtil.cxx:1638
TObject * fExternalObj
first replica
void DrawRPhiHighlighted(std::vector< TEveCaloData::vCellId_t * > &cellLists) const
Draw selected calorimeter cells in RPhi projection.
std::vector< TEveCaloData::vCellId_t * > fCellLists
Definition: TEveCalo.h:216
void DrawRhoZHighlighted(std::vector< TEveCaloData::vCellId_t * > &cellLists) const
Draw selected calorimeter cells in RhoZ projection.
TEveCaloData * GetData() const
Definition: TEveCalo.h:86
Class to manage histogram axis.
Definition: TAxis.h:36
Bool_t IsRPhi() const
Is current projection type RPhi.
void ProcessSelection(vCellId_t &sel_cells, TGLSelectRecord &rec)
Process newly selected cells with given select-record.
Int_t GetNbins() const
Definition: TAxis.h:125
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Definition: TAxis.cxx:499
OpenGL renderer class for TEveCalo2D.
Definition: TEveCalo2DGL.h:25
TEveCalo2D * fM
Definition: TEveCalo2DGL.h:32
virtual Bool_t SetModel(TObject *obj, const Option_t *opt=0)
Set model object.
Standard selection record including information about containing scene and details ob out selected ob...
unsigned int r1[N_CITIES]
Definition: simanTSP.cxx:321
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
Float_t GetTransitionEtaBackward() const
Get transition eta between barrel and backward end-cap cells.
Definition: TEveCalo.cxx:227
virtual void GetCellData(const CellId_t &id, CellData_t &data) const =0
Bool_t SecSelection() const
Definition: TGLRnrCtx.h:224
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
Render with OpenGL.
void Warning(const char *location, const char *msgfmt,...)
vCellId_t & GetCellsHighlighted()
Definition: TEveCaloData.h:189
Float_t Value(Bool_t) const
Return energy value associated with the cell, usually Et.
Double_t Cos(Double_t)
Definition: TMath.h:424
TEveProjection * GetProjection()
Float_t GetTransitionEtaForward() const
Get transition eta between barrel and forward end-cap cells.
Definition: TEveCalo.cxx:209
double f(double x)
std::vector< TEveCaloData::vCellId_t * > fCellListsHighlighted
Definition: TEveCalo.h:219
UInt_t GetItem(Int_t i) const
Double_t y[n]
Definition: legend1.C:17
std::vector< TEveCaloData::vCellId_t * > vBinCells_t
Definition: TEveCalo.h:205
Bool_t fMultiColor
Definition: TGLObject.h:28
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
Definition: TAxis.cxx:449
Mother of all ROOT objects.
Definition: TObject.h:58
TEveCalo2DGL()
Constructor.
TGLColor & Selection(Int_t i)
Definition: TGLUtil.h:857
virtual TAxis * GetEtaBins() const
Definition: TEveCaloData.h:218
ClassImp(TEveCalo2DGL)
virtual void ProcessSelection(TGLRnrCtx &rnrCtx, TGLSelectRecord &rec)
Processes tower selection in eta bin or phi bin.
Double_t Sin(Double_t)
Definition: TMath.h:421
virtual void SetBBox()
Set bounding box.
Exception class thrown by TEve classes and macros.
Definition: TEveUtil.h:102
Cell data inner structure.
Definition: TEveCaloData.h:114
void DrawRPhi(TGLRnrCtx &rnrCtx, TEveCalo2D::vBinCells_t &) const
Draw calorimeter cells in RPhi projection.
TGLColorSet & ColorSet()
Return reference to current color-set (top of the stack).
Definition: TGLRnrCtx.cxx:278
Float_t GetBackwardEndCapPos() const
Definition: TEveCalo.h:103
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
TEveCaloData * fData
Definition: TEveCalo.h:39
virtual const char * what() const
Definition: TEveUtil.h:112
Int_t GetN() const
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
unsigned int r2[N_CITIES]
Definition: simanTSP.cxx:322