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