2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #if !defined(__CINT__) || defined(__MAKECINT__)
13 #include <TEveManager.h>
14 #include <TEveElement.h>
16 #include <AliRunLoader.h>
17 #include <AliEveEventManager.h>
18 #include <AliEveTPCData.h>
19 #include <AliEveTPCSector2D.h>
20 #include <AliEveTPCSector3D.h>
23 void tpc_digits(Int_t mode=1)
25 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
26 rl->LoadDigits("TPC");
27 TTree* dt = rl->GetTreeD("TPC", false);
30 throw TEveException("tpc_digits Can not access digits tree.");
33 AliEveTPCData *x = new AliEveTPCData;
35 x->LoadDigits(dt, kTRUE); // Create all present sectors.
37 gStyle->SetPalette(1, 0);
42 case 0: { // Display a single sector
43 AliEveTPCSector2D* s = new AliEveTPCSector2D();
44 s->SetFrameColor(col);
49 //TGLViewer* cam = gEve->GetDefaultGLViewer();
50 //cam->SetCurrentCamera(TGLViewer::kCameraOrthoXOY) ;
51 //cam->SetOrthoCamera(TGLViewer::kCameraOrthoXOY, 2*left, 2*right, 2*top, bottom);
52 //printf("%f %f %f %f\n", left, right, top, bottom);
57 case 1: { // Display all sectors
58 gEve->DisableRedraw();
60 TEveElementList* l = new TEveElementList("TPC plate 1");
61 l->SetTitle("TPC Plate");
65 for (Int_t i = 0; i<18; i++)
67 AliEveTPCSector2D* s = new AliEveTPCSector2D(Form("AliEveTPCSector2D %d", i));
70 s->SetFrameColor(col);
71 s->SetAutoTrans(kTRUE);
76 TEveElementList* l = new TEveElementList("TPC plate 2");
77 l->SetTitle("TPC Plate");
81 for (Int_t i = 18; i<36; i++)
83 AliEveTPCSector2D* s = new AliEveTPCSector2D(Form("AliEveTPCSector2D %d", i));
86 s->SetFrameColor(col);
87 s->SetAutoTrans(kTRUE);
96 case 2 : { // Display a single sector in 3D
97 AliEveTPCSector3D* s = new AliEveTPCSector3D();
98 s->SetFrameColor(col);
105 case 3: { // Display all sectors in 3D
106 gEve->DisableRedraw();
108 TEveElementList* l = new TEveElementList("TPC plate 1");
109 l->SetTitle("TPC Plate");
110 l->SetMainColor(col);
113 for (Int_t i = 0; i<18; i++)
115 AliEveTPCSector3D* s = new AliEveTPCSector3D(Form("AliEveTPCSector3D %d", i));
118 s->SetFrameColor(col);
119 s->SetAutoTrans(kTRUE);
124 TEveElementList* l = new TEveElementList("TPC plate 2");
125 l->SetTitle("TPC Plate");
126 l->SetMainColor(col);
129 for (Int_t i = 18; i<36; i++)
131 AliEveTPCSector3D* s = new AliEveTPCSector3D(Form("AliEveTPCSector3D %d", i));
134 s->SetFrameColor(col);
135 s->SetAutoTrans(kTRUE);
139 gEve->EnableRedraw();
148 void tpc_digits_2drange(Int_t start, Int_t end)
150 if (start < 0) start = 0;
151 if (end > 35) end = 35;
153 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
154 rl->LoadDigits("TPC");
155 TTree* dt = rl->GetTreeD("TPC", false);
158 throw TEveException("tpc_digits Can not access digits tree.");
161 AliEveTPCData *x = new AliEveTPCData;
163 x->LoadDigits(dt, kTRUE); // Create all present sectors.
165 gStyle->SetPalette(1, 0);
168 gEve->DisableRedraw();
170 TEveElementList* l = new TEveElementList("TPC sectors");
171 l->SetMainColor(col);
174 for (Int_t i=start; i<=end; i++)
176 AliEveTPCSector2D* s = new AliEveTPCSector2D();
179 s->SetFrameColor(col);
180 s->SetAutoTrans(kTRUE);
181 gEve->AddElement(s, l);
184 gEve->EnableRedraw();