Fork me on GitHub

source: svn/trunk/display/DelphesDisplay.cc

Last change on this file was 1097, checked in by Pavel Demin, 12 years ago

add make rule for event display

File size: 4.1 KB
Line 
1
2#include "TEveManager.h"
3#include "TEveViewer.h"
4#include "TGLViewer.h"
5#include "TGLWidget.h"
6#include "TEveScene.h"
7#include "TEveProjectionManager.h"
8#include "TEveProjectionAxes.h"
9#include "TEveBrowser.h"
10#include "TEveWindow.h"
11#include "TGTab.h"
12
13#include "TEveCalo2DGL.h"
14#include "TEveCalo3DGL.h"
15#include "TEveCaloLegoGL.h"
16#include "TEveCaloLegoOverlay.h"
17#include "TEveLegoEventHandler.h"
18
19#include "display/DelphesDisplay.h"
20
21//------------------------------------------------------------------------------
22
23DelphesDisplay::DelphesDisplay()
24{
25 TEveProjectionAxes *axes;
26 TEveWindowSlot *slot;
27 TEveWindowPack *packH, *pack0, *pack1;
28
29 fRPhiMgr = new TEveProjectionManager(TEveProjection::kPT_RPhi);
30 fRhoZMgr = new TEveProjectionManager(TEveProjection::kPT_RhoZ);
31
32 fRPhiGeomScene = gEve->SpawnNewScene("RPhi Geometry");
33 fRhoZGeomScene = gEve->SpawnNewScene("RhoZ Geometry");
34
35 fRPhiCaloScene = gEve->SpawnNewScene("RPhi Calorimeter");
36 fRhoZCaloScene = gEve->SpawnNewScene("RhoZ Calorimeter");
37 fLegoCaloScene = gEve->SpawnNewScene("Lego Calorimeter");
38
39 fRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data");
40 fRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data");
41
42 axes = new TEveProjectionAxes(fRPhiMgr);
43 fRPhiGeomScene->AddElement(axes);
44
45 axes = new TEveProjectionAxes(fRhoZMgr);
46 fRhoZGeomScene->AddElement(axes);
47
48 // close default tab
49 gEve->GetBrowser()->GetTabRight()->CloseTab(0);
50
51 // frames
52 slot = TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight());
53 packH = slot->MakePack();
54
55 packH->SetElementName("Delphes Display");
56 packH->SetHorizontal();
57 packH->SetShowTitleBar(kFALSE);
58
59 pack0 = packH->NewSlot()->MakePack();
60 pack0->SetShowTitleBar(kFALSE);
61
62 pack1 = packH->NewSlot()->MakePack();
63 pack1->SetShowTitleBar(kFALSE);
64
65 pack1->NewSlot()->MakeCurrent();
66 f3DimView = gEve->SpawnNewViewer("3D View", "");
67 f3DimView->AddScene(gEve->GetGlobalScene());
68 f3DimView->AddScene(gEve->GetEventScene());
69
70 pack1->NewSlot()->MakeCurrent();
71 fLegoView = gEve->SpawnNewViewer("Lego View", "");
72 fLegoView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
73 fLegoView->AddScene(fLegoCaloScene);
74
75 pack0->NewSlot()->MakeCurrent();
76 fRPhiView = gEve->SpawnNewViewer("RPhi View", "");
77 fRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
78 fRPhiView->AddScene(fRPhiGeomScene);
79 fRPhiView->AddScene(fRPhiCaloScene);
80 fRPhiView->AddScene(fRPhiEventScene);
81
82 pack0->NewSlot()->MakeCurrent();
83 fRhoZView = gEve->SpawnNewViewer("RhoZ View", "");
84 fRhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
85 fRhoZView->AddScene(fRhoZGeomScene);
86 fRhoZView->AddScene(fRhoZCaloScene);
87 fRhoZView->AddScene(fRhoZEventScene);
88}
89
90//------------------------------------------------------------------------------
91
92DelphesDisplay::~DelphesDisplay()
93{
94}
95
96//------------------------------------------------------------------------------
97
98void DelphesDisplay::ImportGeomRPhi(TEveElement* el)
99{
100 fRPhiMgr->ImportElements(el, fRPhiGeomScene);
101}
102
103void DelphesDisplay::ImportGeomRhoZ(TEveElement* el)
104{
105 fRhoZMgr->ImportElements(el, fRhoZGeomScene);
106}
107
108void DelphesDisplay::ImportCaloRPhi(TEveCalo3D *calo)
109{
110 fRPhiMgr->ImportElements(calo, fRPhiCaloScene);
111}
112
113void DelphesDisplay::ImportCaloRhoZ(TEveCalo3D *calo)
114{
115 fRhoZMgr->ImportElements(calo, fRhoZCaloScene);
116}
117
118void DelphesDisplay::ImportCaloLego(TEveCaloLego *calo)
119{
120 TEveCaloLegoOverlay *overlay = new TEveCaloLegoOverlay();
121
122 overlay->SetCaloLego(calo);
123 fLegoView->GetGLViewer()->AddOverlayElement(overlay);
124
125 fLegoCaloScene->AddElement(calo);
126}
127
128void DelphesDisplay::ImportEventRPhi(TEveElement* el)
129{
130 fRPhiMgr->ImportElements(el, fRPhiEventScene);
131}
132
133void DelphesDisplay::ImportEventRhoZ(TEveElement* el)
134{
135 fRhoZMgr->ImportElements(el, fRhoZEventScene);
136}
137
138//---------------------------------------------------------------------------
139
140void DelphesDisplay::DestroyEventRPhi()
141{
142 fRPhiEventScene->DestroyElements();
143}
144
145void DelphesDisplay::DestroyEventRhoZ()
146{
147 fRhoZEventScene->DestroyElements();
148}
149//------------------------------------------------------------------------------
150
Note: See TracBrowser for help on using the repository browser.