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