]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSClusterFinder.h
Temporary fix waiting for the real changes
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinder.h
1 #ifndef ALIITSCLUSTERFINDER_H
2 #define ALIITSCLUSTERFINDER_H
3  
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6  
7 /* $Id$ */
8
9 ////////////////////////////////////////////////
10 //  ITS Cluster Finder Class                  //
11 ////////////////////////////////////////////////
12
13 #include <Riostream.h>
14 #include <TObject.h>
15 #include <TClonesArray.h>
16
17 class AliITSMap;
18 class AliITSresponse;
19 class AliITSsegmentation;
20 class AliITSRawCluster;
21 class AliITS;
22 class AliITSdigit;
23 class AliITSRecPoint;
24
25 //----------------------------------------------------------------------
26 class AliITSClusterFinder :public TObject{
27   public:
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);
37     //
38     // Do the Reconstruction.
39     virtual void FindRawClusters(Int_t mod=0); // Finds cluster of digits.
40     //
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;}
47     //
48     // Setters and Getters
49     // segmentation
50     virtual void SetSegmentation(AliITSsegmentation *segmentation) {
51         fSegmentation=segmentation;}
52     //Returns fSegmentation
53     virtual AliITSsegmentation* GetSegmentation()const{return fSegmentation;}
54     // Digit
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
61     // Response
62     //Return Response
63     virtual AliITSresponse* GetResponse()const{return fResponse;}
64     virtual void SetResponse(AliITSresponse *response) {// set response
65         fResponse=response;}
66     // clulsters
67     // Set fClusters up
68     virtual void SetClusters(TClonesArray *itsClusters){// set clusters
69         fClusters = itsClusters;fNRawClusters = fClusters->GetEntriesFast();}
70     // Get fCluters
71     virtual TClonesArray* Clusters(){return fClusters;}
72     // Get fCluter
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,
82                             AliITSRecPoint &rp);
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
87     //
88     virtual void SetModule(Int_t module){fModule = module;}// Set module number
89     virtual Int_t GetModule()const{return fModule;}// Returns module number
90     //
91     // RecPoints
92     // Given a cluster of digits, creates the nessesary RecPoint. May also
93     // do some peak separation.
94     virtual void CreateRecPoints(TObjArray *,Int_t){};
95     // Others
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
104     //
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;}
109     //Decluster
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 *){}
118     // IO functions
119     void Print(ostream *os); // Class ascii print function
120     void Read(istream *os);  // Class ascii read function
121
122     // data members
123   protected:
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
128
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  
140
141     ClassDef(AliITSClusterFinder,3) //Class for clustering and reconstruction of space points
142 };
143 // Input and output functions for standard C++ input/output.
144 ostream &operator<<(ostream &os,AliITSClusterFinder &source);
145 istream &operator>>(istream &os,AliITSClusterFinder &source);
146 #endif