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] )
119 for (
Int_t s=0; s<nSlices; ++s)
127 sliceVal[(*it).fSlice] += cellData.
Value(
fM->
fPlotEt)*(*it).fFraction;
134 for (
Int_t s = 0; s < nSlices; ++s)
153 static const TEveException eh(
"TEveCalo2DGL::DrawRPhiHighlighted ");
164 for(
UInt_t phiBin = 1; phiBin <= nPhiBins; ++phiBin)
166 if (cellLists[phiBin])
169 throw eh +
"selected cell not in cell list cache.";
173 for (
Int_t s=0; s<nSlices; ++s) sliceVal[s] = 0;
177 sliceVal[i->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*i).fFraction;
180 for (
Int_t s=0; s<nSlices; ++s) sliceValRef[s] = 0;
184 sliceValRef[i->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*i).fFraction;
187 for (
Int_t s = 0; s < nSlices; ++s) {
200 delete [] sliceValRef;
209 using namespace TMath;
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;
234 if (thetaMax >= transThetaB)
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;
247 for (
Int_t i = 0; i < 4; ++i)
250 y = phiPlus ?
Abs(pnts[2*i]) : -
Abs(pnts[2*i]);
276 for (
UInt_t etaBin = 1; etaBin <= nEta; ++etaBin)
278 if (cellLists[etaBin] )
289 for (
Int_t s = 0; s < nSlices; ++s) {
299 sliceValsUp [it->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*it).fFraction;
301 sliceValsLow[it->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*it).fFraction;
304 isBarrel = !(etaMax > 0 && etaMax > transEtaF) && !(etaMin < 0 && etaMin < transEtaB);
310 for (
Int_t s = 0; s < nSlices; ++s)
337 delete [] sliceValsUp;
338 delete [] sliceValsLow;
346 static const TEveException eh(
"TEveCalo2DGL::DrawRhoZHighlighted ");
361 Float_t towerH, towerHRef, offUp, offLow;
364 for (
UInt_t etaBin = 1; etaBin <= nEtaBins; ++etaBin)
366 if (cellLists[etaBin])
369 throw(eh +
"selected cell not in cell list cache.");
371 offUp = 0; offLow =0;
373 for (
Int_t s = 0; s < nSlices; ++s) {
374 sliceValsUp[s] = 0; sliceValsLow[s] = 0;
380 sliceValsUp [i->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*i).fFraction;
382 sliceValsLow[i->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*i).fFraction;
386 for (
Int_t s = 0; s < nSlices; ++s)
388 sliceValsUpRef[s] = 0; sliceValsLowRef[s] = 0;
395 sliceValsUpRef [i->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*i).fFraction;
397 sliceValsLowRef[i->fSlice] += cellData.
Value(
fM->
fPlotEt)*(*i).fFraction;
401 isBarrel = !(bincenterEta > 0 && bincenterEta > transEtaF) && !(bincenterEta < 0 && bincenterEta < transEtaB);
403 for (
Int_t s = 0; s < nSlices; ++s)
409 if (sliceValsUp[s] > 0) {
417 if (sliceValsLow[s] > 0) {
426 delete [] sliceValsUp;
427 delete [] sliceValsLow;
428 delete [] sliceValsUpRef;
429 delete [] sliceValsLowRef;
440 glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT);
442 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
463 static const TEveException eh(
"TEveCalo2DGL::DrawHighlight ");
515 if ((*it).fSlice == slice)
523 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...
unsigned int r1[N_CITIES]
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
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.
unsigned int r2[N_CITIES]