]>
Commit | Line | Data |
---|---|---|
1d9af2d5 | 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. // | |
8 | // // | |
9 | // For each event: // | |
10 | // 1. Call StartEvent() // | |
11 | // 2. For each pixel hit: // | |
b86a9a14 | 12 | // Call ProcessHit(..) // |
1d9af2d5 | 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) // | |
20 | // // | |
21 | ///////////////////////////////////////////////////////////////////// | |
22 | ||
23 | /* $Id$ */ | |
24 | ||
25 | #ifndef ALIITSUPGRADECLUSTERFINDER_H | |
26 | #define ALIITSUPGRADECLUSTERFINDER_H | |
27 | ||
28 | #include <Rtypes.h> | |
29 | #include "AliITSUpgradeClusterList.h" | |
30 | #include <TObjArray.h> | |
31 | ||
6ea6235b | 32 | class TTree; |
33 | ||
1d9af2d5 | 34 | class AliITSUpgradeClusterFinder :public TObject{ |
35 | ||
36 | public: | |
37 | AliITSUpgradeClusterFinder(); | |
38 | ~AliITSUpgradeClusterFinder(); | |
39 | ||
40 | void ActivateClusterTypeSearch(){fClusterTypeFlag=kTRUE;} | |
41 | void DeActivateClusterTypeSearch(){fClusterTypeFlag=kFALSE;} | |
42 | ||
43 | void StartEvent(); | |
44 | Int_t ProcessHit(Int_t layer, UInt_t col, UInt_t row, UShort_t charge,Int_t label[3]); | |
1d9af2d5 | 45 | void FinishEvent(); |
46 | ||
47 | void AddLabelIndex(UInt_t col, UInt_t row); | |
48 | void SetLabels(Int_t label[3]); | |
6ea6235b | 49 | void MakeRecPointBranch(TTree *treeR); |
50 | void SetRecPointTreeAddress(TTree *treeR); | |
51 | ||
b86a9a14 | 52 | void DigitsToRecPoints(const TObjArray *digList); |
1d9af2d5 | 53 | |
b86a9a14 | 54 | UInt_t GetClusterCount(Int_t layer) const; |
1d9af2d5 | 55 | Float_t GetClusterMeanCol(Int_t layer, UInt_t index); |
56 | Float_t GetClusterMeanRow(Int_t layer, UInt_t index); | |
57 | UInt_t GetClusterSize(Int_t layer, UInt_t index); | |
b86a9a14 | 58 | UInt_t GetClusterWidthZ(Int_t layer, UInt_t index) ; |
59 | UInt_t GetClusterWidthPhi(Int_t layer, UInt_t index) ; | |
60 | UInt_t GetClusterType(Int_t layer, UInt_t index) ; | |
1d9af2d5 | 61 | UShort_t GetCharge(Int_t layer, UInt_t index); |
62 | UInt_t GetPixelCharge(UInt_t col, UInt_t row); | |
63 | Int_t* GetLabels(Int_t layer,UInt_t index) ; | |
64 | void PrintClusters(Int_t layer); | |
65 | void PrintAllClusters(); | |
66 | ||
67 | private: | |
68 | ||
69 | void NewEvent(); | |
70 | void NewModule(); | |
71 | Int_t DoModuleClustering(Int_t Layer, UShort_t charge); | |
72 | UInt_t FindClusterRecu(Int_t col, Int_t row, UShort_t charge); | |
73 | void ShiftClusterTypeArea(UInt_t direction); | |
74 | UInt_t GetClusterType(UInt_t size); | |
75 | UInt_t GetClusterWidthZ(); | |
76 | UInt_t GetClusterWidthPhi(); | |
77 | ||
78 | enum {kMAXCLUSTERTYPESIDEZ=3,kMAXCLUSTERTYPESIDEY=4}; // region of interest for cluster type pattern | |
79 | enum {kSHIFTRIGHT,kSHIFTDOWN}; // used for shifting the region of interest for cluster type pattern | |
80 | ||
81 | UInt_t fNhitsLeft; // number of hits still left to process for this module | |
82 | Bool_t fHits[39530][39530];// hit map for this module | |
83 | UShort_t fHitCol[999999]; // these two arrays remember which pixels are hit for this module | |
84 | UShort_t fHitRow[999999]; // these two arrays remember which pixels are hit for this module | |
85 | Short_t fOldModule; // remember previous module (-1 at start of event) | |
86 | Bool_t fClusterTypeFlag; // should we classify the clusters at all | |
87 | Bool_t fFindClusterType; // temporary, for classifying a cluster (pattern of pixels) | |
88 | UShort_t fClusterTypeOrigCol;// temporary, for classifying a cluster (pattern of pixels) | |
89 | UShort_t fClusterTypeOrigRow;// temporary, for classifying a cluster (pattern of pixels) | |
90 | UInt_t fColSum; // used to determine the center of a cluster | |
91 | UInt_t fRowSum; // used to determine the center of a cluster | |
92 | UShort_t fCharge; // cluster charge | |
93 | Int_t fTmpLabel[3]; // label array to be kept temporarily during the clustering procedure | |
c79d5f80 | 94 | Int_t fLabels[kMAXCLUSTERTYPESIDEZ*kMAXCLUSTERTYPESIDEY]; // label array to be attached to the cluster |
1d9af2d5 | 95 | |
b86a9a14 | 96 | UShort_t fClusterWidthMaxCol; //max column ID of the cluster |
97 | UShort_t fClusterWidthMinCol; //min column ID of the cluster | |
98 | UShort_t fClusterWidthMaxRow; //max row ID of the cluster | |
99 | UShort_t fClusterWidthMinRow; //min row ID of the cluster | |
1d9af2d5 | 100 | Bool_t fClusterTypeArea[kMAXCLUSTERTYPESIDEZ][kMAXCLUSTERTYPESIDEY];// same as above comments |
0ac80088 | 101 | AliITSUpgradeClusterList **fClusterList; //[fNSectors] cluster container |
b86a9a14 | 102 | TObjArray *fChargeArray; // charge identifier |
103 | TClonesArray *fRecPoints; // used to fill treeR | |
4211bbc5 | 104 | |
0ac80088 | 105 | Int_t fNSectors; |
1d9af2d5 | 106 | AliITSUpgradeClusterFinder(const AliITSUpgradeClusterFinder &source); // copy constructor |
107 | // assignment operator | |
108 | AliITSUpgradeClusterFinder& operator=(const AliITSUpgradeClusterFinder &source); | |
109 | ||
110 | ||
111 | ClassDef(AliITSUpgradeClusterFinder,1) | |
112 | ||
113 | }; | |
114 | ||
115 | ||
116 | #endif |