1 /* Copyright(c) 2004-2006, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
3 /////////////////////////////////////////////////////////////////////
4 // Author: A.Mastroserio, C.Terrevoli //
5 // annalisa.mastroserio@cern.ch //
6 // cristina.terrevoli@ba.infn.it //
7 // Alternative cluster finder. Usage instructions below. //
10 // 1. Call StartEvent() //
11 // 2. For each pixel hit: //
12 // Call ProcessHit(..) or ProcessHitOnline(..) //
13 // 3. Call FinishEvent() //
14 // 4. Access cluster information for this event by methods: //
15 // GetClusterCount(layer) //
16 // GetClusterMeanCol(layer,index) //
17 // GetClusterMeanRow(layer,index) //
18 // GetClusterSize(layer,index) //
19 // GetClusterType(layer,index) //
21 /////////////////////////////////////////////////////////////////////
25 #ifndef ALIITSUPGRADECLUSTERFINDER_H
26 #define ALIITSUPGRADECLUSTERFINDER_H
29 #include "AliITSUpgradeClusterList.h"
30 #include <TObjArray.h>
32 class AliITSUpgradeClusterFinder :public TObject{
35 AliITSUpgradeClusterFinder();
36 ~AliITSUpgradeClusterFinder();
38 void ActivateClusterTypeSearch(){fClusterTypeFlag=kTRUE;}
39 void DeActivateClusterTypeSearch(){fClusterTypeFlag=kFALSE;}
42 Int_t ProcessHit(Int_t layer, UInt_t col, UInt_t row, UShort_t charge,Int_t label[3]);
43 Int_t ProcessHitOnline(Int_t layer, UInt_t col, UInt_t row, UShort_t charge, Int_t label[3]);
46 void AddLabelIndex(UInt_t col, UInt_t row);
47 void SetLabels(Int_t label[3]);
49 UInt_t GetClusterCount(Int_t layer);
50 Float_t GetClusterMeanCol(Int_t layer, UInt_t index);
51 Float_t GetClusterMeanRow(Int_t layer, UInt_t index);
52 UInt_t GetClusterSize(Int_t layer, UInt_t index);
53 UInt_t GetClusterWidthZ(Int_t layer, UInt_t index);
54 UInt_t GetClusterWidthPhi(Int_t layer, UInt_t index);
55 UInt_t GetClusterType(Int_t layer, UInt_t index);
56 UShort_t GetCharge(Int_t layer, UInt_t index);
57 UInt_t GetPixelCharge(UInt_t col, UInt_t row);
58 Int_t* GetLabels(Int_t layer,UInt_t index) ;
59 void PrintClusters(Int_t layer);
60 void PrintAllClusters();
66 Int_t DoModuleClustering(Int_t Layer, UShort_t charge);
67 UInt_t FindClusterRecu(Int_t col, Int_t row, UShort_t charge);
68 void ShiftClusterTypeArea(UInt_t direction);
69 UInt_t GetClusterType(UInt_t size);
70 UInt_t GetClusterWidthZ();
71 UInt_t GetClusterWidthPhi();
73 enum {kMAXCLUSTERTYPESIDEZ=3,kMAXCLUSTERTYPESIDEY=4}; // region of interest for cluster type pattern
74 enum {kSHIFTRIGHT,kSHIFTDOWN}; // used for shifting the region of interest for cluster type pattern
76 UInt_t fNhitsLeft; // number of hits still left to process for this module
77 Bool_t fHits[39530][39530];// hit map for this module
78 UShort_t fHitCol[999999]; // these two arrays remember which pixels are hit for this module
79 UShort_t fHitRow[999999]; // these two arrays remember which pixels are hit for this module
80 Short_t fOldModule; // remember previous module (-1 at start of event)
81 Bool_t fClusterTypeFlag; // should we classify the clusters at all
82 Bool_t fFindClusterType; // temporary, for classifying a cluster (pattern of pixels)
83 UShort_t fClusterTypeOrigCol;// temporary, for classifying a cluster (pattern of pixels)
84 UShort_t fClusterTypeOrigRow;// temporary, for classifying a cluster (pattern of pixels)
85 UInt_t fColSum; // used to determine the center of a cluster
86 UInt_t fRowSum; // used to determine the center of a cluster
87 UShort_t fCharge; // cluster charge
88 Int_t fTmpLabel[3]; // label array to be kept temporarily during the clustering procedure
89 Int_t fLabels[10]; // label array to be attached to the cluster
91 UShort_t fClusterWidthMaxCol;
92 UShort_t fClusterWidthMinCol;
93 UShort_t fClusterWidthMaxRow;
94 UShort_t fClusterWidthMinRow;
95 Bool_t fClusterTypeArea[kMAXCLUSTERTYPESIDEZ][kMAXCLUSTERTYPESIDEY];// same as above comments
96 AliITSUpgradeClusterList fClusterList[8];
97 TObjArray *fChargeArray;
99 AliITSUpgradeClusterFinder(const AliITSUpgradeClusterFinder &source); // copy constructor
100 // assignment operator
101 AliITSUpgradeClusterFinder& operator=(const AliITSUpgradeClusterFinder &source);
104 ClassDef(AliITSUpgradeClusterFinder,1)