21#include "TGLIncludes.h"
47 fM = SetModelDynCast<TEveCalo3D>(obj);
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;
109 Float_t r, z, theta, phiU, phiL, eta;
112 for (
Int_t i=0; i<=nx; ++i)
115 if (eta >= transF && (eta > etaMin && eta < etaMax))
118 r = Abs(zEF*Tan(theta));
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)) {
132 r = Abs(zEB*Tan(theta));
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;
220 for(
Int_t i=0; i<=nx; i++)
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);
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);
283 glPushAttrib(GL_ENABLE_BIT | GL_DEPTH_BUFFER_BIT);
287 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
401 using namespace TMath;
405 Float_t z1In, z1Out, z2In, z2Out;
408 z1Out = r2/Tan(cellData.
ThetaMax());
410 z2Out = r2/Tan(cellData.
ThetaMin());
471 using namespace TMath;
472 Float_t z1, r1In, r1Out, z2, r2In, r2Out;
479 r1Out = z1*Tan(cellData.
ThetaMax());
480 r2Out = z2*Tan(cellData.
ThetaMax());
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;
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;
567 if (tower != prevTower)
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);
622 glGetFloatv(GL_DEPTH_RANGE,dr);
624 glDepthRange(dr[0], 0.8*dr[1]);
626 glDepthRange(dr[0], dr[1]);
winID h TVirtualViewer3D TVirtualGLPainter p
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.
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.
TEveCalo3DGL()
Constructor.
void RenderGrid(TGLRnrCtx &rnrCtx) const
Draw frame reading eta, phi axis.
void RenderGridEndCap() const
Render end cap grid.
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
GL rendering.
void DrawSelectedCells(TEveCaloData::vCellId_t cells) const
virtual void ProcessSelection(TGLRnrCtx &rnrCtx, TGLSelectRecord &rec)
Processes tower selection.
virtual Bool_t ShouldDLCache(const TGLRnrCtx &rnrCtx) const
Override from TGLObject.
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.
virtual void DrawHighlight(TGLRnrCtx &rnrCtx, const TGLPhysicalShape *ps, Int_t lvl=-1) const
Draw polygons in highlight mode.
void RenderGridBarrel() const
Render barrel grid.
void RenderEndCapCell(const TEveCaloData::CellGeom_t &cell, Float_t towerH, Float_t &offset) const
Render an endcap cell.
virtual Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr)
Set model object.
virtual void SetBBox()
Set bounding box.
Visualization of a calorimeter event data in 3D.
TEveCaloData::vCellId_t fCellList
Bool_t GetRnrBarrelFrame() const
virtual void BuildCellIdCache()
Build list of drawn cell IDs. See TEveCalo3DGL::DirectDraw().
Float_t GetFrameWidth() const
Char_t fFrameTransparency
Bool_t GetRnrEndCapFrame() const
std::vector< CellId_t > vCellId_t
static Float_t EtaToTheta(Float_t eta)
void ProcessSelection(vCellId_t &sel_cells, TGLSelectRecord &rec)
Process newly selected cells with given select-record.
virtual void GetCellData(const CellId_t &id, CellData_t &data) const =0
virtual TAxis * GetEtaBins() const
vCellId_t & GetCellsHighlighted()
virtual TAxis * GetPhiBins() const
vCellId_t & GetCellsSelected()
std::vector< CellId_t >::iterator vCellId_i
Float_t GetEtaMin() const
Float_t GetTransitionEtaBackward() const
Get transition eta between barrel and backward end-cap cells.
Float_t GetBarrelRadius() const
Float_t GetBackwardEndCapPos() const
Float_t GetForwardEndCapPos() const
TEveCaloData * GetData() const
TEveRGBAPalette * AssertPalette()
Make sure the TEveRGBAPalette pointer is not null.
Float_t GetEtaMax() const
Float_t GetTransitionEtaForward() const
Get transition eta between barrel and forward end-cap cells.
Float_t GetPhiMax() const
Bool_t CellInEtaPhiRng(TEveCaloData::CellData_t &) const
Returns true if given cell is in the ceta phi range.
Bool_t GetValueIsColor() const
Float_t GetPhiMin() 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.
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
Base-class for direct OpenGL renderers.
virtual Bool_t ShouldDLCache(const TGLRnrCtx &rnrCtx) const
Decide if display-list should be used for this pass rendering, as determined by rnrCtx.
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.
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.
Cell data inner structure.
Float_t Value(Bool_t) const
Return energy value associated with the cell, usually Et.
Cell geometry inner structure.