]>
Commit | Line | Data |
---|---|---|
d810d0de | 1 | // $Id$ |
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 | |
0879c50b | 10 | #include "AliEveITSDigitsInfo.h" |
b9df0156 | 11 | #include <AliEveEventManager.h> |
5a5a1232 | 12 | |
0879c50b | 13 | #include <AliITS.h> |
14 | #include <AliITSInitGeometry.h> | |
12f6a2f3 | 15 | #include <AliITSgeomTGeo.h> |
0879c50b | 16 | #include <AliITSsegmentationSPD.h> |
17 | #include <AliITSsegmentationSDD.h> | |
18 | #include <AliITSsegmentationSSD.h> | |
19 | #include <AliITSDDLModuleMapSDD.h> | |
20 | ||
fe6798e0 | 21 | #include <AliITSCalibrationSPD.h> |
105fb267 | 22 | #include <AliITSCalibrationSDD.h> |
23 | #include <AliITSCalibrationSSD.h> | |
5a5a1232 | 24 | #include <AliITSdigit.h> |
25 | #include <AliITSdigitSPD.h> | |
26 | ||
0879c50b | 27 | #include <AliCDBEntry.h> |
28 | #include <AliCDBManager.h> | |
29 | ||
b3bc5327 | 30 | #include <AliRawReader.h> |
31 | #include <AliITSRawStreamSPD.h> | |
32 | #include <AliITSRawStreamSDD.h> | |
74917814 | 33 | #include <AliITSRawStreamSDDCompressed.h> |
b3bc5327 | 34 | #include <AliITSRawStreamSSD.h> |
d810d0de | 35 | |
12f6a2f3 | 36 | #include <TGeoMatrix.h> |
a15e6d7d | 37 | #include <TEveTrans.h> |
a15e6d7d | 38 | |
0879c50b | 39 | #include <TMath.h> |
40 | #include <TVector3.h> | |
c93255fe | 41 | #include <TTree.h> |
0879c50b | 42 | |
a15e6d7d | 43 | //============================================================================== |
44 | //============================================================================== | |
45 | // AliEveITSModuleSelection | |
46 | //============================================================================== | |
47 | ||
54f770b4 | 48 | //______________________________________________________________________________ |
49 | // | |
50 | // Helper for selecting a range of ITS modules by type, layer, phi and | |
51 | // theta. Taken as an argument to AliEveITSDigitsInfo::GetModuleIDs(). | |
3d598e88 | 52 | |
d810d0de | 53 | ClassImp(AliEveITSModuleSelection) |
3d598e88 | 54 | |
d810d0de | 55 | AliEveITSModuleSelection::AliEveITSModuleSelection(): |
3d598e88 | 56 | fType(-1), |
57 | fLayer(-1), | |
32e219c2 | 58 | fMinPhi(-TMath::Pi()), |
59 | fMaxPhi(TMath::Pi()), | |
60 | fMinTheta(-TMath::Pi()), | |
61 | fMaxTheta(TMath::Pi()) | |
54f770b4 | 62 | { |
63 | // Constructor. | |
64 | } | |
65 | ||
b3bc5327 | 66 | |
a15e6d7d | 67 | //============================================================================== |
68 | //============================================================================== | |
69 | // AliEveITSDigitsInfo | |
70 | //============================================================================== | |
71 | ||
54f770b4 | 72 | //______________________________________________________________________________ |
73 | // | |
74 | // Stores ITS geometry information and event-data in format suitable | |
75 | // for visualization. | |
3d598e88 | 76 | |
d810d0de | 77 | ClassImp(AliEveITSDigitsInfo) |
5a5a1232 | 78 | |
fe6798e0 | 79 | AliITSDDLModuleMapSDD *AliEveITSDigitsInfo::fgDDLMapSDD = 0; |
80 | TObjArray *AliEveITSDigitsInfo::fgDeadModSPD = 0; | |
105fb267 | 81 | TObjArray *AliEveITSDigitsInfo::fgDeadModSDD = 0; |
82 | TObjArray *AliEveITSDigitsInfo::fgDeadModSSD = 0; | |
4516a822 | 83 | |
57ffa5fb | 84 | /******************************************************************************/ |
5a5a1232 | 85 | |
d810d0de | 86 | AliEveITSDigitsInfo::AliEveITSDigitsInfo() : |
265ecb21 | 87 | TObject(), |
84aff7a4 | 88 | TEveRefCnt(), |
9af86b69 | 89 | fTree (0), |
fd31e9de | 90 | fSegSPD (0), fSegSDD (0), fSegSSD (0), |
c76ea574 | 91 | fSPDMinVal (0), fSSDMinVal (0), fSDDMinVal (0), |
92 | fSPDMaxVal (0), fSSDMaxVal (0), fSDDMaxVal (0), | |
9af86b69 | 93 | fSPDHighLim (0), fSDDHighLim (0), fSSDHighLim (0), |
94 | fSPDmap (), fSDDmap (), fSSDmap () | |
5a5a1232 | 95 | { |
54f770b4 | 96 | // Default constructor. |
97 | ||
b3bc5327 | 98 | InitInternals(); |
5a5a1232 | 99 | } |
100 | ||
d810d0de | 101 | void AliEveITSDigitsInfo::InitInternals() |
5a5a1232 | 102 | { |
54f770b4 | 103 | // Initialize internal geometry structures, in particular the |
104 | // module-id to transformation-matrix mapping and segmentation | |
105 | // classes and data-structures. | |
106 | ||
a15e6d7d | 107 | static const TEveException kEH("AliEveITSDigitsInfo::InitInternals "); |
5a5a1232 | 108 | |
0879c50b | 109 | AliEveEventManager::AssertGeometry(); |
5a5a1232 | 110 | |
111 | SetITSSegmentation(); | |
d4b6a94c | 112 | |
5a5a1232 | 113 | // create tables for scaling |
d4b6a94c | 114 | fSPDMinVal = 0; |
115 | fSDDMinVal = 5; | |
116 | fSSDMinVal = 2; | |
117 | ||
118 | fSPDMaxVal = 1; | |
119 | fSDDMaxVal = 80; | |
120 | fSSDMaxVal = 100; | |
121 | ||
32e219c2 | 122 | fSPDHighLim = 1; |
123 | fSDDHighLim = 512; | |
124 | fSSDHighLim = 1024; | |
d4b6a94c | 125 | |
d54c094e | 126 | // lowest scale factor refers to unscaled ITS module |
127 | fSPDScaleX[0] = 1; | |
128 | fSPDScaleZ[0] = 1; | |
129 | fSDDScaleX[0] = 1; | |
130 | fSDDScaleZ[0] = 1; | |
131 | fSSDScale [0] = 1; | |
d4b6a94c | 132 | |
b3bc5327 | 133 | // spd lowest resolution |
5a5a1232 | 134 | Int_t nx = 8; // fSegSPD->Npx()/8; // 32 |
135 | Int_t nz = 6; // fSegSPD->Npz()/2; // 128 | |
51346b82 | 136 | fSPDScaleX[1] = Int_t(nx); |
137 | fSPDScaleZ[1] = Int_t(nz); | |
138 | fSPDScaleX[2] = Int_t(nx*2); | |
139 | fSPDScaleZ[2] = Int_t(nz*2); | |
140 | fSPDScaleX[3] = Int_t(nx*3); | |
141 | fSPDScaleZ[3] = Int_t(nz*3); | |
142 | fSPDScaleX[4] = Int_t(nx*4); | |
143 | fSPDScaleZ[4] = Int_t(nz*4); | |
5a5a1232 | 144 | |
5a5a1232 | 145 | fSDDScaleX[1] = 2; |
146 | fSDDScaleZ[1] = 2; | |
147 | fSDDScaleX[2] = 8; | |
148 | fSDDScaleZ[2] = 8; | |
149 | fSDDScaleX[3] = 16; | |
150 | fSDDScaleZ[3] = 16; | |
151 | fSDDScaleX[4] = 25; | |
152 | fSDDScaleZ[4] = 25; | |
153 | ||
154 | fSSDScale[1] = 3; | |
155 | fSSDScale[2] = 9; | |
156 | fSSDScale[3] = 20; | |
157 | fSSDScale[4] = 30; | |
4516a822 | 158 | |
159 | if (fgDDLMapSDD == 0) | |
160 | { | |
161 | fgDDLMapSDD = new AliITSDDLModuleMapSDD(); | |
162 | AliCDBManager *man = AliCDBManager::Instance(); | |
163 | Bool_t cacheStatus = man->GetCacheFlag(); | |
164 | AliCDBEntry *ddlMapSDD = man->Get("ITS/Calib/DDLMapSDD"); | |
165 | ||
166 | if (!ddlMapSDD) | |
167 | { | |
168 | AliWarning("SDD DDL map file retrieval from OCDB failed! - Use default DDL map"); | |
169 | } | |
170 | else | |
171 | { | |
172 | AliITSDDLModuleMapSDD *ddlsdd = (AliITSDDLModuleMapSDD*)ddlMapSDD->GetObject(); | |
173 | if (!ddlsdd) | |
174 | { | |
175 | AliWarning("SDD DDL map object not found in OCDB file! - Use default DDL map"); | |
176 | } | |
177 | else | |
178 | { | |
179 | if (!cacheStatus) | |
180 | ddlMapSDD->SetObject(0); | |
181 | ddlMapSDD->SetOwner(kTRUE); | |
182 | fgDDLMapSDD->SetDDLMap(ddlsdd); | |
183 | } | |
0879c50b | 184 | } |
4516a822 | 185 | |
186 | if (!cacheStatus) | |
187 | delete ddlMapSDD; | |
0879c50b | 188 | } |
fe6798e0 | 189 | |
190 | if (fgDeadModSPD == 0) | |
191 | { | |
192 | AliCDBManager *cdb = AliCDBManager::Instance(); | |
193 | ||
194 | AliCDBEntry *deadSPD = cdb->Get("ITS/Calib/SPDDead"); | |
195 | ||
196 | if (!deadSPD) | |
197 | { | |
198 | AliWarning("SPD Calibration object retrieval failed!"); | |
199 | } | |
200 | else | |
201 | { | |
202 | fgDeadModSPD = (TObjArray*)deadSPD->GetObject(); | |
203 | fgDeadModSPD->SetOwner(kTRUE); | |
204 | } | |
205 | } | |
105fb267 | 206 | |
98c4d14c | 207 | // if (fgDeadModSDD == 0) |
208 | // { | |
209 | // AliCDBManager *cdb = AliCDBManager::Instance(); | |
210 | ||
211 | // AliCDBEntry *deadSDD = cdb->Get("ITS/Calib/SDDDead"); | |
212 | ||
213 | // if (!deadSDD) | |
214 | // { | |
215 | // AliWarning("SDD Calibration object retrieval failed!"); | |
216 | // } | |
217 | // else | |
218 | // { | |
219 | // fgDeadModSDD = (TObjArray*)deadSDD->GetObject(); | |
220 | // fgDeadModSDD->SetOwner(kTRUE); | |
221 | // } | |
222 | // } | |
223 | ||
224 | // if (fgDeadModSSD == 0) | |
225 | // { | |
226 | // AliCDBManager *cdb = AliCDBManager::Instance(); | |
227 | ||
228 | // AliCDBEntry *deadSSD = cdb->Get("ITS/Calib/SSDDead"); | |
229 | ||
230 | // if (!deadSSD) | |
231 | // { | |
232 | // AliWarning("SSD Calibration object retrieval failed!"); | |
233 | // } | |
234 | // else | |
235 | // { | |
236 | // fgDeadModSSD = (TObjArray*)deadSSD->GetObject(); | |
237 | // fgDeadModSSD->SetOwner(kTRUE); | |
238 | // } | |
239 | // } | |
5a5a1232 | 240 | } |
241 | ||
57ffa5fb | 242 | /******************************************************************************/ |
5a5a1232 | 243 | |
4516a822 | 244 | AliEveITSDigitsInfo::~AliEveITSDigitsInfo() |
b3bc5327 | 245 | { |
54f770b4 | 246 | // Destructor. |
2452f391 | 247 | // Deletes the data-maps. |
248 | // The tree, if it was passed into the object, is not touched. | |
54f770b4 | 249 | |
fd31e9de | 250 | std::map<Int_t, TClonesArray*>::iterator j; |
0879c50b | 251 | for (j = fSPDmap.begin(); j != fSPDmap.end(); ++j) |
b3bc5327 | 252 | delete j->second; |
0879c50b | 253 | for (j = fSDDmap.begin(); j != fSDDmap.end(); ++j) |
b3bc5327 | 254 | delete j->second; |
0879c50b | 255 | for (j = fSSDmap.begin(); j != fSSDmap.end(); ++j) |
b3bc5327 | 256 | delete j->second; |
4516a822 | 257 | |
51346b82 | 258 | delete fSegSPD; delete fSegSDD; delete fSegSSD; |
b3bc5327 | 259 | } |
260 | ||
57ffa5fb | 261 | /******************************************************************************/ |
b3bc5327 | 262 | |
d810d0de | 263 | void AliEveITSDigitsInfo::SetTree(TTree* tree) |
b3bc5327 | 264 | { |
265 | // Set digit-tree to be used for digit retrieval. Data is loaded on | |
266 | // demand. | |
267 | ||
268 | fTree = tree; | |
269 | } | |
270 | ||
d810d0de | 271 | void AliEveITSDigitsInfo::ReadRaw(AliRawReader* raw, Int_t mode) |
b3bc5327 | 272 | { |
273 | // Read raw-data into internal structures. AliITSdigit is used to | |
274 | // store raw-adata for all sub-detectors. | |
275 | ||
0879c50b | 276 | if ((mode & 1) || (mode & 2)) |
277 | { | |
b3bc5327 | 278 | AliITSRawStreamSPD inputSPD(raw); |
279 | TClonesArray* digits = 0; | |
b3bc5327 | 280 | while (inputSPD.Next()) |
281 | { | |
282 | Int_t module = inputSPD.GetModuleID(); | |
283 | Int_t column = inputSPD.GetColumn(); | |
284 | Int_t row = inputSPD.GetRow(); | |
51346b82 | 285 | |
b3bc5327 | 286 | if (inputSPD.IsNewModule()) |
287 | { | |
f8495fba | 288 | digits = fSPDmap[module]; |
289 | if (digits == 0) | |
290 | fSPDmap[module] = digits = new TClonesArray("AliITSdigit", 16); | |
377ec156 | 291 | } else if(!digits) { |
292 | AliFatal("No module found\n"); | |
293 | } | |
b3bc5327 | 294 | |
f8495fba | 295 | AliITSdigit* d = new ((*digits)[digits->GetEntriesFast()]) AliITSdigit(); |
b3bc5327 | 296 | d->SetCoord1(column); |
297 | d->SetCoord2(row); | |
298 | d->SetSignal(1); | |
b3bc5327 | 299 | |
300 | // printf("SPD: %d %d %d\n",module,column,row); | |
301 | } | |
b3bc5327 | 302 | raw->Reset(); |
303 | } | |
304 | ||
0879c50b | 305 | if ((mode & 4) || (mode & 8)) |
306 | { | |
4516a822 | 307 | AliITSRawStream* inputSDD = AliITSRawStreamSDD::CreateRawStreamSDD(raw); |
308 | inputSDD->SetDDLModuleMap(fgDDLMapSDD); | |
b3bc5327 | 309 | TClonesArray* digits = 0; |
74917814 | 310 | while (inputSDD->Next()) |
b3bc5327 | 311 | { |
74917814 | 312 | Int_t module = inputSDD->GetModuleID(); |
b3bc5327 | 313 | |
74917814 | 314 | digits = fSDDmap[module]; |
315 | if (digits == 0) | |
316 | fSDDmap[module] = digits = new TClonesArray("AliITSdigit", 0); | |
b3bc5327 | 317 | |
74917814 | 318 | if (inputSDD->IsCompletedModule()==kFALSE && inputSDD->IsCompletedDDL()==kFALSE) |
cb35cec3 | 319 | { |
74917814 | 320 | Int_t anode = inputSDD->GetCoord1()+inputSDD->GetChannel()*AliITSsegmentationSDD::GetNAnodesPerHybrid(); |
321 | Int_t time = inputSDD->GetCoord2(); | |
322 | Int_t signal = inputSDD->GetSignal(); | |
cb35cec3 | 323 | AliITSdigit* d = new ((*digits)[digits->GetEntriesFast()]) AliITSdigit(); |
324 | d->SetCoord1(anode); | |
325 | d->SetCoord2(time); | |
326 | d->SetSignal(signal); | |
327 | } | |
b3bc5327 | 328 | // printf("SDD: %d %d %d %d\n",module,anode,time,signal); |
329 | } | |
74917814 | 330 | delete inputSDD; |
b3bc5327 | 331 | raw->Reset(); |
332 | } | |
333 | ||
0879c50b | 334 | if ((mode & 16) || (mode & 32)) |
335 | { | |
b3bc5327 | 336 | AliITSRawStreamSSD input(raw); |
337 | TClonesArray* digits = 0; | |
b3bc5327 | 338 | while (input.Next()) |
339 | { | |
340 | Int_t module = input.GetModuleID(); | |
341 | Int_t side = input.GetSideFlag(); | |
342 | Int_t strip = input.GetStrip(); | |
343 | Int_t signal = input.GetSignal(); | |
344 | ||
20807c14 | 345 | // !!!! IsNewModule() is false in the beginning of the stream, so we also |
346 | // !!!! check for digits == 0. Should be fixed in SSD stream. | |
347 | if (input.IsNewModule() || digits == 0) | |
b3bc5327 | 348 | { |
f8495fba | 349 | digits = fSSDmap[module]; |
350 | if (digits == 0) | |
351 | fSSDmap[module] = digits = new TClonesArray("AliITSdigit", 0); | |
b3bc5327 | 352 | } |
353 | ||
f8495fba | 354 | AliITSdigit* d = new ((*digits)[digits->GetEntriesFast()]) AliITSdigit(); |
b3bc5327 | 355 | d->SetCoord1(side); |
356 | d->SetCoord2(strip); | |
357 | d->SetSignal(signal); | |
b3bc5327 | 358 | |
359 | // printf("SSD: %d %d %d %d\n",module,side,strip,signal); | |
360 | } | |
b3bc5327 | 361 | raw->Reset(); |
362 | } | |
363 | } | |
364 | ||
57ffa5fb | 365 | /******************************************************************************/ |
b3bc5327 | 366 | |
d810d0de | 367 | void AliEveITSDigitsInfo::SetITSSegmentation() |
5a5a1232 | 368 | { |
54f770b4 | 369 | // Create the segmentation objects and fill internal |
370 | // data-structures. | |
371 | ||
5a5a1232 | 372 | // SPD |
c93f2d9b | 373 | fSegSPD = new AliITSsegmentationSPD("TGeo"); |
54f770b4 | 374 | |
4516a822 | 375 | Float_t fNzSPD = 160; |
376 | Float_t fHlSPD = 3.48; | |
377 | Float_t fZ1pitchSPD = 0.0425, fZ2pitchSPD = 0.0625; | |
5a5a1232 | 378 | |
8cc1d3b4 | 379 | fSPDZCoord[0] = fZ1pitchSPD - fHlSPD; |
4516a822 | 380 | for (Int_t m=1; m<fNzSPD; m++) |
381 | { | |
382 | Float_t dz = fZ1pitchSPD; | |
383 | if (m==31 || m==32 || m==63 || m==64 || m==95 || m==96 || m==127 || m==128) | |
384 | { | |
385 | dz = fZ2pitchSPD; | |
386 | } | |
387 | fSPDZCoord[m] = fSPDZCoord[m-1] + dz; | |
5a5a1232 | 388 | } |
51346b82 | 389 | |
4516a822 | 390 | for (Int_t m=0; m<fNzSPD; m++) |
391 | { | |
392 | Float_t dz = fZ1pitchSPD; | |
393 | if (m==31 || m==32 || m==63 || m==64 || m==95 || m==96 || m==127 || m==128) | |
394 | { | |
395 | dz = fZ2pitchSPD; | |
396 | } | |
397 | fSPDZCoord[m] -= dz; | |
5a5a1232 | 398 | } |
51346b82 | 399 | |
5a5a1232 | 400 | // SDD |
c93f2d9b | 401 | fSegSDD = new AliITSsegmentationSDD("TGeo"); |
0879c50b | 402 | // !!!! Set default drift speed, eventually need to get it from CDB. |
403 | fSegSDD->SetDriftSpeed(7.3); | |
5a5a1232 | 404 | |
405 | // SSD | |
c93f2d9b | 406 | fSegSSD = new AliITSsegmentationSSD("TGeo"); |
5a5a1232 | 407 | } |
408 | ||
57ffa5fb | 409 | /******************************************************************************/ |
5a5a1232 | 410 | |
fe6798e0 | 411 | TClonesArray* AliEveITSDigitsInfo::GetDigits(Int_t mod, Int_t subdet) const |
5a5a1232 | 412 | { |
54f770b4 | 413 | // Return TClonesArray of digits for specified module and sub-detector-id. |
414 | ||
415 | switch(subdet) | |
416 | { | |
417 | case 0: | |
418 | { | |
fd31e9de | 419 | std::map<Int_t, TClonesArray*>::iterator i = fSPDmap.find(mod); |
4516a822 | 420 | if (i != fSPDmap.end()) |
421 | { | |
6ddaaee3 | 422 | return i->second; |
423 | } | |
4516a822 | 424 | else if (fTree) |
425 | { | |
426 | TClonesArray *digitsSPD = 0; | |
427 | TBranch *br = fTree->GetBranch("ITSDigitsSPD"); | |
428 | br->SetAddress(&digitsSPD); | |
429 | br->GetEntry(mod); | |
430 | fSPDmap[mod] = digitsSPD; | |
431 | return digitsSPD; | |
432 | } | |
6ddaaee3 | 433 | break; |
5a5a1232 | 434 | } |
4516a822 | 435 | |
54f770b4 | 436 | case 1: |
437 | { | |
fd31e9de | 438 | std::map<Int_t, TClonesArray*>::iterator i = fSDDmap.find(mod); |
4516a822 | 439 | if (i != fSDDmap.end()) |
440 | { | |
6ddaaee3 | 441 | return i->second; |
442 | } | |
4516a822 | 443 | else if (fTree) |
444 | { | |
445 | TClonesArray *digitsSDD = 0; | |
446 | TBranch *br = fTree->GetBranch("ITSDigitsSDD"); | |
447 | br->SetAddress(&digitsSDD); | |
448 | br->GetEntry(mod); | |
449 | fSDDmap[mod] = digitsSDD; | |
450 | return digitsSDD; | |
451 | } | |
6ddaaee3 | 452 | break; |
5a5a1232 | 453 | } |
4516a822 | 454 | |
54f770b4 | 455 | case 2: |
456 | { | |
fd31e9de | 457 | std::map<Int_t, TClonesArray*>::iterator i = fSSDmap.find(mod); |
4516a822 | 458 | if (i != fSSDmap.end()) |
459 | { | |
6ddaaee3 | 460 | return i->second; |
461 | } | |
4516a822 | 462 | else if (fTree) |
463 | { | |
464 | TClonesArray *digitsSSD = 0; | |
465 | TBranch *br = fTree->GetBranch("ITSDigitsSSD"); | |
466 | br->SetAddress(&digitsSSD); | |
467 | br->GetEntry(mod); | |
468 | fSSDmap[mod] = digitsSSD; | |
469 | return digitsSSD; | |
470 | } | |
6ddaaee3 | 471 | break; |
5a5a1232 | 472 | } |
54f770b4 | 473 | } |
4516a822 | 474 | |
03ecfe88 | 475 | return 0; |
5a5a1232 | 476 | } |
477 | ||
57ffa5fb | 478 | /******************************************************************************/ |
54f770b4 | 479 | |
480 | void AliEveITSDigitsInfo::GetModuleIDs(AliEveITSModuleSelection* sel, | |
fe6798e0 | 481 | std::vector<UInt_t>& ids) const |
3d598e88 | 482 | { |
54f770b4 | 483 | // Fill the id-vector with ids of modules that satisfy conditions |
484 | // given by the AliEveITSModuleSelection object. | |
485 | ||
3d598e88 | 486 | Int_t idx0 = 0, idx1 = 0; |
51346b82 | 487 | switch(sel->GetType()) |
3d598e88 | 488 | { |
489 | case 0: | |
490 | idx0 = 0; | |
12f6a2f3 | 491 | idx1 = AliITSgeomTGeo::GetModuleIndex(3, 1, 1) - 1; |
3d598e88 | 492 | break; |
493 | case 1: | |
12f6a2f3 | 494 | idx0 = AliITSgeomTGeo::GetModuleIndex(3, 1, 1); |
495 | idx1 = AliITSgeomTGeo::GetModuleIndex(5, 1, 1) - 1; | |
3d598e88 | 496 | break; |
497 | case 2: | |
12f6a2f3 | 498 | idx0 = AliITSgeomTGeo::GetModuleIndex(5, 1, 1); |
499 | idx1 = AliITSgeomTGeo::GetNModules() - 1; | |
3d598e88 | 500 | break; |
501 | default: | |
502 | idx1 = 0; | |
12f6a2f3 | 503 | idx1 = AliITSgeomTGeo::GetNModules() - 1; |
54f770b4 | 504 | break; |
3d598e88 | 505 | } |
506 | ||
12f6a2f3 | 507 | TVector3 v; |
84aff7a4 | 508 | TEveTrans mx; |
12f6a2f3 | 509 | Int_t lay, lad, det; |
510 | for (Int_t id = idx0; id < idx1; ++id) | |
54f770b4 | 511 | { |
12f6a2f3 | 512 | AliITSgeomTGeo::GetModuleId(id, lay, lad, det); |
51346b82 | 513 | if (sel->GetLayer() == lay || sel->GetLayer() == -1) |
3d598e88 | 514 | { |
515 | // check data from matrix | |
12f6a2f3 | 516 | mx.SetFrom(*AliITSgeomTGeo::GetMatrix(id)); |
3d598e88 | 517 | mx.GetPos(v); |
51346b82 | 518 | if (v.Phi() <= sel->GetMaxPhi() && v.Phi() >= sel->GetMinPhi() && |
519 | v.Theta() <= sel->GetMaxTheta() && v.Theta() >= sel->GetMinTheta()) | |
54f770b4 | 520 | { |
3d598e88 | 521 | ids.push_back(id); |
54f770b4 | 522 | } |
3d598e88 | 523 | } |
524 | } | |
525 | } | |
5a5a1232 | 526 | |
57ffa5fb | 527 | /******************************************************************************/ |
5a5a1232 | 528 | |
fe6798e0 | 529 | Bool_t AliEveITSDigitsInfo::HasData(Int_t module, Int_t det_id) const |
530 | { | |
531 | // Return true if given module has data. | |
532 | ||
533 | TClonesArray *digits = GetDigits(module, det_id); | |
534 | return digits && digits->GetEntriesFast() > 0; | |
535 | } | |
536 | ||
537 | Bool_t AliEveITSDigitsInfo::IsDead (Int_t module, Int_t det_id) const | |
538 | { | |
539 | // Return true if given module is dead. | |
540 | // Only implemented for SPD. | |
541 | ||
542 | if (det_id == 0 && fgDeadModSPD) | |
543 | return ((AliITSCalibrationSPD*) fgDeadModSPD->At(module))->IsBad(); | |
105fb267 | 544 | if (det_id == 1 && fgDeadModSDD) |
545 | return ((AliITSCalibrationSDD*) fgDeadModSDD->At(module))->IsBad(); | |
546 | if (det_id == 2 && fgDeadModSSD) | |
547 | return ((AliITSCalibrationSSD*) fgDeadModSSD->At(module))->IsBad(); | |
fe6798e0 | 548 | return kFALSE; |
549 | } | |
550 | ||
551 | /******************************************************************************/ | |
552 | ||
d810d0de | 553 | void AliEveITSDigitsInfo::Print(Option_t* ) const |
5a5a1232 | 554 | { |
54f770b4 | 555 | // Print information about stored geometry and segmentation. |
556 | ||
5a5a1232 | 557 | printf("*********************************************************\n"); |
54f770b4 | 558 | printf("SPD module dimension (%f,%f)\n", fSegSPD->Dx()*0.0001, fSegSPD->Dz()*0.0001); |
12f6a2f3 | 559 | printf("SPD first,last module: %d, %d\n", |
560 | AliITSgeomTGeo::GetModuleIndex(1,1,1), | |
561 | AliITSgeomTGeo::GetModuleIndex(3,1,1) - 1); | |
54f770b4 | 562 | printf("SPD num cells per module (x::%d,z::%d)\n", fSegSPD->Npx(), fSegSPD->Npz()); |
563 | Int_t iz = 0, ix = 0; | |
564 | printf("SPD dimesion of (%d,%d) in pixel(%f,%f)\n", ix, iz, fSegSPD->Dpx(ix), fSegSPD->Dpz(iz)); | |
5a5a1232 | 565 | iz = 32; |
54f770b4 | 566 | printf("SPD dimesion of pixel (%d,%d) are (%f,%f)\n", ix, iz, fSegSPD->Dpx(ix)*0.001, fSegSPD->Dpz(iz)*0.001); |
51346b82 | 567 | |
5a5a1232 | 568 | printf("*********************************************************\n"); |
54f770b4 | 569 | printf("SDD module dimension (%f,%f)\n", fSegSDD->Dx()*0.0001, fSegSDD->Dz()*0.0001); |
12f6a2f3 | 570 | printf("SDD first,last module: %d, %d\n", |
571 | AliITSgeomTGeo::GetModuleIndex(3,1,1), | |
572 | AliITSgeomTGeo::GetModuleIndex(5,1,1) - 1); | |
54f770b4 | 573 | printf("SDD num cells per module (x::%d,z::%d)\n", fSegSDD->Npx(), fSegSDD->Npz()); |
574 | printf("SDD dimesion of pixel are (%f,%f)\n", fSegSDD->Dpx(1)*0.001, fSegSDD->Dpz(1)*0.001); | |
575 | ||
576 | Float_t ap, an; | |
5a5a1232 | 577 | printf("*********************************************************\n"); |
54f770b4 | 578 | printf("SSD module dimension (%f,%f)\n", fSegSSD->Dx()*0.0001, fSegSSD->Dz()*0.0001); |
12f6a2f3 | 579 | printf("SSD first, last module: %d, %d\n", |
580 | AliITSgeomTGeo::GetModuleIndex(5,1,1), | |
581 | AliITSgeomTGeo::GetNModules() - 1); | |
54f770b4 | 582 | printf("SSD strips in module %d\n", fSegSSD->Npx()); |
583 | printf("SSD strip sizes are (%f,%f)\n", fSegSSD->Dpx(1), fSegSSD->Dpz(1)); | |
584 | fSegSSD->SetLayer(5); fSegSSD->Angles(ap,an); | |
51346b82 | 585 | printf("SSD layer 5 stereoP %f stereoN %f angle\n", ap, an); |
5a5a1232 | 586 | fSegSSD->SetLayer(6); fSegSSD->Angles(ap,an); |
51346b82 | 587 | printf("SSD layer 6 stereoP %f stereoN %f angle\n", ap, an); |
5a5a1232 | 588 | } |
589 | ||
590 | ||
591 | /* | |
592 | printf("num cells %d,%d scaled %d,%d \n",fSegSPD->Npz(),fSegSPD->Npx(),Nz,Nx); | |
d810d0de | 593 | printf("%d digits in AliEveITSModule %d\n",ne, module); |
5a5a1232 | 594 | Float_t zn = i*(3.48*2)/Nz - 3.48 ; |
595 | Float_t xo = -fSegSPD->Dx()*0.00005 + fSegSPD->Dpx(0)*od->GetCoord2()*0.0001; | |
596 | Float_t xn = -fSegSPD->Dx()*0.00005 + j*0.0001*fSegSPD->Dx()/Nx; | |
597 | Float_t dpx = 0.0001*fSegSPD->Dx()/Nx; | |
598 | Float_t dpz = 3.48*2/Nz; | |
599 | printf("Z::original (%3f) scaled (%3f, %3f) \n", zo, zn-dpz/2, zn+dpz/2); | |
600 | printf("X::original (%3f) scaled (%3f, %3f) \n", xo, xn-dpx/2, xn+dpx/2); | |
601 | printf("%d,%d maped to %d,%d \n", od->GetCoord1(), od->GetCoord2(), i,j ); | |
51346b82 | 602 | */ |