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