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 **************************************************************************/
18 ////////////////////////////////////////////////////////////////////////////
20 // Base Class used to find //
21 // the reconstructed points for ITS Upgrade //
23 ////////////////////////////////////////////////////////////////////////////
25 #include "AliITSUpgradeClusterFinder.h"
26 #include "AliITSsegmentationUpgrade.h"
27 #include "AliITSRecPointU.h"
28 #include "AliITSDigitUpgrade.h"
29 #include "AliITSRawStreamSPD.h"
30 #include "AliITSUPixelModule.h"
33 #include <TObjString.h>
34 #include <TClonesArray.h>
38 AliITSUpgradeClusterFinder::AliITSUpgradeClusterFinder() :
42 fClusterTypeFlag(kTRUE),
43 fFindClusterType(kFALSE),
44 fClusterTypeOrigCol(0),
45 fClusterTypeOrigRow(0),
46 fColSum(0),fRowSum(0),
48 fClusterWidthMaxCol(0),
49 fClusterWidthMinCol(0),
50 fClusterWidthMaxRow(0),
51 fClusterWidthMinRow(0),
58 // Default constructor
60 AliITSsegmentationUpgrade *s = new AliITSsegmentationUpgrade();
61 fNSectors = s->GetNSectors();
63 fClusterList = new AliITSUpgradeClusterList*[fNSectors];
64 for(Int_t imod =0; imod < fNSectors; imod++){
65 fClusterList[imod] = new AliITSUpgradeClusterList();
68 fChargeArray = new TObjArray();
69 fChargeArray->SetOwner(kTRUE);
70 fRecPoints = new TClonesArray("AliITSRecPointU",3000);
74 for(int il=0; il<10;il++) fLabels[il]=-5;
75 for(int k=0; k<999999; k++){
81 //___________________________________________________________________________________
82 AliITSUpgradeClusterFinder::~AliITSUpgradeClusterFinder() {
83 if(fChargeArray) delete fChargeArray;
84 if(fRecPoints) delete fRecPoints;
85 if(fClusterList)delete [] fClusterList;
87 //___________________________________________________________________________________
88 void AliITSUpgradeClusterFinder::StartEvent() {
91 //___________________________________________________________________________________
92 Int_t AliITSUpgradeClusterFinder::ProcessHit(Int_t module , UInt_t col, UInt_t row, UShort_t charge, Int_t label[3]) {
94 // Adds one pixel to the cluster
96 AliDebug(2,Form("module,col,row,charge,label(0,1,2) = %d,%d,%d,%d,(%d,%d,%d)\n",module ,col,row,charge,label[0],label[1],label[2]));
97 if (module>=fNSectors) {
98 AliError(Form("Out of bounds: module ,col,row, charge, label(0,1,2)= %d,%d,%d,%d,(%d,%d,%d)\n",module ,col,row,charge,label[0],label[1],label[2]));
101 // do we need to perform clustering on previous module?
102 if (fOldModule!=-1 && (Int_t)module!=fOldModule) {
103 //fChargeArray->AddLast(new TObjString(Form("%i %i %i %i %i %i",col,row,charge,label[0],label[1],label[2])));
104 AliITSUPixelModule *pix = new AliITSUPixelModule(module,col, row, charge, label);
105 fChargeArray->AddLast(pix);
107 DoModuleClustering(fOldModule,charge);
111 AliITSUPixelModule *pix = new AliITSUPixelModule(module,col, row, charge, label);
112 fChargeArray->AddLast(pix);
113 // fChargeArray->AddLast(new TObjString(Form("%i %i %i %i %i %i",col,row,charge,label[0],label[1],label[2])));
116 fHitCol[fNhitsLeft]=col;
117 fHitRow[fNhitsLeft]=row;
118 fHits[col][row]=kTRUE;
119 fTmpLabel[0]=label[0];
120 fTmpLabel[1]=label[1];
121 fTmpLabel[2]=label[2];
125 //___________________________________________________________________________________
126 void AliITSUpgradeClusterFinder::FinishEvent() {
128 DoModuleClustering(fOldModule,fCharge);
131 //___________________________________________________________________________________
132 UInt_t AliITSUpgradeClusterFinder::GetClusterCount(Int_t module) const {
134 // number of clusters in the module
136 if (module>fNSectors ) {
137 printf("ERROR: UpgradeClusterFinder::GetClusterCount: Module out of bounds: module = %d\n",module);
140 return fClusterList[module]->GetNrEntries();
142 //___________________________________________________________________________________
143 Float_t AliITSUpgradeClusterFinder::GetClusterMeanCol(Int_t module, UInt_t index) {
145 // cluster position in terms of colums : mean column ID
147 if (module>=fNSectors) {
148 printf("ERROR: UpgradeClusterFinder::GetClusterMeanCol: Module out of bounds: module = %d\n",module);
151 return fClusterList[module]->GetColIndex(index);
153 //___________________________________________________________________________________
154 Float_t AliITSUpgradeClusterFinder::GetClusterMeanRow(Int_t module, UInt_t index) {
156 // cluster position in terms of rows : mean row ID
158 if (module>=fNSectors) {
159 printf("ERROR: UpgradeClusterFinder::GetClusterMeanRow: Module out of bounds: module = %d\n",module);
162 return fClusterList[module]->GetRowIndex(index);
164 //___________________________________________________________________________________
165 UInt_t AliITSUpgradeClusterFinder::GetClusterSize(Int_t module, UInt_t index) {
167 // total number of pixels of the cluster
169 if (module>=fNSectors) {
170 printf("ERROR: UpgradeClusterFinder::GetClusterSize: Module out of bounds: module = %d\n",module);
173 return fClusterList[module]->GetSizeIndex(index);
175 //___________________________________________________________________________________
176 UInt_t AliITSUpgradeClusterFinder::GetClusterWidthZ(Int_t module, UInt_t index) {
178 // # pixels of the cluster in Z direction
181 if (module>=fNSectors) {
182 printf("ERROR: UpgradeClusterFinder::GetClusterWidthZ: Module out of bounds: module = %d\n",module);
185 return fClusterList[module]->GetWidthZIndex(index);
187 //___________________________________________________________________________________
188 UInt_t AliITSUpgradeClusterFinder::GetClusterWidthPhi(Int_t module, UInt_t index) {
190 // # pixels of the cluster in phi direction (XY plane)
193 if (module>=fNSectors) {
194 printf("ERROR: UpgradeClusterFinder::GetClusterWidthPhi: Module out of bounds: module = %d\n",module);
197 return fClusterList[module]->GetWidthPhiIndex(index);
199 //___________________________________________________________________________________
200 UInt_t AliITSUpgradeClusterFinder::GetClusterType(Int_t module, UInt_t index) {
205 if (module>=fNSectors) {
206 printf("ERROR: UpgradeClusterFinder::GetClusterType: Module out of bounds: layer = %d\n",module);
209 return fClusterList[module]->GetTypeIndex(index);
211 //___________________________________________________________________________________
212 void AliITSUpgradeClusterFinder::PrintAllClusters() {
214 // printout of the cluster information
217 for (Int_t module=0; module<fNSectors; module++) {
218 PrintClusters(module);
221 //___________________________________________________________________________________
222 void AliITSUpgradeClusterFinder::PrintClusters(Int_t module) {
224 // printout of the cluster information
227 if (module>=fNSectors) {
228 printf("ERROR: UpgradeClusterFinder::PrintClusters: Out of bounds: layer = %d\n",module);
231 if(fClusterList[module]->GetNrEntries()==0) {
232 printf("no cluster list entries. Exiting... \n");
235 // for (UInt_t c=0; c<fClusterList[layer]->GetNrEntries(); c++) {
236 //printf("layer %d , z,y=%f,%f , size=%d , type=%d labels=%d %d %d (label printout to be implemented...)\n",layer,fClusterList[layer].GetColIndex(c),fClusterList[layer].GetRowIndex(c),fClusterList[layer].GetSizeIndex(c),fClusterList[layer].GetTypeIndex(c),999,999,999);
239 //___________________________________________________________________________________
240 void AliITSUpgradeClusterFinder::NewEvent() {
242 // Cleaning up and preparation for the clustering procedure
245 for (Int_t i=0; i<fNSectors; i++) {
246 fClusterList[i]->Clear();
251 //___________________________________________________________________________________
252 void AliITSUpgradeClusterFinder::NewModule() {
257 memset(fHits,0,999*999*sizeof(Bool_t));
258 fChargeArray->Clear();
260 //___________________________________________________________________________________
261 Int_t AliITSUpgradeClusterFinder::DoModuleClustering(Int_t module, UShort_t charge) {
263 // Clustering and cluster-list container filling
265 UInt_t maxHits=fNhitsLeft;
266 for (UInt_t hit=0; hit<maxHits; hit++) {
267 if (fClusterTypeFlag) fFindClusterType = kTRUE;
269 fClusterWidthMinCol = fHitCol[hit];
270 fClusterWidthMinRow = fHitRow[hit];
271 fClusterWidthMaxCol = fHitCol[hit];
272 fClusterWidthMaxRow = fHitRow[hit];
274 fClusterTypeOrigCol = fHitCol[hit];
275 fClusterTypeOrigRow = fHitRow[hit];
276 memset(fClusterTypeArea,0,kMAXCLUSTERTYPESIDEZ*kMAXCLUSTERTYPESIDEY*sizeof(Bool_t));
279 UInt_t size = FindClusterRecu(fClusterTypeOrigCol,fClusterTypeOrigRow,charge);
281 fCharge=GetPixelCharge(fColSum,fRowSum);
282 AddLabelIndex(fColSum,fRowSum);
285 if(size>1) AliDebug(2,Form("DoModuleClustering, size %i , labels : %i %i %i \n",size,fLabels[0],fLabels[1],fLabels[2]));
286 fClusterList[module]->Insert((Float_t)fColSum/size, (Float_t)fRowSum/size, size, GetClusterWidthZ(), GetClusterWidthPhi(), GetClusterType(size), fCharge,fLabels);
288 for(Int_t i=0; i<kMAXCLUSTERTYPESIDEZ*kMAXCLUSTERTYPESIDEY; i++) fLabels[i]=-5;
290 if (fNhitsLeft==0) break;
294 //___________________________________________________________________________________
295 UInt_t AliITSUpgradeClusterFinder::FindClusterRecu(Int_t col, Int_t row, UShort_t charge) {
297 // Pixel selection for the clusters (adjiacent pixels or pixels at the corners)
299 if (col<0 || !fHits[col][row]) {
302 fHits[col][row]=kFALSE;
308 if (col>fClusterWidthMaxCol) fClusterWidthMaxCol = col;
309 if (col<fClusterWidthMinCol) fClusterWidthMinCol = col;
310 if (row>fClusterWidthMaxRow) fClusterWidthMaxRow = row;
311 if (row<fClusterWidthMaxRow) fClusterWidthMinRow = row;
313 if (fFindClusterType) {
314 Short_t diffz = fClusterTypeOrigCol - col;
315 Short_t diffy = row - fClusterTypeOrigRow;
316 if (diffz>=kMAXCLUSTERTYPESIDEZ || diffy>=kMAXCLUSTERTYPESIDEY) {
317 fFindClusterType=kFALSE;
321 ShiftClusterTypeArea(kSHIFTRIGHT);
325 ShiftClusterTypeArea(kSHIFTDOWN);
328 fClusterTypeArea[diffz][diffy] = kTRUE;
332 size+=FindClusterRecu(col ,row-1,charge);
333 fCharge+=GetPixelCharge(col,row-1);
334 AddLabelIndex(col,row-1);
336 size+=FindClusterRecu(col-1,row ,charge);
337 fCharge+=GetPixelCharge(col-1,row);
338 AddLabelIndex(col-1,row);
340 size+=FindClusterRecu(col ,row+1,charge);
341 fCharge+=GetPixelCharge(col,row+1);
342 AddLabelIndex(col,row+1);
344 size+=FindClusterRecu(col+1,row ,charge );
345 fCharge+=GetPixelCharge(col+1,row);
346 AddLabelIndex(col+1,row);
349 size+=FindClusterRecu(col-1,row-1,charge);
350 fCharge+=GetPixelCharge(col-1,row-1);
351 AddLabelIndex(col-1,row-1);
353 size+=FindClusterRecu(col-1,row+1,charge);
354 fCharge+=GetPixelCharge(col-1,row+1);
355 AddLabelIndex(col-1,row+1);
357 size+=FindClusterRecu(col+1,row-1,charge);
358 fCharge+=GetPixelCharge(col+1,row-1);
359 AddLabelIndex(col+1,row-1);
361 size+=FindClusterRecu(col+1,row+1,charge);
362 fCharge+=GetPixelCharge(col+1,row+1);
363 AddLabelIndex(col+1,row+1);
366 //___________________________________________________________________________________
367 void AliITSUpgradeClusterFinder::ShiftClusterTypeArea(UInt_t direction) {
372 if (direction == kSHIFTRIGHT) {
373 fClusterTypeOrigCol++;
374 Bool_t tmpClusterTypeArea[kMAXCLUSTERTYPESIDEZ][kMAXCLUSTERTYPESIDEY];
375 memset(tmpClusterTypeArea,0,kMAXCLUSTERTYPESIDEZ*kMAXCLUSTERTYPESIDEY*sizeof(Bool_t));
376 for (UInt_t z=0; z<kMAXCLUSTERTYPESIDEZ; z++) {
377 for (UInt_t y=0; y<kMAXCLUSTERTYPESIDEY; y++) {
378 if (fClusterTypeArea[z][y]) {
379 if (z==kMAXCLUSTERTYPESIDEZ-1) {
380 fFindClusterType=kFALSE;
384 tmpClusterTypeArea[z+1][y] = kTRUE;
389 memcpy(fClusterTypeArea,tmpClusterTypeArea,kMAXCLUSTERTYPESIDEZ*kMAXCLUSTERTYPESIDEY*sizeof(Bool_t));
391 else if (direction == kSHIFTDOWN) {
392 fClusterTypeOrigRow--;
393 Bool_t tmpClusterTypeArea[kMAXCLUSTERTYPESIDEZ][kMAXCLUSTERTYPESIDEY];
394 memset(tmpClusterTypeArea,0,kMAXCLUSTERTYPESIDEZ*kMAXCLUSTERTYPESIDEY*sizeof(Bool_t));
395 for (UInt_t z=0; z<kMAXCLUSTERTYPESIDEZ; z++) {
396 for (UInt_t y=0; y<kMAXCLUSTERTYPESIDEY; y++) {
397 if (fClusterTypeArea[z][y]) {
398 if (y==kMAXCLUSTERTYPESIDEY-1) {
399 fFindClusterType=kFALSE;
403 tmpClusterTypeArea[z][y+1] = kTRUE;
408 memcpy(fClusterTypeArea,tmpClusterTypeArea,kMAXCLUSTERTYPESIDEZ*kMAXCLUSTERTYPESIDEY*sizeof(Bool_t));
411 //___________________________________________________________________________________
412 UShort_t AliITSUpgradeClusterFinder::GetCharge(Int_t module,UInt_t index ) {
413 return fClusterList[module]->GetCharge(index);
415 //___________________________________________________________________________________
416 Int_t * AliITSUpgradeClusterFinder::GetLabels(Int_t module,UInt_t index) {
417 return fClusterList[module]->GetLabels(index);
420 //___________________________________________________________________________________
421 UInt_t AliITSUpgradeClusterFinder::GetClusterWidthZ() {
422 return fClusterWidthMaxCol-fClusterWidthMinCol+1;
424 //___________________________________________________________________________________
425 UInt_t AliITSUpgradeClusterFinder::GetClusterWidthPhi() {
426 return fClusterWidthMaxRow-fClusterWidthMinRow+1;
428 //___________________________________________________________________________________
429 UInt_t AliITSUpgradeClusterFinder::GetClusterType(UInt_t size) {
433 if (!fFindClusterType || size>4)
443 fClusterTypeArea[0][1] &&
444 fClusterTypeArea[0][0] )
449 fClusterTypeArea[1][0] &&
450 fClusterTypeArea[0][0] )
457 fClusterTypeArea[0][2] &&
458 fClusterTypeArea[0][1] &&
459 fClusterTypeArea[0][0] )
463 // X and equivalent...
467 fClusterTypeArea[0][0] &&
468 fClusterTypeArea[0][1] &&
469 (fClusterTypeArea[1][1] ||
470 fClusterTypeArea[1][0])
474 fClusterTypeArea[1][0] &&
475 fClusterTypeArea[1][1] &&
476 (fClusterTypeArea[0][1] ||
477 fClusterTypeArea[0][0])
485 fClusterTypeArea[2][0] &&
486 fClusterTypeArea[1][0] &&
487 fClusterTypeArea[0][0] )
495 fClusterTypeArea[0][3] &&
496 fClusterTypeArea[0][2] &&
497 fClusterTypeArea[0][1] &&
498 fClusterTypeArea[0][0] )
504 fClusterTypeArea[1][1] &&
505 fClusterTypeArea[1][0] &&
506 fClusterTypeArea[0][1] &&
507 fClusterTypeArea[0][0] )
512 // X and equivalent...
516 fClusterTypeArea[1][0] &&
517 fClusterTypeArea[1][1] &&
518 fClusterTypeArea[1][2] &&
519 fClusterTypeArea[0][0]
523 fClusterTypeArea[1][0] &&
524 fClusterTypeArea[1][1] &&
525 fClusterTypeArea[1][2] &&
526 fClusterTypeArea[0][2]
530 fClusterTypeArea[0][0] &&
531 fClusterTypeArea[0][1] &&
532 fClusterTypeArea[0][2] &&
533 fClusterTypeArea[1][0]
537 fClusterTypeArea[0][0] &&
538 fClusterTypeArea[0][1] &&
539 fClusterTypeArea[0][2] &&
540 fClusterTypeArea[1][2]
548 // X and equivalent...
552 fClusterTypeArea[1][0] &&
553 fClusterTypeArea[1][1] &&
554 fClusterTypeArea[1][2] &&
555 fClusterTypeArea[0][1]
559 fClusterTypeArea[0][0] &&
560 fClusterTypeArea[0][1] &&
561 fClusterTypeArea[0][2] &&
562 fClusterTypeArea[1][1]
569 // XXX and equivalent...
573 fClusterTypeArea[2][0] &&
574 fClusterTypeArea[2][1] &&
575 fClusterTypeArea[1][1] &&
576 fClusterTypeArea[0][1]
580 fClusterTypeArea[0][0] &&
581 fClusterTypeArea[2][1] &&
582 fClusterTypeArea[1][1] &&
583 fClusterTypeArea[0][1]
587 fClusterTypeArea[2][1] &&
588 fClusterTypeArea[2][0] &&
589 fClusterTypeArea[1][0] &&
590 fClusterTypeArea[0][0]
594 fClusterTypeArea[0][1] &&
595 fClusterTypeArea[2][0] &&
596 fClusterTypeArea[1][0] &&
597 fClusterTypeArea[0][0]
604 // XXX and equivalent...
608 fClusterTypeArea[1][0] &&
609 fClusterTypeArea[2][1] &&
610 fClusterTypeArea[1][1] &&
611 fClusterTypeArea[0][1]
615 fClusterTypeArea[1][1] &&
616 fClusterTypeArea[2][0] &&
617 fClusterTypeArea[1][0] &&
618 fClusterTypeArea[0][0]
625 // X and equivalent...
629 fClusterTypeArea[0][0] &&
630 fClusterTypeArea[1][1]
634 fClusterTypeArea[1][0] &&
635 fClusterTypeArea[0][1]
643 // X and equivalent...
647 fClusterTypeArea[0][0] &&
648 fClusterTypeArea[0][1] &&
649 fClusterTypeArea[1][2]
653 fClusterTypeArea[1][0] &&
654 fClusterTypeArea[1][1] &&
655 fClusterTypeArea[0][2]
659 fClusterTypeArea[1][0] &&
660 fClusterTypeArea[0][1] &&
661 fClusterTypeArea[0][2]
665 fClusterTypeArea[0][0] &&
666 fClusterTypeArea[1][1] &&
667 fClusterTypeArea[1][2]
674 // X and equivalent...
678 fClusterTypeArea[0][0] &&
679 fClusterTypeArea[1][0] &&
680 fClusterTypeArea[2][1]
684 fClusterTypeArea[0][1] &&
685 fClusterTypeArea[1][1] &&
686 fClusterTypeArea[2][0]
690 fClusterTypeArea[0][0] &&
691 fClusterTypeArea[1][1] &&
692 fClusterTypeArea[2][1]
696 fClusterTypeArea[0][1] &&
697 fClusterTypeArea[1][0] &&
698 fClusterTypeArea[2][0]
709 //___________________________________________________________________________________________________
710 UInt_t AliITSUpgradeClusterFinder::GetPixelCharge(UInt_t col, UInt_t row){
715 //AliInfo(Form(" entrate charge array %i ", fChargeArray->GetEntries()));
716 for(Int_t entry =0; entry < fChargeArray->GetEntries(); entry++){
717 /* TObjString *s = (TObjString*)fChargeArray->At(entry);
718 TString name = s->GetString();
719 if(!name.Contains(Form("%i %i",col,row)))
721 AliInfo(Form(" 1 entry %i ", entry));
722 TObjArray *array = name.Tokenize(" ");
723 array->SetOwner(kTRUE);
724 AliInfo(Form(" 2 entry %i ", entry));
725 TString charge = ((TObjString*)array->At(2))->String();
728 rowS = ((TObjString*)array->At(0))->String();
729 colS = ((TObjString*)array->At(1))->String();
730 AliInfo(Form(" 3 prima del delete entry %i ", entry));
733 AliInfo(Form(" 4 dopo il delete entry %i ", entry));
736 AliITSUPixelModule *pixMod = (AliITSUPixelModule*)fChargeArray->At(entry);
737 // pixMod->PrintInfo();
738 if(col!=pixMod->GetCol())continue;
739 if(row!=pixMod->GetRow())continue;
740 q= pixMod->GetCharge();
745 //____________________________________________________
747 void AliITSUpgradeClusterFinder::AddLabelIndex(UInt_t col, UInt_t row){
749 // Adding cluster labels
752 for(Int_t entry =0; entry < fChargeArray->GetEntries(); entry++){
753 /* TObjString *s = (TObjString*)fChargeArray->At(entry);
754 TString name = s->GetString();
755 if(!name.Contains(Form("%i %i",col,row)))
757 TObjArray *array = name.Tokenize(" ");
760 for(Int_t i=0; i<3; i++){
761 index[i]=((TObjString*)array->At(3+i))->String();
762 label[i]=index[i].Atoi();
766 AliITSUPixelModule *pix= (AliITSUPixelModule*)fChargeArray->At(entry);
767 if(col!=pix->GetCol())continue;
768 if(row!=pix->GetRow())continue;
769 Int_t label[3]={-1,-1,-1};
770 for(Int_t i=0;i<3;i++){
771 label[i] = pix->GetLabels(i);
776 //____________________________________________________
778 void AliITSUpgradeClusterFinder::SetLabels(Int_t label[3]){
780 //Set the MC lables to the cluster
783 Bool_t isAssigned[3]={kFALSE,kFALSE,kFALSE};
784 for(Int_t k=0; k<3; k++){
785 if(label[k]<0) continue;
786 for(Int_t i=0; i<kMAXCLUSTERTYPESIDEZ*kMAXCLUSTERTYPESIDEY; i++){
787 if(position>=kMAXCLUSTERTYPESIDEZ*kMAXCLUSTERTYPESIDEY) continue;
788 // if there is no label assigned and it is not present in previous labels
789 if(fLabels[position]<0) {
791 fLabels[position]=label[k];
797 // check if this label has been already assigned, if this is the case, go to the next label[k]
798 if(fLabels[position]==label[k]) {
811 //____________________________________________________
812 void AliITSUpgradeClusterFinder::MakeRecPointBranch(TTree *treeR){
814 // Creating the branch (see AliITSUpgradeReconstructor::Reconstruct)
817 if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPointU",1000);
819 TBranch *branch = treeR->GetBranch("ITSRecPoints");
821 else branch = treeR->Branch("ITSRecPoints",&fRecPoints);
824 //____________________________________________________
825 void AliITSUpgradeClusterFinder::SetRecPointTreeAddress(TTree *treeR){
827 // Addressing the branch (see AliITSUpgradeReconstructor::Reconstruct)
830 if(!fRecPoints) fRecPoints = new TClonesArray("AliITSRecPointU",1000);
833 branch = treeR->GetBranch("ITSRecPoints");
835 branch->SetAddress(&fRecPoints);
836 } else AliError("No RecPoint branch available");
839 //____________________________________________________
840 void AliITSUpgradeClusterFinder::DigitsToRecPoints(const TObjArray *digList) {
842 // the clusterization is performed here
844 AliITSsegmentationUpgrade *segmentation = new AliITSsegmentationUpgrade();
845 AliITSRecPointU recpnt;
847 TClonesArray &lrecp = *fRecPoints;
848 for(Int_t ilayer=0; ilayer < 6 ;ilayer ++){
850 TClonesArray *pArrDig= (TClonesArray*)digList->At(ilayer);
854 for(Int_t ientr =0; ientr < pArrDig->GetEntries() ; ientr++){
855 AliITSDigitUpgrade *dig = (AliITSDigitUpgrade*)pArrDig->At(ientr);
856 Int_t colz=dig->GetzPixelNumber();
857 Int_t rowx=dig->GetxPixelNumber();
858 Double_t hitcharge= (dig->GetNelectrons());
859 ProcessHit(dig->GetModule(),colz, rowx,(Short_t)hitcharge,dig->GetTracks());
862 for(Int_t module=0; module<fNSectors; module++){
864 // printf(" module loop %i \n", module);
865 for(UInt_t nClu = 0; nClu < GetClusterCount(module); nClu++){
866 //printf(" nclu in getclustercount %i \n", nClu);
867 UShort_t charge = GetCharge(module, nClu);
869 recpnt.SetLayer(ilayer);
870 recpnt.SetModule(module);
871 Int_t *lab=GetLabels(module,nClu);
872 for(Int_t l=0; l<3; l++) {recpnt.SetLabel(lab[l],l);}
874 Double_t xzl2[2]={0.,0.};
875 Double_t xPixC2,zPixC2=0.;
877 xPixC2 = GetClusterMeanRow(module, nClu);
878 zPixC2 = GetClusterMeanCol(module, nClu);
879 //cout << "zPixC2 "<< zPixC2 << endl;
880 xzl2[0] = xPixC2*(segmentation->GetCellSizeX(ilayer))+0.5*(segmentation-> GetCellSizeX(ilayer));
881 xzl2[1] = zPixC2*(segmentation->GetCellSizeZ(ilayer))+0.5*(segmentation->GetCellSizeZ(ilayer))-(segmentation->GetHalfLength(ilayer));
882 //check2 = segmentation->DetToGlobal(ilayer,xzl2[0], xzl2[1],xcheck2,ycheck2,zcheck2);
883 recpnt.SetType(GetClusterType(module,nClu ));
884 recpnt.SetLocalCoord(xzl2[0],xzl2[1]); //temporary solution (no LocalToTrack Matrix)
885 //from global to tracking system coordinate
886 // global coordinate -> local coordinate getting alpha angle of the recpoint
888 Double_t yclu1 = 0.;//upgrade clusters global coordinate ( ITS official: GetX tracking coordinate)
889 Double_t zclu1 = 0.;//upgrade clusters global coordinate ( ITS official: GetX tracking coordinate)
890 // Float_t xclg = xcheck2;//upgrade clusters global coordinate ( ITS official: GetX tracking coordinate)
891 // Float_t yclg = ycheck2;
892 // Float_t zclg = zcheck2;
894 detr = segmentation->DetToTrack(ilayer,module, xzl2[0],xzl2[1], yclu1, zclu1);
895 // printf( " det to track in clusterfinder il %i xl %f zl %f y track %f z track %f module %i \n", ilayer, xzl2[0] , xzl2[1] , yclu1, zclu1, module);
897 //////////////////////////
903 Double_t xsize, zsize;
904 segmentation->GetSegmentation(ilayer,xsize, zsize);
905 recpnt.SetSigmaY2(xsize/TMath::Sqrt(12)*xsize/TMath::Sqrt(12));
906 recpnt.SetSigmaZ2(zsize/TMath::Sqrt(12)*zsize/TMath::Sqrt(12));
907 new(lrecp[nClusters++]) AliITSRecPointU(recpnt);
908 //Int_t idx = fRecPoints->GetEntries();
909 AliDebug(1,Form("recpoint : Nelectrons %f (entry %i)",recpnt.GetQ(),fRecPoints->GetEntries()));
911 }//cluster list entries
914 if(segmentation) delete segmentation;