21#include "TGLIncludes.h"
80 out[0] =
v1[1] *
v2[2] -
v1[2] *
v2[1];
81 out[1] =
v1[2] *
v2[0] -
v1[0] *
v2[2];
82 out[2] =
v1[0] *
v2[1] -
v1[1] *
v2[0];
90 using namespace TMath;
98 Float_t transF =
fM->GetTransitionEtaForward();
99 Float_t transB =
fM->GetTransitionEtaBackward();
103 TAxis *ax =
fM->GetData()->GetEtaBins();
105 TAxis *ay =
fM->GetData()->GetPhiBins();
109 Float_t r, z, theta, phiU, phiL, eta;
115 if (eta >= transF && (eta > etaMin && eta < etaMax))
120 for (
Int_t j=1; j<=ny; ++j)
126 glVertex3f(
r*
Cos(phiL),
r*
Sin(phiL), z);
127 glVertex3f(
r*
Cos(phiU),
r*
Sin(phiU), z);
130 }
else if (eta <= transB && (eta > etaMin && eta < etaMax)) {
134 for (
Int_t j=1; j<=ny; ++j)
140 glVertex3f(
r*
Cos(phiL),
r*
Sin(phiL), z);
141 glVertex3f(
r*
Cos(phiU),
r*
Sin(phiU), z);
157 for (
Int_t j=1; j<=ny; ++j)
163 glVertex3f( r1*
Cos(phiU), r1*
Sin(phiU), zEF);
164 glVertex3f( r2*
Cos(phiU), r2*
Sin(phiU), zEF);
165 glVertex3f( r1*
Cos(phiL), r1*
Sin(phiL), zEF);
166 glVertex3f( r2*
Cos(phiL), r2*
Sin(phiL), zEF);
182 for (
Int_t j=1; j<=ny; ++j)
188 glVertex3f(r1*
Cos(phiU), r1*
Sin(phiU), zEB);
189 glVertex3f(r2*
Cos(phiU), r2*
Sin(phiU), zEB);
190 glVertex3f(r1*
Cos(phiL), r1*
Sin(phiL), zEB);
191 glVertex3f(r2*
Cos(phiL), r2*
Sin(phiL), zEB);
202 using namespace TMath;
206 Float_t transF =
fM->GetTransitionEtaForward();
207 Float_t transB =
fM->GetTransitionEtaBackward();
212 TAxis *ax =
fM->GetData()->GetEtaBins();
214 TAxis *ay =
fM->GetData()->GetPhiBins();
223 if (eta<=transF && eta>=transB && (etaMin < eta && eta < etaMax))
227 for (
Int_t j=1; j<=ny; j++)
233 glVertex3f(rB*
Cos(phiL), rB*
Sin(phiL), z);
234 glVertex3f(rB*
Cos(phiU), rB*
Sin(phiU), z);
246 zB =
fM->GetBackwardEndCapPos();
252 zF =
fM->GetForwardEndCapPos();
254 for (
Int_t j=1; j<=ny; j++)
262 glVertex3f(
x,
y, zB);
263 glVertex3f(
x,
y, zF);
266 glVertex3f(
x,
y, zB);
267 glVertex3f(
x,
y, zF);
279 Bool_t transparent_p =
fM->fFrameTransparency > 0;
283 glPushAttrib(GL_ENABLE_BIT | GL_DEPTH_BUFFER_BIT);
287 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
300 Float_t transF =
fM->GetTransitionEtaForward();
301 Float_t transB =
fM->GetTransitionEtaBackward();
302 if (
fM->GetRnrBarrelFrame() && (etaMin < transF && etaMax > transB))
307 if (
fM->GetRnrEndCapFrame() && (etaMax > transF || etaMin < transB))
401 using namespace TMath;
405 Float_t z1In, z1Out, z2In, z2Out;
471 using namespace TMath;
472 Float_t z1, r1In, r1Out, z2, r2In, r2Out;
511 pnts[0] = r1Out*cos1;
512 pnts[1] = r1Out*sin1;
516 pnts[0] = r1Out*cos2;
517 pnts[1] = r1Out*sin2;
521 pnts[0] = r2Out*cos2;
522 pnts[1] = r2Out*sin2;
526 pnts[0] = r2Out*cos1;
527 pnts[1] = r2Out*sin1;
541 if (
fM->GetValueIsColor())
fM->AssertPalette();
545 fM->BuildCellIdCache();
547 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT | GL_POLYGON_BIT);
548 glEnable(GL_LIGHTING);
549 glEnable(GL_NORMALIZE);
551 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
556 Int_t prevTower = -1;
565 fM->fData->GetCellData((*
i), cellData);
567 if (tower != prevTower)
573 fM->SetupColorHeight(cellData.
Value(
fM->fPlotEt), (*i).fSlice, towerH);
577 if ((cellData.
Eta() > 0 && cellData.
Eta() <
fM->GetTransitionEtaForward()) ||
578 (cellData.
Eta() < 0 && cellData.
Eta() >
fM->GetTransitionEtaBackward()))
601 if (
fM->fData->GetCellsSelected().empty() &&
fM->fData->GetCellsHighlighted().empty())
606 glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT | GL_POLYGON_BIT);
607 glDisable(GL_LIGHTING);
608 glDisable(GL_CULL_FACE);
609 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
614 if (!
fM->fData->GetCellsHighlighted().empty())
619 if (!
fM->fData->GetCellsSelected().empty())
622 glGetFloatv(GL_DEPTH_RANGE,dr);
624 glDepthRange(dr[0], 0.8*dr[1]);
626 glDepthRange(dr[0], dr[1]);
642 fM->fData->GetCellData(*
i, cellData);
643 fM->SetupColorHeight(cellData.
Value(
fM->fPlotEt), (*i).fSlice, towerH);
647 for (
Int_t j = 0; j < (
Int_t)
fM->fCellList.size(); ++j)
649 if (
fM->fCellList[j].fTower ==
i->fTower &&
fM->fCellList[j].fSlice ==
i->fSlice )
656 if (
fM->CellInEtaPhiRng(cellData))
658 if (cellData.
Eta() <
fM->GetTransitionEtaForward() && cellData.
Eta() >
fM->GetTransitionEtaBackward())
675 sel.push_back(
fM->fCellList[rec.GetItem(1)]);
677 fM->fData->ProcessSelection(
sel, rec);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
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.
OpenGL renderer class for TEveCalo3D.
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
first replica
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
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.