23 #include "TEveScene.h"
24 #include "TGLViewer.h"
25 #include "TEveArrow.h"
28 using namespace DD4hep;
37 InstanceCount::increment(
this);
41 Calo2DProjection::~Calo2DProjection() {
42 InstanceCount::decrement(
this);
46 View& Calo2DProjection::Build(TEveWindow*
slot) {
49 CreateRhoPhiProjection().AddAxis();
50 AddToGlobalItems(name());
56 DisplayConfiguration::Configurations::const_iterator fit;
57 DisplayConfiguration::Configurations::const_reverse_iterator rit;
58 float legend_y = Annotation::DefaultTextSize()+Annotation::DefaultMargin();
61 if ( cfg.
type == DisplayConfiguration::DETELEMENT ) {
64 for(TEveElementList::List_i i=sens.BeginChildren(); i!=sens.EndChildren(); ++i) {
66 if ( ll && cfg.
name == ll->GetName() ) {
67 m_projMgr->ImportElements(*i,m_geoScene);
71 for(TEveElementList::List_i i=struc.BeginChildren(); i!=struc.EndChildren(); ++i) {
73 if ( ll && cfg.
name == ll->GetName() ) {
74 m_projMgr->ImportElements(*i,m_geoScene);
85 if ( cfg.
type == DisplayConfiguration::CALODATA && cfg.
use.empty() ) {
86 const char* n = cfg.
name.c_str();
89 TEveCalo2D* calo2d = (TEveCalo2D*)m_projMgr->ImportElements(ctx.
calo3D,m_geoScene);
90 calo2d->SetPlotEt(kFALSE);
91 calo2d->SetDepth(depth += 1.0);
92 calo2d->SetAutoRange(kTRUE);
93 calo2d->SetScaleAbs(kTRUE);
94 calo2d->SetMainColor(calo3d.
color);
95 calo2d->SetMaxValAbs(calo3d.
emax);
96 calo2d->SetMaxTowerH(calo3d.
towerH);
97 calo2d->SetBarrelRadius(calo3d.
rmin);
98 calo2d->SetEndCapPos(calo3d.
dz);
99 calo2d->InvalidateCellIdCache();
100 calo2d->AssertCellIdCache();
101 calo2d->ComputeBBox();
102 Color_t col = ctx.
calo3D->GetDataSliceColor(ctx.
slice);
106 TEveArrow* a1 =
new TEveArrow(100,100, 100,0., 0., 0.);
107 a1->SetMainColor(calo3d.
color);
109 a1->SetPickable(kFALSE);
110 m_projMgr->ImportElements(a1,m_geoScene);
112 legend_y += a->GetTextSize();
113 printout(
INFO,
"Calo2DProjection",
"+++ %s: add detector %s [%s] rmin=%f towerH:%f emax=%f",
122 this->View::ConfigureEvent(config);
126 void Calo2DProjection::ImportGeoTopics(
const string& ) {
#define DECLARE_VIEW_FACTORY(x)
Class of the ROOT toolkit. See http://root.cern.ch/root/htmldoc/ClassIndex.html.
Configurations subdetectors
DisplayConfiguration::Config config
union DD4hep::DisplayConfiguration::Config::Values data
View TEveWindowSlot * slot
class View View.h DDEve/View.h
class Projection Projection.h DDEve/Projection.h
ClassImp(Calo2DProjection) Calo2DProjection
Initializing constructor.
2D projection operator for calorimeters
int printout(PrintLevel severity, const char *src, const char *fmt,...)
Calls the display action with a given severity level.
The main class of the DDEve display.
Class to add annotations to eve viewers.