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