19 #include "TGLViewer.h"
20 #include "TGLLightSet.h"
21 #include "TGLPerspectiveCamera.h"
22 #include "TGLOrthoCamera.h"
23 #include "TEveManager.h"
24 #include "TEveElement.h"
25 #include "TEveScene.h"
27 #include "TEveTrans.h"
28 #include "TEveScene.h"
29 #include "TEveCaloLegoOverlay.h"
55 m_autoRebin(this,
"Auto rebin on zoom-out",
false),
56 m_pixelsPerBin(this,
"Pixels per bin", 10., 1., 20.),
57 m_projectionMode(this,
"Projection", 0
l, 0
l, 2
l),
58 m_cell2DMode(this,
"Cell2DMode", 1
l, 1
l, 2
l),
59 m_drawValuesIn2D(this,
"Draw Cell2D threshold (pixels)", 40
l, 16
l, 1200
l),
60 m_showOverlay(this,
"Draw scales",
true) {
61 viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
62 viewerGL()->GetLightSet()->SetUseSpecular(
false);
93 data =
static_cast<TEveCaloData*
>(ctx.
getCaloData());
98 TEveCaloDataHist* hdata =
new TEveCaloDataHist();
99 hdata->IncDenyDestroy();
101 Bool_t
status = TH1::AddDirectoryStatus();
102 TH1::AddDirectory(kFALSE);
106 TH1::AddDirectory(status);
107 Int_t sliceIndex = hdata->AddHistogram(dummy);
108 (hdata)->RefSliceInfo(sliceIndex).Setup(
"background", 0., 0);
112 data->GetEtaBins()->SetNdivisions(710);
113 data->GetPhiBins()->SetNdivisions(510);
114 data->GetEtaBins()->SetTitleFont(120);
115 data->GetEtaBins()->SetTitle(
"h");
116 data->GetPhiBins()->SetTitleFont(120);
117 data->GetPhiBins()->SetTitle(
"f");
118 data->GetEtaBins()->SetLabelSize(0.02);
119 data->GetEtaBins()->SetTitleSize(0.03);
121 m_lego =
new TEveCaloLego(data);
129 m_lego->SetScaleAbs(
true);
132 m_lego->SetHasFixedHeightIn2DMode(
true);
133 m_lego->SetFixedHeightValIn2DMode(0.001);
136 TEveLegoEventHandler* eh =
dynamic_cast<TEveLegoEventHandler*
>(
viewerGL()->GetEventHandler());
150 m_lego->ElementChanged(kTRUE, kTRUE);
155 m_lego->ElementChanged(kTRUE, kTRUE);
173 if (value !=
nullptr) {
175 std::istringstream
s(value->
value());
221 viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
222 TGLOrthoCamera* camera =
dynamic_cast<TGLOrthoCamera*
>(&(
viewerGL()->RefCamera(TGLViewer::kCameraOrthoXOY)));
225 viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOY);
226 TGLPerspectiveCamera* camera =
227 dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->RefCamera(TGLViewer::kCameraPerspXOY)));
232 viewerGL()->ResetCamerasAfterNextUpdate();
239 bool topView =
viewerGL()->CurrentCamera().IsOrthographic();
240 std::ostringstream
s;
246 TGLOrthoCamera* camera =
dynamic_cast<TGLOrthoCamera*
>(&(
viewerGL()->RefCamera(TGLViewer::kCameraOrthoXOY)));
249 TGLPerspectiveCamera* camera =
250 dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->RefCamera(TGLViewer::kCameraPerspXOY)));
257 m_lego->ElementChanged(kTRUE, kTRUE);
void addToOrthoCamera(TGLOrthoCamera *, FWConfiguration &) const
TEveCaloDataVec * getCaloDataHF() const
FWEnumParameter m_projectionMode
FWDoubleParameter m_pixelsPerBin
~FWLegoViewBase() override
ViewerParameterGUI & requestTab(const char *)
ViewerParameterGUI & separator()
const std::string & typeName() const
unsigned int version() const
FWLegoViewBase(TEveWindowSlot *, FWViewType::EType)
TGLViewer * viewerGL() const
bool addEntry(Long_t id, const std::string &txt)
TEveCaloDataHist * getCaloData() const
void populateController(ViewerParameterGUI &) const override
FWBoolParameter m_showOverlay
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
FWLongParameter m_drawValuesIn2D
void setContext(const fireworks::Context &) override
TEveCaloLegoOverlay * m_overlay
FWBoolParameter m_autoRebin
const std::string & value(unsigned int iIndex=0) const
void populateController(ViewerParameterGUI &) const override
void setFrom(const FWConfiguration &) override
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
TEveCaloViz * getEveCalo() const override
ViewerParameterGUI & addParam(const FWParameterBase *)
sigc::signal< void, T > changed_
char data[epos_bytes_allocation]
void addTo(FWConfiguration &) const override
FWEnumParameter m_cell2DMode
const FWConfiguration * valueForKey(const std::string &iKey) const
void addTo(FWConfiguration &) const override
void setFromOrthoCamera(TGLOrthoCamera *, const FWConfiguration &)
void setFrom(const FWConfiguration &) override
virtual void setContext(const fireworks::Context &x)
FWViewType::EType typeId() const
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const