1 #ifndef ALIITSCLUSTERFINDER_H
2 #define ALIITSCLUSTERFINDER_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
9 ////////////////////////////////////////////////
10 // ITS Cluster Finder Class //
11 ////////////////////////////////////////////////
13 #include <Riostream.h>
15 #include <TClonesArray.h>
19 class AliITSsegmentation;
20 class AliITSRawCluster;
25 //----------------------------------------------------------------------
26 class AliITSClusterFinder :public TObject{
28 AliITSClusterFinder(); // Default constructor
29 // Standard Constructor
30 AliITSClusterFinder(AliITSsegmentation *seg, AliITSresponse *resp);
31 AliITSClusterFinder(AliITSsegmentation *seg, AliITSresponse *resp,
32 TClonesArray *digits);// Standard+ Constructor
33 virtual ~AliITSClusterFinder(); // Destructor
34 AliITSClusterFinder(const AliITSClusterFinder &source); // copy constructor
35 // assignment operator
36 AliITSClusterFinder& operator=(const AliITSClusterFinder &source);
38 // Do the Reconstruction.
39 virtual void FindRawClusters(Int_t mod=0); // Finds cluster of digits.
41 // Sets the debug flag for debugging output
42 void SetDebug(Int_t level=1){fDebug=level;}
43 // Clears the debug flag so no debugging output will be generated
44 void SetNoDebug(){fDebug=0;}
45 // Returns the debug flag value
46 Bool_t GetDebug(Int_t level=1)const {return fDebug>=level;}
48 // Setters and Getters
50 virtual void SetSegmentation(AliITSsegmentation *segmentation) {
51 fSegmentation=segmentation;}
52 //Returns fSegmentation
53 virtual AliITSsegmentation* GetSegmentation()const{return fSegmentation;}
55 virtual void SetDigits(TClonesArray *itsDigits) {// set digits
56 fDigits=itsDigits;fNdigits = fDigits->GetEntriesFast();}
57 virtual AliITSdigit* GetDigit(Int_t i){ // Returns ith digit
58 return (AliITSdigit*) fDigits->UncheckedAt(i);}
59 virtual TClonesArray* Digits(){return fDigits;}// Gets fDigits
60 virtual Int_t NDigits() const {return fNdigits;}// Get Number of Digits
63 virtual AliITSresponse* GetResponse()const{return fResponse;}
64 virtual void SetResponse(AliITSresponse *response) {// set response
68 virtual void SetClusters(TClonesArray *itsClusters){// set clusters
69 fClusters = itsClusters;fNRawClusters = fClusters->GetEntriesFast();}
71 virtual TClonesArray* Clusters(){return fClusters;}
73 virtual AliITSRawCluster* Cluster(Int_t i){
74 return (AliITSRawCluster*)(fClusters->At(i));}
75 // Returns the present number of enteries
76 virtual Int_t NClusters()const {return fClusters->GetEntriesFast();}
77 // returns fNRawClusters
78 virtual Int_t GetNRawClusters() const {return fNRawClusters;}
79 // Determins if digit i has a neighbor and if so that neighor index is j.
80 virtual void AddCluster(Int_t branch,AliITSRawCluster *c);
81 virtual void AddCluster(Int_t branch,AliITSRawCluster *c,
83 virtual void FillCluster(AliITSRawCluster *,Int_t) {}// fiil cluster
84 virtual void FillCluster(AliITSRawCluster *cluster) {// fill cluster
85 FillCluster(cluster,1);}
86 virtual void FindCluster(Int_t,Int_t,AliITSRawCluster *) {}// find cluster
88 virtual void SetModule(Int_t module){fModule = module;}// Set module number
89 virtual Int_t GetModule()const{return fModule;}// Returns module number
92 // Given a cluster of digits, creates the nessesary RecPoint. May also
93 // do some peak separation.
94 virtual void CreateRecPoints(TObjArray *,Int_t){};
96 virtual void SetMap(AliITSMap *m) {fMap=m;}// map
97 AliITSMap* Map(){return fMap;}// map
98 virtual Int_t GetNperMax() const {return fNperMax;}// returns fNperMax
99 // returns fDeclusterFlag
100 virtual Int_t GetDeclusterFlag()const{return fDeclusterFlag;}
101 // returns fClusterSize
102 virtual Int_t GetClusterSize() const {return fClusterSize;}
103 virtual Int_t GetNPeaks() const {return fNPeaks;}// returns fNPeaks
105 virtual Bool_t IsNeighbor(TObjArray *digs,Int_t i,Int_t j[]) const;
106 virtual void Decluster(AliITSRawCluster *) {}// Decluster
107 // Set max. Number of cells per local cluster
108 virtual void SetNperMax(Int_t npermax=3) {fNperMax = npermax;}
110 virtual void SetDeclusterFlag(Int_t flag=1){fDeclusterFlag=flag;}
111 // Set max. cluster size ; bigger clusters will be rejected
112 virtual void SetClusterSize(Int_t clsize=3) {fClusterSize = clsize;}
113 virtual void CalibrateCOG() {}// Self Calibration of COG
114 virtual void CorrectCOG(){}// correct COG
115 virtual Bool_t Centered(AliITSRawCluster *) const {return kTRUE;}// cluster
116 //split by local maxima
117 virtual void SplitByLocalMaxima(AliITSRawCluster *){}
119 void Print(ostream *os); // Class ascii print function
120 void Read(istream *os); // Class ascii read function
124 Int_t fDebug; //! Debug flag/level
125 Int_t fModule; //! Module number to be reconstuctted
126 TClonesArray *fDigits; //! digits
127 Int_t fNdigits; //! num of digits
129 AliITSresponse *fResponse; //! response
130 AliITSsegmentation *fSegmentation; //! segmentation
131 TClonesArray *fClusters; //! Array of clusters
132 Int_t fNRawClusters; //! in case we split the cluster
133 // and want to keep track of
134 // the cluster which was splitted
135 AliITSMap *fMap; //! map
136 Int_t fNperMax; //! NperMax
137 Int_t fDeclusterFlag; //! DeclusterFlag
138 Int_t fClusterSize; //! ClusterSize
139 Int_t fNPeaks; //! NPeaks
141 ClassDef(AliITSClusterFinder,3) //Class for clustering and reconstruction of space points
143 // Input and output functions for standard C++ input/output.
144 ostream &operator<<(ostream &os,AliITSClusterFinder &source);
145 istream &operator>>(istream &os,AliITSClusterFinder &source);