1 /***************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors 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"
32 #include "AliITSClusterFinder.h"
33 #include "AliITSClusterFinderV2.h"
34 #include "AliITSClusterFinderV2SPD.h"
35 #include "AliITSClusterFinderV2SDD.h"
36 #include "AliITSClusterFinderV2SSD.h"
37 #include "AliITSClusterFinderSPD.h"
38 #include "AliITSClusterFinderSDD.h"
39 #include "AliITSClusterFinderSSD.h"
40 #include "AliITSclusterV2.h"
41 #include "AliITSgeom.h"
42 #include "AliITSDetTypeRec.h"
43 #include "AliITSRawCluster.h"
44 #include "AliITSRawClusterSPD.h"
45 #include "AliITSRawClusterSDD.h"
46 #include "AliITSRawClusterSSD.h"
47 #include "AliITSRecPoint.h"
48 #include "AliITSresponseSDD.h"
49 #include "AliITSsegmentationSPD.h"
50 #include "AliITSsegmentationSDD.h"
51 #include "AliITSsegmentationSSD.h"
54 const Int_t AliITSDetTypeRec::fgkNdettypes = 3;
55 const Int_t AliITSDetTypeRec::fgkDefaultNModulesSPD = 240;
56 const Int_t AliITSDetTypeRec::fgkDefaultNModulesSDD = 260;
57 const Int_t AliITSDetTypeRec::fgkDefaultNModulesSSD = 1698;
59 ClassImp(AliITSDetTypeRec)
61 //________________________________________________________________
62 AliITSDetTypeRec::AliITSDetTypeRec(): TObject(),
64 fReconstruction(),// [NDet]
65 fSegmentation(), // [NDet]
66 fCalibration(), // [NMod]
67 fPreProcess(), // [] e.g. Find Calibration values
68 fPostProcess(), // [] e.g. find primary vertex
69 fDigits(), //! [NMod][NDigits]
70 fClusterClassName(), // String with Cluster class name
71 fDigClassName(), // String with digit class name.
72 fRecPointClassName(){// String with RecPoint class name
73 // Default Constructor
79 // A properly zero-ed AliITSDetTypeRec class.
82 fReconstruction = new TObjArray(fgkNdettypes);
87 fDigits = new TObjArray(fgkNdettypes);
88 fNdtype = new Int_t[fgkNdettypes];
89 fCtype = new TObjArray(fgkNdettypes);
90 fNctype = new Int_t[fgkNdettypes];
91 fRecPoints = new TClonesArray("AliITSRecPoint",1000);
93 fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
96 for(Int_t i=0;i<fgkNdettypes;i++){
104 fNMod[0] = fgkDefaultNModulesSPD;
105 fNMod[1] = fgkDefaultNModulesSDD;
106 fNMod[2] = fgkDefaultNModulesSSD;
110 //______________________________________________________________________
111 AliITSDetTypeRec::AliITSDetTypeRec(const AliITSDetTypeRec &/*rec*/):TObject(/*rec*/){
114 Error("Copy constructor","Copy constructor not allowed");
117 //______________________________________________________________________
118 AliITSDetTypeRec& AliITSDetTypeRec::operator=(const AliITSDetTypeRec& /*source*/){
119 // Assignment operator. This is a function which is not allowed to be
121 Error("operator=","Assignment operator not allowed\n");
125 //_____________________________________________________________________
126 AliITSDetTypeRec::~AliITSDetTypeRec(){
129 if(fGeom) delete fGeom;
130 if(fReconstruction) delete fReconstruction;
131 if(fSegmentation) delete fSegmentation;
132 if(fCalibration) delete fCalibration;
133 if(fPreProcess) delete fPreProcess;
134 if(fPostProcess) delete fPostProcess;
142 fRecPoints->Delete();
147 fClustersV2->Delete();
158 if(fLoader) delete fLoader;
161 //___________________________________________________________________
162 void AliITSDetTypeRec::SetReconstructionModel(Int_t dettype,AliITSClusterFinder *clf){
164 //Set reconstruction model for detector type
166 if(fReconstruction==0) fReconstruction = new TObjArray(fgkNdettypes);
167 if(fReconstruction->At(dettype)!=0) delete fReconstruction->At(dettype);
168 fReconstruction->AddAt(clf,dettype);
170 //______________________________________________________________________
171 AliITSClusterFinder* AliITSDetTypeRec::GetReconstructionModel(Int_t dettype){
173 //Get reconstruction model for detector type
174 if(fReconstruction==0) {
175 Warning("GetReconstructionModel","fReconstruction is 0!");
178 return (AliITSClusterFinder*)fReconstruction->At(dettype);
181 //______________________________________________________________________
182 void AliITSDetTypeRec::SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg){
184 //Set segmentation model for detector type
186 if(fSegmentation==0) fSegmentation = new TObjArray(fgkNdettypes);
187 if(fSegmentation->At(dettype)!=0) delete fSegmentation->At(dettype);
188 fSegmentation->AddAt(seg,dettype);
191 //______________________________________________________________________
192 AliITSsegmentation* AliITSDetTypeRec::GetSegmentationModel(Int_t dettype){
194 //Get segmentation model for detector type
196 if(fSegmentation==0) {
197 Warning("GetSegmentationModel","fSegmentation is 0!");
200 return (AliITSsegmentation*)fSegmentation->At(dettype);
203 //_______________________________________________________________________
204 void AliITSDetTypeRec::SetCalibrationModel(Int_t iMod, AliITSresponse *cal){
206 //Set calibration (response) for the module iMod of type dettype
207 if (fCalibration==0) {
208 fCalibration = new TObjArray(fGeom->GetIndexMax());
209 fCalibration->SetOwner(kTRUE);
210 fCalibration->Clear();
213 if (fCalibration->At(iMod) != 0)
214 delete (AliITSresponse*) fCalibration->At(iMod);
215 fCalibration->AddAt(cal,iMod);
218 //_______________________________________________________________________
219 AliITSresponse* AliITSDetTypeRec::GetCalibrationModel(Int_t iMod){
221 //Get calibration model for module type
223 if(fCalibration==0) {
224 Warning("GetalibrationModel","fCalibration is 0!");
228 return (AliITSresponse*)fCalibration->At(iMod);
231 //______________________________________________________________________
232 void AliITSDetTypeRec::SetTreeAddress(){
233 // Set branch address for the Trees.
235 TTree *treeR = fLoader->TreeR();
236 TTree *treeD = fLoader->TreeD();
238 SetTreeAddressD(treeD);
239 SetTreeAddressR(treeR);
241 //______________________________________________________________________
242 void AliITSDetTypeRec::SetTreeAddressD(TTree *treeD){
243 // Set branch address for the tree of digits.
245 const char *det[4] = {"SPD","SDD","SSD","ITS"};
252 if (fDigits == 0x0) fDigits = new TObjArray(fgkNdettypes);
253 for (i=0; i<fgkNdettypes; i++) {
254 digclass = GetDigitClassName(i);
255 if(!(fDigits->At(i))) {
256 fDigits->AddAt(new TClonesArray(digclass,1000),i);
260 if (fgkNdettypes==3) sprintf(branchname,"%sDigits%s",det[3],det[i]);
261 else sprintf(branchname,"%sDigits%d",det[3],i+1);
263 branch = treeD->GetBranch(branchname);
264 if (branch) branch->SetAddress(&((*fDigits)[i]));
269 //_______________________________________________________________________
270 TBranch* AliITSDetTypeRec::MakeBranchInTree(TTree *tree, const char* name,
271 const char *classname,
272 void* address,Int_t size,
273 Int_t splitlevel, const char */*file*/)
276 // Makes branch in given tree and diverts them to a separate file
282 Error("MakeBranchInTree","Making Branch %s Tree is NULL",name);
285 TBranch *branch = tree->GetBranch(name);
290 branch = tree->Branch(name,classname,address,size,splitlevel);
293 branch = tree->Bronch(name, "TClonesArray", address, size, splitlevel);
299 //____________________________________________________________________
300 void AliITSDetTypeRec::SetDefaults(){
302 //Set defaults for segmentation and response
305 Warning("SetDefaults","fGeom is 0!");
309 AliITSsegmentation* seg;
310 if(!GetCalibration()) {AliFatal("Exit");exit(0);}
312 for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
314 seg = new AliITSsegmentationSPD(fGeom);
315 SetSegmentationModel(dettype,seg);
316 SetDigitClassName(dettype,"AliITSdigitSPD");
317 SetClusterClassName(dettype,"AliITSRawClusterSPD");
321 AliITSresponseSDD* res=(AliITSresponseSDD*) GetCalibrationModel(fGeom->GetStartSDD());
322 seg = new AliITSsegmentationSDD(fGeom,res);
323 SetSegmentationModel(dettype,seg);
324 const char *kopt = res->ZeroSuppOption();
325 if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D"))) SetDigitClassName(dettype,"AliITSdigit");
326 else SetDigitClassName(dettype,"AliITSdigitSDD");
327 SetClusterClassName(dettype,"AliITSRawClusterSDD");
331 AliITSsegmentationSSD* seg2 = new AliITSsegmentationSSD(fGeom);
332 seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
333 seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
334 seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
335 SetSegmentationModel(dettype,seg2);
336 SetDigitClassName(dettype,"AliITSdigitSSD");
337 SetClusterClassName(dettype,"AliITSRawClusterSSD");
342 //______________________________________________________________________
343 Bool_t AliITSDetTypeRec::GetCalibration() {
344 // Get Default calibration if a storage is not defined.
346 Bool_t deleteManager = kFALSE;
347 if(!AliCDBManager::Instance()->IsDefaultStorageSet()) {
348 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
349 deleteManager = kTRUE;
351 AliCDBStorage *storage = AliCDBManager::Instance()->GetDefaultStorage();
353 AliCDBEntry *entrySPD = storage->Get("ITS/Calib/RespSPD", fRunNumber);
354 TObjArray *respSPD = (TObjArray *)entrySPD->GetObject();
355 entrySPD->SetObject(NULL);
356 entrySPD->SetOwner(kTRUE);
357 AliCDBEntry *entrySDD = storage->Get("ITS/Calib/RespSDD", fRunNumber);
358 TObjArray *respSDD = (TObjArray *)entrySDD->GetObject();
359 entrySDD->SetObject(NULL);
360 entrySDD->SetOwner(kTRUE);
361 AliCDBEntry *entrySSD = storage->Get("ITS/Calib/RespSSD", fRunNumber);
362 TObjArray *respSSD = (TObjArray *)entrySSD->GetObject();
363 entrySSD->SetObject(NULL);
364 entrySSD->SetOwner(kTRUE);
365 // DB entries are dleted. In this waymetadeta objects are deleted as well
370 AliCDBManager::Instance()->Destroy();
371 AliCDBManager::Instance()->RemoveDefaultStorage();
372 storage = 0; // the storage is killed by AliCDBManager::Instance()->Destroy()
374 if ((! respSPD)||(! respSDD)||(! respSSD)) {
375 AliWarning("Can not get calibration from calibration database !");
379 fNMod[0] = respSPD->GetEntries();
380 fNMod[1] = respSDD->GetEntries();
381 fNMod[2] = respSSD->GetEntries();
382 AliInfo(Form("%i SPD, %i SDD and %i SSD in calibration database",
383 fNMod[0], fNMod[1], fNMod[2]));
385 for (Int_t i=0; i<fNMod[0]; i++) {
386 res = (AliITSresponse*) respSPD->At(i);
387 SetCalibrationModel(i, res);
389 for (Int_t i=0; i<fNMod[1]; i++) {
390 res = (AliITSresponse*) respSDD->At(i);
391 Int_t iMod = i + fNMod[0];
392 SetCalibrationModel(iMod, res);
394 for (Int_t i=0; i<fNMod[2]; i++) {
395 res = (AliITSresponse*) respSSD->At(i);
396 Int_t iMod = i + fNMod[0] + fNMod[1];
397 SetCalibrationModel(iMod, res);
404 //________________________________________________________________
405 void AliITSDetTypeRec::SetDefaultClusterFinders(){
407 //set defaults for standard cluster finder
410 Warning("SetDefaults","fGeom is 0!");
414 AliITSClusterFinder *clf;
418 for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
421 if(!GetReconstructionModel(dettype)){
422 TClonesArray *dig0 = DigitsAddress(0);
423 TClonesArray *rec0 = ClustersAddress(0);
424 clf = new AliITSClusterFinderSPD(this,dig0,rec0);
425 SetReconstructionModel(dettype,clf);
432 if(!GetReconstructionModel(dettype)){
433 TClonesArray *dig1 = DigitsAddress(1);
434 TClonesArray *rec1 = ClustersAddress(1);
435 clf = new AliITSClusterFinderSDD(this,dig1,rec1);
436 SetReconstructionModel(dettype,clf);
442 if(!GetReconstructionModel(dettype)){
443 TClonesArray* dig2 = DigitsAddress(2);
444 clf = new AliITSClusterFinderSSD(this,dig2);
445 SetReconstructionModel(dettype,clf);
454 //________________________________________________________________
455 void AliITSDetTypeRec::SetDefaultClusterFindersV2(Bool_t rawdata){
457 //Set defaults for cluster finder V2
460 Warning("SetDefaults","fGeom is 0!");
464 AliITSClusterFinder *clf;
467 for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
470 if(!GetReconstructionModel(dettype)){
471 clf = new AliITSClusterFinderV2SPD(this);
473 if(!rawdata) clf->SetDigits(DigitsAddress(0));
474 SetReconstructionModel(dettype,clf);
480 if(!GetReconstructionModel(dettype)){
481 clf = new AliITSClusterFinderV2SDD(this);
483 if(!rawdata) clf->SetDigits(DigitsAddress(1));
484 SetReconstructionModel(dettype,clf);
491 if(!GetReconstructionModel(dettype)){
492 clf = new AliITSClusterFinderV2SSD(this);
494 if(!rawdata) clf->SetDigits(DigitsAddress(2));
495 SetReconstructionModel(dettype,clf);
502 //______________________________________________________________________
503 void AliITSDetTypeRec::MakeBranch(Option_t* option){
505 //Creates branches for clusters and recpoints
506 Bool_t cR = (strstr(option,"R")!=0);
507 Bool_t cRF = (strstr(option,"RF")!=0);
508 Bool_t v2 = (strstr(option,"v2")!=0);
512 if(cR) MakeBranchR(0);
513 if(cRF) MakeBranchRF(0);
514 if(v2) MakeBranchR(0,"v2");
518 //_____________________________________________________________
519 void AliITSDetTypeRec::MakeTreeC(){
521 //Create a separate tree to store the clusters
523 Warning("MakeTreeC","ITS loader is null!");
526 if(fLoader->TreeC()== 0x0) fLoader->MakeTree("C");
530 //______________________________________________________________
531 void AliITSDetTypeRec::MakeBranchC(){
533 //Make branches in the tree of clusters
536 Warning("MakeBranchC","ITS loader is null!");
539 TTree* lTC = fLoader->TreeC();
541 Error("MakeTreeC","Can not get TreeC from loader");
545 Int_t buffersize = 4000;
546 Char_t branchname[30];
548 const char *det[4]={"SPD","SDD","SSD","ITS"};
550 for(Int_t i=0;i<fgkNdettypes;i++){
551 cluclass = GetClusterClassName(i);
552 if(fCtype==0x0) fCtype = new TObjArray(fgkNdettypes);
553 if(!ClustersAddress(i)){
554 fCtype->AddAt(new TClonesArray(cluclass,1000),i);
556 if(fgkNdettypes==3) sprintf(branchname,"%sClusters%s",det[3],det[i]);
557 else sprintf(branchname,"%sClusters%d",det[3],i+1);
559 if(lTC->GetBranch(branchname)){
560 Warning("MakeBranchC","Branch %s already exists in TreeC",branchname);
562 Info("MakeBranchC","Creating branch %s in TreeC",branchname);
563 lTC->Branch(branchname,&((*fCtype)[i]),buffersize);
571 //_______________________________________________________________
572 void AliITSDetTypeRec::GetTreeC(Int_t event){
574 //Get the clusters tree for this event and
575 //sets the branch address
579 Warning("GetTreeC","ITS loader is null!");
583 Char_t branchname[30];
584 const char *det[4] = {"SPD","SDD","SSD","ITS"};
585 TTree* lTC = fLoader->TreeC();
588 if(lTC) fLoader->CleanRawClusters();
593 for(Int_t i=0;i<fgkNdettypes;i++){
594 cluclass = GetClusterClassName(i);
595 if(fCtype==0x0) fCtype = new TObjArray(fgkNdettypes);
596 if(!fCtype->At(i)) fCtype->AddAt(new TClonesArray(cluclass,1000),i);
597 if(fgkNdettypes==3) sprintf(branchname,"%sClusters%s",det[3],det[i]);
598 else sprintf(branchname,"%sClusters%d",det[3],i+1);
600 branch = lTC->GetBranch(branchname);
601 if(branch) branch->SetAddress(&((*fCtype)[i]));
605 Error("GetTreeC","cannot find clusters Tree for vent %d",event);
610 //___________________________________________________________________
611 void AliITSDetTypeRec::AddCluster(Int_t id, AliITSRawCluster *c){
613 // Adds a raw cluster to the list
614 TClonesArray &lc = *((TClonesArray*)fCtype->At(id));
617 new(lc[fNctype[id]++]) AliITSRawClusterSPD(*((AliITSRawClusterSPD*)c));
620 new(lc[fNctype[id]++]) AliITSRawClusterSDD(*((AliITSRawClusterSDD*)c));
623 new(lc[fNctype[id]++]) AliITSRawClusterSSD(*((AliITSRawClusterSSD*)c));
627 //___________________________________________________________________
628 void AliITSDetTypeRec::ResetDigits(){
629 // Reset number of digits and the digits array for the ITS detector.
632 for(Int_t i=0;i<fgkNdettypes;i++){
636 //___________________________________________________________________
637 void AliITSDetTypeRec::ResetDigits(Int_t branch){
638 // Reset number of digits and the digits array for this branch.
640 if(fDigits->At(branch)) ((TClonesArray*)fDigits->At(branch))->Clear();
641 if(fNdtype) fNdtype[branch]=0;
645 //__________________________________________________________________
646 void AliITSDetTypeRec::ResetClusters(){
648 //Resets number of clusters and the cluster array
649 for(Int_t i=0;i<fgkNdettypes;i++){
654 //__________________________________________________________________
655 void AliITSDetTypeRec::ResetClusters(Int_t i){
657 //Resets number of clusters and the cluster array for this branch
659 if (fCtype->At(i)) ((TClonesArray*)fCtype->At(i))->Clear();
660 if (fNctype) fNctype[i]=0;
662 //__________________________________________________________________
663 void AliITSDetTypeRec::MakeBranchR(const char *file, Option_t *opt){
665 //Creates tree branches for recpoints
667 // cont char *file File name where RecPoints branch is to be written
668 // to. If blank it write the SDigits to the same
669 // file in which the Hits were found.
672 Warning("MakeBranchR","ITS loader is null!");
679 // only one branch for rec points for all detector types
680 Bool_t oFast= (strstr(opt,"Fast")!=0);
681 Bool_t v2 = (strstr(opt,"v2")!=0);
683 Char_t detname[10] = "ITS";
687 sprintf(branchname,"%sRecPointsF",detname);
689 sprintf(branchname,"Clusters");
691 sprintf(branchname,"%sRecPoints",detname);
696 if(!fClustersV2)fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
697 if(fLoader->TreeR()){
698 if(fClustersV2==0x0) fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
699 MakeBranchInTree(fLoader->TreeR(),branchname,0,&fClustersV2,buffsz,99,file);
703 if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPoint",1000);
704 if (fLoader->TreeR()) {
705 if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",
707 MakeBranchInTree(fLoader->TreeR(),branchname,0,&fRecPoints,buffsz,99,file);
712 //______________________________________________________________________
713 void AliITSDetTypeRec::SetTreeAddressR(TTree *treeR){
714 // Set branch address for the Reconstructed points Trees.
716 // TTree *treeR Tree containing the RecPoints.
722 Char_t namedet[10]="ITS";
725 if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000);
727 sprintf(branchname,"Clusters");
728 branch1 = treeR->GetBranch(branchname);
730 if(fClustersV2==0x0) fClustersV2 = new TClonesArray("AliITSclusterV2",3000);
731 branch1->SetAddress(&fClustersV2);
735 sprintf(branchname,"%sRecPoints",namedet);
736 branch = treeR->GetBranch(branchname);
738 branch->SetAddress(&fRecPoints);
740 sprintf(branchname,"%sRecPointsF",namedet);
741 branch = treeR->GetBranch(branchname);
743 branch->SetAddress(&fRecPoints);
748 //____________________________________________________________________
749 void AliITSDetTypeRec::AddRecPoint(const AliITSRecPoint &r){
750 // Add a reconstructed space point to the list
752 // const AliITSRecPoint &r RecPoint class to be added to the tree
753 // of reconstructed points TreeR.
759 TClonesArray &lrecp = *fRecPoints;
760 new(lrecp[fNRecPoints++]) AliITSRecPoint(r);
762 //______________________________________________________________________
763 void AliITSDetTypeRec::AddClusterV2(const AliITSclusterV2 &r){
764 // Add a reconstructed space point to the list
766 // const AliITSClusterV2 &r class to be added to the tree
767 // of reconstructed points TreeR.
773 TClonesArray &lrecp = *fClustersV2;
774 new(lrecp[fNClustersV2++]) AliITSclusterV2(r);
777 //______________________________________________________________________
778 void AliITSDetTypeRec::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt, Bool_t v2){
779 // cluster finding and reconstruction of space points
780 // the condition below will disappear when the geom class will be
781 // initialized for all versions - for the moment it is only for v5 !
782 // 7 is the SDD beam test version
784 // Int_t evNumber Event number to be processed.
785 // Int_t lastentry Offset for module when not all of the modules
787 // Option_t *opt String indicating which ITS sub-detectors should
788 // be processed. If ="All" then all of the ITS
789 // sub detectors are processed.
792 Warning("DigitsToRecPoints","fGeom is null!");
796 Warning("DigitsToRecPoints","ITS loader is null!");
800 const char *all = strstr(opt,"All");
801 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
803 if(!v2) SetDefaultClusterFinders();
804 else SetDefaultClusterFindersV2();
807 TTree *treeC=fLoader->TreeC();
812 AliITSClusterFinder *rec = 0;
813 Int_t id,module,first=0;
814 for(module=0;module<fGeom->GetIndexMax();module++){
815 id = fGeom->GetModuleType(module);
816 if (!all && !det[id]) continue;
817 if(det[id]) first = fGeom->GetStartDet(id);
818 rec = (AliITSClusterFinder*)GetReconstructionModel(id);
819 TClonesArray *itsDigits = DigitsAddress(id);
821 Error("DigitsToRecPoints",
822 "The reconstruction class was not instanciated! event=%d",
827 TTree *lTD = fLoader->TreeD();
829 lTD->GetEvent(lastentry+module);
831 lTD->GetEvent(lastentry+(module-first));
833 Int_t ndigits = itsDigits->GetEntriesFast();
835 rec->SetDetTypeRec(this);
836 rec->SetDigits(DigitsAddress(id));
837 rec->SetClusters(ClustersAddress(id));
838 rec->FindRawClusters(module);
840 fLoader->TreeR()->Fill();
847 fLoader->WriteRecPoints("OVERWRITE");
848 fLoader->WriteRawClusters("OVERWRITE");
850 //______________________________________________________________________
851 void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader){
852 // cluster finding and reconstruction of space points
853 // the condition below will disappear when the geom class will be
854 // initialized for all versions - for the moment it is only for v5 !
855 // 7 is the SDD beam test version
857 // Int_t evNumber Event number to be processed.
858 // Int_t lastentry Offset for module when not all of the modules
860 // Option_t *opt String indicating which ITS sub-detectors should
861 // be processed. If ="All" then all of the ITS
862 // sub detectors are processed.
868 Warning("DigitsToRecPoints","fGeom is null!");
872 Warning("DigitsToRecPoints","ITS loader is null!");
877 AliITSClusterFinderV2 *rec = 0;
880 if(!fLoader->TreeR()) fLoader->MakeTree("R");
881 TTree* cTree = fLoader->TreeR();
882 TClonesArray *array=new TClonesArray("AliITSclusterV2",1000);
883 cTree->Branch("Clusters",&array);
886 TClonesArray** clusters = new TClonesArray*[fGeom->GetIndexMax()];
887 for (Int_t iModule = 0; iModule < fGeom->GetIndexMax(); iModule++) {
888 clusters[iModule] = NULL;
891 rec = (AliITSClusterFinderV2*)GetReconstructionModel(id);
892 rec->SetDetTypeRec(this);
894 Error("DigitsToRecPoints",
895 "The reconstruction class was not instanciated");
898 rec->RawdataToClusters(rawReader,clusters);
901 for(Int_t iModule=0;iModule<fGeom->GetIndexMax();iModule++){
902 array = clusters[iModule];
904 Error("DigitsToRecPoints","data for module %d missing!",iModule);
905 array = new TClonesArray("AliITSclusterV2");
907 cTree->SetBranchAddress("Clusters",&array);
909 nClusters+=array->GetEntriesFast();
912 fLoader->WriteRecPoints("OVERWRITE");
915 Info("DigitsToRecPoints", "total number of found clustersV2 in ITS: %d\n",