14 #include <boost/bind.hpp> 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" 56 m_autoRebin(this,
"Auto rebin on zoom-out",
false),
57 m_pixelsPerBin(this,
"Pixels per bin", 10., 1., 20.),
58 m_projectionMode(this,
"Projection", 0
l, 0
l, 2
l),
59 m_cell2DMode(this,
"Cell2DMode", 1
l, 1
l, 2
l),
60 m_drawValuesIn2D(this,
"Draw Cell2D threshold (pixels)",40
l,16
l,1200
l),
61 m_showOverlay(this,
"Draw scales",
true)
63 viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
64 viewerGL()->GetLightSet()->SetUseSpecular(
false);
92 return static_cast<TEveCaloViz*
>(
m_lego);
102 data =
static_cast<TEveCaloData*
>(ctx.
getCaloData());
110 TEveCaloDataHist* hdata =
new TEveCaloDataHist();
111 hdata->IncDenyDestroy();
113 Bool_t
status = TH1::AddDirectoryStatus();
114 TH1::AddDirectory(kFALSE);
115 TH2F*
dummy =
new TH2F(
"background",
120 TH1::AddDirectory(status);
121 Int_t sliceIndex = hdata->AddHistogram(dummy);
122 (hdata)->RefSliceInfo(sliceIndex).Setup(
"background", 0., 0);
126 data->GetEtaBins()->SetNdivisions(710);
127 data->GetPhiBins()->SetNdivisions(510);
128 data->GetEtaBins()->SetTitleFont(120);
129 data->GetEtaBins()->SetTitle(
"h");
130 data->GetPhiBins()->SetTitleFont(120);
131 data->GetPhiBins()->SetTitle(
"f");
132 data->GetEtaBins()->SetLabelSize(0.02);
133 data->GetEtaBins()->SetTitleSize(0.03);
135 m_lego =
new TEveCaloLego(data);
143 m_lego->SetScaleAbs(
true);
146 m_lego->SetHasFixedHeightIn2DMode(
true);
147 m_lego->SetFixedHeightValIn2DMode(0.001);
150 TEveLegoEventHandler* eh =
dynamic_cast<TEveLegoEventHandler*
>(
viewerGL()->GetEventHandler());
151 if (eh) eh->SetLego(
m_lego);
165 m_lego->ElementChanged(kTRUE,kTRUE);
172 m_lego->ElementChanged(kTRUE,kTRUE);
197 std::istringstream
s(value->
value());
244 viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
245 TGLOrthoCamera* camera =
dynamic_cast<TGLOrthoCamera*
>( &(
viewerGL()->RefCamera(TGLViewer::kCameraOrthoXOY)) );
250 viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOY);
251 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->RefCamera(TGLViewer::kCameraPerspXOY)));
258 viewerGL()->ResetCamerasAfterNextUpdate();
268 bool topView =
viewerGL()->CurrentCamera().IsOrthographic();
269 std::ostringstream
s;
276 TGLOrthoCamera* camera =
dynamic_cast<TGLOrthoCamera*
>(&(
viewerGL()->RefCamera(TGLViewer::kCameraOrthoXOY)));
281 TGLPerspectiveCamera* camera =
dynamic_cast<TGLPerspectiveCamera*
>(&(
viewerGL()->RefCamera(TGLViewer::kCameraPerspXOY)));
290 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