Put black-listed classes out of Alieve namespace.
[u/mrichter/AliRoot.git] / EVE / alice-macros / its_raw.C
CommitLineData
961e5e6c 1void its_raw(const char *input = "rawdata.root",
2 Int_t mode = 63,
3 Int_t event = 0,
4 Bool_t accumulate = kFALSE)
9d7caeed 5{
6 if (gSystem->AccessPathName(input, kReadPermission))
7 {
8 Error("its_raw", "file '%s' not found.", input);
9 return;
10 }
11
12 AliRawReader *rawReader = NULL;
13 TString fileName(input);
14 if (fileName.EndsWith("/")) {
15 rawReader = new AliRawReaderFile(fileName);
16 } else if (fileName.EndsWith(".root")) {
17 rawReader = new AliRawReaderRoot(fileName);
18 } else if (!fileName.IsNull()) {
19 rawReader = new AliRawReaderDate(fileName);
20 rawReader->SelectEvents(7);
21 }
22
9d7caeed 23 Alieve::ITSDigitsInfo* di = new Alieve::ITSDigitsInfo();
961e5e6c 24
25 if (accumulate) AliLog::SetGlobalLogLevel(AliLog::kError);
26 Int_t ev = 0;
27 do {
28 if (ev % 100 == 0) printf("Event: %d\n", ev);
29 if (rawReader->NextEvent() == kFALSE)
30 {
31 Error("its_raw", "Reading event %d failed (requested event %d).", ev, event);
32 if (accumulate)
33 break;
34 else
35 return;
36 }
540e156e 37 if (accumulate) di->ReadRaw(rawReader,mode);
961e5e6c 38 } while (++ev < event);
39
540e156e 40 if ( ! accumulate) di->ReadRaw(rawReader,mode);
961e5e6c 41
9d7caeed 42 di->Dump();
43
44 delete rawReader;
45 // Could initialize ITSModule statics (?)
46
47 AliITSgeom* g = di->fGeom;
48
49 gStyle->SetPalette(1, 0);
50 // Initialize palettes (?)
51
84aff7a4 52 gEve->DisableRedraw();
9d7caeed 53
54 TString sSector;
55 TString bsSector="Sector";
56 TString sStave;
57 TString bsStave="Stave";
58 TString sLadder;
59 TString bsLadder="Ladder";
60
61 Int_t i=0;
62 Int_t nsec, nstave, nlad, nMod;
63
64 if (mode & 1) {
84aff7a4 65 TEveElementList* l = new TEveElementList("SPD0");
9d7caeed 66 l->SetTitle("SPDs' first layer");
67 l->SetMainColor((Color_t)2);
84aff7a4 68 gEve->AddElement(l);
69 for (nsec=0; nsec<10; nsec++) {
9d7caeed 70 sSector = bsSector;
71 sSector += nsec;
84aff7a4 72 TEveElementList* relSector = new TEveElementList(sSector.Data());
9d7caeed 73 relSector->SetMainColor((Color_t)2);
84aff7a4 74 gEve->AddElement(relSector, l);
75 for (nstave=0; nstave<2; nstave++){
9d7caeed 76 sStave = bsStave;
77 sStave += nstave;
84aff7a4 78 TEveElementList* relStave = new TEveElementList(sStave.Data());
9d7caeed 79 relStave->SetMainColor((Color_t)2);
84aff7a4 80 gEve->AddElement(relStave, relSector);
81 for (nMod=0; nMod<4; nMod++)
961e5e6c 82 {
83 if (di->GetDigits(i, 0) && di->GetDigits(i, 0)->GetEntriesFast() > 0)
84 {
85 Alieve::ITSModule* m = new Alieve::ITSModule(i, di);
84aff7a4 86 gEve->AddElement(m, relStave);
961e5e6c 87 }
88 ++i;
9d7caeed 89 }
90 }
91 }
92 } else {
93 i += 10*2*4;
94 }
95
96 if (mode & 2) {
84aff7a4 97 TEveElementList* l = new TEveElementList("SPD1");
9d7caeed 98 l->SetTitle("SPDs' second layer");
99 l->SetMainColor((Color_t)2);
84aff7a4 100 gEve->AddElement(l);
9d7caeed 101
84aff7a4 102 for (nsec=0; nsec<10; nsec++) {
9d7caeed 103 sSector = bsSector;
104 sSector += nsec;
84aff7a4 105 TEveElementList* relSector = new TEveElementList(sSector.Data());
9d7caeed 106 relSector->SetMainColor((Color_t)2);
84aff7a4 107 gEve->AddElement(relSector, l);
108 for (nstave=0; nstave<4; nstave++){
9d7caeed 109 sStave = bsStave;
110 sStave += nstave;
84aff7a4 111 TEveElementList* relStave = new TEveElementList(sStave.Data());
9d7caeed 112 relStave->SetMainColor((Color_t)2);
84aff7a4 113 gEve->AddElement(relStave, relSector);
114 for (nMod=0; nMod<4; nMod++)
961e5e6c 115 {
116 if (di->GetDigits(i, 0) && di->GetDigits(i, 0)->GetEntriesFast() > 0)
117 {
118 Alieve::ITSModule* m = new Alieve::ITSModule(i, di);
84aff7a4 119 gEve->AddElement(m, relStave);
961e5e6c 120 }
121 ++i;
9d7caeed 122 }
123 }
124 }
125 } else {
126 i += 10*4*4;
127 }
128
129 if (mode & 4) {
84aff7a4 130 TEveElementList* l = new TEveElementList("SDD2");
9d7caeed 131 l->SetTitle("SDDs' first layer");
132 l->SetMainColor((Color_t)3);
84aff7a4 133 gEve->AddElement(l);
9d7caeed 134
84aff7a4 135 for (nlad=0; nlad<14; nlad++) {
9d7caeed 136 sLadder = bsLadder;
137 sLadder += nlad;
84aff7a4 138 TEveElementList* relLadder = new TEveElementList(sLadder.Data());
9d7caeed 139 relLadder->SetMainColor((Color_t)3);
84aff7a4 140 gEve->AddElement(relLadder, l);
141 for (nMod=0; nMod<6; nMod++) {
9d7caeed 142 Alieve::ITSModule* m = new Alieve::ITSModule(i++, di);
84aff7a4 143 gEve->AddElement(m, relLadder);
9d7caeed 144 }
145 }
146 } else {
147 i += 14*6;
148 }
149
150 if (mode & 8) {
84aff7a4 151 TEveElementList* l = new TEveElementList("SDD3");
9d7caeed 152 l->SetTitle("SDDs' second layer");
153 l->SetMainColor((Color_t)3);
84aff7a4 154 gEve->AddElement(l);
155 for (nlad=0; nlad<22; nlad++) {
9d7caeed 156 sLadder = bsLadder;
157 sLadder += nlad;
84aff7a4 158 TEveElementList* relLadder = new TEveElementList(sLadder.Data());
9d7caeed 159 relLadder->SetMainColor((Color_t)3);
84aff7a4 160 gEve->AddElement(relLadder, l);
161 for (nMod=0; nMod<8; nMod++) {
9d7caeed 162 Alieve::ITSModule* m = new Alieve::ITSModule(i++, di);
84aff7a4 163 gEve->AddElement(m, relLadder);
9d7caeed 164 }
165 }
166 } else {
167 i += 22*8;
168 }
169
170 if (mode & 16) {
84aff7a4 171 TEveElementList* l = new TEveElementList("SSD4");
9d7caeed 172 l->SetTitle("SSDs' first layer");
173 l->SetMainColor((Color_t)4);
84aff7a4 174 gEve->AddElement(l);
175 for (nlad=0; nlad<34; nlad++) {
9d7caeed 176 sLadder = bsLadder;
177 sLadder += nlad;
84aff7a4 178 TEveElementList* relLadder = new TEveElementList(sLadder.Data());
9d7caeed 179 relLadder->SetMainColor((Color_t)4);
84aff7a4 180 gEve->AddElement(relLadder, l);
181 for (nMod=0; nMod<22; nMod++) {
9d7caeed 182 Alieve::ITSModule* m = new Alieve::ITSModule(i++, di);
84aff7a4 183 gEve->AddElement(m, relLadder);
9d7caeed 184 }
185 }
186 } else {
187 i += 34*22;
188 }
189
190 if (mode & 32) {
84aff7a4 191 TEveElementList* l = new TEveElementList("SSD5");
9d7caeed 192 l->SetTitle("SSDs' second layer");
193 l->SetMainColor((Color_t)4);
84aff7a4 194 gEve->AddElement(l);
195 for (nlad=0; nlad<38; nlad++) {
9d7caeed 196 sLadder = bsLadder;
197 sLadder += nlad;
84aff7a4 198 TEveElementList* relLadder = new TEveElementList(sLadder.Data());
9d7caeed 199 relLadder->SetMainColor((Color_t)4);
84aff7a4 200 gEve->AddElement(relLadder, l);
201 for (nMod=0; nMod<25; nMod++) {
9d7caeed 202 Alieve::ITSModule* m = new Alieve::ITSModule(i++, di);
84aff7a4 203 gEve->AddElement(m, relLadder);
9d7caeed 204 }
205 }
206 } else {
207 i += 38*25;
208 }
209
84aff7a4 210 gEve->EnableRedraw();
9d7caeed 211}