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