]>
Commit | Line | Data |
---|---|---|
5a5a1232 | 1 | // $Id$ |
d810d0de | 2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 |
3 | ||
4 | /************************************************************************** | |
5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
51346b82 | 7 | * full copyright notice. * |
d810d0de | 8 | **************************************************************************/ |
5a5a1232 | 9 | |
32e219c2 | 10 | void tpc_digits(Int_t mode=1) |
5a5a1232 | 11 | { |
4d62585e | 12 | AliRunLoader* rl = AliEveEventManager::AssertRunLoader(); |
13 | rl->LoadDigits("TPC"); | |
14 | TTree* dt = rl->GetTreeD("TPC", false); | |
15 | if (dt == 0) | |
cb4245bb | 16 | { |
05bd816b | 17 | throw TEveException("tpc_digits Can not access digits tree."); |
915dabe1 | 18 | } |
5a5a1232 | 19 | |
4d62585e | 20 | AliEveTPCData *x = new AliEveTPCData; |
21 | ||
22 | x->LoadDigits(dt, kTRUE); // Create all present sectors. | |
5a5a1232 | 23 | |
24 | gStyle->SetPalette(1, 0); | |
092578a7 | 25 | Color_t col = 36; |
5a5a1232 | 26 | |
915dabe1 | 27 | switch(mode) { |
28 | ||
29 | case 0: { // Display a single sector | |
d810d0de | 30 | AliEveTPCSector2D* s = new AliEveTPCSector2D(); |
092578a7 | 31 | s->SetFrameColor(col); |
4d62585e | 32 | s->SetDataSource(x); |
84aff7a4 | 33 | gEve->AddElement(s); |
34 | gEve->Redraw3D(); | |
5a5a1232 | 35 | |
68ca2fe7 | 36 | //TGLViewer* cam = gEve->GetDefaultGLViewer(); |
5a5a1232 | 37 | //cam->SetCurrentCamera(TGLViewer::kCameraOrthoXOY) ; |
51346b82 | 38 | //cam->SetOrthoCamera(TGLViewer::kCameraOrthoXOY, 2*left, 2*right, 2*top, bottom); |
5a5a1232 | 39 | //printf("%f %f %f %f\n", left, right, top, bottom); |
40 | ||
915dabe1 | 41 | break; |
42 | } | |
43 | ||
44 | case 1: { // Display all sectors | |
84aff7a4 | 45 | gEve->DisableRedraw(); |
5a5a1232 | 46 | { |
84aff7a4 | 47 | TEveElementList* l = new TEveElementList("TPC plate 1"); |
5a5a1232 | 48 | l->SetTitle("TPC Plate"); |
fbc350a3 | 49 | l->SetMainColor(col); |
84aff7a4 | 50 | gEve->AddElement(l); |
51346b82 | 51 | |
cb4245bb | 52 | for (Int_t i = 0; i<18; i++) |
53 | { | |
d810d0de | 54 | AliEveTPCSector2D* s = new AliEveTPCSector2D(Form("AliEveTPCSector2D %d", i)); |
092578a7 | 55 | s->SetSectorID(i); |
4d62585e | 56 | s->SetDataSource(x); |
092578a7 | 57 | s->SetFrameColor(col); |
601bca51 | 58 | s->SetAutoTrans(kTRUE); |
68ca2fe7 | 59 | l->AddElement(s); |
5a5a1232 | 60 | } |
5a5a1232 | 61 | } |
62 | { | |
84aff7a4 | 63 | TEveElementList* l = new TEveElementList("TPC plate 2"); |
5a5a1232 | 64 | l->SetTitle("TPC Plate"); |
fbc350a3 | 65 | l->SetMainColor(col); |
5a5a1232 | 66 | |
84aff7a4 | 67 | gEve->AddElement(l); |
cb4245bb | 68 | for (Int_t i = 18; i<36; i++) |
69 | { | |
d810d0de | 70 | AliEveTPCSector2D* s = new AliEveTPCSector2D(Form("AliEveTPCSector2D %d", i)); |
092578a7 | 71 | s->SetSectorID(i); |
4d62585e | 72 | s->SetDataSource(x); |
092578a7 | 73 | s->SetFrameColor(col); |
601bca51 | 74 | s->SetAutoTrans(kTRUE); |
68ca2fe7 | 75 | l->AddElement(s); |
5a5a1232 | 76 | } |
5a5a1232 | 77 | } |
84aff7a4 | 78 | gEve->EnableRedraw(); |
915dabe1 | 79 | |
80 | break; | |
5a5a1232 | 81 | } |
915dabe1 | 82 | |
915dabe1 | 83 | case 2 : { // Display a single sector in 3D |
d810d0de | 84 | AliEveTPCSector3D* s = new AliEveTPCSector3D(); |
092578a7 | 85 | s->SetFrameColor(col); |
4d62585e | 86 | s->SetDataSource(x); |
84aff7a4 | 87 | gEve->AddElement(s); |
88 | gEve->Redraw3D(); | |
915dabe1 | 89 | break; |
90 | } | |
915dabe1 | 91 | |
a8600b56 | 92 | case 3: { // Display all sectors in 3D |
84aff7a4 | 93 | gEve->DisableRedraw(); |
a8600b56 | 94 | { |
84aff7a4 | 95 | TEveElementList* l = new TEveElementList("TPC plate 1"); |
a8600b56 | 96 | l->SetTitle("TPC Plate"); |
fbc350a3 | 97 | l->SetMainColor(col); |
84aff7a4 | 98 | gEve->AddElement(l); |
51346b82 | 99 | |
cb4245bb | 100 | for (Int_t i = 0; i<18; i++) |
101 | { | |
d810d0de | 102 | AliEveTPCSector3D* s = new AliEveTPCSector3D(Form("AliEveTPCSector3D %d", i)); |
a8600b56 | 103 | s->SetSectorID(i); |
4d62585e | 104 | s->SetDataSource(x); |
a8600b56 | 105 | s->SetFrameColor(col); |
601bca51 | 106 | s->SetAutoTrans(kTRUE); |
68ca2fe7 | 107 | l->AddElement(s); |
a8600b56 | 108 | } |
109 | } | |
110 | { | |
84aff7a4 | 111 | TEveElementList* l = new TEveElementList("TPC plate 2"); |
a8600b56 | 112 | l->SetTitle("TPC Plate"); |
fbc350a3 | 113 | l->SetMainColor(col); |
a8600b56 | 114 | |
84aff7a4 | 115 | gEve->AddElement(l); |
cb4245bb | 116 | for (Int_t i = 18; i<36; i++) |
117 | { | |
d810d0de | 118 | AliEveTPCSector3D* s = new AliEveTPCSector3D(Form("AliEveTPCSector3D %d", i)); |
a8600b56 | 119 | s->SetSectorID(i); |
4d62585e | 120 | s->SetDataSource(x); |
a8600b56 | 121 | s->SetFrameColor(col); |
601bca51 | 122 | s->SetAutoTrans(kTRUE); |
68ca2fe7 | 123 | l->AddElement(s); |
a8600b56 | 124 | } |
125 | } | |
84aff7a4 | 126 | gEve->EnableRedraw(); |
a8600b56 | 127 | |
128 | break; | |
129 | } | |
130 | ||
915dabe1 | 131 | } // switch |
5a5a1232 | 132 | } |
c78930aa | 133 | |
134 | ||
135 | void tpc_digits_2drange(Int_t start, Int_t end) | |
136 | { | |
137 | if (start < 0) start = 0; | |
138 | if (end > 35) end = 35; | |
139 | ||
4d62585e | 140 | AliRunLoader* rl = AliEveEventManager::AssertRunLoader(); |
141 | rl->LoadDigits("TPC"); | |
142 | TTree* dt = rl->GetTreeD("TPC", false); | |
143 | if (dt == 0) | |
144 | { | |
05bd816b | 145 | throw TEveException("tpc_digits Can not access digits tree."); |
4d62585e | 146 | } |
c78930aa | 147 | |
4d62585e | 148 | AliEveTPCData *x = new AliEveTPCData; |
c78930aa | 149 | |
4d62585e | 150 | x->LoadDigits(dt, kTRUE); // Create all present sectors. |
c78930aa | 151 | |
152 | gStyle->SetPalette(1, 0); | |
153 | Color_t col = 36; | |
154 | ||
84aff7a4 | 155 | gEve->DisableRedraw(); |
c78930aa | 156 | { |
84aff7a4 | 157 | TEveElementList* l = new TEveElementList("TPC sectors"); |
fbc350a3 | 158 | l->SetMainColor(col); |
84aff7a4 | 159 | gEve->AddElement(l); |
51346b82 | 160 | |
cb4245bb | 161 | for (Int_t i=start; i<=end; i++) |
162 | { | |
d810d0de | 163 | AliEveTPCSector2D* s = new AliEveTPCSector2D(); |
c78930aa | 164 | s->SetSectorID(i); |
4d62585e | 165 | s->SetDataSource(x); |
c78930aa | 166 | s->SetFrameColor(col); |
167 | s->SetAutoTrans(kTRUE); | |
84aff7a4 | 168 | gEve->AddElement(s, l); |
c78930aa | 169 | } |
170 | } | |
84aff7a4 | 171 | gEve->EnableRedraw(); |
c78930aa | 172 | } |