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 "AliITSMapSDD.h"
48 #include "AliITSCalibrationSSD.h"
49 #include "AliITSNoiseSSD.h"
50 #include "AliITSGainSSD.h"
51 #include "AliITSBadChannelsSSD.h"
52 #include "AliITSsegmentationSPD.h"
53 #include "AliITSsegmentationSDD.h"
54 #include "AliITSsegmentationSSD.h"
58 const Int_t AliITSDetTypeRec::fgkNdettypes = 3;
59 const Int_t AliITSDetTypeRec::fgkDefaultNModulesSPD = 240;
60 const Int_t AliITSDetTypeRec::fgkDefaultNModulesSDD = 260;
61 const Int_t AliITSDetTypeRec::fgkDefaultNModulesSSD = 1698;
63 ClassImp(AliITSDetTypeRec)
65 //________________________________________________________________
66 AliITSDetTypeRec::AliITSDetTypeRec(): TObject(),
82 // Standard Constructor
90 fReconstruction = new TObjArray(fgkNdettypes);
91 fDigits = new TObjArray(fgkNdettypes);
92 for(Int_t i=0; i<3; i++){
93 fClusterClassName[i]=0;
95 fRecPointClassName[i]=0;
97 fNdtype = new Int_t[fgkNdettypes];
98 fCtype = new TObjArray(fgkNdettypes);
99 fNctype = new Int_t[fgkNdettypes];
100 fNMod = new Int_t [fgkNdettypes];
101 fNMod[0] = fgkDefaultNModulesSPD;
102 fNMod[1] = fgkDefaultNModulesSDD;
103 fNMod[2] = fgkDefaultNModulesSSD;
104 fRecPoints = new TClonesArray("AliITSRecPoint",3000);
107 for(Int_t i=0;i<fgkNdettypes;i++){
115 //______________________________________________________________________
116 AliITSDetTypeRec::AliITSDetTypeRec(const AliITSDetTypeRec & rec):TObject(rec),
118 fITSgeom(rec.fITSgeom),
119 fReconstruction(rec.fReconstruction),
120 fSegmentation(rec.fSegmentation),
121 fCalibration(rec.fCalibration),
122 fPreProcess(rec.fPreProcess),
123 fPostProcess(rec.fPostProcess),
124 fDigits(rec.fDigits),
125 fNdtype(rec.fNdtype),
127 fNctype(rec.fNctype),
128 fRecPoints(rec.fRecPoints),
129 fNRecPoints(rec.fNRecPoints),
130 fSelectedVertexer(rec.fSelectedVertexer),
131 fFirstcall(rec.fFirstcall)
137 //______________________________________________________________________
138 AliITSDetTypeRec& AliITSDetTypeRec::operator=(const AliITSDetTypeRec& source){
139 // Assignment operator.
140 this->~AliITSDetTypeRec();
141 new(this) AliITSDetTypeRec(source);
146 //_____________________________________________________________________
147 AliITSDetTypeRec::~AliITSDetTypeRec(){
151 fReconstruction->Delete();
152 delete fReconstruction;
156 fSegmentation->Delete();
157 delete fSegmentation;
161 AliITSresponse* rspd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSPD()))->GetResponse();
162 AliITSresponse* rsdd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSDD()))->GetResponse();
163 AliITSresponse* rssd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSSD()))->GetResponse();
164 if(rspd) delete rspd;
165 if(rsdd) delete rsdd;
166 if(rssd) delete rssd;
167 fCalibration->Delete();
171 if(fPreProcess) delete fPreProcess;
172 if(fPostProcess) delete fPostProcess;
180 fRecPoints->Delete();
193 if (fITSgeom) delete fITSgeom;
197 //___________________________________________________________________
198 void AliITSDetTypeRec::SetReconstructionModel(Int_t dettype,AliITSClusterFinder *clf){
200 //Set reconstruction model for detector type
202 if(fReconstruction==0) fReconstruction = new TObjArray(fgkNdettypes);
203 if(fReconstruction->At(dettype)!=0) delete fReconstruction->At(dettype);
204 fReconstruction->AddAt(clf,dettype);
206 //______________________________________________________________________
207 AliITSClusterFinder* AliITSDetTypeRec::GetReconstructionModel(Int_t dettype){
209 //Get reconstruction model for detector type
210 if(fReconstruction==0) {
211 Warning("GetReconstructionModel","fReconstruction is 0!");
214 return (AliITSClusterFinder*)fReconstruction->At(dettype);
217 //______________________________________________________________________
218 void AliITSDetTypeRec::SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg){
220 //Set segmentation model for detector type
222 if(fSegmentation==0) fSegmentation = new TObjArray(fgkNdettypes);
223 if(fSegmentation->At(dettype)!=0) delete fSegmentation->At(dettype);
224 fSegmentation->AddAt(seg,dettype);
227 //______________________________________________________________________
228 AliITSsegmentation* AliITSDetTypeRec::GetSegmentationModel(Int_t dettype){
230 //Get segmentation model for detector type
232 if(fSegmentation==0) {
233 Warning("GetSegmentationModel","fSegmentation is 0!");
236 return (AliITSsegmentation*)fSegmentation->At(dettype);
239 //_______________________________________________________________________
240 void AliITSDetTypeRec::SetCalibrationModel(Int_t iMod, AliITSCalibration *cal){
242 //Set calibration (response) for the module iMod of type dettype
243 if (fCalibration==0) {
244 fCalibration = new TObjArray(GetITSgeom()->GetIndexMax());
245 fCalibration->SetOwner(kTRUE);
246 fCalibration->Clear();
249 if (fCalibration->At(iMod) != 0)
250 delete (AliITSCalibration*) fCalibration->At(iMod);
251 fCalibration->AddAt(cal,iMod);
254 //_______________________________________________________________________
255 AliITSCalibration* AliITSDetTypeRec::GetCalibrationModel(Int_t iMod){
257 //Get calibration model for module type
259 if(fCalibration==0) {
260 Warning("GetalibrationModel","fCalibration is 0!");
264 return (AliITSCalibration*)fCalibration->At(iMod);
267 //______________________________________________________________________
268 void AliITSDetTypeRec::SetTreeAddressD(TTree *treeD){
269 // Set branch address for the tree of digits.
271 const char *det[4] = {"SPD","SDD","SSD","ITS"};
278 if (fDigits == 0x0) fDigits = new TObjArray(fgkNdettypes);
279 for (i=0; i<fgkNdettypes; i++) {
280 digclass = GetDigitClassName(i);
281 if(!(fDigits->At(i))) {
282 fDigits->AddAt(new TClonesArray(digclass,1000),i);
286 if (fgkNdettypes==3) sprintf(branchname,"%sDigits%s",det[3],det[i]);
287 else sprintf(branchname,"%sDigits%d",det[3],i+1);
289 branch = treeD->GetBranch(branchname);
290 if (branch) branch->SetAddress(&((*fDigits)[i]));
295 //_______________________________________________________________________
296 TBranch* AliITSDetTypeRec::MakeBranchInTree(TTree *tree, const char* name,
297 const char *classname,
298 void* address,Int_t size,
302 // Makes branch in given tree and diverts them to a separate file
308 Error("MakeBranchInTree","Making Branch %s Tree is NULL",name);
311 TBranch *branch = tree->GetBranch(name);
316 branch = tree->Branch(name,classname,address,size,splitlevel);
319 branch = tree->Bronch(name, "TClonesArray", address, size, splitlevel);
325 //____________________________________________________________________
326 void AliITSDetTypeRec::SetDefaults(){
328 //Set defaults for segmentation and response
331 Warning("SetDefaults","null pointer to AliITSgeomGeom !");
335 AliITSsegmentation* seg;
336 if(!GetCalibration()) {AliFatal("Exit");exit(0);}
338 for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
340 seg = new AliITSsegmentationSPD(GetITSgeom());
341 SetSegmentationModel(dettype,seg);
342 SetDigitClassName(dettype,"AliITSdigitSPD");
343 SetClusterClassName(dettype,"AliITSRawClusterSPD");
347 AliITSCalibrationSDD* res=(AliITSCalibrationSDD*) GetCalibrationModel(GetITSgeom()->GetStartSDD());
348 seg = new AliITSsegmentationSDD(GetITSgeom(),res);
349 SetSegmentationModel(dettype,seg);
350 const char *kopt = ((AliITSresponseSDD*)res->GetResponse())->ZeroSuppOption();
351 if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D"))) SetDigitClassName(dettype,"AliITSdigit");
352 else SetDigitClassName(dettype,"AliITSdigitSDD");
353 SetClusterClassName(dettype,"AliITSRawClusterSDD");
357 AliITSsegmentationSSD* seg2 = new AliITSsegmentationSSD(GetITSgeom());
358 seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
359 seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
360 seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
361 SetSegmentationModel(dettype,seg2);
362 SetDigitClassName(dettype,"AliITSdigitSSD");
363 SetClusterClassName(dettype,"AliITSRawClusterSSD");
368 //______________________________________________________________________
369 Bool_t AliITSDetTypeRec::GetCalibration() {
370 // Get Default calibration if a storage is not defined.
373 AliITSCalibration* cal = GetCalibrationModel(0);
380 // SetRunNumber((Int_t)AliCDBManager::Instance()->GetRun());
381 // Int_t run=GetRunNumber();
383 Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
384 if (fCalibration==0) {
385 fCalibration = new TObjArray(GetITSgeom()->GetIndexMax());
386 fCalibration->SetOwner(!cacheStatus);
387 fCalibration->Clear();
390 AliCDBEntry *entrySPD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSPD");
391 AliCDBEntry *entrySDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD");
393 // AliCDBEntry *entrySSD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSSD");
394 AliCDBEntry *entryNoiseSSD = AliCDBManager::Instance()->Get("ITS/Calib/NoiseSSD");
395 AliCDBEntry *entryGainSSD = AliCDBManager::Instance()->Get("ITS/Calib/GainSSD");
396 AliCDBEntry *entryBadChannelsSSD = AliCDBManager::Instance()->Get("ITS/Calib/BadChannelsSSD");
398 AliCDBEntry *entry2SPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD");
399 AliCDBEntry *entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD");
400 AliCDBEntry *entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD");
401 AliCDBEntry *mapASDD = AliCDBManager::Instance()->Get("ITS/Calib/MapsAnodeSDD");
402 AliCDBEntry *mapTSDD = AliCDBManager::Instance()->Get("ITS/Calib/MapsTimeSDD");
404 if(!entrySPD || !entrySDD || !entryNoiseSSD || !entryGainSSD || !entryBadChannelsSSD ||
405 !entry2SPD || !entry2SDD || !entry2SSD || !mapASDD || !mapTSDD){
406 AliFatal("Calibration object retrieval failed! ");
410 TObjArray *calSPD = (TObjArray *)entrySPD->GetObject();
411 if(!cacheStatus)entrySPD->SetObject(NULL);
412 entrySPD->SetOwner(kTRUE);
414 AliITSresponseSPD *pSPD = (AliITSresponseSPD*)entry2SPD->GetObject();
415 if(!cacheStatus)entry2SPD->SetObject(NULL);
416 entry2SPD->SetOwner(kTRUE);
418 TObjArray *calSDD = (TObjArray *)entrySDD->GetObject();
419 if(!cacheStatus)entrySDD->SetObject(NULL);
420 entrySDD->SetOwner(kTRUE);
422 AliITSresponseSDD *pSDD = (AliITSresponseSDD*)entry2SDD->GetObject();
423 if(!cacheStatus)entry2SDD->SetObject(NULL);
424 entry2SDD->SetOwner(kTRUE);
426 TObjArray *mapAn = (TObjArray *)mapASDD->GetObject();
427 if(!cacheStatus)mapASDD->SetObject(NULL);
428 mapASDD->SetOwner(kTRUE);
430 TObjArray *mapT = (TObjArray *)mapTSDD->GetObject();
431 if(!cacheStatus)mapTSDD->SetObject(NULL);
432 mapTSDD->SetOwner(kTRUE);
434 TObjArray *noiseSSD = (TObjArray *)entryNoiseSSD->GetObject();
435 if(!cacheStatus)entryNoiseSSD->SetObject(NULL);
436 entryNoiseSSD->SetOwner(kTRUE);
438 TObjArray *gainSSD = (TObjArray *)entryGainSSD->GetObject();
439 if(!cacheStatus)entryGainSSD->SetObject(NULL);
440 entryGainSSD->SetOwner(kTRUE);
442 TObjArray *badchannelsSSD = (TObjArray *)entryBadChannelsSSD->GetObject();
443 if(!cacheStatus)entryBadChannelsSSD->SetObject(NULL);
444 entryBadChannelsSSD->SetOwner(kTRUE);
446 AliITSresponseSSD *pSSD = (AliITSresponseSSD*)entry2SSD->GetObject();
447 if(!cacheStatus)entry2SSD->SetObject(NULL);
448 entry2SSD->SetOwner(kTRUE);
450 // DB entries are deleted. In this way metadeta objects are deleted as well
454 delete entryNoiseSSD;
456 delete entryBadChannelsSSD;
464 if ((!pSPD)||(!pSDD)||(!pSSD) || (!calSPD) || (!calSDD)
465 || (!mapAn) || (!mapT) || (!noiseSSD)|| (!gainSSD)|| (!badchannelsSSD)) {
466 AliWarning("Can not get calibration from calibration database !");
470 fNMod[0] = calSPD->GetEntries();
471 fNMod[1] = calSDD->GetEntries();
472 fNMod[2] = noiseSSD->GetEntries();
473 AliInfo(Form("%i SPD, %i SDD and %i SSD in calibration database",
474 fNMod[0], fNMod[1], fNMod[2]));
475 AliITSCalibration* cal;
476 for (Int_t i=0; i<fNMod[0]; i++) {
477 cal = (AliITSCalibration*) calSPD->At(i);
478 cal->SetResponse((AliITSresponse*)pSPD);
479 SetCalibrationModel(i, cal);
483 for (Int_t i=0; i<fNMod[1]; i++) {
484 cal = (AliITSCalibration*) calSDD->At(i);
485 cal->SetResponse((AliITSresponse*)pSDD);
486 AliITSMapSDD* m1 = (AliITSMapSDD*)mapAn->At(nn1);nn1++;
487 AliITSMapSDD* m2 = (AliITSMapSDD*)mapAn->At(nn1);nn1++;
488 AliITSMapSDD* m3 = (AliITSMapSDD*)mapT->At(nn2);nn2++;
489 AliITSMapSDD* m4 = (AliITSMapSDD*)mapT->At(nn2);nn2++;
494 Int_t iMod = i + fNMod[0];
495 SetCalibrationModel(iMod, cal);
497 for (Int_t i=0; i<fNMod[2]; i++) {
499 AliITSCalibrationSSD *calibSSD = new AliITSCalibrationSSD();
500 calibSSD->SetResponse((AliITSresponse*)pSSD);
502 AliITSNoiseSSD *noise = (AliITSNoiseSSD*) (noiseSSD->At(i));
503 calibSSD->SetNoise(noise);
504 AliITSGainSSD *gain = (AliITSGainSSD*) (gainSSD->At(i));
505 calibSSD->SetGain(gain);
506 AliITSBadChannelsSSD *bad = (AliITSBadChannelsSSD*) (badchannelsSSD->At(i));
507 calibSSD->SetBadChannels(bad);
509 Int_t iMod = i + fNMod[0] + fNMod[1];
510 SetCalibrationModel(iMod, calibSSD);
517 //________________________________________________________________
518 void AliITSDetTypeRec::SetDefaultClusterFinders(){
520 //set defaults for standard cluster finder
523 Warning("SetDefaults","null pointer to AliITSgeom!");
527 AliITSClusterFinder *clf;
529 for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
532 if(!GetReconstructionModel(dettype)){
533 TClonesArray *dig0 = DigitsAddress(0);
534 TClonesArray *rec0 = ClustersAddress(0);
535 clf = new AliITSClusterFinderSPD(this,dig0,rec0);
536 SetReconstructionModel(dettype,clf);
543 if(!GetReconstructionModel(dettype)){
544 TClonesArray *dig1 = DigitsAddress(1);
545 TClonesArray *rec1 = ClustersAddress(1);
546 clf = new AliITSClusterFinderSDD(this,dig1,rec1);
547 SetReconstructionModel(dettype,clf);
553 if(!GetReconstructionModel(dettype)){
554 TClonesArray* dig2 = DigitsAddress(2);
555 clf = new AliITSClusterFinderSSD(this,dig2);
556 SetReconstructionModel(dettype,clf);
565 //________________________________________________________________
566 void AliITSDetTypeRec::SetDefaultClusterFindersV2(Bool_t rawdata){
568 //Set defaults for cluster finder V2
571 Warning("SetDefaults","Null pointer to AliITSgeom !");
575 AliITSClusterFinder *clf;
577 for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
580 if(!GetReconstructionModel(dettype)){
581 clf = new AliITSClusterFinderV2SPD(this);
583 if(!rawdata) clf->SetDigits(DigitsAddress(0));
584 SetReconstructionModel(dettype,clf);
590 if(!GetReconstructionModel(dettype)){
591 clf = new AliITSClusterFinderV2SDD(this);
593 if(!rawdata) clf->SetDigits(DigitsAddress(1));
594 SetReconstructionModel(dettype,clf);
601 if(!GetReconstructionModel(dettype)){
602 clf = new AliITSClusterFinderV2SSD(this);
604 if(!rawdata) clf->SetDigits(DigitsAddress(2));
605 SetReconstructionModel(dettype,clf);
612 //______________________________________________________________________
613 void AliITSDetTypeRec::MakeBranch(TTree* tree, Option_t* option){
615 //Creates branches for clusters and recpoints
616 Bool_t cR = (strstr(option,"R")!=0);
617 Bool_t cRF = (strstr(option,"RF")!=0);
621 if(cR) MakeBranchR(tree);
622 if(cRF) MakeBranchRF(tree);
626 //___________________________________________________________________
627 void AliITSDetTypeRec::AddCluster(Int_t id, AliITSRawCluster *c){
629 // Adds a raw cluster to the list
630 TClonesArray &lc = *((TClonesArray*)fCtype->At(id));
633 new(lc[fNctype[id]++]) AliITSRawClusterSPD(*((AliITSRawClusterSPD*)c));
636 new(lc[fNctype[id]++]) AliITSRawClusterSDD(*((AliITSRawClusterSDD*)c));
639 new(lc[fNctype[id]++]) AliITSRawClusterSSD(*((AliITSRawClusterSSD*)c));
643 //___________________________________________________________________
644 void AliITSDetTypeRec::ResetDigits(){
645 // Reset number of digits and the digits array for the ITS detector.
648 for(Int_t i=0;i<fgkNdettypes;i++){
652 //___________________________________________________________________
653 void AliITSDetTypeRec::ResetDigits(Int_t branch){
654 // Reset number of digits and the digits array for this branch.
656 if(fDigits->At(branch)) ((TClonesArray*)fDigits->At(branch))->Clear();
657 if(fNdtype) fNdtype[branch]=0;
661 //__________________________________________________________________
662 void AliITSDetTypeRec::ResetClusters(){
664 //Resets number of clusters and the cluster array
665 for(Int_t i=0;i<fgkNdettypes;i++){
670 //__________________________________________________________________
671 void AliITSDetTypeRec::ResetClusters(Int_t i){
673 //Resets number of clusters and the cluster array for this branch
675 if (fCtype->At(i)) ((TClonesArray*)fCtype->At(i))->Clear();
676 if (fNctype) fNctype[i]=0;
678 //__________________________________________________________________
679 void AliITSDetTypeRec::MakeBranchR(TTree *treeR, Option_t *opt){
681 //Creates tree branches for recpoints
683 // cont char *file File name where RecPoints branch is to be written
684 // to. If blank it write the SDigits to the same
685 // file in which the Hits were found.
690 // only one branch for rec points for all detector types
691 Bool_t oFast= (strstr(opt,"Fast")!=0);
693 Char_t detname[10] = "ITS";
697 sprintf(branchname,"%sRecPointsF",detname);
699 sprintf(branchname,"%sRecPoints",detname);
702 if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPoint",1000);
704 MakeBranchInTree(treeR,branchname,0,&fRecPoints,buffsz,99);
706 //______________________________________________________________________
707 void AliITSDetTypeRec::SetTreeAddressR(TTree *treeR){
708 // Set branch address for the Reconstructed points Trees.
710 // TTree *treeR Tree containing the RecPoints.
716 Char_t namedet[10]="ITS";
719 if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000);
721 sprintf(branchname,"%sRecPoints",namedet);
722 branch = treeR->GetBranch(branchname);
724 branch->SetAddress(&fRecPoints);
726 sprintf(branchname,"%sRecPointsF",namedet);
727 branch = treeR->GetBranch(branchname);
729 branch->SetAddress(&fRecPoints);
734 //____________________________________________________________________
735 void AliITSDetTypeRec::AddRecPoint(const AliITSRecPoint &r){
736 // Add a reconstructed space point to the list
738 // const AliITSRecPoint &r RecPoint class to be added to the tree
739 // of reconstructed points TreeR.
745 TClonesArray &lrecp = *fRecPoints;
746 new(lrecp[fNRecPoints++]) AliITSRecPoint(r);
749 //______________________________________________________________________
750 void AliITSDetTypeRec::DigitsToRecPoints(TTree *treeD,TTree *treeR,Int_t lastentry,Option_t *opt, Bool_t v2){
751 // cluster finding and reconstruction of space points
752 // the condition below will disappear when the geom class will be
753 // initialized for all versions - for the moment it is only for v5 !
754 // 7 is the SDD beam test version
756 // TTree *treeD Digits tree
757 // TTree *treeR Clusters tree
758 // Int_t lastentry Offset for module when not all of the modules
760 // Option_t *opt String indicating which ITS sub-detectors should
761 // be processed. If ="All" then all of the ITS
762 // sub detectors are processed.
764 const char *all = strstr(opt,"All");
765 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
768 SetDefaultClusterFinders();
769 AliInfo("Original cluster finder has been selected\n");
772 SetDefaultClusterFindersV2();
773 AliInfo("V2 cluster finder has been selected \n");
776 AliITSClusterFinder *rec = 0;
777 Int_t id,module,first=0;
778 for(module=0;module<GetITSgeom()->GetIndexMax();module++){
779 id = GetITSgeom()->GetModuleType(module);
780 if (!all && !det[id]) continue;
781 if(det[id]) first = GetITSgeom()->GetStartDet(id);
782 rec = (AliITSClusterFinder*)GetReconstructionModel(id);
783 TClonesArray *itsDigits = DigitsAddress(id);
785 AliFatal("The reconstruction class was not instanciated!");
786 ResetDigits(); // MvL: Not sure we neeed this when rereading anyways
788 treeD->GetEvent(lastentry+module);
790 treeD->GetEvent(lastentry+(module-first));
792 Int_t ndigits = itsDigits->GetEntriesFast();
794 rec->SetDetTypeRec(this);
795 rec->SetDigits(DigitsAddress(id));
796 // rec->SetClusters(ClustersAddress(id));
797 rec->FindRawClusters(module);
804 //______________________________________________________________________
805 void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader,TTree *treeR,Option_t *opt){
806 // cluster finding and reconstruction of space points
807 // the condition below will disappear when the geom class will be
808 // initialized for all versions - for the moment it is only for v5 !
809 // 7 is the SDD beam test version
811 // AliRawReader *rawReader Pointer to the raw-data reader
812 // TTree *treeR Clusters tree
817 const char *all = strstr(opt,"All");
818 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
820 AliITSClusterFinderV2 *rec = 0;
823 TClonesArray *array=new TClonesArray("AliITSRecPoint",1000);
824 TBranch *branch = treeR->Branch("ITSRecPoints",&array);
827 TClonesArray** clusters = new TClonesArray*[GetITSgeom()->GetIndexMax()];
828 for (Int_t iModule = 0; iModule < GetITSgeom()->GetIndexMax(); iModule++) {
829 clusters[iModule] = NULL;
832 if (!all && !det[id]) continue;
833 rec = (AliITSClusterFinderV2*)GetReconstructionModel(id);
835 AliFatal("The reconstruction class was not instanciated");
836 rec->SetDetTypeRec(this);
837 rec->RawdataToClusters(rawReader,clusters);
840 TClonesArray *emptyArray=new TClonesArray("AliITSRecPoint");
841 for(Int_t iModule=0;iModule<GetITSgeom()->GetIndexMax();iModule++){
842 id = GetITSgeom()->GetModuleType(iModule);
843 if (!all && !det[id]) continue;
844 array = clusters[iModule];
846 AliDebug(1,Form("data for module %d missing!",iModule));
849 branch->SetAddress(&array);
851 nClusters+=array->GetEntriesFast();
853 if (array != emptyArray) {
861 Info("DigitsToRecPoints", "total number of found recpoints in ITS: %d\n",