24 #include "TEveTrans.h"
25 #include "TEveScene.h"
26 #include "TGLViewer.h"
27 #include "TGLWidget.h"
28 #include "TEveCaloLegoOverlay.h"
29 #include "TEveLegoEventHandler.h"
33 using namespace DD4hep;
42 InstanceCount::increment(
this);
46 CaloLego::~CaloLego() {
47 InstanceCount::decrement(
this);
54 AddToGlobalItems(name());
60 DisplayConfiguration::Configurations::const_iterator j = config.
subdetectors.begin();
62 float legend_y = Annotation::DefaultTextSize()+Annotation::DefaultMargin();
64 ctx.
eveHist =
new TEveCaloDataHist();
66 const char* n = (*j).name.c_str();
70 for(
int isl = 0; isl<calo.
eveHist->GetNSlices(); ++isl) {
71 int nslice = ctx.
eveHist->GetNSlices();
72 TH2F* h =
new TH2F(*calo.
eveHist->GetHist(isl));
76 legend_y += a->GetTextSize();
80 TEveCaloLego* lego =
new TEveCaloLego(ctx.
eveHist);
87 lego->InitMainTrans();
88 lego->RefMainTrans().SetScale(TMath::TwoPi(), TMath::TwoPi(), TMath::Pi());
91 TGLViewer* glv = viewer()->GetGLViewer();
92 TEveCaloLegoOverlay* overlay =
new TEveCaloLegoOverlay();
93 glv->AddOverlayElement(overlay);
94 overlay->SetCaloLego(lego);
97 glv->SetEventHandler(
new TEveLegoEventHandler(glv->GetGLWidget(), glv, lego));
98 glv->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
99 ctx.
eveHist->GetEtaBins()->SetTitleFont(120);
100 ctx.
eveHist->GetEtaBins()->SetTitle(
"h");
101 ctx.
eveHist->GetPhiBins()->SetTitleFont(120);
102 ctx.
eveHist->GetPhiBins()->SetTitle(
"f");
109 DisplayConfiguration::Configurations::const_iterator j = config.
subdetectors.begin();
110 printout(
INFO,
"CaloLego",
"+++ Import geometry topics for view %s.",name().c_str());
112 const char* n = (*j).name.c_str();
115 for(
int isl = 0; isl<ctx.
eveHist->GetNSlices(); ++isl) {
116 TH2F* global = ctx.
eveHist->GetHist(isl);
117 TH2F* local = m_data.eveHist->GetHist(ihist);
123 m_data.eveHist->DataChanged();
127 void CaloLego::ImportGeoTopics(
const string&) {
#define DECLARE_VIEW_FACTORY(x)
Configurations subdetectors
TEveCaloDataHist * eveHist
Lego plot for calorimeter energy deposits.
DisplayConfiguration::Config config
union DD4hep::DisplayConfiguration::Config::Values data
View TEveWindowSlot * slot
class View View.h DDEve/View.h
int printout(PrintLevel severity, const char *src, const char *fmt,...)
Calls the display action with a given severity level.
ClassImp(CaloLego) CaloLego
Initializing constructor.
The main class of the DDEve display.
Class to add annotations to eve viewers.