]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/its_common_foos.C
Geometry for MFT (Brigitte)
[u/mrichter/AliRoot.git] / EVE / alice-macros / its_common_foos.C
CommitLineData
20dae051 1// $Id$
c2c4b7a2 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 *
7 * full copyright notice. *
8 **************************************************************************/
6c49a8e1 9
4f8b4026 10#if !defined(__CINT__) || defined(__MAKECINT__)
11#include <TString.h>
12#include <TEveManager.h>
13#include <TEveElement.h>
14
6c49a8e1 15#include <AliEveITSModule.h>
16#include <AliEveITSDigitsInfo.h>
17#include <AliEveITSScaledModule.h>
4f8b4026 18#endif
19
c2c4b7a2 20
21void its_common_foos()
22{}
23
a4135a45 24AliEveITSModule* its_make_module(Int_t i, TEveElement* parent,
25 AliEveITSDigitsInfo* di,
26 AliEveDigitScaleInfo* si,
4516a822 27 Bool_t check_empty,
28 Bool_t scaled_modules)
a4135a45 29{
30 AliEveITSModule* m = 0;
31
32 Int_t det_id = 0;
33 if (i > 239 && i < 500) det_id = 1;
34 else if (i >= 500) det_id = 2;
35
fe6798e0 36 if (!check_empty || di->HasData(i, det_id) || di->IsDead(i, det_id))
a4135a45 37 {
38 if (scaled_modules)
39 m = new AliEveITSScaledModule(i, di, si);
40 else
41 m = new AliEveITSModule(i, di);
fe6798e0 42
43 // Before 5.26 ROOT did not draw frames of empty quad-sets.
44 // Bypass until we move there.
45 if (!di->HasData(i, det_id))
46 {
47 m->AddQuad(0,0,0,0);
48 m->RefitPlex();
49 }
50
a4135a45 51 if (parent)
52 parent->AddElement(m);
53 }
54
55 return m;
56}
57
58void its_display_raw_digits(AliEveITSDigitsInfo* di, Int_t mode,
59 Bool_t check_empty = kTRUE,
60 Bool_t scaled_modules = kFALSE)
c2c4b7a2 61{
4516a822 62 const TString bsSector = "Sector";
63 const TString bsStave = "Stave";
64 const TString bsLadder = "Ladder";
c2c4b7a2 65 TString sSector;
c2c4b7a2 66 TString sStave;
c2c4b7a2 67 TString sLadder;
c2c4b7a2 68
4516a822 69 Int_t i=0;
70 Long_t nsec, nstave, nlad, nMod;
c2c4b7a2 71
72 gEve->DisableRedraw();
73
a4135a45 74 AliEveDigitScaleInfo* si = 0;
75 if (scaled_modules)
4516a822 76 {
a4135a45 77 si = new AliEveDigitScaleInfo;
4516a822 78 }
a4135a45 79
4516a822 80 if (mode & 1)
81 {
c2c4b7a2 82 TEveElementList* l = new TEveElementList("SPD0");
83 l->SetTitle("SPDs' first layer");
4516a822 84 l->SetMainColor(kRed);
c2c4b7a2 85 gEve->AddElement(l);
4516a822 86
87 for (nsec=0; nsec<10; nsec++)
88 {
89 TEveElementList* relSector = new TEveElementList(bsSector + nsec);
90 relSector->SetMainColor(kRed);
91 l->AddElement(relSector);
92
93 for (nstave=0; nstave<2; nstave++)
94 {
95 TEveElementList* relStave = new TEveElementList(bsStave + nstave);
96 relStave->SetMainColor(kRed);
97 relSector->AddElement(relStave);
98
a4135a45 99 for (nMod=0; nMod<4; ++nMod, ++i)
c2c4b7a2 100 {
a4135a45 101 its_make_module(i, relStave, di, si, check_empty, scaled_modules);
c2c4b7a2 102 }
103 }
104 }
4516a822 105 }
106 else
107 {
c2c4b7a2 108 i += 10*2*4;
109 }
110
4516a822 111 if (mode & 2)
112 {
c2c4b7a2 113 TEveElementList* l = new TEveElementList("SPD1");
114 l->SetTitle("SPDs' second layer");
4516a822 115 l->SetMainColor(kRed);
c2c4b7a2 116 gEve->AddElement(l);
117
4516a822 118 for (nsec=0; nsec<10; nsec++)
119 {
120 TEveElementList* relSector = new TEveElementList(bsSector + nsec);
121 relSector->SetMainColor(kRed);
122 l->AddElement(relSector);
123
124 for (nstave=0; nstave<4; nstave++)
125 {
126 TEveElementList* relStave = new TEveElementList(bsStave + nstave);
127 relStave->SetMainColor(kRed);
128 relSector->AddElement(relStave);
129
a4135a45 130 for (nMod=0; nMod<4; ++nMod, ++i)
c2c4b7a2 131 {
a4135a45 132 its_make_module(i, relStave, di, si, check_empty, scaled_modules);
c2c4b7a2 133 }
134 }
135 }
4516a822 136 }
137 else
138 {
c2c4b7a2 139 i += 10*4*4;
140 }
141
4516a822 142 if (mode & 4)
143 {
c2c4b7a2 144 TEveElementList* l = new TEveElementList("SDD2");
145 l->SetTitle("SDDs' first layer");
4516a822 146 l->SetMainColor(kBlue);
c2c4b7a2 147 gEve->AddElement(l);
148
4516a822 149 for (nlad=0; nlad<14; nlad++)
150 {
151 TEveElementList* relLadder = new TEveElementList(bsLadder + nlad);
152 relLadder->SetMainColor(kBlue);
153 l->AddElement(relLadder);
a4135a45 154 for (nMod=0; nMod<6; ++nMod, ++i)
155 {
156 its_make_module(i, relLadder, di, si, check_empty, scaled_modules);
c2c4b7a2 157 }
158 }
4516a822 159 }
160 else
161 {
c2c4b7a2 162 i += 14*6;
163 }
164
4516a822 165 if (mode & 8)
166 {
c2c4b7a2 167 TEveElementList* l = new TEveElementList("SDD3");
168 l->SetTitle("SDDs' second layer");
4516a822 169 l->SetMainColor(kBlue);
c2c4b7a2 170 gEve->AddElement(l);
4516a822 171
172 for (nlad=0; nlad<22; nlad++)
173 {
174 TEveElementList* relLadder = new TEveElementList(bsLadder + nlad);
175 relLadder->SetMainColor(kBlue);
176 l->AddElement(relLadder);
a4135a45 177 for (nMod=0; nMod<8; ++nMod, ++i)
178 {
179 its_make_module(i, relLadder, di, si, check_empty, scaled_modules);
c2c4b7a2 180 }
181 }
4516a822 182 }
183 else
184 {
c2c4b7a2 185 i += 22*8;
186 }
187
4516a822 188 if (mode & 16)
189 {
c2c4b7a2 190 TEveElementList* l = new TEveElementList("SSD4");
191 l->SetTitle("SSDs' first layer");
4516a822 192 l->SetMainColor(kGreen);
c2c4b7a2 193 gEve->AddElement(l);
4516a822 194
195 for (nlad=0; nlad<34; nlad++)
196 {
197 TEveElementList* relLadder = new TEveElementList(bsLadder + nlad);
198 relLadder->SetMainColor(kGreen);
199 l->AddElement(relLadder);
a4135a45 200 for (nMod=0; nMod<22; ++nMod, ++i)
201 {
202 its_make_module(i, relLadder, di, si, check_empty, scaled_modules);
c2c4b7a2 203 }
204 }
4516a822 205 }
206 else
207 {
c2c4b7a2 208 i += 34*22;
209 }
210
4516a822 211 if (mode & 32)
212 {
c2c4b7a2 213 TEveElementList* l = new TEveElementList("SSD5");
214 l->SetTitle("SSDs' second layer");
4516a822 215 l->SetMainColor(kGreen);
c2c4b7a2 216 gEve->AddElement(l);
4516a822 217
218 for (nlad=0; nlad<38; nlad++)
219 {
220 TEveElementList* relLadder = new TEveElementList(bsLadder + nlad);
221 relLadder->SetMainColor(kGreen);
222 l->AddElement(relLadder);
a4135a45 223 for (nMod=0; nMod<25; ++nMod, ++i)
224 {
225 its_make_module(i, relLadder, di, si, check_empty, scaled_modules);
c2c4b7a2 226 }
227 }
4516a822 228 }
229 else
230 {
c2c4b7a2 231 i += 38*25;
232 }
233
234 gEve->EnableRedraw();
235}