21#include "TGLIncludes.h"
79 out[0] =
v1[1] *
v2[2] -
v1[2] *
v2[1];
80 out[1] =
v1[2] *
v2[0] -
v1[0] *
v2[2];
81 out[2] =
v1[0] *
v2[1] -
v1[1] *
v2[0];
89 using namespace TMath;
97 Float_t transF =
fM->GetTransitionEtaForward();
98 Float_t transB =
fM->GetTransitionEtaBackward();
102 TAxis *ax =
fM->GetData()->GetEtaBins();
103 Int_t nx = ax->GetNbins();
104 TAxis *ay =
fM->GetData()->GetPhiBins();
108 Float_t r, z, theta, phiU, phiL, eta;
111 for (
Int_t i=0; i<=nx; ++i)
113 eta = ax->GetBinUpEdge(i);
114 if (eta >= transF && (eta > etaMin && eta < etaMax))
118 z =
Sign(zEF, ax->GetBinLowEdge(i));
119 for (
Int_t j=1; j<=ny; ++j)
125 glVertex3f(
r*
Cos(phiL),
r*
Sin(phiL), z);
126 glVertex3f(
r*
Cos(phiU),
r*
Sin(phiU), z);
129 }
else if (eta <= transB && (eta > etaMin && eta < etaMax)) {
132 z =
Sign(zEB, ax->GetBinLowEdge(i));
133 for (
Int_t j=1; j<=ny; ++j)
139 glVertex3f(
r*
Cos(phiL),
r*
Sin(phiL), z);
140 glVertex3f(
r*
Cos(phiU),
r*
Sin(phiU), z);
156 for (
Int_t j=1; j<=ny; ++j)
162 glVertex3f( r1*
Cos(phiU), r1*
Sin(phiU), zEF);
163 glVertex3f( r2*
Cos(phiU), r2*
Sin(phiU), zEF);
164 glVertex3f( r1*
Cos(phiL), r1*
Sin(phiL), zEF);
165 glVertex3f( r2*
Cos(phiL), r2*
Sin(phiL), zEF);
181 for (
Int_t j=1; j<=ny; ++j)
187 glVertex3f(r1*
Cos(phiU), r1*
Sin(phiU), zEB);
188 glVertex3f(r2*
Cos(phiU), r2*
Sin(phiU), zEB);
189 glVertex3f(r1*
Cos(phiL), r1*
Sin(phiL), zEB);
190 glVertex3f(r2*
Cos(phiL), r2*
Sin(phiL), zEB);
201 using namespace TMath;
205 Float_t transF =
fM->GetTransitionEtaForward();
206 Float_t transB =
fM->GetTransitionEtaBackward();
211 TAxis *ax =
fM->GetData()->GetEtaBins();
212 Int_t nx = ax->GetNbins();
213 TAxis *ay =
fM->GetData()->GetPhiBins();
219 for(
Int_t i=0; i<=nx; i++)
221 eta = ax->GetBinUpEdge(i);
222 if (eta<=transF && eta>=transB && (etaMin < eta && eta < etaMax))
226 for (
Int_t j=1; j<=ny; j++)
232 glVertex3f(rB*
Cos(phiL), rB*
Sin(phiL), z);
233 glVertex3f(rB*
Cos(phiU), rB*
Sin(phiU), z);
245 zB =
fM->GetBackwardEndCapPos();
251 zF =
fM->GetForwardEndCapPos();
253 for (
Int_t j=1; j<=ny; j++)
261 glVertex3f(
x,
y, zB);
262 glVertex3f(
x,
y, zF);
265 glVertex3f(
x,
y, zB);
266 glVertex3f(
x,
y, zF);
278 Bool_t transparent_p =
fM->fFrameTransparency > 0;
282 glPushAttrib(GL_ENABLE_BIT | GL_DEPTH_BUFFER_BIT);
284 glDepthMask(GL_FALSE);
286 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
299 Float_t transF =
fM->GetTransitionEtaForward();
300 Float_t transB =
fM->GetTransitionEtaBackward();
301 if (
fM->GetRnrBarrelFrame() && (etaMin < transF && etaMax > transB))
306 if (
fM->GetRnrEndCapFrame() && (etaMax > transF || etaMin < transB))
400 using namespace TMath;
402 Float_t r1 =
fM->GetBarrelRadius() + offset;
404 Float_t z1In, z1Out, z2In, z2Out;
470 using namespace TMath;
471 Float_t z1, r1In, r1Out, z2, r2In, r2Out;
473 z1 = (cellData.
EtaMin()<0) ?
fM->fEndCapPosB - offset :
fM->fEndCapPosF + offset;
510 pnts[0] = r1Out*cos1;
511 pnts[1] = r1Out*sin1;
515 pnts[0] = r1Out*cos2;
516 pnts[1] = r1Out*sin2;
520 pnts[0] = r2Out*cos2;
521 pnts[1] = r2Out*sin2;
525 pnts[0] = r2Out*cos1;
526 pnts[1] = r2Out*sin1;
540 if (
fM->GetValueIsColor())
fM->AssertPalette();
544 fM->BuildCellIdCache();
546 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT | GL_POLYGON_BIT);
547 glEnable(GL_LIGHTING);
548 glEnable(GL_NORMALIZE);
550 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
555 Int_t prevTower = -1;
564 fM->fData->GetCellData((*i), cellData);
566 if (tower != prevTower)
572 fM->SetupColorHeight(cellData.
Value(
fM->fPlotEt), (*i).fSlice, towerH);
576 if ((cellData.
Eta() > 0 && cellData.
Eta() <
fM->GetTransitionEtaForward()) ||
577 (cellData.
Eta() < 0 && cellData.
Eta() >
fM->GetTransitionEtaBackward()))
600 if (
fM->fData->GetCellsSelected().empty() &&
fM->fData->GetCellsHighlighted().empty())
605 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT | GL_POLYGON_BIT);
606 glDisable(GL_LIGHTING);
607 glDisable(GL_CULL_FACE);
608 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
613 if (!
fM->fData->GetCellsHighlighted().empty())
618 if (!
fM->fData->GetCellsSelected().empty())
621 glGetFloatv(GL_DEPTH_RANGE,dr);
623 glDepthRange(dr[0], 0.8*dr[1]);
625 glDepthRange(dr[0], dr[1]);
641 fM->fData->GetCellData(*i, cellData);
642 fM->SetupColorHeight(cellData.
Value(
fM->fPlotEt), (*i).fSlice, towerH);
646 for (
Int_t j = 0; j < (
Int_t)
fM->fCellList.size(); ++j)
648 if (
fM->fCellList[j].fTower == i->fTower &&
fM->fCellList[j].fSlice == i->fSlice )
655 if (
fM->CellInEtaPhiRng(cellData))
657 if (cellData.
Eta() <
fM->GetTransitionEtaForward() && cellData.
Eta() >
fM->GetTransitionEtaBackward())
674 sel.push_back(
fM->fCellList[rec.
GetItem(1)]);
676 fM->fData->ProcessSelection(sel, rec);
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
Class to manage histogram axis.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
void SetBBox() override
Set bounding box.
std::vector< Float_t > fOffset
void RenderBarrelCell(const TEveCaloData::CellGeom_t &cell, Float_t towerH, Float_t &offset) const
Render barrel cell.
void RenderBox(const Float_t pnts[8]) const
Render box with given points.
void DirectDraw(TGLRnrCtx &rnrCtx) const override
GL rendering.
TEveCalo3DGL()
Constructor.
void RenderGrid(TGLRnrCtx &rnrCtx) const
Draw frame reading eta, phi axis.
void RenderGridEndCap() const
Render end cap grid.
void ProcessSelection(TGLRnrCtx &rnrCtx, TGLSelectRecord &rec) override
Processes tower selection.
void DrawHighlight(TGLRnrCtx &rnrCtx, const TGLPhysicalShape *ps, Int_t lvl=-1) const override
Draw polygons in highlight mode.
void DrawSelectedCells(TEveCaloData::vCellId_t cells) const
void CrossProduct(const Float_t a[3], const Float_t b[3], const Float_t c[3], Float_t out[3]) const
Calculate cross-product.
Bool_t ShouldDLCache(const TGLRnrCtx &rnrCtx) const override
Override from TGLObject.
void RenderGridBarrel() const
Render barrel grid.
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
Set model object.
void RenderEndCapCell(const TEveCaloData::CellGeom_t &cell, Float_t towerH, Float_t &offset) const
Render an endcap cell.
Visualization of a calorimeter event data in 3D.
std::vector< CellId_t > vCellId_t
static Float_t EtaToTheta(Float_t eta)
std::vector< CellId_t >::iterator vCellId_i
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.
TGLColor & Selection(Int_t i)
const UChar_t * CArr() const
TObject * fExternalObj
! Also plays the role of ID.
TT * SetModelDynCast(TObject *obj)
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.
Bool_t ShouldDLCache(const TGLRnrCtx &rnrCtx) const override
Decide if display-list should be used for this pass rendering, as determined by rnrCtx.
Concrete physical shape - a GL drawable.
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Bool_t SecSelection() const
TGLColorSet & ColorSet()
Return reference to current color-set (top of the stack).
Bool_t IsDrawPassOutlineLine() const
UInt_t GetItem(Int_t i) const
Standard selection record including information about containing scene and details ob out selected ob...
static UInt_t LockColor()
Prevent further color changes.
static void ColorTransparency(Color_t color_index, Char_t transparency=0)
Set color from color_index and ROOT-style transparency (default 0).
static UInt_t UnlockColor()
Allow color changes.
static Float_t LineWidth()
Get the line-width, taking the global scaling into account.
Mother of all ROOT objects.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
T1 Sign(T1 a, T2 b)
Returns a value with the magnitude of a and the sign of b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Cell data inner structure.
Float_t Value(Bool_t) const
Return energy value associated with the cell, usually Et.
Cell geometry inner structure.