Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
REveCalo.hxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Author: Matevz Tadel 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_REveCalo
13#define ROOT_REveCalo
14
15#include "ROOT/REveElement.hxx"
18
19#include "TAtt3D.h"
20#include "TAttBBox.h"
21#include "ROOT/REveCaloData.hxx"
22
23class TClass;
24
25namespace ROOT {
26namespace Experimental {
27
28class REveRGBAPalette;
29class REveCaloViz : public REveElement,
30 public TAtt3D,
31 public TAttBBox,
32 public REveProjectable
33{
34
35private:
37
38protected:
39 REveCaloData* fData; // event data reference
40 Bool_t fCellIdCacheOK; // data cell ids cache state
41
44
46 Double_t fPhiOffset; // phi range +/- offset
47
48 Bool_t fAutoRange; // set eta phi limits on DataChanged()
49
50 Float_t fBarrelRadius; // barrel raidus in cm
51 Float_t fEndCapPosF; // forward end cap z coordinate in cm
52 Float_t fEndCapPosB; // backward end cap z coordinate in cm (should be < 0)
53
54 Float_t fPlotEt; // plot E or Et.
55
56 Float_t fMaxTowerH; // bounding box z dimesion
59
60 Bool_t fValueIsColor; // Interpret signal value as RGBA color.
61 REveRGBAPalette* fPalette; // Pointer to signal-color palette.
62
63
65
66 void SetupHeight(Float_t value, Int_t slice, Float_t& height) const;
67
68 virtual void BuildCellIdCache() = 0;
69
70public:
71 REveCaloViz(REveCaloData* data=nullptr, const char* n="REveCaloViz", const char* t="");
72
73 ~REveCaloViz() override;
74
75 bool RequiresExtraSelectionData() const override { return true; };
77 virtual REveElement* ForwardEdit();
78
79 TClass* ProjectedClass(const REveProjection* p) const override;
80 virtual Float_t GetValToHeight() const;
81 // virtual void CellSelectionChanged() {}
82
83 virtual void SetScaleAbs(Bool_t x) { fScaleAbs = x; }
84
85 REveCaloData* GetData() const { return fData; }
86 void SetData(REveCaloData* d);
87 void DataChanged();
88 Float_t GetMaxVal() const;
89
92
94 void SetDataSliceThreshold(Int_t slice, Float_t val);
95 Color_t GetDataSliceColor(Int_t slice) const;
96 void SetDataSliceColor(Int_t slice, Color_t col);
97
100 Float_t GetEndCapPos () const { return fEndCapPosF; } // get end cap position, assuming fEndCapPosF = -fEndCapPosB
106
107 Bool_t GetPlotEt() const { return fPlotEt; }
108 void SetPlotEt(Bool_t x);
109
111 Float_t GetMaxTowerH() const { return fMaxTowerH; }
112 Bool_t GetScaleAbs() const { return fScaleAbs; }
114 Float_t GetMaxValAbs() const { return fMaxValAbs; }
115
122
125
129
130 Bool_t GetAutoRange() const { return fAutoRange; }
132
133 void SetEta(Float_t l, Float_t u);
134 Float_t GetEta() const { return 0.5f*(fEtaMin+fEtaMax); }
135 Float_t GetEtaMin() const { return fEtaMin; }
136 Float_t GetEtaMax() const { return fEtaMax; }
137 Float_t GetEtaRng() const { return fEtaMax-fEtaMin; }
138
140 void SetPhiRng(Float_t rng) { SetPhiWithRng(fPhi, rng); }
142 Float_t GetPhi() const { return fPhi; }
143 Float_t GetPhiMin() const { return fPhi-fPhiOffset; }
144 Float_t GetPhiMax() const { return fPhi+fPhiOffset; }
145 Float_t GetPhiRng() const { return 2.0f*fPhiOffset; }
146
148
149 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
150 virtual void WriteCoreJsonSelection(nlohmann::json &j, REveCaloData::vCellId_t) = 0;
151};
152
153/**************************************************************************/
154/**************************************************************************/
155
157{
158private:
159 REveCalo3D& operator=(const REveCalo3D&) = delete;
160
161 void MakeBarrelCell(const REveCaloData::CellGeom_t &cellData, float towerH, Float_t& offset, float *pnts) const;
162 void MakeEndCapCell(const REveCaloData::CellGeom_t &cellData, float towerH, Float_t& offset, float *pnts) const;
163
164protected:
166
169
173
174 void BuildCellIdCache() override;
175
176public:
177 REveCalo3D(REveCaloData* d=nullptr, const char* n="REveCalo3D", const char* t="");
178 ~REveCalo3D() override {}
179 void ComputeBBox() override;
180
181 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
182 void WriteCoreJsonSelection(nlohmann::json &j, REveCaloData::vCellId_t) override;
183 void BuildRenderData() override;
184
187
194
197
198 void NewTowerPicked(Int_t tower, Int_t slice, Int_t selectionId, Bool_t multi);
199};
200
201/**************************************************************************/
202/**************************************************************************/
203
204class REveCalo2D : public REveCaloViz,
205 public REveProjected
206{
207public:
208 typedef std::vector<REveCaloData::vCellId_t*> vBinCells_t;
209 typedef std::vector<REveCaloData::vCellId_t*>::iterator vBinCells_i;
210
211private:
212 REveCalo2D& operator=(const REveCalo2D&) = delete;
213
215 void CellSelectionChangedInternal(REveCaloData::vCellId_t& cells, std::vector<REveCaloData::vCellId_t*>& cellLists);
216
217 void MakeRPhiCell(Float_t phiMin, Float_t phiMax,
218 Float_t towerH, Float_t offset, float* pntsOut) const;
219
220 void MakeRhoZCell(Float_t thetaMin, Float_t thetaMax,
221 Float_t& offset, Bool_t isBarrel, Bool_t phiPlus, Float_t towerH, float *pntsOut) const;
222
223 void BuildRenderDataRPhi();
224 void BuildRenderDataRhoZ();
225
226protected:
227 std::vector<REveCaloData::vCellId_t*> fCellLists;
228
229 std::vector<REveCaloData::vCellId_t*> fCellListsSelected;
230 std::vector<REveCaloData::vCellId_t*> fCellListsHighlighted;
231
234
235 void BuildCellIdCache() override;
236
237 void SetDepthLocal(Float_t x) override { fDepth = x; }
238
239 bool IsRPhi() const;
240
241public:
242 REveCalo2D(const char* n="REveCalo2D", const char* t="");
243 ~REveCalo2D() override;
244
245 void SetProjection(REveProjectionManager* proj, REveProjectable* model) override;
246 void UpdateProjection() override;
247 void ComputeBBox() override;
248
249 void SetScaleAbs(Bool_t) override;
250
251 Float_t GetValToHeight() const override;
252
253 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
254 void WriteCoreJsonSelection(nlohmann::json &j, REveCaloData::vCellId_t) override;
255 void BuildRenderData() override;
256
257 void NewBinPicked(Int_t bin, Int_t slice, Int_t selectionId, Bool_t multi);
258
260};
261
262/**************************************************************************/
263/**************************************************************************/
264
266{
267public:
271
272private:
274
275protected:
277
282
283 Int_t fNZSteps; // Z axis label step in GeV
285
289
292 EBoxMode_e fBoxMode; // additional scale info
293
296
298 Float_t fFixedHeightValIn2DMode; // 1% of whole height
299
302
303 void BuildCellIdCache() override;
304
305public:
306 REveCaloLego(REveCaloData* data=nullptr, const char* n="REveCaloLego", const char* t="");
307 ~REveCaloLego() override{}
308
309 void ComputeBBox() override;
310 virtual void SetData(REveCaloData* d);
311
312 Color_t GetFontColor() const { return fFontColor; }
314
315 Color_t GetGridColor() const { return fGridColor; }
317
320
323
324 Int_t GetNZSteps() const { return fNZSteps; }
325 void SetNZSteps(Int_t s) { fNZSteps = s;}
326
329
330 Bool_t GetAutoRebin() const { return fAutoRebin; }
332
335
338
341
344
347
350
351 Bool_t GetDrawHPlane() const { return fDrawHPlane; }
353
354 Float_t GetHPlaneVal() const { return fHPlaneVal; }
356
361};
362
363} // namespace Experimental
364} // namespace ROOT
365
366#endif
#define d(i)
Definition RSha256.hxx:102
#define b(i)
Definition RSha256.hxx:100
#define e(i)
Definition RSha256.hxx:103
bool Bool_t
Definition RtypesCore.h:63
short Color_t
Definition RtypesCore.h:85
char Char_t
Definition RtypesCore.h:37
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
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
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
A generic, speed-optimised mapping from value to RGBA color supporting different wrapping and range t...
void BuildRenderData() override
Creates 2D point array for rendering.
std::vector< REveCaloData::vCellId_t * > vBinCells_t
Definition REveCalo.hxx:208
void SetProjection(REveProjectionManager *proj, REveProjectable *model) override
Set projection manager and model object.
Definition REveCalo.cxx:797
void MakeRhoZCell(Float_t thetaMin, Float_t thetaMax, Float_t &offset, Bool_t isBarrel, Bool_t phiPlus, Float_t towerH, float *pntsOut) const
Get cell vertices in RhoZ projection.
void BuildRenderDataRPhi()
Creates 2D point array in RPhi() projection.
void SetDepthLocal(Float_t x) override
Base-class implementation – just sets fDepth.
Definition REveCalo.hxx:237
bool IsRPhi() const
Is current projection type RPhi.
Definition REveCalo.cxx:807
void WriteCoreJsonSelection(nlohmann::json &j, REveCaloData::vCellId_t) override
Fill core part of JSON representation for selection.
void ComputeBBox() override
Fill bounding-box information of the base-class TAttBBox (virtual method).
Definition REveCalo.cxx:987
~REveCalo2D() override
Destructor.
Definition REveCalo.cxx:755
std::vector< REveCaloData::vCellId_t * >::iterator vBinCells_i
Definition REveCalo.hxx:209
void NewBinPicked(Int_t bin, Int_t slice, Int_t selectionId, Bool_t multi)
Client callback.
void CellSelectionChangedInternal(REveCaloData::vCellId_t &cells, std::vector< REveCaloData::vCellId_t * > &cellLists)
s////////////////////////////////// Sort selected cells in eta or phi bins.
Definition REveCalo.cxx:908
REveProjection::EPType_e fOldProjectionType
Definition REveCalo.hxx:214
void UpdateProjection() override
This is virtual method from base-class REveProjected.
Definition REveCalo.cxx:784
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
std::vector< REveCaloData::vCellId_t * > fCellLists
Definition REveCalo.hxx:227
std::vector< REveCaloData::vCellId_t * > fCellListsHighlighted
Definition REveCalo.hxx:230
std::vector< REveCaloData::vCellId_t * > fCellListsSelected
Definition REveCalo.hxx:229
const REveCalo2D::vBinCells_t & GetBinLists() const
Definition REveCalo.hxx:259
void BuildCellIdCache() override
Build lists of drawn cell IDs. See REveCalo2DGL::DirecDraw().
Definition REveCalo.cxx:815
void BuildRenderDataRhoZ()
Creates 2D point array in RhoZ projection.
REveCalo2D & operator=(const REveCalo2D &)=delete
Float_t GetValToHeight() const override
Virtual function of REveCaloViz.
Definition REveCalo.cxx:963
void MakeRPhiCell(Float_t phiMin, Float_t phiMax, Float_t towerH, Float_t offset, float *pntsOut) const
Calculate vertices for the calorimeter cell in RPhi projection.
void SetScaleAbs(Bool_t) override
Set absolute scale in projected calorimeter.
Definition REveCalo.cxx:953
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
Definition REveCalo.cxx:659
void ComputeBBox() override
Fill bounding-box information of the base-class TAttBBox (virtual method).
Definition REveCalo.cxx:708
Char_t GetFrameTransparency() const
Definition REveCalo.hxx:196
void MakeBarrelCell(const REveCaloData::CellGeom_t &cellData, float towerH, Float_t &offset, float *pnts) const
Make endcap cell.
Definition REveCalo.cxx:535
void SetRnrFrame(Bool_t e, Bool_t b)
Definition REveCalo.hxx:188
void MakeEndCapCell(const REveCaloData::CellGeom_t &cellData, float towerH, Float_t &offset, float *pnts) const
Make endcap cell.
Definition REveCalo.cxx:470
void WriteCoreJsonSelection(nlohmann::json &j, REveCaloData::vCellId_t) override
Fill core part of JSON representation for selection.
Definition REveCalo.cxx:667
void BuildRenderData() override
Crates 3D point array for rendering.
Definition REveCalo.cxx:602
void BuildCellIdCache() override
Build list of drawn cell IDs. See REveCalo3DGL::DirectDraw().
Definition REveCalo.cxx:696
void NewTowerPicked(Int_t tower, Int_t slice, Int_t selectionId, Bool_t multi)
Client selection callback.
Definition REveCalo.cxx:730
void SetFrameTransparency(Char_t x)
Definition REveCalo.hxx:195
REveCalo3D & operator=(const REveCalo3D &)=delete
REveCaloData::vCellId_t fCellList
Definition REveCalo.hxx:165
void GetRnrFrame(Bool_t &e, Bool_t &b) const
Definition REveCalo.hxx:189
std::vector< CellId_t > vCellId_t
void BuildCellIdCache() override
Build list of drawn cell IDs. For more information see REveCaloLegoGL:DirectDraw().
float GetFixedHeightValIn2DMode() const
Definition REveCalo.hxx:345
void SetBoxMode(EBoxMode_e p)
Definition REveCalo.hxx:348
void SetFixedHeightValIn2DMode(float x)
Definition REveCalo.hxx:346
virtual void SetData(REveCaloData *d)
void ComputeBBox() override
Fill bounding-box information of the base-class TAttBBox (virtual method).
REveCaloData::vCellId_t fCellList
Definition REveCalo.hxx:276
REveCaloLego & operator=(const REveCaloLego &)=delete
void SetProjection(EProjection_e p)
Definition REveCalo.hxx:337
EProjection_e GetProjection() const
Definition REveCalo.hxx:336
bool RequiresExtraSelectionData() const override
Definition REveCalo.hxx:75
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
Definition REveCalo.cxx:427
virtual REveElement * ForwardSelection()
Management of selection state and ownership of selected cell list is done in REveCaloData.
Definition REveCalo.cxx:96
Float_t GetBarrelRadius() const
Definition REveCalo.hxx:98
Float_t GetBackwardEndCapPos() const
Definition REveCalo.hxx:102
void SetPlotEt(Bool_t x)
Set E/Et plot.
Definition REveCalo.cxx:149
Float_t GetTransitionTheta() const
Get transition angle between barrel and end-cap cells, assuming fEndCapPosF = -fEndCapPosB.
Definition REveCalo.cxx:184
virtual void BuildCellIdCache()=0
void SetPalette(REveRGBAPalette *p)
Set REveRGBAPalette object pointer.
Definition REveCalo.cxx:348
virtual void SetScaleAbs(Bool_t x)
Definition REveCalo.hxx:83
Float_t GetTransitionEtaForward() const
Get transition eta between barrel and forward end-cap cells.
Definition REveCalo.cxx:210
void DataChanged()
Update setting and cache on data changed.
Definition REveCalo.cxx:257
void SetDataSliceColor(Int_t slice, Color_t col)
Set slice color in data.
Definition REveCalo.cxx:130
REveCaloViz & operator=(const REveCaloViz &)=delete
REveCaloData * GetData() const
Definition REveCalo.hxx:85
Float_t GetTransitionEta() const
Get transition eta between barrel and end-cap cells, assuming fEndCapPosF = -fEndCapPosB.
Definition REveCalo.cxx:192
Color_t GetDataSliceColor(Int_t slice) const
Get slice color from data.
Definition REveCalo.cxx:122
virtual void WriteCoreJsonSelection(nlohmann::json &j, REveCaloData::vCellId_t)=0
Float_t GetTransitionEtaBackward() const
Get transition eta between barrel and backward end-cap cells.
Definition REveCalo.cxx:228
Bool_t AssertCellIdCache() const
Assert cell id cache is ok.
Definition REveCalo.cxx:294
void SetBackwardEndCapPos(Float_t z)
Definition REveCalo.hxx:105
void SetPhiWithRng(Float_t x, Float_t r)
Set phi range.
Definition REveCalo.cxx:171
~REveCaloViz() override
Destructor.
Definition REveCalo.cxx:79
virtual Float_t GetValToHeight() const
Get transformation factor from E/Et to height.
Definition REveCalo.cxx:359
REveRGBAPalette * GetPalette() const
Definition REveCalo.hxx:123
TClass * ProjectedClass(const REveProjection *p) const override
Virtual from REveProjectable, returns REveCalo2D class.
Definition REveCalo.cxx:399
void SetBarrelRadius(Float_t r)
Definition REveCalo.hxx:99
Float_t GetDataSliceThreshold(Int_t slice) const
Get threshold for given slice.
Definition REveCalo.cxx:87
Float_t GetForwardEndCapPos() const
Definition REveCalo.hxx:101
Bool_t CellInEtaPhiRng(REveCaloData::CellData_t &) const
Returns true if given cell is in the ceta phi range.
Definition REveCalo.cxx:308
void SetupHeight(Float_t value, Int_t slice, Float_t &height) const
Set color and height for a given value and slice using slice color or REveRGBAPalette.
Definition REveCalo.cxx:407
void SetForwardEndCapPos(Float_t z)
Definition REveCalo.hxx:104
Float_t GetTransitionThetaForward() const
Get transition angle between barrel and forward end-cap cells.
Definition REveCalo.cxx:202
void SetData(REveCaloData *d)
Set calorimeter event data.
Definition REveCalo.cxx:240
Float_t GetTransitionThetaBackward() const
Get transition angle between barrel and backward end-cap cells.
Definition REveCalo.cxx:220
void AssignCaloVizParameters(REveCaloViz *cv)
Assign parameters from given model.
Definition REveCalo.cxx:322
virtual REveElement * ForwardEdit()
Management of selection state and ownership of selected cell list is done in REveCaloData.
Definition REveCalo.cxx:106
void SetDataSliceThreshold(Int_t slice, Float_t val)
Set threshold for given slice.
Definition REveCalo.cxx:114
REveRGBAPalette * AssertPalette()
Make sure the REveRGBAPalette pointer is not null.
Definition REveCalo.cxx:380
void SetEta(Float_t l, Float_t u)
Set eta range.
Definition REveCalo.cxx:138
REveProjectionManager Manager class for steering of projections and managing projected objects.
REveProjection Base for specific classes that implement non-linear projections.
Use this attribute class when an object should have 3D capabilities.
Definition TAtt3D.h:19
Helper for management of bounding-box information.
Definition TAttBBox.h:18
void ResetBBox()
Definition TAttBBox.h:57
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
TLine l
Definition textangle.C:4