48 fM = SetModelDynCast<TEveCalo2D>(obj);
75 using namespace TMath;
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);
89 for (
Int_t i = 0; i < 4; ++i)
113 for(
UInt_t phiBin = 1; phiBin <= nPhi; ++phiBin)
115 if (cellLists[phiBin] )
127 sliceVal[(*it).fSlice] += cellData.
Value(
fM->
fPlotEt)*(*it).fFraction;
153 static const TEveException eh(
"TEveCalo2DGL::DrawRPhiHighlighted ");
164 for(
UInt_t phiBin = 1; phiBin <= nPhiBins; ++phiBin)
166 if (cellLists[phiBin])
170 delete[] sliceValRef;
171 throw eh +
"selected cell not in cell list cache.";
176 for (
Int_t s=0;
s<nSlices; ++
s) sliceVal[
s] = 0;
180 sliceVal[i->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*i).fFraction;
183 for (
Int_t s=0;
s<nSlices; ++
s) sliceValRef[
s] = 0;
187 sliceValRef[i->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*i).fFraction;
190 for (
Int_t s = 0;
s < nSlices; ++
s) {
203 delete [] sliceValRef;
212 using namespace TMath;
226 pnts[0] = r1*sin1; pnts[1] = r1*cos1;
227 pnts[2] = r2*sin1; pnts[3] = r2*cos1;
228 pnts[4] = r2*sin2; pnts[5] = r2*cos2;
229 pnts[6] = r1*sin2; pnts[7] = r1*cos2;
237 if (thetaMax >= transThetaB)
242 pnts[0] = r1*sin1; pnts[1] = r1*cos1;
243 pnts[2] = r2*sin1; pnts[3] = r2*cos1;
244 pnts[4] = r2*sin2; pnts[5] = r2*cos2;
245 pnts[6] = r1*sin2; pnts[7] = r1*cos2;
250 for (
Int_t i = 0; i < 4; ++i)
253 y = phiPlus ?
Abs(pnts[2*i]) : -
Abs(pnts[2*i]);
279 for (
UInt_t etaBin = 1; etaBin <= nEta; ++etaBin)
281 if (cellLists[etaBin] )
292 for (
Int_t s = 0;
s < nSlices; ++
s) {
302 sliceValsUp [it->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*it).fFraction;
304 sliceValsLow[it->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*it).fFraction;
307 isBarrel = !(etaMax > 0 && etaMax > transEtaF) && !(etaMin < 0 && etaMin < transEtaB);
340 delete [] sliceValsUp;
341 delete [] sliceValsLow;
349 static const TEveException eh(
"TEveCalo2DGL::DrawRhoZHighlighted ");
364 Float_t towerH, towerHRef, offUp, offLow;
367 for (
UInt_t etaBin = 1; etaBin <= nEtaBins; ++etaBin)
369 if (cellLists[etaBin])
372 delete[] sliceValsUp;
373 delete[] sliceValsLow;
374 delete[] sliceValsUpRef;
375 delete[] sliceValsLowRef;
376 throw(eh +
"selected cell not in cell list cache.");
379 offUp = 0; offLow =0;
381 for (
Int_t s = 0;
s < nSlices; ++
s) {
382 sliceValsUp[
s] = 0; sliceValsLow[
s] = 0;
388 sliceValsUp [i->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*i).fFraction;
390 sliceValsLow[i->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*i).fFraction;
396 sliceValsUpRef[
s] = 0; sliceValsLowRef[
s] = 0;
403 sliceValsUpRef [i->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*i).fFraction;
405 sliceValsLowRef[i->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*i).fFraction;
409 isBarrel = !(bincenterEta > 0 && bincenterEta > transEtaF) && !(bincenterEta < 0 && bincenterEta < transEtaB);
417 if (sliceValsUp[s] > 0) {
425 if (sliceValsLow[s] > 0) {
434 delete [] sliceValsUp;
435 delete [] sliceValsLow;
436 delete [] sliceValsUpRef;
437 delete [] sliceValsLowRef;
448 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT);
450 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
471 static const TEveException eh(
"TEveCalo2DGL::DrawHighlight ");
523 if ((*it).fSlice == slice)
531 assert(rec.
GetN() > 3);
TEveRGBAPalette * AssertPalette()
Make sure the TEveRGBAPalette pointer is not null.
vCellId_t & GetCellsSelected()
TEveCaloData * GetData() const
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Bool_t SecSelection() const
A central manager for calorimeter event data.
virtual TAxis * GetEtaBins() const
std::vector< CellId_t >::iterator vCellId_i
void DrawRhoZHighlighted(std::vector< TEveCaloData::vCellId_t *> &cellLists) const
Draw selected calorimeter cells in RhoZ projection.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual void DrawHighlight(TGLRnrCtx &rnrCtx, const TGLPhysicalShape *ps, Int_t lvl=-1) const
Draw towers in highlight mode.
Float_t GetForwardEndCapPos() const
Float_t GetTransitionEtaBackward() const
Get transition eta between barrel and backward end-cap cells.
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.
T etaMax()
Function providing the maximum possible value of pseudorapidity for a non-zero rho, in the Scalar type with the largest dynamic range.
virtual const char * what() const noexcept
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Concrete physical shape - a GL drawable.
std::vector< TEveCaloData::vCellId_t * > fCellListsSelected
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.
void DrawRhoZ(TGLRnrCtx &rnrCtx, TEveCalo2D::vBinCells_t &) const
Draw calorimeter in RhoZ projection.
static Float_t EtaToTheta(Float_t eta)
void MakeRPhiCell(Float_t phiMin, Float_t phiMax, Float_t towerH, Float_t offset) const
Calculate vertices for the calorimeter cell in RPhi projection.
const UChar_t * CArr() const
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
Base-class for direct OpenGL renderers.
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.
std::vector< CellId_t > vCellId_t
static UInt_t LockColor()
Prevent further color changes.
static UInt_t UnlockColor()
Allow color changes.
TObject * fExternalObj
first replica
std::vector< TEveCaloData::vCellId_t * > fCellLists
Bool_t IsUpperRho() const
Class to manage histogram axis.
Float_t GetTransitionEtaForward() const
Get transition eta between barrel and forward end-cap cells.
void ProcessSelection(vCellId_t &sel_cells, TGLSelectRecord &rec)
Process newly selected cells with given select-record.
OpenGL renderer class for TEveCalo2D.
void DrawRPhi(TGLRnrCtx &rnrCtx, TEveCalo2D::vBinCells_t &) const
Draw calorimeter cells in RPhi projection.
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...
TEveProjectionManager * fManager
virtual void BuildCellIdCache()
Build lists of drawn cell IDs. See TEveCalo2DGL::DirecDraw().
virtual void GetCellData(const CellId_t &id, CellData_t &data) const =0
void Warning(const char *location, const char *msgfmt,...)
vCellId_t & GetCellsHighlighted()
TEveProjection * GetProjection()
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.
std::vector< TEveCaloData::vCellId_t * > fCellListsHighlighted
UInt_t GetItem(Int_t i) const
static constexpr double s
std::vector< TEveCaloData::vCellId_t * > vBinCells_t
virtual TAxis * GetPhiBins() const
Bool_t IsRPhi() const
Is current projection type RPhi.
Mother of all ROOT objects.
you should not use this method at all Int_t Int_t z
TEveCalo2DGL()
Constructor.
TGLColor & Selection(Int_t i)
Float_t GetBackwardEndCapPos() const
virtual void ProcessSelection(TGLRnrCtx &rnrCtx, TGLSelectRecord &rec)
Processes tower selection in eta bin or phi bin.
virtual void SetBBox()
Set bounding box.
Exception class thrown by TEve classes and macros.
Cell data inner structure.
TGLColorSet & ColorSet()
Return reference to current color-set (top of the stack).
Float_t Value(Bool_t) const
Return energy value associated with the cell, usually Et.
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
Render with OpenGL.
void DrawRPhiHighlighted(std::vector< TEveCaloData::vCellId_t *> &cellLists) const
Draw selected calorimeter cells in RPhi projection.