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 "ROOT/REveCaloData.hxx"
20
21class TClass;
22
23namespace ROOT {
24namespace Experimental {
25
26class REveRGBAPalette;
27class REveCaloViz : public REveElement, public REveProjectable {
28
29private:
31
32protected:
33 REveCaloData* fData; // event data reference
34 Bool_t fCellIdCacheOK; // data cell ids cache state
35
38
40 Double_t fPhiOffset; // phi range +/- offset
41
42 Bool_t fAutoRange; // set eta phi limits on DataChanged()
43
44 Float_t fBarrelRadius; // barrel raidus in cm
45 Float_t fEndCapPosF; // forward end cap z coordinate in cm
46 Float_t fEndCapPosB; // backward end cap z coordinate in cm (should be < 0)
47
48 Float_t fPlotEt; // plot E or Et.
49
50 Float_t fMaxTowerH; // bounding box z dimesion
53
54 Bool_t fValueIsColor; // Interpret signal value as RGBA color.
55 REveRGBAPalette* fPalette; // Pointer to signal-color palette.
56
57
59
60 void SetupHeight(Float_t value, Int_t slice, Float_t& height) const;
61
62 virtual void BuildCellIdCache() = 0;
63
64public:
65 REveCaloViz(REveCaloData* data=nullptr, const char* n="REveCaloViz", const char* t="");
66
67 ~REveCaloViz() override;
68
69 bool RequiresExtraSelectionData() const override { return true; };
71 virtual REveElement* ForwardEdit();
72
73 TClass* ProjectedClass(const REveProjection* p) const override;
74 virtual Float_t GetValToHeight() const;
75 // virtual void CellSelectionChanged() {}
76
77 virtual void SetScaleAbs(Bool_t x) { fScaleAbs = x; }
78
79 REveCaloData* GetData() const { return fData; }
80 void SetData(REveCaloData* d);
81 void DataChanged();
82 Float_t GetMaxVal() const;
83
86
88 void SetDataSliceThreshold(Int_t slice, Float_t val);
89 Color_t GetDataSliceColor(Int_t slice) const;
90 void SetDataSliceColor(Int_t slice, Color_t col);
91
94 Float_t GetEndCapPos () const { return fEndCapPosF; } // get end cap position, assuming fEndCapPosF = -fEndCapPosB
100
101 Bool_t GetPlotEt() const { return fPlotEt; }
102 void SetPlotEt(Bool_t x);
103
105 Float_t GetMaxTowerH() const { return fMaxTowerH; }
106 Bool_t GetScaleAbs() const { return fScaleAbs; }
108 Float_t GetMaxValAbs() const { return fMaxValAbs; }
109
116
119
123
124 Bool_t GetAutoRange() const { return fAutoRange; }
126
127 void SetEta(Float_t l, Float_t u);
128 Float_t GetEta() const { return 0.5f*(fEtaMin+fEtaMax); }
129 Float_t GetEtaMin() const { return fEtaMin; }
130 Float_t GetEtaMax() const { return fEtaMax; }
131 Float_t GetEtaRng() const { return fEtaMax-fEtaMin; }
132
134 void SetPhiRng(Float_t rng) { SetPhiWithRng(fPhi, rng); }
136 Float_t GetPhi() const { return fPhi; }
137 Float_t GetPhiMin() const { return fPhi-fPhiOffset; }
138 Float_t GetPhiMax() const { return fPhi+fPhiOffset; }
139 Float_t GetPhiRng() const { return 2.0f*fPhiOffset; }
140
142
143 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
144 virtual void WriteCoreJsonSelection(nlohmann::json &j, REveCaloData::vCellId_t) = 0;
145};
146
147/**************************************************************************/
148/**************************************************************************/
149
151{
152private:
153 REveCalo3D& operator=(const REveCalo3D&) = delete;
154
155 void MakeBarrelCell(const REveCaloData::CellGeom_t &cellData, float towerH, Float_t& offset, float *pnts) const;
156 void MakeEndCapCell(const REveCaloData::CellGeom_t &cellData, float towerH, Float_t& offset, float *pnts) const;
157
158protected:
160
163
167
168 void BuildCellIdCache() override;
169
170public:
171 REveCalo3D(REveCaloData* d=nullptr, const char* n="REveCalo3D", const char* t="");
172 ~REveCalo3D() override {}
173 void ComputeBBox() override;
174
175 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
176 void WriteCoreJsonSelection(nlohmann::json &j, REveCaloData::vCellId_t) override;
177 void BuildRenderData() override;
178
181
188
191
192 void NewTowerPicked(Int_t tower, Int_t slice, Int_t selectionId, Bool_t multi);
193};
194
195/**************************************************************************/
196/**************************************************************************/
197
198class REveCalo2D : public REveCaloViz,
199 public REveProjected
200{
201public:
202 typedef std::vector<REveCaloData::vCellId_t*> vBinCells_t;
203 typedef std::vector<REveCaloData::vCellId_t*>::iterator vBinCells_i;
204
205private:
206 REveCalo2D& operator=(const REveCalo2D&) = delete;
207
209 void CellSelectionChangedInternal(REveCaloData::vCellId_t& cells, std::vector<REveCaloData::vCellId_t*>& cellLists);
210
211 void MakeRPhiCell(Float_t phiMin, Float_t phiMax,
212 Float_t towerH, Float_t offset, float* pntsOut) const;
213
214 void MakeRhoZCell(Float_t thetaMin, Float_t thetaMax,
215 Float_t& offset, Bool_t isBarrel, Bool_t phiPlus, Float_t towerH, float *pntsOut) const;
216
217 void BuildRenderDataRPhi();
218 void BuildRenderDataRhoZ();
219
220protected:
221 std::vector<REveCaloData::vCellId_t*> fCellLists;
222
223 std::vector<REveCaloData::vCellId_t*> fCellListsSelected;
224 std::vector<REveCaloData::vCellId_t*> fCellListsHighlighted;
225
228
229 void BuildCellIdCache() override;
230
231 void SetDepthLocal(Float_t x) override { fDepth = x; }
232
233 bool IsRPhi() const;
234
235public:
236 REveCalo2D(const char* n="REveCalo2D", const char* t="");
237 ~REveCalo2D() override;
238
239 void SetProjection(REveProjectionManager* proj, REveProjectable* model) override;
240 void UpdateProjection() override;
241 void ComputeBBox() override;
242
243 void SetScaleAbs(Bool_t) override;
244
245 Float_t GetValToHeight() const override;
246
247 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
248 void WriteCoreJsonSelection(nlohmann::json &j, REveCaloData::vCellId_t) override;
249 void BuildRenderData() override;
250
251 void NewBinPicked(Int_t bin, Int_t slice, Int_t selectionId, Bool_t multi);
252
254};
255
256/**************************************************************************/
257/**************************************************************************/
258
260{
261public:
265
266private:
268
269protected:
271
276
277 Int_t fNZSteps; // Z axis label step in GeV
279
283
286 EBoxMode_e fBoxMode; // additional scale info
287
290
292 Float_t fFixedHeightValIn2DMode; // 1% of whole height
293
296
297 void BuildCellIdCache() override;
298
299public:
300 REveCaloLego(REveCaloData* data=nullptr, const char* n="REveCaloLego", const char* t="");
301 ~REveCaloLego() override{}
302
303 void ComputeBBox() override;
304 virtual void SetData(REveCaloData* d);
305
306 Color_t GetFontColor() const { return fFontColor; }
308
309 Color_t GetGridColor() const { return fGridColor; }
311
314
317
318 Int_t GetNZSteps() const { return fNZSteps; }
319 void SetNZSteps(Int_t s) { fNZSteps = s;}
320
323
324 Bool_t GetAutoRebin() const { return fAutoRebin; }
326
329
332
335
338
341
344
345 Bool_t GetDrawHPlane() const { return fDrawHPlane; }
347
348 Float_t GetHPlaneVal() const { return fHPlaneVal; }
350
355};
356
357} // namespace Experimental
358} // namespace ROOT
359
360#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
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:78
short Color_t
Color number (short)
Definition RtypesCore.h:100
char Char_t
Character 1 byte (char)
Definition RtypesCore.h:52
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:72
constexpr Bool_t kFALSE
Definition RtypesCore.h:109
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:202
void SetProjection(REveProjectionManager *proj, REveProjectable *model) override
Set projection manager and model object.
Definition REveCalo.cxx:794
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:231
bool IsRPhi() const
Is current projection type RPhi.
Definition REveCalo.cxx:804
void WriteCoreJsonSelection(nlohmann::json &j, REveCaloData::vCellId_t) override
Fill core part of JSON representation for selection.
void ComputeBBox() override
Fill the bounding box (virtual from REveElement).
Definition REveCalo.cxx:984
~REveCalo2D() override
Destructor.
Definition REveCalo.cxx:752
std::vector< REveCaloData::vCellId_t * >::iterator vBinCells_i
Definition REveCalo.hxx:203
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:905
REveProjection::EPType_e fOldProjectionType
Definition REveCalo.hxx:208
REveCalo2D(const char *n="REveCalo2D", const char *t="")
Constructor.
Definition REveCalo.cxx:740
void UpdateProjection() override
This is virtual method from base-class REveProjected.
Definition REveCalo.cxx:781
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:221
std::vector< REveCaloData::vCellId_t * > fCellListsHighlighted
Definition REveCalo.hxx:224
std::vector< REveCaloData::vCellId_t * > fCellListsSelected
Definition REveCalo.hxx:223
const REveCalo2D::vBinCells_t & GetBinLists() const
Definition REveCalo.hxx:253
void BuildCellIdCache() override
Build lists of drawn cell IDs. See REveCalo2DGL::DirecDraw().
Definition REveCalo.cxx:812
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:960
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:950
REveCalo3D(REveCaloData *d=nullptr, const char *n="REveCalo3D", const char *t="")
Constructor.
Definition REveCalo.cxx:452
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 the bounding box (virtual from REveElement).
Definition REveCalo.cxx:708
Char_t GetFrameTransparency() const
Definition REveCalo.hxx:190
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:182
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:727
void SetFrameTransparency(Char_t x)
Definition REveCalo.hxx:189
REveCalo3D & operator=(const REveCalo3D &)=delete
REveCaloData::vCellId_t fCellList
Definition REveCalo.hxx:159
void GetRnrFrame(Bool_t &e, Bool_t &b) const
Definition REveCalo.hxx:183
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:339
void SetBoxMode(EBoxMode_e p)
Definition REveCalo.hxx:342
void SetFixedHeightValIn2DMode(float x)
Definition REveCalo.hxx:340
virtual void SetData(REveCaloData *d)
void ComputeBBox() override
Fill the bounding box (virtual from REveElement).
REveCaloData::vCellId_t fCellList
Definition REveCalo.hxx:270
REveCaloLego & operator=(const REveCaloLego &)=delete
REveCaloLego(REveCaloData *data=nullptr, const char *n="REveCaloLego", const char *t="")
Constructor.
void SetProjection(EProjection_e p)
Definition REveCalo.hxx:331
EProjection_e GetProjection() const
Definition REveCalo.hxx:330
bool RequiresExtraSelectionData() const override
Definition REveCalo.hxx:69
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:92
Float_t GetBackwardEndCapPos() const
Definition REveCalo.hxx:96
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:77
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
REveCaloViz(REveCaloData *data=nullptr, const char *n="REveCaloViz", const char *t="")
Definition REveCalo.cxx:41
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:79
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:99
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:117
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:93
Float_t GetDataSliceThreshold(Int_t slice) const
Get threshold for given slice.
Definition REveCalo.cxx:87
Float_t GetForwardEndCapPos() const
Definition REveCalo.hxx:95
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:98
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.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
TLine l
Definition textangle.C:4