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=0, const char* n="REveCaloViz", const char* t="");
72
73 virtual ~REveCaloViz();
74
76 virtual REveElement* ForwardEdit();
77
78 TClass* ProjectedClass(const REveProjection* p) const override;
79 virtual Float_t GetValToHeight() const;
80 // virtual void CellSelectionChanged() {}
81
82 virtual void SetScaleAbs(Bool_t x) { fScaleAbs = x; }
83
84 REveCaloData* GetData() const { return fData; }
85 void SetData(REveCaloData* d);
86 void DataChanged();
87 Float_t GetMaxVal() const;
88
91
93 void SetDataSliceThreshold(Int_t slice, Float_t val);
94 Color_t GetDataSliceColor(Int_t slice) const;
95 void SetDataSliceColor(Int_t slice, Color_t col);
96
99 Float_t GetEndCapPos () const { return fEndCapPosF; } // get end cap position, assuming fEndCapPosF = -fEndCapPosB
105
106 Bool_t GetPlotEt() const { return fPlotEt; }
107 void SetPlotEt(Bool_t x);
108
110 Float_t GetMaxTowerH() const { return fMaxTowerH; }
111 Bool_t GetScaleAbs() const { return fScaleAbs; }
113 Float_t GetMaxValAbs() const { return fMaxValAbs; }
114
121
124
128
129 Bool_t GetAutoRange() const { return fAutoRange; }
131
132 void SetEta(Float_t l, Float_t u);
133 Float_t GetEta() const { return 0.5f*(fEtaMin+fEtaMax); }
134 Float_t GetEtaMin() const { return fEtaMin; }
135 Float_t GetEtaMax() const { return fEtaMax; }
136 Float_t GetEtaRng() const { return fEtaMax-fEtaMin; }
137
139 void SetPhiRng(Float_t rng) { SetPhiWithRng(fPhi, rng); }
141 Float_t GetPhi() const { return fPhi; }
142 Float_t GetPhiMin() const { return fPhi-fPhiOffset; }
143 Float_t GetPhiMax() const { return fPhi+fPhiOffset; }
144 Float_t GetPhiRng() const { return 2.0f*fPhiOffset; }
145
147
148 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
150};
151
152/**************************************************************************/
153/**************************************************************************/
154
156{
157private:
158 REveCalo3D& operator=(const REveCalo3D&) = delete;
159
160 void MakeBarrelCell(const REveCaloData::CellGeom_t &cellData, float towerH, Float_t& offset, float *pnts) const;
161 void MakeEndCapCell(const REveCaloData::CellGeom_t &cellData, float towerH, Float_t& offset, float *pnts) const;
162
163protected:
165
168
172
173 void BuildCellIdCache() override;
174
175public:
176 REveCalo3D(REveCaloData* d=0, const char* n="REveCalo3D", const char* t="");
177 virtual ~REveCalo3D() {}
178 void ComputeBBox() override;
179
180 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
182 void BuildRenderData() override;
183
186
193
196
197 void NewTowerPicked(Int_t tower, Int_t slice, Int_t selectionId, Bool_t multi);
198};
199
200/**************************************************************************/
201/**************************************************************************/
202
203class REveCalo2D : public REveCaloViz,
204 public REveProjected
205{
206public:
207 typedef std::vector<REveCaloData::vCellId_t*> vBinCells_t;
208 typedef std::vector<REveCaloData::vCellId_t*>::iterator vBinCells_i;
209
210private:
211 REveCalo2D& operator=(const REveCalo2D&) = delete;
212
214 void CellSelectionChangedInternal(REveCaloData::vCellId_t& cells, std::vector<REveCaloData::vCellId_t*>& cellLists);
215
216 void MakeRPhiCell(Float_t phiMin, Float_t phiMax,
217 Float_t towerH, Float_t offset, float* pntsOut) const;
218
219 void MakeRhoZCell(Float_t thetaMin, Float_t thetaMax,
220 Float_t& offset, Bool_t isBarrel, Bool_t phiPlus, Float_t towerH, float *pntsOut) const;
221
222 void BuildRenderDataRPhi();
223 void BuildRenderDataRhoZ();
224
225protected:
226 std::vector<REveCaloData::vCellId_t*> fCellLists;
227
228 std::vector<REveCaloData::vCellId_t*> fCellListsSelected;
229 std::vector<REveCaloData::vCellId_t*> fCellListsHighlighted;
230
233
234 void BuildCellIdCache() override;
235
236 void SetDepthLocal(Float_t x) override { fDepth = x; }
237
238 bool IsRPhi() const;
239
240public:
241 REveCalo2D(const char* n="REveCalo2D", const char* t="");
242 virtual ~REveCalo2D();
243
244 void SetProjection(REveProjectionManager* proj, REveProjectable* model) override;
245 void UpdateProjection() override;
246 void ComputeBBox() override;
247
248 void SetScaleAbs(Bool_t) override;
249
250 Float_t GetValToHeight() const override;
251
252 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
254 void BuildRenderData() override;
255
256 void NewBinPicked(Int_t bin, Int_t slice, Int_t selectionId, Bool_t multi);
257
259};
260
261/**************************************************************************/
262/**************************************************************************/
263
265{
266public:
270
271private:
273
274protected:
276
281
282 Int_t fNZSteps; // Z axis label step in GeV
284
288
291 EBoxMode_e fBoxMode; // additional scale info
292
295
297 Float_t fFixedHeightValIn2DMode; // 1% of whole height
298
301
302 void BuildCellIdCache() override;
303
304public:
305 REveCaloLego(REveCaloData* data=0, const char* n="REveCaloLego", const char* t="");
306 virtual ~REveCaloLego(){}
307
308 void ComputeBBox() override;
309 virtual void SetData(REveCaloData* d);
310
311 Color_t GetFontColor() const { return fFontColor; }
313
314 Color_t GetGridColor() const { return fGridColor; }
316
319
322
323 Int_t GetNZSteps() const { return fNZSteps; }
324 void SetNZSteps(Int_t s) { fNZSteps = s;}
325
328
329 Bool_t GetAutoRebin() const { return fAutoRebin; }
331
334
337
338 void Set2DMode(E2DMode_e p) { f2DMode = p; }
340
343
346
349
350 Bool_t GetDrawHPlane() const { return fDrawHPlane; }
352
353 Float_t GetHPlaneVal() const { return fHPlaneVal; }
355
360};
361
362} // namespace Experimental
363} // namespace ROOT
364
365#endif
ROOT::R::TRInterface & r
Definition Object.C:4
#define d(i)
Definition RSha256.hxx:102
#define b(i)
Definition RSha256.hxx:100
#define e(i)
Definition RSha256.hxx:103
char Char_t
Definition RtypesCore.h:37
const Bool_t kFALSE
Definition RtypesCore.h:101
bool Bool_t
Definition RtypesCore.h:63
double Double_t
Definition RtypesCore.h:59
short Color_t
Definition RtypesCore.h:92
float Float_t
Definition RtypesCore.h:57
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:207
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:236
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
std::vector< REveCaloData::vCellId_t * >::iterator vBinCells_i
Definition REveCalo.hxx:208
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:213
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:226
std::vector< REveCaloData::vCellId_t * > fCellListsHighlighted
Definition REveCalo.hxx:229
std::vector< REveCaloData::vCellId_t * > fCellListsSelected
Definition REveCalo.hxx:228
const REveCalo2D::vBinCells_t & GetBinLists() const
Definition REveCalo.hxx:258
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
virtual ~REveCalo2D()
Destructor.
Definition REveCalo.cxx:755
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:195
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:187
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:194
REveCalo3D & operator=(const REveCalo3D &)=delete
REveCaloData::vCellId_t fCellList
Definition REveCalo.hxx:164
void GetRnrFrame(Bool_t &e, Bool_t &b) const
Definition REveCalo.hxx:188
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:344
void SetBoxMode(EBoxMode_e p)
Definition REveCalo.hxx:347
void SetFixedHeightValIn2DMode(float x)
Definition REveCalo.hxx:345
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:275
REveCaloLego & operator=(const REveCaloLego &)=delete
void SetProjection(EProjection_e p)
Definition REveCalo.hxx:336
EProjection_e GetProjection() const
Definition REveCalo.hxx:335
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:97
Float_t GetBackwardEndCapPos() const
Definition REveCalo.hxx:101
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:82
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:84
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:104
void SetPhiWithRng(Float_t x, Float_t r)
Set phi range.
Definition REveCalo.cxx:171
virtual ~REveCaloViz()
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:122
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:98
Float_t GetDataSliceThreshold(Int_t slice) const
Get threshold for given slice.
Definition REveCalo.cxx:87
Float_t GetForwardEndCapPos() const
Definition REveCalo.hxx:100
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:103
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:46
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:80
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...
basic_json< std::map, std::vector, std::string, bool, std::int64_t, std::uint64_t, double, std::allocator, adl_serializer, std::vector< std::uint8_t > > json
auto * l
Definition textangle.C:4