15 #include <boost/bind.hpp>
20 #include "TGLViewer.h"
21 #include "TGLLightSet.h"
22 #include "TGLPerspectiveCamera.h"
23 #include "TGLOrthoCamera.h"
24 #include "TEveManager.h"
25 #include "TEveElement.h"
26 #include "TEveScene.h"
28 #include "TEveTrans.h"
29 #include "TEveScene.h"
30 #include "TEveCaloLegoOverlay.h"
57 m_autoRebin(this,
"Auto rebin on zoom-out",
false),
58 m_pixelsPerBin(this,
"Pixels per bin", 10., 1., 20.),
59 m_projectionMode(this,
"Projection", 0
l, 0
l, 2
l),
60 m_cell2DMode(this,
"Cell2DMode", 1
l, 1
l, 2
l),
61 m_drawValuesIn2D(this,
"Draw Cell2D threshold (pixels)",40
l,16
l,200
l),
62 m_showOverlay(this,
"Draw scales",
true)
64 viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
65 viewerGL()->GetLightSet()->SetUseSpecular(
false);
93 return static_cast<TEveCaloViz*
>(
m_lego);
103 data =
static_cast<TEveCaloData*
>(ctx.
getCaloData());
111 TEveCaloDataHist* hdata =
new TEveCaloDataHist();
112 hdata->IncDenyDestroy();
114 Bool_t
status = TH1::AddDirectoryStatus();
115 TH1::AddDirectory(kFALSE);
116 TH2F* dummy =
new TH2F(
"background",
121 TH1::AddDirectory(status);
122 Int_t sliceIndex = hdata->AddHistogram(dummy);
123 (hdata)->RefSliceInfo(sliceIndex).Setup(
"background", 0., 0);
127 data->GetEtaBins()->SetNdivisions(710);
128 data->GetPhiBins()->SetNdivisions(510);
129 data->GetEtaBins()->SetTitleFont(120);
130 data->GetEtaBins()->SetTitle(
"h");
131 data->GetPhiBins()->SetTitleFont(120);
132 data->GetPhiBins()->SetTitle(
"f");
133 data->GetEtaBins()->SetLabelSize(0.02);
134 data->GetEtaBins()->SetTitleSize(0.03);
136 m_lego =
new TEveCaloLego(data);
144 m_lego->SetScaleAbs(
true);
147 m_lego->SetHasFixedHeightIn2DMode(
true);
148 m_lego->SetFixedHeightValIn2DMode(0.001);
151 TEveLegoEventHandler* eh =
dynamic_cast<TEveLegoEventHandler*
>(
viewerGL()->GetEventHandler());
152 if (eh) eh->SetLego(
m_lego);
166 m_lego->ElementChanged(kTRUE,kTRUE);
173 m_lego->ElementChanged(kTRUE,kTRUE);
198 std::istringstream
s(value->
value());
237 std::string stateName(
"topView"); stateName +=
typeName();
245 viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
246 TGLOrthoCamera* camera =
dynamic_cast<TGLOrthoCamera*
>( &(
viewerGL()->RefCamera(TGLViewer::kCameraOrthoXOY)) );
251 viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOY);
252 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->RefCamera(TGLViewer::kCameraPerspXOY)));
259 viewerGL()->ResetCamerasAfterNextUpdate();
269 bool topView =
viewerGL()->CurrentCamera().IsOrthographic();
270 std::ostringstream
s;
272 std::string
name =
"topView";
277 TGLOrthoCamera* camera =
dynamic_cast<TGLOrthoCamera*
>(&(
viewerGL()->RefCamera(TGLViewer::kCameraOrthoXOY)));
282 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->RefCamera(TGLViewer::kCameraPerspXOY)));
291 m_lego->ElementChanged(kTRUE,kTRUE);
void addToOrthoCamera(TGLOrthoCamera *, FWConfiguration &) const
virtual void addTo(FWConfiguration &) const
TEveCaloDataVec * getCaloDataHF() const
FWEnumParameter m_projectionMode
virtual void populateController(ViewerParameterGUI &) const
FWDoubleParameter m_pixelsPerBin
virtual void populateController(ViewerParameterGUI &) const
ViewerParameterGUI & requestTab(const char *)
virtual void setFrom(const FWConfiguration &)
const std::string & typeName() const
unsigned int version() const
FWLegoViewBase(TEveWindowSlot *, FWViewType::EType)
virtual TEveCaloViz * getEveCalo() const
TGLViewer * viewerGL() const
sigc::signal< void, T > changed_
virtual void setContext(const fireworks::Context &)
virtual ~FWLegoViewBase()
virtual void setFrom(const FWConfiguration &)
bool addEntry(Long_t id, const std::string &txt)
TEveCaloDataHist * getCaloData() const
FWBoolParameter m_showOverlay
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
FWLongParameter m_drawValuesIn2D
TEveCaloLegoOverlay * m_overlay
FWBoolParameter m_autoRebin
const std::string & value(unsigned int iIndex=0) const
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
char data[epos_bytes_allocation]
FWEnumParameter m_cell2DMode
const FWConfiguration * valueForKey(const std::string &iKey) const
void setFromOrthoCamera(TGLOrthoCamera *, const FWConfiguration &)
virtual void addTo(FWConfiguration &) const
virtual void setContext(const fireworks::Context &x)
FWViewType::EType typeId() const
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const