Fork me on GitHub

source: git/display/DelphesDisplay.cc@ 3b02069

Last change on this file since 3b02069 was 341014c, checked in by Pavel Demin <pavel-demin@…>, 6 years ago

apply .clang-format to all .h, .cc and .cpp files

  • Property mode set to 100644
File size: 4.9 KB
RevLine 
[b443089]1/*
2 * Delphes: a framework for fast simulation of a generic collider experiment
3 * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium
[1fa50c2]4 *
[b443089]5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
[1fa50c2]9 *
[b443089]10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
[1fa50c2]14 *
[b443089]15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
[341014c]19#include "TEveBrowser.h"
[d7d2da3]20#include "TEveManager.h"
[341014c]21#include "TEveProjectionAxes.h"
22#include "TEveProjectionManager.h"
23#include "TEveScene.h"
[d7d2da3]24#include "TEveViewer.h"
[341014c]25#include "TEveWindow.h"
[d7d2da3]26#include "TGLViewer.h"
27#include "TGLWidget.h"
28#include "TGTab.h"
29
30#include "TEveCalo2DGL.h"
[341014c]31#include "TEveCalo3DGL.h"
[d7d2da3]32#include "TEveCaloLegoGL.h"
33#include "TEveCaloLegoOverlay.h"
34#include "TEveLegoEventHandler.h"
35
[00bcbe6]36#include "display/DelphesDisplay.h"
[d7d2da3]37
38//------------------------------------------------------------------------------
39
40DelphesDisplay::DelphesDisplay()
41{
42 TEveProjectionAxes *axes;
43 TEveWindowSlot *slot;
44 TEveWindowPack *packH, *pack0, *pack1;
45
46 fRPhiMgr = new TEveProjectionManager(TEveProjection::kPT_RPhi);
47 fRhoZMgr = new TEveProjectionManager(TEveProjection::kPT_RhoZ);
48
[341014c]49 fRPhiGeomScene = gEve->SpawnNewScene("RPhi Geometry");
50 fRhoZGeomScene = gEve->SpawnNewScene("RhoZ Geometry");
[d7d2da3]51
[341014c]52 fRPhiCaloScene = gEve->SpawnNewScene("RPhi Calorimeter");
53 fRhoZCaloScene = gEve->SpawnNewScene("RhoZ Calorimeter");
54 fLegoCaloScene = gEve->SpawnNewScene("Lego Calorimeter");
55
56 fRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data");
57 fRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data");
[d7d2da3]58
59 axes = new TEveProjectionAxes(fRPhiMgr);
60 fRPhiGeomScene->AddElement(axes);
61
62 axes = new TEveProjectionAxes(fRhoZMgr);
63 fRhoZGeomScene->AddElement(axes);
64
65 // close default tab
66 gEve->GetBrowser()->GetTabRight()->CloseTab(0);
67
68 // frames
69 slot = TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight());
70 packH = slot->MakePack();
71
72 packH->SetElementName("Delphes Display");
73 packH->SetHorizontal();
74 packH->SetShowTitleBar(kFALSE);
75
76 pack0 = packH->NewSlot()->MakePack();
77 pack0->SetShowTitleBar(kFALSE);
78
79 pack1 = packH->NewSlot()->MakePack();
80 pack1->SetShowTitleBar(kFALSE);
81
82 pack1->NewSlot()->MakeCurrent();
83 f3DimView = gEve->SpawnNewViewer("3D View", "");
84 f3DimView->AddScene(gEve->GetGlobalScene());
85 f3DimView->AddScene(gEve->GetEventScene());
[341014c]86
[d7d2da3]87 pack1->NewSlot()->MakeCurrent();
88 fLegoView = gEve->SpawnNewViewer("Lego View", "");
89 fLegoView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
90 fLegoView->AddScene(fLegoCaloScene);
[341014c]91
[d7d2da3]92 pack0->NewSlot()->MakeCurrent();
93 fRPhiView = gEve->SpawnNewViewer("RPhi View", "");
94 fRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
95 fRPhiView->AddScene(fRPhiGeomScene);
96 fRPhiView->AddScene(fRPhiCaloScene);
97 fRPhiView->AddScene(fRPhiEventScene);
[341014c]98
[d7d2da3]99 pack0->NewSlot()->MakeCurrent();
100 fRhoZView = gEve->SpawnNewViewer("RhoZ View", "");
101 fRhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
102 fRhoZView->AddScene(fRhoZGeomScene);
103 fRhoZView->AddScene(fRhoZCaloScene);
104 fRhoZView->AddScene(fRhoZEventScene);
105}
106
107//------------------------------------------------------------------------------
108
109DelphesDisplay::~DelphesDisplay()
110{
111}
112
113//------------------------------------------------------------------------------
114
[341014c]115void DelphesDisplay::ImportGeomRPhi(TEveElement *el)
116{
[d7d2da3]117 fRPhiMgr->ImportElements(el, fRPhiGeomScene);
118}
119
[341014c]120void DelphesDisplay::ImportGeomRhoZ(TEveElement *el)
121{
[d7d2da3]122 fRhoZMgr->ImportElements(el, fRhoZGeomScene);
123}
124
125void DelphesDisplay::ImportCaloRPhi(TEveCalo3D *calo)
126{
127 fRPhiMgr->ImportElements(calo, fRPhiCaloScene);
128}
129
130void DelphesDisplay::ImportCaloRhoZ(TEveCalo3D *calo)
131{
132 fRhoZMgr->ImportElements(calo, fRhoZCaloScene);
133}
134
135void DelphesDisplay::ImportCaloLego(TEveCaloLego *calo)
136{
137 TEveCaloLegoOverlay *overlay = new TEveCaloLegoOverlay();
[341014c]138
[d7d2da3]139 overlay->SetCaloLego(calo);
140 fLegoView->GetGLViewer()->AddOverlayElement(overlay);
141
142 fLegoCaloScene->AddElement(calo);
143}
144
[341014c]145void DelphesDisplay::ImportEventRPhi(TEveElement *el)
146{
[d7d2da3]147 fRPhiMgr->ImportElements(el, fRPhiEventScene);
148}
149
[341014c]150void DelphesDisplay::ImportEventRhoZ(TEveElement *el)
151{
[d7d2da3]152 fRhoZMgr->ImportElements(el, fRhoZEventScene);
153}
154
155//---------------------------------------------------------------------------
156
157void DelphesDisplay::DestroyEventRPhi()
158{
159 fRPhiEventScene->DestroyElements();
160}
161
162void DelphesDisplay::DestroyEventRhoZ()
163{
164 fRhoZEventScene->DestroyElements();
165}
166//------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.