]>
Commit | Line | Data |
---|---|---|
3b9df642 | 1 | /*************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
b17dae48 | 5 | * Conributors are mentioned in the code where appropriate. * |
3b9df642 | 6 | * * |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* | |
140e5249 | 17 | $Id$ |
3b9df642 | 18 | */ |
19 | ||
7d62fb64 | 20 | //////////////////////////////////////////////////////////////////////// |
21 | // This class defines the "Standard" reconstruction for the ITS // | |
22 | // detector. // | |
23 | // // | |
24 | //////////////////////////////////////////////////////////////////////// | |
25 | #include "TObjArray.h" | |
26 | #include "TTree.h" | |
27 | ||
8ba39da9 | 28 | #include "AliCDBManager.h" |
e8c4cf33 | 29 | #include "AliCDBStorage.h" |
8ba39da9 | 30 | #include "AliCDBEntry.h" |
7d62fb64 | 31 | #include "AliITSClusterFinder.h" |
32 | #include "AliITSClusterFinderV2.h" | |
33 | #include "AliITSClusterFinderV2SPD.h" | |
34 | #include "AliITSClusterFinderV2SDD.h" | |
35 | #include "AliITSClusterFinderV2SSD.h" | |
36 | #include "AliITSClusterFinderSPD.h" | |
37 | #include "AliITSClusterFinderSDD.h" | |
38 | #include "AliITSClusterFinderSSD.h" | |
3b9df642 | 39 | #include "AliITSDetTypeRec.h" |
6cae184e | 40 | #include "AliITSgeom.h" |
7d62fb64 | 41 | #include "AliITSRawCluster.h" |
42 | #include "AliITSRawClusterSPD.h" | |
43 | #include "AliITSRawClusterSDD.h" | |
44 | #include "AliITSRawClusterSSD.h" | |
45 | #include "AliITSRecPoint.h" | |
ed446fa3 | 46 | #include "AliITSReconstructor.h" |
47 | #include "AliITSRecoParam.h" | |
fcf95fc7 | 48 | #include "AliITSCalibrationSDD.h" |
028a3709 | 49 | #include "AliITSMapSDD.h" |
18da6e54 | 50 | #include "AliITSDriftSpeedArraySDD.h" |
140e5249 | 51 | #include "AliITSDriftSpeedSDD.h" |
fb4dfab9 | 52 | #include "AliITSCalibrationSSD.h" |
53 | #include "AliITSNoiseSSD.h" | |
54 | #include "AliITSGainSSD.h" | |
55 | #include "AliITSBadChannelsSSD.h" | |
b42cfa25 | 56 | #include "AliITSPedestalSSD.h" |
7d62fb64 | 57 | #include "AliITSsegmentationSPD.h" |
58 | #include "AliITSsegmentationSDD.h" | |
59 | #include "AliITSsegmentationSSD.h" | |
00a7cc50 | 60 | #include "AliLog.h" |
7d62fb64 | 61 | |
3b9df642 | 62 | |
7d62fb64 | 63 | const Int_t AliITSDetTypeRec::fgkNdettypes = 3; |
8ba39da9 | 64 | const Int_t AliITSDetTypeRec::fgkDefaultNModulesSPD = 240; |
65 | const Int_t AliITSDetTypeRec::fgkDefaultNModulesSDD = 260; | |
66 | const Int_t AliITSDetTypeRec::fgkDefaultNModulesSSD = 1698; | |
67 | ||
3b9df642 | 68 | ClassImp(AliITSDetTypeRec) |
69 | ||
7d62fb64 | 70 | //________________________________________________________________ |
e56160b8 | 71 | AliITSDetTypeRec::AliITSDetTypeRec(): TObject(), |
72 | fNMod(0), | |
6cae184e | 73 | fITSgeom(0), |
e56160b8 | 74 | fReconstruction(0), |
75 | fSegmentation(0), | |
76 | fCalibration(0), | |
ced4d9bc | 77 | fSSDCalibration(0), |
23197852 | 78 | fSPDDead(0), |
e56160b8 | 79 | fPreProcess(0), |
80 | fPostProcess(0), | |
81 | fDigits(0), | |
979b5a5f | 82 | fDDLMapSDD(0), |
253e68a0 | 83 | fRespSDD(0), |
e56160b8 | 84 | fNdtype(0), |
85 | fCtype(0), | |
86 | fNctype(0), | |
87 | fRecPoints(0), | |
88 | fNRecPoints(0), | |
89 | fSelectedVertexer(), | |
e56160b8 | 90 | fFirstcall(kTRUE){ |
8e50d897 | 91 | // Standard Constructor |
92 | // Inputs: | |
93 | // none. | |
94 | // Outputs: | |
95 | // none. | |
96 | // Return: | |
97 | // | |
7d62fb64 | 98 | |
7d62fb64 | 99 | fReconstruction = new TObjArray(fgkNdettypes); |
7d62fb64 | 100 | fDigits = new TObjArray(fgkNdettypes); |
8e50d897 | 101 | for(Int_t i=0; i<3; i++){ |
102 | fClusterClassName[i]=0; | |
103 | fDigClassName[i]=0; | |
104 | fRecPointClassName[i]=0; | |
105 | } | |
ced4d9bc | 106 | fSSDCalibration=new AliITSCalibrationSSD(); |
7d62fb64 | 107 | fNdtype = new Int_t[fgkNdettypes]; |
108 | fCtype = new TObjArray(fgkNdettypes); | |
109 | fNctype = new Int_t[fgkNdettypes]; | |
8e50d897 | 110 | fNMod = new Int_t [fgkNdettypes]; |
111 | fNMod[0] = fgkDefaultNModulesSPD; | |
112 | fNMod[1] = fgkDefaultNModulesSDD; | |
113 | fNMod[2] = fgkDefaultNModulesSSD; | |
00a7cc50 | 114 | fRecPoints = new TClonesArray("AliITSRecPoint",3000); |
7d62fb64 | 115 | fNRecPoints = 0; |
7d62fb64 | 116 | |
117 | for(Int_t i=0;i<fgkNdettypes;i++){ | |
118 | fNdtype[i]=0; | |
119 | fNctype[i]=0; | |
120 | } | |
121 | ||
e56160b8 | 122 | SelectVertexer(" "); |
7d62fb64 | 123 | } |
7537d03c | 124 | |
7d62fb64 | 125 | //______________________________________________________________________ |
7537d03c | 126 | AliITSDetTypeRec::AliITSDetTypeRec(const AliITSDetTypeRec & rec):TObject(rec), |
127 | fNMod(rec.fNMod), | |
6cae184e | 128 | fITSgeom(rec.fITSgeom), |
7537d03c | 129 | fReconstruction(rec.fReconstruction), |
130 | fSegmentation(rec.fSegmentation), | |
131 | fCalibration(rec.fCalibration), | |
ced4d9bc | 132 | fSSDCalibration(rec.fSSDCalibration), |
23197852 | 133 | fSPDDead(rec.fSPDDead), |
7537d03c | 134 | fPreProcess(rec.fPreProcess), |
135 | fPostProcess(rec.fPostProcess), | |
136 | fDigits(rec.fDigits), | |
979b5a5f | 137 | fDDLMapSDD(rec.fDDLMapSDD), |
253e68a0 | 138 | fRespSDD(rec.fRespSDD), |
7537d03c | 139 | fNdtype(rec.fNdtype), |
140 | fCtype(rec.fCtype), | |
141 | fNctype(rec.fNctype), | |
142 | fRecPoints(rec.fRecPoints), | |
143 | fNRecPoints(rec.fNRecPoints), | |
144 | fSelectedVertexer(rec.fSelectedVertexer), | |
7537d03c | 145 | fFirstcall(rec.fFirstcall) |
e56160b8 | 146 | { |
7d62fb64 | 147 | |
e56160b8 | 148 | // Copy constructor. |
7537d03c | 149 | |
7d62fb64 | 150 | } |
151 | //______________________________________________________________________ | |
e56160b8 | 152 | AliITSDetTypeRec& AliITSDetTypeRec::operator=(const AliITSDetTypeRec& source){ |
7537d03c | 153 | // Assignment operator. |
154 | this->~AliITSDetTypeRec(); | |
155 | new(this) AliITSDetTypeRec(source); | |
156 | return *this; | |
7d62fb64 | 157 | |
e56160b8 | 158 | } |
7537d03c | 159 | |
7d62fb64 | 160 | //_____________________________________________________________________ |
3b9df642 | 161 | AliITSDetTypeRec::~AliITSDetTypeRec(){ |
7d62fb64 | 162 | //Destructor |
6cae184e | 163 | |
fcf95fc7 | 164 | if(fReconstruction){ |
165 | fReconstruction->Delete(); | |
166 | delete fReconstruction; | |
167 | fReconstruction = 0; | |
168 | } | |
169 | if(fSegmentation){ | |
170 | fSegmentation->Delete(); | |
171 | delete fSegmentation; | |
172 | fSegmentation = 0; | |
173 | } | |
6cae184e | 174 | if(fCalibration){ |
7032f6a2 | 175 | if(!(AliCDBManager::Instance()->GetCacheFlag())) { |
a85a36c4 | 176 | AliITSCalibration * calSPD = (AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSPD()); |
177 | if (calSPD) { | |
178 | AliITSresponse* rspd = calSPD->GetResponse(); | |
179 | if(rspd) delete rspd; | |
180 | } | |
181 | ||
182 | AliITSCalibration * calSSD = (AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSSD()); | |
183 | if (calSSD) { | |
184 | AliITSresponse* rssd = calSSD->GetResponse(); | |
185 | if(rssd) delete rssd; | |
186 | } | |
7032f6a2 | 187 | fCalibration->Delete(); |
188 | delete fCalibration; | |
189 | fCalibration = 0; | |
253e68a0 | 190 | if(fRespSDD) delete fRespSDD; |
191 | if(fDDLMapSDD) delete fDDLMapSDD; | |
192 | } | |
fcf95fc7 | 193 | } |
ced4d9bc | 194 | if(fSSDCalibration) delete fSSDCalibration; |
195 | if(fSPDDead){ | |
23197852 | 196 | if(!(AliCDBManager::Instance()->GetCacheFlag())) { |
197 | fSPDDead->Delete(); | |
198 | delete fSPDDead; | |
199 | fSPDDead = 0; | |
200 | } | |
201 | } | |
7d62fb64 | 202 | if(fPreProcess) delete fPreProcess; |
203 | if(fPostProcess) delete fPostProcess; | |
7d62fb64 | 204 | if(fDigits){ |
205 | fDigits->Delete(); | |
206 | delete fDigits; | |
207 | fDigits=0; | |
208 | } | |
209 | if(fRecPoints){ | |
210 | fRecPoints->Delete(); | |
211 | delete fRecPoints; | |
212 | fRecPoints=0; | |
213 | } | |
7d62fb64 | 214 | if(fCtype) { |
215 | fCtype->Delete(); | |
216 | delete fCtype; | |
217 | fCtype = 0; | |
218 | } | |
219 | delete [] fNctype; | |
8ba39da9 | 220 | delete [] fNdtype; |
8e50d897 | 221 | delete [] fNMod; |
7d62fb64 | 222 | |
6cae184e | 223 | if (fITSgeom) delete fITSgeom; |
224 | ||
7d62fb64 | 225 | } |
8e50d897 | 226 | |
7d62fb64 | 227 | //___________________________________________________________________ |
228 | void AliITSDetTypeRec::SetReconstructionModel(Int_t dettype,AliITSClusterFinder *clf){ | |
229 | ||
230 | //Set reconstruction model for detector type | |
231 | ||
232 | if(fReconstruction==0) fReconstruction = new TObjArray(fgkNdettypes); | |
233 | if(fReconstruction->At(dettype)!=0) delete fReconstruction->At(dettype); | |
234 | fReconstruction->AddAt(clf,dettype); | |
235 | } | |
236 | //______________________________________________________________________ | |
237 | AliITSClusterFinder* AliITSDetTypeRec::GetReconstructionModel(Int_t dettype){ | |
238 | ||
239 | //Get reconstruction model for detector type | |
240 | if(fReconstruction==0) { | |
241 | Warning("GetReconstructionModel","fReconstruction is 0!"); | |
242 | return 0; | |
243 | } | |
244 | return (AliITSClusterFinder*)fReconstruction->At(dettype); | |
245 | } | |
246 | ||
247 | //______________________________________________________________________ | |
248 | void AliITSDetTypeRec::SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg){ | |
249 | ||
250 | //Set segmentation model for detector type | |
251 | ||
252 | if(fSegmentation==0) fSegmentation = new TObjArray(fgkNdettypes); | |
253 | if(fSegmentation->At(dettype)!=0) delete fSegmentation->At(dettype); | |
254 | fSegmentation->AddAt(seg,dettype); | |
255 | ||
256 | } | |
257 | //______________________________________________________________________ | |
258 | AliITSsegmentation* AliITSDetTypeRec::GetSegmentationModel(Int_t dettype){ | |
259 | ||
260 | //Get segmentation model for detector type | |
261 | ||
262 | if(fSegmentation==0) { | |
263 | Warning("GetSegmentationModel","fSegmentation is 0!"); | |
264 | return 0; | |
265 | } | |
266 | return (AliITSsegmentation*)fSegmentation->At(dettype); | |
267 | ||
268 | } | |
269 | //_______________________________________________________________________ | |
fcf95fc7 | 270 | void AliITSDetTypeRec::SetCalibrationModel(Int_t iMod, AliITSCalibration *cal){ |
8ba39da9 | 271 | |
272 | //Set calibration (response) for the module iMod of type dettype | |
273 | if (fCalibration==0) { | |
8e50d897 | 274 | fCalibration = new TObjArray(GetITSgeom()->GetIndexMax()); |
8ba39da9 | 275 | fCalibration->SetOwner(kTRUE); |
276 | fCalibration->Clear(); | |
277 | } | |
278 | ||
279 | if (fCalibration->At(iMod) != 0) | |
fcf95fc7 | 280 | delete (AliITSCalibration*) fCalibration->At(iMod); |
8ba39da9 | 281 | fCalibration->AddAt(cal,iMod); |
7d62fb64 | 282 | |
7d62fb64 | 283 | } |
284 | //_______________________________________________________________________ | |
23197852 | 285 | void AliITSDetTypeRec::SetSPDDeadModel(Int_t iMod, AliITSCalibration *cal){ |
286 | ||
287 | //Set dead pixel info for the SPD module iMod | |
288 | if (fSPDDead==0) { | |
289 | fSPDDead = new TObjArray(fgkDefaultNModulesSPD); | |
290 | fSPDDead->SetOwner(kTRUE); | |
291 | fSPDDead->Clear(); | |
292 | } | |
293 | ||
294 | if (fSPDDead->At(iMod) != 0) | |
295 | delete (AliITSCalibration*) fSPDDead->At(iMod); | |
296 | fSPDDead->AddAt(cal,iMod); | |
297 | } | |
298 | //_______________________________________________________________________ | |
fcf95fc7 | 299 | AliITSCalibration* AliITSDetTypeRec::GetCalibrationModel(Int_t iMod){ |
7d62fb64 | 300 | |
8ba39da9 | 301 | //Get calibration model for module type |
7d62fb64 | 302 | |
303 | if(fCalibration==0) { | |
8ba39da9 | 304 | Warning("GetalibrationModel","fCalibration is 0!"); |
7d62fb64 | 305 | return 0; |
306 | } | |
8ba39da9 | 307 | |
ced4d9bc | 308 | if(iMod<fgkDefaultNModulesSPD+fgkDefaultNModulesSDD){ |
309 | return (AliITSCalibration*)fCalibration->At(iMod); | |
310 | }else{ | |
311 | Int_t i=iMod-(fgkDefaultNModulesSPD+fgkDefaultNModulesSDD); | |
312 | fSSDCalibration->SetModule(i); | |
313 | return (AliITSCalibration*)fSSDCalibration; | |
314 | } | |
315 | ||
7d62fb64 | 316 | } |
23197852 | 317 | //_______________________________________________________________________ |
318 | AliITSCalibration* AliITSDetTypeRec::GetSPDDeadModel(Int_t iMod){ | |
319 | ||
320 | //Get SPD dead for module iMod | |
321 | ||
322 | if(fSPDDead==0) { | |
323 | AliWarning("fSPDDead is 0!"); | |
324 | return 0; | |
325 | } | |
326 | ||
327 | return (AliITSCalibration*)fSPDDead->At(iMod); | |
328 | } | |
7d62fb64 | 329 | |
7d62fb64 | 330 | //______________________________________________________________________ |
331 | void AliITSDetTypeRec::SetTreeAddressD(TTree *treeD){ | |
332 | // Set branch address for the tree of digits. | |
333 | ||
334 | const char *det[4] = {"SPD","SDD","SSD","ITS"}; | |
335 | TBranch *branch; | |
336 | Char_t* digclass; | |
337 | Int_t i; | |
338 | char branchname[30]; | |
339 | ||
340 | if(!treeD) return; | |
341 | if (fDigits == 0x0) fDigits = new TObjArray(fgkNdettypes); | |
342 | for (i=0; i<fgkNdettypes; i++) { | |
343 | digclass = GetDigitClassName(i); | |
344 | if(!(fDigits->At(i))) { | |
345 | fDigits->AddAt(new TClonesArray(digclass,1000),i); | |
346 | }else{ | |
347 | ResetDigits(i); | |
348 | } | |
349 | if (fgkNdettypes==3) sprintf(branchname,"%sDigits%s",det[3],det[i]); | |
350 | else sprintf(branchname,"%sDigits%d",det[3],i+1); | |
351 | if (fDigits) { | |
352 | branch = treeD->GetBranch(branchname); | |
353 | if (branch) branch->SetAddress(&((*fDigits)[i])); | |
354 | } | |
355 | } | |
356 | } | |
357 | ||
358 | //_______________________________________________________________________ | |
359 | TBranch* AliITSDetTypeRec::MakeBranchInTree(TTree *tree, const char* name, | |
360 | const char *classname, | |
361 | void* address,Int_t size, | |
6cae184e | 362 | Int_t splitlevel) |
7d62fb64 | 363 | { |
364 | // | |
365 | // Makes branch in given tree and diverts them to a separate file | |
366 | // | |
367 | // | |
368 | // | |
369 | ||
370 | if (tree == 0x0) { | |
371 | Error("MakeBranchInTree","Making Branch %s Tree is NULL",name); | |
372 | return 0x0; | |
373 | } | |
374 | TBranch *branch = tree->GetBranch(name); | |
375 | if (branch) { | |
376 | return branch; | |
377 | } | |
378 | if (classname){ | |
379 | branch = tree->Branch(name,classname,address,size,splitlevel); | |
380 | } | |
381 | else { | |
382 | branch = tree->Bronch(name, "TClonesArray", address, size, splitlevel); | |
383 | } | |
384 | ||
385 | return branch; | |
386 | } | |
387 | ||
388 | //____________________________________________________________________ | |
389 | void AliITSDetTypeRec::SetDefaults(){ | |
390 | ||
391 | //Set defaults for segmentation and response | |
392 | ||
8e50d897 | 393 | if(!GetITSgeom()){ |
394 | Warning("SetDefaults","null pointer to AliITSgeomGeom !"); | |
7d62fb64 | 395 | return; |
396 | } | |
397 | ||
398 | AliITSsegmentation* seg; | |
8ba39da9 | 399 | if(!GetCalibration()) {AliFatal("Exit");exit(0);} |
7d62fb64 | 400 | |
401 | for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){ | |
402 | if(dettype==0){ | |
d24bc9d6 | 403 | seg = new AliITSsegmentationSPD(); |
7d62fb64 | 404 | SetSegmentationModel(dettype,seg); |
3a7c3e6d | 405 | SetDigitClassName(dettype,"AliITSdigitSPD"); |
406 | SetClusterClassName(dettype,"AliITSRawClusterSPD"); | |
407 | ||
7d62fb64 | 408 | } |
409 | if(dettype==1){ | |
d24bc9d6 | 410 | seg = new AliITSsegmentationSDD(); |
7d62fb64 | 411 | SetSegmentationModel(dettype,seg); |
fa4f0f62 | 412 | SetDigitClassName(dettype,"AliITSdigitSDD"); |
3a7c3e6d | 413 | SetClusterClassName(dettype,"AliITSRawClusterSDD"); |
7d62fb64 | 414 | } |
415 | if(dettype==2){ | |
d24bc9d6 | 416 | AliITSsegmentationSSD* seg2 = new AliITSsegmentationSSD(); |
7d62fb64 | 417 | SetSegmentationModel(dettype,seg2); |
7d62fb64 | 418 | SetDigitClassName(dettype,"AliITSdigitSSD"); |
419 | SetClusterClassName(dettype,"AliITSRawClusterSSD"); | |
420 | } | |
7d62fb64 | 421 | } |
7d62fb64 | 422 | |
423 | } | |
8ba39da9 | 424 | //______________________________________________________________________ |
425 | Bool_t AliITSDetTypeRec::GetCalibration() { | |
426 | // Get Default calibration if a storage is not defined. | |
427 | ||
b17dae48 | 428 | if(!fFirstcall){ |
429 | AliITSCalibration* cal = GetCalibrationModel(0); | |
430 | if(cal)return kTRUE; | |
431 | } | |
432 | else { | |
433 | fFirstcall = kFALSE; | |
434 | } | |
06232459 | 435 | |
6cae184e | 436 | // SetRunNumber((Int_t)AliCDBManager::Instance()->GetRun()); |
437 | // Int_t run=GetRunNumber(); | |
b17dae48 | 438 | |
6cae184e | 439 | Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag(); |
b17dae48 | 440 | if (fCalibration==0) { |
441 | fCalibration = new TObjArray(GetITSgeom()->GetIndexMax()); | |
6cae184e | 442 | fCalibration->SetOwner(!cacheStatus); |
b17dae48 | 443 | fCalibration->Clear(); |
444 | } | |
445 | ||
8d37cc87 | 446 | // dead pixel are not used for local reconstruction |
447 | AliCDBEntry *entrySPD = AliCDBManager::Instance()->Get("ITS/Calib/SPDNoisy"); | |
23197852 | 448 | AliCDBEntry *deadSPD = AliCDBManager::Instance()->Get("ITS/Calib/SPDDead"); |
6cae184e | 449 | AliCDBEntry *entrySDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD"); |
fb4dfab9 | 450 | |
451 | // AliCDBEntry *entrySSD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSSD"); | |
23197852 | 452 | AliCDBEntry *entryNoiseSSD = AliCDBManager::Instance()->Get("ITS/Calib/NoiseSSD"); |
453 | AliCDBEntry *entryPedestalSSD = AliCDBManager::Instance()->Get("ITS/Calib/PedestalSSD"); | |
454 | AliCDBEntry *entryGainSSD = AliCDBManager::Instance()->Get("ITS/Calib/GainSSD"); | |
455 | AliCDBEntry *entryBadChannelsSSD = AliCDBManager::Instance()->Get("ITS/Calib/BadChannelsSSD"); | |
6cae184e | 456 | AliCDBEntry *entry2SPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD"); |
457 | AliCDBEntry *entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD"); | |
458 | AliCDBEntry *entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD"); | |
18da6e54 | 459 | AliCDBEntry *drSpSDD = AliCDBManager::Instance()->Get("ITS/Calib/DriftSpeedSDD"); |
979b5a5f | 460 | AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD"); |
028a3709 | 461 | AliCDBEntry *mapASDD = AliCDBManager::Instance()->Get("ITS/Calib/MapsAnodeSDD"); |
462 | AliCDBEntry *mapTSDD = AliCDBManager::Instance()->Get("ITS/Calib/MapsTimeSDD"); | |
06232459 | 463 | |
23197852 | 464 | if(!entrySPD || !deadSPD || !entrySDD || !entryNoiseSSD || !entryGainSSD || |
b42cfa25 | 465 | !entryPedestalSSD || !entryBadChannelsSSD || |
ef318a80 | 466 | !entry2SPD || !entry2SDD || !entry2SSD || !drSpSDD || !ddlMapSDD || !mapASDD || !mapTSDD ){ |
566f73ca | 467 | AliFatal("Calibration object retrieval failed! "); |
e8c4cf33 | 468 | return kFALSE; |
566f73ca | 469 | } |
470 | ||
b17dae48 | 471 | TObjArray *calSPD = (TObjArray *)entrySPD->GetObject(); |
6cae184e | 472 | if(!cacheStatus)entrySPD->SetObject(NULL); |
8ba39da9 | 473 | entrySPD->SetOwner(kTRUE); |
fcf95fc7 | 474 | |
23197852 | 475 | TObjArray *caldeadSPD = (TObjArray *)deadSPD->GetObject(); |
476 | if(!cacheStatus)deadSPD->SetObject(NULL); | |
477 | deadSPD->SetOwner(kTRUE); | |
478 | ||
fcf95fc7 | 479 | AliITSresponseSPD *pSPD = (AliITSresponseSPD*)entry2SPD->GetObject(); |
6cae184e | 480 | if(!cacheStatus)entry2SPD->SetObject(NULL); |
fcf95fc7 | 481 | entry2SPD->SetOwner(kTRUE); |
482 | ||
b17dae48 | 483 | TObjArray *calSDD = (TObjArray *)entrySDD->GetObject(); |
6cae184e | 484 | if(!cacheStatus)entrySDD->SetObject(NULL); |
8ba39da9 | 485 | entrySDD->SetOwner(kTRUE); |
fcf95fc7 | 486 | |
487 | AliITSresponseSDD *pSDD = (AliITSresponseSDD*)entry2SDD->GetObject(); | |
6cae184e | 488 | if(!cacheStatus)entry2SDD->SetObject(NULL); |
fcf95fc7 | 489 | entry2SDD->SetOwner(kTRUE); |
490 | ||
18da6e54 | 491 | TObjArray *drSp = (TObjArray *)drSpSDD->GetObject(); |
492 | if(!cacheStatus)drSpSDD->SetObject(NULL); | |
493 | drSpSDD->SetOwner(kTRUE); | |
494 | ||
979b5a5f | 495 | AliITSDDLModuleMapSDD *ddlsdd=(AliITSDDLModuleMapSDD*)ddlMapSDD->GetObject(); |
496 | if(!cacheStatus)ddlMapSDD->SetObject(NULL); | |
497 | ddlMapSDD->SetOwner(kTRUE); | |
498 | ||
028a3709 | 499 | TObjArray *mapAn = (TObjArray *)mapASDD->GetObject(); |
500 | if(!cacheStatus)mapASDD->SetObject(NULL); | |
501 | mapASDD->SetOwner(kTRUE); | |
502 | ||
503 | TObjArray *mapT = (TObjArray *)mapTSDD->GetObject(); | |
504 | if(!cacheStatus)mapTSDD->SetObject(NULL); | |
505 | mapTSDD->SetOwner(kTRUE); | |
506 | ||
ced4d9bc | 507 | AliITSNoiseSSD *noiseSSD = (AliITSNoiseSSD *)entryNoiseSSD->GetObject(); |
fb4dfab9 | 508 | if(!cacheStatus)entryNoiseSSD->SetObject(NULL); |
509 | entryNoiseSSD->SetOwner(kTRUE); | |
510 | ||
ced4d9bc | 511 | AliITSPedestalSSD *pedestalSSD = |
512 | (AliITSPedestalSSD*)entryPedestalSSD->GetObject(); | |
b42cfa25 | 513 | if(!cacheStatus)entryPedestalSSD->SetObject(NULL); |
514 | entryPedestalSSD->SetOwner(kTRUE); | |
515 | ||
ced4d9bc | 516 | AliITSGainSSD *gainSSD = (AliITSGainSSD *)entryGainSSD->GetObject(); |
fb4dfab9 | 517 | if(!cacheStatus)entryGainSSD->SetObject(NULL); |
518 | entryGainSSD->SetOwner(kTRUE); | |
519 | ||
ced4d9bc | 520 | AliITSBadChannelsSSD *badchannelsSSD = |
521 | (AliITSBadChannelsSSD*)entryBadChannelsSSD->GetObject(); | |
fb4dfab9 | 522 | if(!cacheStatus)entryBadChannelsSSD->SetObject(NULL); |
523 | entryBadChannelsSSD->SetOwner(kTRUE); | |
fcf95fc7 | 524 | |
525 | AliITSresponseSSD *pSSD = (AliITSresponseSSD*)entry2SSD->GetObject(); | |
6cae184e | 526 | if(!cacheStatus)entry2SSD->SetObject(NULL); |
fcf95fc7 | 527 | entry2SSD->SetOwner(kTRUE); |
528 | ||
b17dae48 | 529 | // DB entries are deleted. In this way metadeta objects are deleted as well |
6cae184e | 530 | if(!cacheStatus){ |
b17dae48 | 531 | delete entrySPD; |
23197852 | 532 | delete deadSPD; |
b17dae48 | 533 | delete entrySDD; |
fb4dfab9 | 534 | delete entryNoiseSSD; |
b42cfa25 | 535 | delete entryPedestalSSD; |
fb4dfab9 | 536 | delete entryGainSSD; |
537 | delete entryBadChannelsSSD; | |
b17dae48 | 538 | delete entry2SPD; |
539 | delete entry2SDD; | |
540 | delete entry2SSD; | |
028a3709 | 541 | delete mapASDD; |
542 | delete mapTSDD; | |
18da6e54 | 543 | delete drSpSDD; |
979b5a5f | 544 | delete ddlMapSDD; |
b17dae48 | 545 | } |
06232459 | 546 | |
23197852 | 547 | if ((!pSPD)||(!pSDD)||(!pSSD) || (!calSPD) || (!caldeadSPD) ||(!calSDD) || (!drSp) || (!ddlsdd) |
028a3709 | 548 | || (!mapAn) || (!mapT) || (!noiseSSD)|| (!gainSSD)|| (!badchannelsSSD)) { |
8ba39da9 | 549 | AliWarning("Can not get calibration from calibration database !"); |
550 | return kFALSE; | |
551 | } | |
fcf95fc7 | 552 | |
b17dae48 | 553 | fNMod[0] = calSPD->GetEntries(); |
554 | fNMod[1] = calSDD->GetEntries(); | |
ced4d9bc | 555 | //fNMod[2] = noiseSSD->GetEntries(); |
8ba39da9 | 556 | AliInfo(Form("%i SPD, %i SDD and %i SSD in calibration database", |
557 | fNMod[0], fNMod[1], fNMod[2])); | |
622d99ba | 558 | AliITSCalibration* cal; |
8ba39da9 | 559 | for (Int_t i=0; i<fNMod[0]; i++) { |
622d99ba | 560 | cal = (AliITSCalibration*) calSPD->At(i); |
561 | cal->SetResponse((AliITSresponse*)pSPD); | |
562 | SetCalibrationModel(i, cal); | |
23197852 | 563 | cal = (AliITSCalibration*) caldeadSPD->At(i); |
564 | SetSPDDeadModel(i, cal); | |
028a3709 | 565 | } |
140e5249 | 566 | |
253e68a0 | 567 | fDDLMapSDD=ddlsdd; |
568 | fRespSDD=pSDD; | |
140e5249 | 569 | for(Int_t iddl=0; iddl<AliITSDDLModuleMapSDD::GetNDDLs(); iddl++){ |
570 | for(Int_t icar=0; icar<AliITSDDLModuleMapSDD::GetNModPerDDL();icar++){ | |
571 | Int_t iMod=fDDLMapSDD->GetModuleNumber(iddl,icar); | |
572 | if(iMod==-1) continue; | |
6cc25d49 | 573 | Int_t i=iMod - fgkDefaultNModulesSPD; |
140e5249 | 574 | cal = (AliITSCalibration*) calSDD->At(i); |
140e5249 | 575 | Int_t i0=2*i; |
576 | Int_t i1=1+2*i; | |
577 | AliITSDriftSpeedArraySDD* arr0 = (AliITSDriftSpeedArraySDD*) drSp->At(i0); | |
578 | AliITSMapSDD* ma0 = (AliITSMapSDD*)mapAn->At(i0); | |
579 | AliITSMapSDD* mt0 = (AliITSMapSDD*)mapT->At(i0); | |
580 | AliITSDriftSpeedArraySDD* arr1 = (AliITSDriftSpeedArraySDD*) drSp->At(i1); | |
581 | AliITSMapSDD* ma1 = (AliITSMapSDD*)mapAn->At(i1); | |
582 | AliITSMapSDD* mt1 = (AliITSMapSDD*)mapT->At(i1); | |
583 | cal->SetDriftSpeed(0,arr0); | |
584 | cal->SetDriftSpeed(1,arr1); | |
585 | cal->SetMapA(0,ma0); | |
586 | cal->SetMapA(1,ma1); | |
587 | cal->SetMapT(0,mt0); | |
588 | cal->SetMapT(1,mt1); | |
589 | SetCalibrationModel(iMod, cal); | |
590 | } | |
028a3709 | 591 | } |
ced4d9bc | 592 | |
593 | fSSDCalibration->SetResponse((AliITSresponse*)pSSD); | |
594 | fSSDCalibration->SetNoise(noiseSSD); | |
595 | fSSDCalibration->SetPedestal(pedestalSSD); | |
596 | fSSDCalibration->SetGain(gainSSD); | |
597 | fSSDCalibration->SetBadChannels(badchannelsSSD); | |
598 | //fSSDCalibration->FillBadChipMap(); | |
599 | ||
600 | ||
601 | /* | |
8ba39da9 | 602 | for (Int_t i=0; i<fNMod[2]; i++) { |
fb4dfab9 | 603 | |
604 | AliITSCalibrationSSD *calibSSD = new AliITSCalibrationSSD(); | |
605 | calibSSD->SetResponse((AliITSresponse*)pSSD); | |
606 | ||
607 | AliITSNoiseSSD *noise = (AliITSNoiseSSD*) (noiseSSD->At(i)); | |
608 | calibSSD->SetNoise(noise); | |
b42cfa25 | 609 | AliITSPedestalSSD *pedestal = (AliITSPedestalSSD*) (pedestalSSD->At(i)); |
610 | calibSSD->SetPedestal(pedestal); | |
fb4dfab9 | 611 | AliITSGainSSD *gain = (AliITSGainSSD*) (gainSSD->At(i)); |
612 | calibSSD->SetGain(gain); | |
613 | AliITSBadChannelsSSD *bad = (AliITSBadChannelsSSD*) (badchannelsSSD->At(i)); | |
614 | calibSSD->SetBadChannels(bad); | |
23197852 | 615 | calibSSD->FillBadChipMap(); |
fb4dfab9 | 616 | |
6cc25d49 | 617 | Int_t iMod = i + fgkDefaultNModulesSPD + fgkDefaultNModulesSDD; |
fb4dfab9 | 618 | SetCalibrationModel(iMod, calibSSD); |
8ba39da9 | 619 | } |
ced4d9bc | 620 | */ |
8ba39da9 | 621 | |
622 | return kTRUE; | |
623 | } | |
624 | ||
7d62fb64 | 625 | |
626 | //________________________________________________________________ | |
627 | void AliITSDetTypeRec::SetDefaultClusterFinders(){ | |
628 | ||
629 | //set defaults for standard cluster finder | |
630 | ||
8e50d897 | 631 | if(!GetITSgeom()){ |
632 | Warning("SetDefaults","null pointer to AliITSgeom!"); | |
7d62fb64 | 633 | return; |
634 | } | |
635 | ||
7d62fb64 | 636 | AliITSClusterFinder *clf; |
637 | ||
6cae184e | 638 | for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){ |
7d62fb64 | 639 | //SPD |
640 | if(dettype==0){ | |
641 | if(!GetReconstructionModel(dettype)){ | |
7d62fb64 | 642 | TClonesArray *dig0 = DigitsAddress(0); |
643 | TClonesArray *rec0 = ClustersAddress(0); | |
8ba39da9 | 644 | clf = new AliITSClusterFinderSPD(this,dig0,rec0); |
7d62fb64 | 645 | SetReconstructionModel(dettype,clf); |
8ba39da9 | 646 | |
7d62fb64 | 647 | } |
648 | } | |
8ba39da9 | 649 | |
7d62fb64 | 650 | //SDD |
651 | if(dettype==1){ | |
652 | if(!GetReconstructionModel(dettype)){ | |
7d62fb64 | 653 | TClonesArray *dig1 = DigitsAddress(1); |
654 | TClonesArray *rec1 = ClustersAddress(1); | |
8ba39da9 | 655 | clf = new AliITSClusterFinderSDD(this,dig1,rec1); |
7d62fb64 | 656 | SetReconstructionModel(dettype,clf); |
657 | } | |
658 | ||
659 | } | |
660 | //SSD | |
661 | if(dettype==2){ | |
662 | if(!GetReconstructionModel(dettype)){ | |
7d62fb64 | 663 | TClonesArray* dig2 = DigitsAddress(2); |
8ba39da9 | 664 | clf = new AliITSClusterFinderSSD(this,dig2); |
7d62fb64 | 665 | SetReconstructionModel(dettype,clf); |
666 | } | |
667 | } | |
668 | ||
669 | } | |
670 | ||
671 | ||
672 | } | |
673 | ||
674 | //________________________________________________________________ | |
3a7c3e6d | 675 | void AliITSDetTypeRec::SetDefaultClusterFindersV2(Bool_t rawdata){ |
7d62fb64 | 676 | |
677 | //Set defaults for cluster finder V2 | |
678 | ||
8e50d897 | 679 | if(!GetITSgeom()){ |
680 | Warning("SetDefaults","Null pointer to AliITSgeom !"); | |
7d62fb64 | 681 | return; |
682 | } | |
683 | ||
7d62fb64 | 684 | AliITSClusterFinder *clf; |
685 | ||
3a7c3e6d | 686 | for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){ |
7d62fb64 | 687 | //SPD |
688 | if(dettype==0){ | |
689 | if(!GetReconstructionModel(dettype)){ | |
8ba39da9 | 690 | clf = new AliITSClusterFinderV2SPD(this); |
7d62fb64 | 691 | clf->InitGeometry(); |
3a7c3e6d | 692 | if(!rawdata) clf->SetDigits(DigitsAddress(0)); |
7d62fb64 | 693 | SetReconstructionModel(dettype,clf); |
694 | ||
695 | } | |
696 | } | |
697 | //SDD | |
698 | if(dettype==1){ | |
699 | if(!GetReconstructionModel(dettype)){ | |
8ba39da9 | 700 | clf = new AliITSClusterFinderV2SDD(this); |
701 | clf->InitGeometry(); | |
3a7c3e6d | 702 | if(!rawdata) clf->SetDigits(DigitsAddress(1)); |
7d62fb64 | 703 | SetReconstructionModel(dettype,clf); |
704 | } | |
705 | ||
706 | } | |
707 | ||
708 | //SSD | |
709 | if(dettype==2){ | |
710 | if(!GetReconstructionModel(dettype)){ | |
8ba39da9 | 711 | clf = new AliITSClusterFinderV2SSD(this); |
7d62fb64 | 712 | clf->InitGeometry(); |
3a7c3e6d | 713 | if(!rawdata) clf->SetDigits(DigitsAddress(2)); |
7d62fb64 | 714 | SetReconstructionModel(dettype,clf); |
715 | } | |
716 | } | |
717 | ||
718 | } | |
719 | ||
720 | } | |
721 | //______________________________________________________________________ | |
6cae184e | 722 | void AliITSDetTypeRec::MakeBranch(TTree* tree, Option_t* option){ |
7d62fb64 | 723 | |
724 | //Creates branches for clusters and recpoints | |
725 | Bool_t cR = (strstr(option,"R")!=0); | |
726 | Bool_t cRF = (strstr(option,"RF")!=0); | |
7d62fb64 | 727 | |
728 | if(cRF)cR = kFALSE; | |
729 | ||
6cae184e | 730 | if(cR) MakeBranchR(tree); |
731 | if(cRF) MakeBranchRF(tree); | |
7d62fb64 | 732 | |
733 | } | |
734 | ||
735 | //___________________________________________________________________ | |
736 | void AliITSDetTypeRec::AddCluster(Int_t id, AliITSRawCluster *c){ | |
737 | ||
738 | // Adds a raw cluster to the list | |
739 | TClonesArray &lc = *((TClonesArray*)fCtype->At(id)); | |
740 | switch(id){ | |
741 | case 0: | |
742 | new(lc[fNctype[id]++]) AliITSRawClusterSPD(*((AliITSRawClusterSPD*)c)); | |
743 | break; | |
744 | case 1: | |
745 | new(lc[fNctype[id]++]) AliITSRawClusterSDD(*((AliITSRawClusterSDD*)c)); | |
746 | break; | |
747 | case 2: | |
748 | new(lc[fNctype[id]++]) AliITSRawClusterSSD(*((AliITSRawClusterSSD*)c)); | |
749 | break; | |
750 | } | |
751 | } | |
752 | //___________________________________________________________________ | |
753 | void AliITSDetTypeRec::ResetDigits(){ | |
754 | // Reset number of digits and the digits array for the ITS detector. | |
755 | ||
756 | if(!fDigits) return; | |
757 | for(Int_t i=0;i<fgkNdettypes;i++){ | |
758 | ResetDigits(i); | |
759 | } | |
760 | } | |
761 | //___________________________________________________________________ | |
762 | void AliITSDetTypeRec::ResetDigits(Int_t branch){ | |
763 | // Reset number of digits and the digits array for this branch. | |
764 | ||
765 | if(fDigits->At(branch)) ((TClonesArray*)fDigits->At(branch))->Clear(); | |
766 | if(fNdtype) fNdtype[branch]=0; | |
767 | ||
768 | } | |
769 | ||
770 | //__________________________________________________________________ | |
771 | void AliITSDetTypeRec::ResetClusters(){ | |
772 | ||
773 | //Resets number of clusters and the cluster array | |
774 | for(Int_t i=0;i<fgkNdettypes;i++){ | |
775 | ResetClusters(i); | |
776 | } | |
777 | } | |
778 | ||
779 | //__________________________________________________________________ | |
780 | void AliITSDetTypeRec::ResetClusters(Int_t i){ | |
781 | ||
782 | //Resets number of clusters and the cluster array for this branch | |
783 | ||
784 | if (fCtype->At(i)) ((TClonesArray*)fCtype->At(i))->Clear(); | |
785 | if (fNctype) fNctype[i]=0; | |
786 | } | |
787 | //__________________________________________________________________ | |
6cae184e | 788 | void AliITSDetTypeRec::MakeBranchR(TTree *treeR, Option_t *opt){ |
7d62fb64 | 789 | |
790 | //Creates tree branches for recpoints | |
791 | // Inputs: | |
792 | // cont char *file File name where RecPoints branch is to be written | |
793 | // to. If blank it write the SDigits to the same | |
794 | // file in which the Hits were found. | |
795 | ||
7d62fb64 | 796 | Int_t buffsz = 4000; |
797 | char branchname[30]; | |
798 | ||
799 | // only one branch for rec points for all detector types | |
800 | Bool_t oFast= (strstr(opt,"Fast")!=0); | |
7d62fb64 | 801 | |
802 | Char_t detname[10] = "ITS"; | |
803 | ||
804 | ||
805 | if(oFast){ | |
806 | sprintf(branchname,"%sRecPointsF",detname); | |
7d62fb64 | 807 | } else { |
808 | sprintf(branchname,"%sRecPoints",detname); | |
809 | } | |
810 | ||
00a7cc50 | 811 | if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPoint",1000); |
6cae184e | 812 | if (treeR) |
813 | MakeBranchInTree(treeR,branchname,0,&fRecPoints,buffsz,99); | |
7d62fb64 | 814 | } |
815 | //______________________________________________________________________ | |
816 | void AliITSDetTypeRec::SetTreeAddressR(TTree *treeR){ | |
817 | // Set branch address for the Reconstructed points Trees. | |
3b9df642 | 818 | // Inputs: |
7d62fb64 | 819 | // TTree *treeR Tree containing the RecPoints. |
3b9df642 | 820 | // Outputs: |
7d62fb64 | 821 | // none. |
3b9df642 | 822 | // Return: |
7d62fb64 | 823 | |
824 | char branchname[30]; | |
825 | Char_t namedet[10]="ITS"; | |
826 | ||
827 | if(!treeR) return; | |
828 | if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000); | |
00a7cc50 | 829 | TBranch *branch; |
830 | sprintf(branchname,"%sRecPoints",namedet); | |
831 | branch = treeR->GetBranch(branchname); | |
832 | if (branch) { | |
833 | branch->SetAddress(&fRecPoints); | |
834 | }else { | |
835 | sprintf(branchname,"%sRecPointsF",namedet); | |
7d62fb64 | 836 | branch = treeR->GetBranch(branchname); |
837 | if (branch) { | |
00a7cc50 | 838 | branch->SetAddress(&fRecPoints); |
7d62fb64 | 839 | } |
00a7cc50 | 840 | |
7d62fb64 | 841 | } |
3b9df642 | 842 | } |
7d62fb64 | 843 | //____________________________________________________________________ |
844 | void AliITSDetTypeRec::AddRecPoint(const AliITSRecPoint &r){ | |
845 | // Add a reconstructed space point to the list | |
846 | // Inputs: | |
847 | // const AliITSRecPoint &r RecPoint class to be added to the tree | |
848 | // of reconstructed points TreeR. | |
849 | // Outputs: | |
850 | // none. | |
851 | // Return: | |
852 | // none. | |
853 | ||
854 | TClonesArray &lrecp = *fRecPoints; | |
855 | new(lrecp[fNRecPoints++]) AliITSRecPoint(r); | |
856 | } | |
7d62fb64 | 857 | |
858 | //______________________________________________________________________ | |
6cae184e | 859 | void AliITSDetTypeRec::DigitsToRecPoints(TTree *treeD,TTree *treeR,Int_t lastentry,Option_t *opt, Bool_t v2){ |
7d62fb64 | 860 | // cluster finding and reconstruction of space points |
861 | // the condition below will disappear when the geom class will be | |
862 | // initialized for all versions - for the moment it is only for v5 ! | |
863 | // 7 is the SDD beam test version | |
864 | // Inputs: | |
6cae184e | 865 | // TTree *treeD Digits tree |
866 | // TTree *treeR Clusters tree | |
7d62fb64 | 867 | // Int_t lastentry Offset for module when not all of the modules |
868 | // are processed. | |
869 | // Option_t *opt String indicating which ITS sub-detectors should | |
870 | // be processed. If ="All" then all of the ITS | |
871 | // sub detectors are processed. | |
872 | ||
7d62fb64 | 873 | const char *all = strstr(opt,"All"); |
874 | const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"), | |
875 | strstr(opt,"SSD")}; | |
00a7cc50 | 876 | if(!v2) { |
877 | SetDefaultClusterFinders(); | |
878 | AliInfo("Original cluster finder has been selected\n"); | |
879 | } | |
880 | else { | |
881 | SetDefaultClusterFindersV2(); | |
882 | AliInfo("V2 cluster finder has been selected \n"); | |
883 | } | |
7d62fb64 | 884 | |
7d62fb64 | 885 | AliITSClusterFinder *rec = 0; |
886 | Int_t id,module,first=0; | |
8e50d897 | 887 | for(module=0;module<GetITSgeom()->GetIndexMax();module++){ |
888 | id = GetITSgeom()->GetModuleType(module); | |
7d62fb64 | 889 | if (!all && !det[id]) continue; |
8e50d897 | 890 | if(det[id]) first = GetITSgeom()->GetStartDet(id); |
7d62fb64 | 891 | rec = (AliITSClusterFinder*)GetReconstructionModel(id); |
892 | TClonesArray *itsDigits = DigitsAddress(id); | |
6cae184e | 893 | if (!rec) |
894 | AliFatal("The reconstruction class was not instanciated!"); | |
5e5bc8f1 | 895 | ResetDigits(); // MvL: Not sure we neeed this when rereading anyways |
7d62fb64 | 896 | if (all) { |
6cae184e | 897 | treeD->GetEvent(lastentry+module); |
7d62fb64 | 898 | }else { |
6cae184e | 899 | treeD->GetEvent(lastentry+(module-first)); |
7d62fb64 | 900 | } |
901 | Int_t ndigits = itsDigits->GetEntriesFast(); | |
902 | if(ndigits>0){ | |
903 | rec->SetDetTypeRec(this); | |
7d62fb64 | 904 | rec->SetDigits(DigitsAddress(id)); |
6cae184e | 905 | // rec->SetClusters(ClustersAddress(id)); |
7d62fb64 | 906 | rec->FindRawClusters(module); |
907 | } // end if | |
6cae184e | 908 | treeR->Fill(); |
7d62fb64 | 909 | ResetRecPoints(); |
7d62fb64 | 910 | ResetClusters(); |
911 | } | |
7d62fb64 | 912 | } |
913 | //______________________________________________________________________ | |
8484b32d | 914 | void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader,TTree *treeR,Option_t *opt){ |
7d62fb64 | 915 | // cluster finding and reconstruction of space points |
916 | // the condition below will disappear when the geom class will be | |
917 | // initialized for all versions - for the moment it is only for v5 ! | |
918 | // 7 is the SDD beam test version | |
919 | // Inputs: | |
6cae184e | 920 | // AliRawReader *rawReader Pointer to the raw-data reader |
921 | // TTree *treeR Clusters tree | |
7d62fb64 | 922 | // Outputs: |
923 | // none. | |
924 | // Return: | |
925 | // none. | |
8484b32d | 926 | const char *all = strstr(opt,"All"); |
927 | const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"), | |
928 | strstr(opt,"SSD")}; | |
7d62fb64 | 929 | AliITSClusterFinderV2 *rec = 0; |
930 | Int_t id=0; | |
931 | ||
00a7cc50 | 932 | TClonesArray *array=new TClonesArray("AliITSRecPoint",1000); |
6cae184e | 933 | TBranch *branch = treeR->Branch("ITSRecPoints",&array); |
7d62fb64 | 934 | delete array; |
935 | ||
8e50d897 | 936 | TClonesArray** clusters = new TClonesArray*[GetITSgeom()->GetIndexMax()]; |
937 | for (Int_t iModule = 0; iModule < GetITSgeom()->GetIndexMax(); iModule++) { | |
7d62fb64 | 938 | clusters[iModule] = NULL; |
939 | } | |
940 | for(id=0;id<3;id++){ | |
8484b32d | 941 | if (!all && !det[id]) continue; |
7d62fb64 | 942 | rec = (AliITSClusterFinderV2*)GetReconstructionModel(id); |
c157c94e | 943 | if (!rec) |
944 | AliFatal("The reconstruction class was not instanciated"); | |
6cae184e | 945 | rec->SetDetTypeRec(this); |
7d62fb64 | 946 | rec->RawdataToClusters(rawReader,clusters); |
947 | } | |
948 | Int_t nClusters =0; | |
c157c94e | 949 | TClonesArray *emptyArray=new TClonesArray("AliITSRecPoint"); |
8e50d897 | 950 | for(Int_t iModule=0;iModule<GetITSgeom()->GetIndexMax();iModule++){ |
8484b32d | 951 | id = GetITSgeom()->GetModuleType(iModule); |
952 | if (!all && !det[id]) continue; | |
7d62fb64 | 953 | array = clusters[iModule]; |
954 | if(!array){ | |
c157c94e | 955 | AliDebug(1,Form("data for module %d missing!",iModule)); |
956 | array = emptyArray; | |
7d62fb64 | 957 | } |
6cae184e | 958 | branch->SetAddress(&array); |
959 | treeR->Fill(); | |
7d62fb64 | 960 | nClusters+=array->GetEntriesFast(); |
5ef4644f | 961 | |
962 | if (array != emptyArray) { | |
963 | array->Delete(); | |
964 | delete array; | |
965 | } | |
7d62fb64 | 966 | } |
c157c94e | 967 | delete emptyArray; |
968 | ||
7d62fb64 | 969 | delete[] clusters; |
00a7cc50 | 970 | Info("DigitsToRecPoints", "total number of found recpoints in ITS: %d\n", |
7d62fb64 | 971 | nClusters); |
972 | ||
973 | } | |
974 | ||
8ba39da9 | 975 |