1 /***************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Conributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 ////////////////////////////////////////////////////////////////////////
21 // This class defines the "Standard" reconstruction for the ITS //
24 ////////////////////////////////////////////////////////////////////////
25 #include "TObjArray.h"
28 #include "AliCDBManager.h"
29 #include "AliCDBStorage.h"
30 #include "AliCDBEntry.h"
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"
39 #include "AliITSDetTypeRec.h"
40 #include "AliITSgeom.h"
41 #include "AliITSRawCluster.h"
42 #include "AliITSRawClusterSPD.h"
43 #include "AliITSRawClusterSDD.h"
44 #include "AliITSRawClusterSSD.h"
45 #include "AliITSRecPoint.h"
46 #include "AliITSCalibrationSDD.h"
47 #include "AliITSCalibrationSSD.h"
48 #include "AliITSNoiseSSD.h"
49 #include "AliITSGainSSD.h"
50 #include "AliITSBadChannelsSSD.h"
51 #include "AliITSsegmentationSPD.h"
52 #include "AliITSsegmentationSDD.h"
53 #include "AliITSsegmentationSSD.h"
57 const Int_t AliITSDetTypeRec::fgkNdettypes = 3;
58 const Int_t AliITSDetTypeRec::fgkDefaultNModulesSPD = 240;
59 const Int_t AliITSDetTypeRec::fgkDefaultNModulesSDD = 260;
60 const Int_t AliITSDetTypeRec::fgkDefaultNModulesSSD = 1698;
62 ClassImp(AliITSDetTypeRec)
64 //________________________________________________________________
65 AliITSDetTypeRec::AliITSDetTypeRec(): TObject(),
81 // Standard Constructor
89 fReconstruction = new TObjArray(fgkNdettypes);
90 fDigits = new TObjArray(fgkNdettypes);
91 for(Int_t i=0; i<3; i++){
92 fClusterClassName[i]=0;
94 fRecPointClassName[i]=0;
96 fNdtype = new Int_t[fgkNdettypes];
97 fCtype = new TObjArray(fgkNdettypes);
98 fNctype = new Int_t[fgkNdettypes];
99 fNMod = new Int_t [fgkNdettypes];
100 fNMod[0] = fgkDefaultNModulesSPD;
101 fNMod[1] = fgkDefaultNModulesSDD;
102 fNMod[2] = fgkDefaultNModulesSSD;
103 fRecPoints = new TClonesArray("AliITSRecPoint",3000);
106 for(Int_t i=0;i<fgkNdettypes;i++){
114 //______________________________________________________________________
115 AliITSDetTypeRec::AliITSDetTypeRec(const AliITSDetTypeRec & rec):TObject(rec),
117 fITSgeom(rec.fITSgeom),
118 fReconstruction(rec.fReconstruction),
119 fSegmentation(rec.fSegmentation),
120 fCalibration(rec.fCalibration),
121 fPreProcess(rec.fPreProcess),
122 fPostProcess(rec.fPostProcess),
123 fDigits(rec.fDigits),
124 fNdtype(rec.fNdtype),
126 fNctype(rec.fNctype),
127 fRecPoints(rec.fRecPoints),
128 fNRecPoints(rec.fNRecPoints),
129 fSelectedVertexer(rec.fSelectedVertexer),
130 fFirstcall(rec.fFirstcall)
136 //______________________________________________________________________
137 AliITSDetTypeRec& AliITSDetTypeRec::operator=(const AliITSDetTypeRec& source){
138 // Assignment operator.
139 this->~AliITSDetTypeRec();
140 new(this) AliITSDetTypeRec(source);
145 //_____________________________________________________________________
146 AliITSDetTypeRec::~AliITSDetTypeRec(){
150 fReconstruction->Delete();
151 delete fReconstruction;
155 fSegmentation->Delete();
156 delete fSegmentation;
160 AliITSresponse* rspd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSPD()))->GetResponse();
161 AliITSresponse* rsdd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSDD()))->GetResponse();
162 AliITSresponse* rssd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSSD()))->GetResponse();
163 if(rspd) delete rspd;
164 if(rsdd) delete rsdd;
165 if(rssd) delete rssd;
166 fCalibration->Delete();
170 if(fPreProcess) delete fPreProcess;
171 if(fPostProcess) delete fPostProcess;
179 fRecPoints->Delete();
192 if (fITSgeom) delete fITSgeom;
196 //___________________________________________________________________
197 void AliITSDetTypeRec::SetReconstructionModel(Int_t dettype,AliITSClusterFinder *clf){
199 //Set reconstruction model for detector type
201 if(fReconstruction==0) fReconstruction = new TObjArray(fgkNdettypes);
202 if(fReconstruction->At(dettype)!=0) delete fReconstruction->At(dettype);
203 fReconstruction->AddAt(clf,dettype);
205 //______________________________________________________________________
206 AliITSClusterFinder* AliITSDetTypeRec::GetReconstructionModel(Int_t dettype){
208 //Get reconstruction model for detector type
209 if(fReconstruction==0) {
210 Warning("GetReconstructionModel","fReconstruction is 0!");
213 return (AliITSClusterFinder*)fReconstruction->At(dettype);
216 //______________________________________________________________________
217 void AliITSDetTypeRec::SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg){
219 //Set segmentation model for detector type
221 if(fSegmentation==0) fSegmentation = new TObjArray(fgkNdettypes);
222 if(fSegmentation->At(dettype)!=0) delete fSegmentation->At(dettype);
223 fSegmentation->AddAt(seg,dettype);
226 //______________________________________________________________________
227 AliITSsegmentation* AliITSDetTypeRec::GetSegmentationModel(Int_t dettype){
229 //Get segmentation model for detector type
231 if(fSegmentation==0) {
232 Warning("GetSegmentationModel","fSegmentation is 0!");
235 return (AliITSsegmentation*)fSegmentation->At(dettype);
238 //_______________________________________________________________________
239 void AliITSDetTypeRec::SetCalibrationModel(Int_t iMod, AliITSCalibration *cal){
241 //Set calibration (response) for the module iMod of type dettype
242 if (fCalibration==0) {
243 fCalibration = new TObjArray(GetITSgeom()->GetIndexMax());
244 fCalibration->SetOwner(kTRUE);
245 fCalibration->Clear();
248 if (fCalibration->At(iMod) != 0)
249 delete (AliITSCalibration*) fCalibration->At(iMod);
250 fCalibration->AddAt(cal,iMod);
253 //_______________________________________________________________________
254 AliITSCalibration* AliITSDetTypeRec::GetCalibrationModel(Int_t iMod){
256 //Get calibration model for module type
258 if(fCalibration==0) {
259 Warning("GetalibrationModel","fCalibration is 0!");
263 return (AliITSCalibration*)fCalibration->At(iMod);
266 //______________________________________________________________________
267 void AliITSDetTypeRec::SetTreeAddressD(TTree *treeD){
268 // Set branch address for the tree of digits.
270 const char *det[4] = {"SPD","SDD","SSD","ITS"};
277 if (fDigits == 0x0) fDigits = new TObjArray(fgkNdettypes);
278 for (i=0; i<fgkNdettypes; i++) {
279 digclass = GetDigitClassName(i);
280 if(!(fDigits->At(i))) {
281 fDigits->AddAt(new TClonesArray(digclass,1000),i);
285 if (fgkNdettypes==3) sprintf(branchname,"%sDigits%s",det[3],det[i]);
286 else sprintf(branchname,"%sDigits%d",det[3],i+1);
288 branch = treeD->GetBranch(branchname);
289 if (branch) branch->SetAddress(&((*fDigits)[i]));
294 //_______________________________________________________________________
295 TBranch* AliITSDetTypeRec::MakeBranchInTree(TTree *tree, const char* name,
296 const char *classname,
297 void* address,Int_t size,
301 // Makes branch in given tree and diverts them to a separate file
307 Error("MakeBranchInTree","Making Branch %s Tree is NULL",name);
310 TBranch *branch = tree->GetBranch(name);
315 branch = tree->Branch(name,classname,address,size,splitlevel);
318 branch = tree->Bronch(name, "TClonesArray", address, size, splitlevel);
324 //____________________________________________________________________
325 void AliITSDetTypeRec::SetDefaults(){
327 //Set defaults for segmentation and response
330 Warning("SetDefaults","null pointer to AliITSgeomGeom !");
334 AliITSsegmentation* seg;
335 if(!GetCalibration()) {AliFatal("Exit");exit(0);}
337 for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
339 seg = new AliITSsegmentationSPD(GetITSgeom());
340 SetSegmentationModel(dettype,seg);
341 SetDigitClassName(dettype,"AliITSdigitSPD");
342 SetClusterClassName(dettype,"AliITSRawClusterSPD");
346 AliITSCalibrationSDD* res=(AliITSCalibrationSDD*) GetCalibrationModel(GetITSgeom()->GetStartSDD());
347 seg = new AliITSsegmentationSDD(GetITSgeom(),res);
348 SetSegmentationModel(dettype,seg);
349 const char *kopt = ((AliITSresponseSDD*)res->GetResponse())->ZeroSuppOption();
350 if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D"))) SetDigitClassName(dettype,"AliITSdigit");
351 else SetDigitClassName(dettype,"AliITSdigitSDD");
352 SetClusterClassName(dettype,"AliITSRawClusterSDD");
356 AliITSsegmentationSSD* seg2 = new AliITSsegmentationSSD(GetITSgeom());
357 seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
358 seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
359 seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
360 SetSegmentationModel(dettype,seg2);
361 SetDigitClassName(dettype,"AliITSdigitSSD");
362 SetClusterClassName(dettype,"AliITSRawClusterSSD");
367 //______________________________________________________________________
368 Bool_t AliITSDetTypeRec::GetCalibration() {
369 // Get Default calibration if a storage is not defined.
372 AliITSCalibration* cal = GetCalibrationModel(0);
379 // SetRunNumber((Int_t)AliCDBManager::Instance()->GetRun());
380 // Int_t run=GetRunNumber();
382 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
383 if (fCalibration==0) {
384 fCalibration = new TObjArray(GetITSgeom()->GetIndexMax());
385 fCalibration->SetOwner(!cacheStatus);
386 fCalibration->Clear();
389 AliCDBEntry *entrySPD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSPD");
390 AliCDBEntry *entrySDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD");
392 // AliCDBEntry *entrySSD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSSD");
393 AliCDBEntry *entryNoiseSSD = AliCDBManager::Instance()->Get("ITS/Calib/NoiseSSD");
394 AliCDBEntry *entryGainSSD = AliCDBManager::Instance()->Get("ITS/Calib/GainSSD");
395 AliCDBEntry *entryBadChannelsSSD = AliCDBManager::Instance()->Get("ITS/Calib/BadChannelsSSD");
397 AliCDBEntry *entry2SPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD");
398 AliCDBEntry *entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD");
399 AliCDBEntry *entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD");
401 if(!entrySPD || !entrySDD || !entryNoiseSSD || !entryGainSSD || !entryBadChannelsSSD ||
402 !entry2SPD || !entry2SDD || !entry2SSD){
403 AliFatal("Calibration object retrieval failed! ");
407 TObjArray *calSPD = (TObjArray *)entrySPD->GetObject();
408 if(!cacheStatus)entrySPD->SetObject(NULL);
409 entrySPD->SetOwner(kTRUE);
411 AliITSresponseSPD *pSPD = (AliITSresponseSPD*)entry2SPD->GetObject();
412 if(!cacheStatus)entry2SPD->SetObject(NULL);
413 entry2SPD->SetOwner(kTRUE);
415 TObjArray *calSDD = (TObjArray *)entrySDD->GetObject();
416 if(!cacheStatus)entrySDD->SetObject(NULL);
417 entrySDD->SetOwner(kTRUE);
419 AliITSresponseSDD *pSDD = (AliITSresponseSDD*)entry2SDD->GetObject();
420 if(!cacheStatus)entry2SDD->SetObject(NULL);
421 entry2SDD->SetOwner(kTRUE);
423 TObjArray *noiseSSD = (TObjArray *)entryNoiseSSD->GetObject();
424 if(!cacheStatus)entryNoiseSSD->SetObject(NULL);
425 entryNoiseSSD->SetOwner(kTRUE);
427 TObjArray *gainSSD = (TObjArray *)entryGainSSD->GetObject();
428 if(!cacheStatus)entryGainSSD->SetObject(NULL);
429 entryGainSSD->SetOwner(kTRUE);
431 TObjArray *badchannelsSSD = (TObjArray *)entryBadChannelsSSD->GetObject();
432 if(!cacheStatus)entryBadChannelsSSD->SetObject(NULL);
433 entryBadChannelsSSD->SetOwner(kTRUE);
435 AliITSresponseSSD *pSSD = (AliITSresponseSSD*)entry2SSD->GetObject();
436 if(!cacheStatus)entry2SSD->SetObject(NULL);
437 entry2SSD->SetOwner(kTRUE);
439 // DB entries are deleted. In this way metadeta objects are deleted as well
443 delete entryNoiseSSD;
445 delete entryBadChannelsSSD;
451 if ((!pSPD)||(!pSDD)||(!pSSD) || (!calSPD) || (!calSDD)
452 || (!noiseSSD)|| (!gainSSD)|| (!badchannelsSSD)) {
453 AliWarning("Can not get calibration from calibration database !");
457 fNMod[0] = calSPD->GetEntries();
458 fNMod[1] = calSDD->GetEntries();
459 fNMod[2] = noiseSSD->GetEntries();
460 AliInfo(Form("%i SPD, %i SDD and %i SSD in calibration database",
461 fNMod[0], fNMod[1], fNMod[2]));
462 AliITSCalibration* cal;
463 for (Int_t i=0; i<fNMod[0]; i++) {
464 cal = (AliITSCalibration*) calSPD->At(i);
465 cal->SetResponse((AliITSresponse*)pSPD);
466 SetCalibrationModel(i, cal);
468 for (Int_t i=0; i<fNMod[1]; i++) {
469 cal = (AliITSCalibration*) calSDD->At(i);
470 cal->SetResponse((AliITSresponse*)pSDD);
471 Int_t iMod = i + fNMod[0];
472 SetCalibrationModel(iMod, cal);
474 for (Int_t i=0; i<fNMod[2]; i++) {
476 AliITSCalibrationSSD *calibSSD = new AliITSCalibrationSSD();
477 calibSSD->SetResponse((AliITSresponse*)pSSD);
479 AliITSNoiseSSD *noise = (AliITSNoiseSSD*) (noiseSSD->At(i));
480 calibSSD->SetNoise(noise);
481 AliITSGainSSD *gain = (AliITSGainSSD*) (gainSSD->At(i));
482 calibSSD->SetGain(gain);
483 AliITSBadChannelsSSD *bad = (AliITSBadChannelsSSD*) (badchannelsSSD->At(i));
484 calibSSD->SetBadChannels(bad);
486 Int_t iMod = i + fNMod[0] + fNMod[1];
487 SetCalibrationModel(iMod, calibSSD);
494 //________________________________________________________________
495 void AliITSDetTypeRec::SetDefaultClusterFinders(){
497 //set defaults for standard cluster finder
500 Warning("SetDefaults","null pointer to AliITSgeom!");
504 AliITSClusterFinder *clf;
506 for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
509 if(!GetReconstructionModel(dettype)){
510 TClonesArray *dig0 = DigitsAddress(0);
511 TClonesArray *rec0 = ClustersAddress(0);
512 clf = new AliITSClusterFinderSPD(this,dig0,rec0);
513 SetReconstructionModel(dettype,clf);
520 if(!GetReconstructionModel(dettype)){
521 TClonesArray *dig1 = DigitsAddress(1);
522 TClonesArray *rec1 = ClustersAddress(1);
523 clf = new AliITSClusterFinderSDD(this,dig1,rec1);
524 SetReconstructionModel(dettype,clf);
530 if(!GetReconstructionModel(dettype)){
531 TClonesArray* dig2 = DigitsAddress(2);
532 clf = new AliITSClusterFinderSSD(this,dig2);
533 SetReconstructionModel(dettype,clf);
542 //________________________________________________________________
543 void AliITSDetTypeRec::SetDefaultClusterFindersV2(Bool_t rawdata){
545 //Set defaults for cluster finder V2
548 Warning("SetDefaults","Null pointer to AliITSgeom !");
552 AliITSClusterFinder *clf;
554 for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
557 if(!GetReconstructionModel(dettype)){
558 clf = new AliITSClusterFinderV2SPD(this);
560 if(!rawdata) clf->SetDigits(DigitsAddress(0));
561 SetReconstructionModel(dettype,clf);
567 if(!GetReconstructionModel(dettype)){
568 clf = new AliITSClusterFinderV2SDD(this);
570 if(!rawdata) clf->SetDigits(DigitsAddress(1));
571 SetReconstructionModel(dettype,clf);
578 if(!GetReconstructionModel(dettype)){
579 clf = new AliITSClusterFinderV2SSD(this);
581 if(!rawdata) clf->SetDigits(DigitsAddress(2));
582 SetReconstructionModel(dettype,clf);
589 //______________________________________________________________________
590 void AliITSDetTypeRec::MakeBranch(TTree* tree, Option_t* option){
592 //Creates branches for clusters and recpoints
593 Bool_t cR = (strstr(option,"R")!=0);
594 Bool_t cRF = (strstr(option,"RF")!=0);
598 if(cR) MakeBranchR(tree);
599 if(cRF) MakeBranchRF(tree);
603 //___________________________________________________________________
604 void AliITSDetTypeRec::AddCluster(Int_t id, AliITSRawCluster *c){
606 // Adds a raw cluster to the list
607 TClonesArray &lc = *((TClonesArray*)fCtype->At(id));
610 new(lc[fNctype[id]++]) AliITSRawClusterSPD(*((AliITSRawClusterSPD*)c));
613 new(lc[fNctype[id]++]) AliITSRawClusterSDD(*((AliITSRawClusterSDD*)c));
616 new(lc[fNctype[id]++]) AliITSRawClusterSSD(*((AliITSRawClusterSSD*)c));
620 //___________________________________________________________________
621 void AliITSDetTypeRec::ResetDigits(){
622 // Reset number of digits and the digits array for the ITS detector.
625 for(Int_t i=0;i<fgkNdettypes;i++){
629 //___________________________________________________________________
630 void AliITSDetTypeRec::ResetDigits(Int_t branch){
631 // Reset number of digits and the digits array for this branch.
633 if(fDigits->At(branch)) ((TClonesArray*)fDigits->At(branch))->Clear();
634 if(fNdtype) fNdtype[branch]=0;
638 //__________________________________________________________________
639 void AliITSDetTypeRec::ResetClusters(){
641 //Resets number of clusters and the cluster array
642 for(Int_t i=0;i<fgkNdettypes;i++){
647 //__________________________________________________________________
648 void AliITSDetTypeRec::ResetClusters(Int_t i){
650 //Resets number of clusters and the cluster array for this branch
652 if (fCtype->At(i)) ((TClonesArray*)fCtype->At(i))->Clear();
653 if (fNctype) fNctype[i]=0;
655 //__________________________________________________________________
656 void AliITSDetTypeRec::MakeBranchR(TTree *treeR, Option_t *opt){
658 //Creates tree branches for recpoints
660 // cont char *file File name where RecPoints branch is to be written
661 // to. If blank it write the SDigits to the same
662 // file in which the Hits were found.
667 // only one branch for rec points for all detector types
668 Bool_t oFast= (strstr(opt,"Fast")!=0);
670 Char_t detname[10] = "ITS";
674 sprintf(branchname,"%sRecPointsF",detname);
676 sprintf(branchname,"%sRecPoints",detname);
679 if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPoint",1000);
681 MakeBranchInTree(treeR,branchname,0,&fRecPoints,buffsz,99);
683 //______________________________________________________________________
684 void AliITSDetTypeRec::SetTreeAddressR(TTree *treeR){
685 // Set branch address for the Reconstructed points Trees.
687 // TTree *treeR Tree containing the RecPoints.
693 Char_t namedet[10]="ITS";
696 if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000);
698 sprintf(branchname,"%sRecPoints",namedet);
699 branch = treeR->GetBranch(branchname);
701 branch->SetAddress(&fRecPoints);
703 sprintf(branchname,"%sRecPointsF",namedet);
704 branch = treeR->GetBranch(branchname);
706 branch->SetAddress(&fRecPoints);
711 //____________________________________________________________________
712 void AliITSDetTypeRec::AddRecPoint(const AliITSRecPoint &r){
713 // Add a reconstructed space point to the list
715 // const AliITSRecPoint &r RecPoint class to be added to the tree
716 // of reconstructed points TreeR.
722 TClonesArray &lrecp = *fRecPoints;
723 new(lrecp[fNRecPoints++]) AliITSRecPoint(r);
726 //______________________________________________________________________
727 void AliITSDetTypeRec::DigitsToRecPoints(TTree *treeD,TTree *treeR,Int_t lastentry,Option_t *opt, Bool_t v2){
728 // cluster finding and reconstruction of space points
729 // the condition below will disappear when the geom class will be
730 // initialized for all versions - for the moment it is only for v5 !
731 // 7 is the SDD beam test version
733 // TTree *treeD Digits tree
734 // TTree *treeR Clusters tree
735 // Int_t lastentry Offset for module when not all of the modules
737 // Option_t *opt String indicating which ITS sub-detectors should
738 // be processed. If ="All" then all of the ITS
739 // sub detectors are processed.
741 const char *all = strstr(opt,"All");
742 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
745 SetDefaultClusterFinders();
746 AliInfo("Original cluster finder has been selected\n");
749 SetDefaultClusterFindersV2();
750 AliInfo("V2 cluster finder has been selected \n");
753 AliITSClusterFinder *rec = 0;
754 Int_t id,module,first=0;
755 for(module=0;module<GetITSgeom()->GetIndexMax();module++){
756 id = GetITSgeom()->GetModuleType(module);
757 if (!all && !det[id]) continue;
758 if(det[id]) first = GetITSgeom()->GetStartDet(id);
759 rec = (AliITSClusterFinder*)GetReconstructionModel(id);
760 TClonesArray *itsDigits = DigitsAddress(id);
762 AliFatal("The reconstruction class was not instanciated!");
763 ResetDigits(); // MvL: Not sure we neeed this when rereading anyways
765 treeD->GetEvent(lastentry+module);
767 treeD->GetEvent(lastentry+(module-first));
769 Int_t ndigits = itsDigits->GetEntriesFast();
771 rec->SetDetTypeRec(this);
772 rec->SetDigits(DigitsAddress(id));
773 // rec->SetClusters(ClustersAddress(id));
774 rec->FindRawClusters(module);
781 //______________________________________________________________________
782 void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader,TTree *treeR,Option_t *opt){
783 // cluster finding and reconstruction of space points
784 // the condition below will disappear when the geom class will be
785 // initialized for all versions - for the moment it is only for v5 !
786 // 7 is the SDD beam test version
788 // AliRawReader *rawReader Pointer to the raw-data reader
789 // TTree *treeR Clusters tree
794 const char *all = strstr(opt,"All");
795 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
797 AliITSClusterFinderV2 *rec = 0;
800 TClonesArray *array=new TClonesArray("AliITSRecPoint",1000);
801 TBranch *branch = treeR->Branch("ITSRecPoints",&array);
804 TClonesArray** clusters = new TClonesArray*[GetITSgeom()->GetIndexMax()];
805 for (Int_t iModule = 0; iModule < GetITSgeom()->GetIndexMax(); iModule++) {
806 clusters[iModule] = NULL;
809 if (!all && !det[id]) continue;
810 rec = (AliITSClusterFinderV2*)GetReconstructionModel(id);
812 AliFatal("The reconstruction class was not instanciated");
813 rec->SetDetTypeRec(this);
814 rec->RawdataToClusters(rawReader,clusters);
817 TClonesArray *emptyArray=new TClonesArray("AliITSRecPoint");
818 for(Int_t iModule=0;iModule<GetITSgeom()->GetIndexMax();iModule++){
819 id = GetITSgeom()->GetModuleType(iModule);
820 if (!all && !det[id]) continue;
821 array = clusters[iModule];
823 AliDebug(1,Form("data for module %d missing!",iModule));
826 branch->SetAddress(&array);
828 nClusters+=array->GetEntriesFast();
830 if (array != emptyArray) {
838 Info("DigitsToRecPoints", "total number of found recpoints in ITS: %d\n",