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 void tpc_digits(Int_t mode=1)
12 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
13 rl->LoadDigits("TPC");
14 TTree* dt = rl->GetTreeD("TPC", false);
17 throw TEveException("tpc_digits Can not access digits tree.");
20 AliEveTPCData *x = new AliEveTPCData;
22 x->LoadDigits(dt, kTRUE); // Create all present sectors.
24 gStyle->SetPalette(1, 0);
29 case 0: { // Display a single sector
30 AliEveTPCSector2D* s = new AliEveTPCSector2D();
31 s->SetFrameColor(col);
36 //TGLViewer* cam = gEve->GetDefaultGLViewer();
37 //cam->SetCurrentCamera(TGLViewer::kCameraOrthoXOY) ;
38 //cam->SetOrthoCamera(TGLViewer::kCameraOrthoXOY, 2*left, 2*right, 2*top, bottom);
39 //printf("%f %f %f %f\n", left, right, top, bottom);
44 case 1: { // Display all sectors
45 gEve->DisableRedraw();
47 TEveElementList* l = new TEveElementList("TPC plate 1");
48 l->SetTitle("TPC Plate");
52 for (Int_t i = 0; i<18; i++)
54 AliEveTPCSector2D* s = new AliEveTPCSector2D(Form("AliEveTPCSector2D %d", i));
57 s->SetFrameColor(col);
58 s->SetAutoTrans(kTRUE);
63 TEveElementList* l = new TEveElementList("TPC plate 2");
64 l->SetTitle("TPC Plate");
68 for (Int_t i = 18; i<36; i++)
70 AliEveTPCSector2D* s = new AliEveTPCSector2D(Form("AliEveTPCSector2D %d", i));
73 s->SetFrameColor(col);
74 s->SetAutoTrans(kTRUE);
83 case 2 : { // Display a single sector in 3D
84 AliEveTPCSector3D* s = new AliEveTPCSector3D();
85 s->SetFrameColor(col);
92 case 3: { // Display all sectors in 3D
93 gEve->DisableRedraw();
95 TEveElementList* l = new TEveElementList("TPC plate 1");
96 l->SetTitle("TPC Plate");
100 for (Int_t i = 0; i<18; i++)
102 AliEveTPCSector3D* s = new AliEveTPCSector3D(Form("AliEveTPCSector3D %d", i));
105 s->SetFrameColor(col);
106 s->SetAutoTrans(kTRUE);
111 TEveElementList* l = new TEveElementList("TPC plate 2");
112 l->SetTitle("TPC Plate");
113 l->SetMainColor(col);
116 for (Int_t i = 18; i<36; i++)
118 AliEveTPCSector3D* s = new AliEveTPCSector3D(Form("AliEveTPCSector3D %d", i));
121 s->SetFrameColor(col);
122 s->SetAutoTrans(kTRUE);
126 gEve->EnableRedraw();
135 void tpc_digits_2drange(Int_t start, Int_t end)
137 if (start < 0) start = 0;
138 if (end > 35) end = 35;
140 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
141 rl->LoadDigits("TPC");
142 TTree* dt = rl->GetTreeD("TPC", false);
145 throw TEveException("tpc_digits Can not access digits tree.");
148 AliEveTPCData *x = new AliEveTPCData;
150 x->LoadDigits(dt, kTRUE); // Create all present sectors.
152 gStyle->SetPalette(1, 0);
155 gEve->DisableRedraw();
157 TEveElementList* l = new TEveElementList("TPC sectors");
158 l->SetMainColor(col);
161 for (Int_t i=start; i<=end; i++)
163 AliEveTPCSector2D* s = new AliEveTPCSector2D();
166 s->SetFrameColor(col);
167 s->SetAutoTrans(kTRUE);
168 gEve->AddElement(s, l);
171 gEve->EnableRedraw();