From Massimo: remove usage of AliITSgeom, use AliITSgeomTGeo instead.
[u/mrichter/AliRoot.git] / EVE / alice-macros / its_digits.C
CommitLineData
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
716345b3 10// Load ITS digits.
11// Argument mode is a bitwise or determining which layers to import:
12// 1, 2 : SPD
13// 4, 8 : SDD
14// 16, 32 : SSD
15// By default import all layers.
16
17void its_digits(Int_t mode=63)
5a5a1232 18{
d810d0de 19 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
5a5a1232 20 rl->LoadDigits("ITS");
21 TTree* dt = rl->GetTreeD("ITS", false);
22
d810d0de 23 AliEveITSDigitsInfo* di = new AliEveITSDigitsInfo();
5a5a1232 24 di->SetTree(dt);
25 di->Dump();
5a5a1232 26
27 gStyle->SetPalette(1, 0);
28
84aff7a4 29 gEve->DisableRedraw();
5a5a1232 30
716345b3 31 TString sSector;
32 TString bsSector="Sector";
33 TString sStave;
34 TString bsStave="Stave";
35 TString sLadder;
36 TString bsLadder="Ladder";
37
38 Int_t i=0;
39 Int_t nsec, nstave, nlad, nMod;
40
5a5a1232 41 if (mode & 1) {
84aff7a4 42 TEveElementList* l = new TEveElementList("SPD0");
716345b3 43 l->SetTitle("SPDs' first layer");
5a5a1232 44 l->SetMainColor((Color_t)2);
84aff7a4 45 gEve->AddElement(l);
46 for (nsec=0; nsec<10; nsec++) {
2a2d341b 47 sSector = bsSector;
48 sSector += nsec;
84aff7a4 49 TEveElementList* relSector = new TEveElementList(sSector.Data());
716345b3 50 relSector->SetMainColor((Color_t)2);
84aff7a4 51 gEve->AddElement(relSector, l);
52 for (nstave=0; nstave<2; nstave++){
2a2d341b 53 sStave = bsStave;
716345b3 54 sStave += nstave;
84aff7a4 55 TEveElementList* relStave = new TEveElementList(sStave.Data());
716345b3 56 relStave->SetMainColor((Color_t)2);
84aff7a4 57 gEve->AddElement(relStave, relSector);
58 for (nMod=0; nMod<4; nMod++) {
d810d0de 59 AliEveITSModule* m = new AliEveITSModule(i++, di);
84aff7a4 60 gEve->AddElement(m, relStave);
716345b3 61 }
62 }
5a5a1232 63 }
2a2d341b 64 } else {
65 i += 10*2*4;
5a5a1232 66 }
67
68 if (mode & 2) {
84aff7a4 69 TEveElementList* l = new TEveElementList("SPD1");
716345b3 70 l->SetTitle("SPDs' second layer");
71 l->SetMainColor((Color_t)2);
84aff7a4 72 gEve->AddElement(l);
716345b3 73
84aff7a4 74 for (nsec=0; nsec<10; nsec++) {
2a2d341b 75 sSector = bsSector;
76 sSector += nsec;
84aff7a4 77 TEveElementList* relSector = new TEveElementList(sSector.Data());
716345b3 78 relSector->SetMainColor((Color_t)2);
84aff7a4 79 gEve->AddElement(relSector, l);
80 for (nstave=0; nstave<4; nstave++){
2a2d341b 81 sStave = bsStave;
716345b3 82 sStave += nstave;
84aff7a4 83 TEveElementList* relStave = new TEveElementList(sStave.Data());
716345b3 84 relStave->SetMainColor((Color_t)2);
84aff7a4 85 gEve->AddElement(relStave, relSector);
86 for (nMod=0; nMod<4; nMod++) {
d810d0de 87 AliEveITSModule* m = new AliEveITSModule(i++, di);
84aff7a4 88 gEve->AddElement(m, relStave);
716345b3 89 }
90 }
5a5a1232 91 }
2a2d341b 92 } else {
93 i += 10*4*4;
5a5a1232 94 }
95
96 if (mode & 4) {
84aff7a4 97 TEveElementList* l = new TEveElementList("SDD2");
716345b3 98 l->SetTitle("SDDs' first layer");
99 l->SetMainColor((Color_t)3);
84aff7a4 100 gEve->AddElement(l);
716345b3 101
84aff7a4 102 for (nlad=0; nlad<14; nlad++) {
2a2d341b 103 sLadder = bsLadder;
104 sLadder += nlad;
84aff7a4 105 TEveElementList* relLadder = new TEveElementList(sLadder.Data());
716345b3 106 relLadder->SetMainColor((Color_t)3);
84aff7a4 107 gEve->AddElement(relLadder, l);
108 for (nMod=0; nMod<6; nMod++) {
d810d0de 109 AliEveITSModule* m = new AliEveITSModule(i++, di);
84aff7a4 110 gEve->AddElement(m, relLadder);
716345b3 111 }
112 }
2a2d341b 113 } else {
114 i += 14*6;
716345b3 115 }
116
117 if (mode & 8) {
84aff7a4 118 TEveElementList* l = new TEveElementList("SDD3");
716345b3 119 l->SetTitle("SDDs' second layer");
120 l->SetMainColor((Color_t)3);
84aff7a4 121 gEve->AddElement(l);
122 for (nlad=0; nlad<22; nlad++) {
2a2d341b 123 sLadder = bsLadder;
124 sLadder += nlad;
84aff7a4 125 TEveElementList* relLadder = new TEveElementList(sLadder.Data());
716345b3 126 relLadder->SetMainColor((Color_t)3);
84aff7a4 127 gEve->AddElement(relLadder, l);
128 for (nMod=0; nMod<8; nMod++) {
d810d0de 129 AliEveITSModule* m = new AliEveITSModule(i++, di);
84aff7a4 130 gEve->AddElement(m, relLadder);
716345b3 131 }
132 }
2a2d341b 133 } else {
134 i += 22*8;
716345b3 135 }
136
137 if (mode & 16) {
84aff7a4 138 TEveElementList* l = new TEveElementList("SSD4");
716345b3 139 l->SetTitle("SSDs' first layer");
5a5a1232 140 l->SetMainColor((Color_t)4);
84aff7a4 141 gEve->AddElement(l);
142 for (nlad=0; nlad<34; nlad++) {
2a2d341b 143 sLadder = bsLadder;
144 sLadder += nlad;
84aff7a4 145 TEveElementList* relLadder = new TEveElementList(sLadder.Data());
716345b3 146 relLadder->SetMainColor((Color_t)4);
84aff7a4 147 gEve->AddElement(relLadder, l);
148 for (nMod=0; nMod<22; nMod++) {
d810d0de 149 AliEveITSModule* m = new AliEveITSModule(i++, di);
84aff7a4 150 gEve->AddElement(m, relLadder);
716345b3 151 }
152 }
2a2d341b 153 } else {
154 i += 34*22;
716345b3 155 }
156
157 if (mode & 32) {
84aff7a4 158 TEveElementList* l = new TEveElementList("SSD5");
716345b3 159 l->SetTitle("SSDs' second layer");
160 l->SetMainColor((Color_t)4);
84aff7a4 161 gEve->AddElement(l);
162 for (nlad=0; nlad<38; nlad++) {
2a2d341b 163 sLadder = bsLadder;
164 sLadder += nlad;
84aff7a4 165 TEveElementList* relLadder = new TEveElementList(sLadder.Data());
716345b3 166 relLadder->SetMainColor((Color_t)4);
84aff7a4 167 gEve->AddElement(relLadder, l);
168 for (nMod=0; nMod<25; nMod++) {
d810d0de 169 AliEveITSModule* m = new AliEveITSModule(i++, di);
84aff7a4 170 gEve->AddElement(m, relLadder);
716345b3 171 }
172 }
2a2d341b 173 } else {
174 i += 38*25;
5a5a1232 175 }
176
84aff7a4 177 gEve->EnableRedraw();
5a5a1232 178}