]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSClusterFinder.h
V2 clusterer moved to the standard framework. V2 clusters and recpoints are still...
[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 ////////////////////////////////////////////////
14
15 #include <TObject.h>
16 #include <TClonesArray.h>
17
18 class AliITSMap;
19 class AliITSresponse;
20 class AliITSsegmentation;
21 class AliITSRawCluster;
22 class AliITS;
23 class AliITSdigit;
24 class AliITSRecPoint;
25
26 //----------------------------------------------------------------------
27 class AliITSClusterFinder :public TObject{
28   public:
29     AliITSClusterFinder(); // Default constructor
30     // Standard Constructor
31     AliITSClusterFinder(AliITSsegmentation *seg, AliITSresponse *resp);
32     AliITSClusterFinder(AliITSsegmentation *seg, AliITSresponse *resp,
33                         TClonesArray *digits);// Standard+ Constructor
34     virtual ~AliITSClusterFinder(); // Destructor
35     //
36     // Do the Reconstruction.
37     virtual void FindRawClusters(Int_t mod=0); // Finds cluster of digits.
38      //
39     // Sets the debug flag for debugging output
40     void SetDebug(Int_t level=1){fDebug=level;}
41     // Clears the debug flag so no debugging output will be generated
42     void SetNoDebug(){fDebug=0;}
43     // Returns the debug flag value
44     Bool_t GetDebug(Int_t level=1)const {return fDebug>=level;}
45     //
46     // Setters and Getters
47     // segmentation
48     virtual void SetSegmentation(AliITSsegmentation *segmentation) {
49         fSegmentation=segmentation;}
50     //Returns fSegmentation
51     virtual AliITSsegmentation* GetSegmentation()const{return fSegmentation;}
52     // Digit
53     virtual void SetDigits(TClonesArray *itsDigits) {// set digits
54         fDigits=itsDigits;fNdigits = fDigits->GetEntriesFast();}
55     virtual AliITSdigit* GetDigit(Int_t i){ // Returns ith digit
56         return (AliITSdigit*) fDigits->UncheckedAt(i);}
57     virtual TClonesArray* Digits(){return fDigits;}// Gets fDigits
58     virtual Int_t   NDigits() const {return fNdigits;}// Get Number of Digits
59     // Response
60     //Return Response
61     virtual AliITSresponse* GetResponse()const{return fResponse;}
62     virtual void SetResponse(AliITSresponse *response) {// set response
63         fResponse=response;}
64     // clulsters
65     // Set fClusters up
66     virtual void SetClusters(TClonesArray *itsClusters){// set clusters
67         fClusters = itsClusters;fNRawClusters = fClusters->GetEntriesFast();}
68     // Get fCluters
69     virtual TClonesArray* Clusters(){return fClusters;}
70     // Get fCluter
71     virtual AliITSRawCluster* Cluster(Int_t i){
72         return (AliITSRawCluster*)(fClusters->At(i));}
73     // Returns the present number of enteries
74     virtual Int_t NClusters()const {return fClusters->GetEntriesFast();}
75     // returns fNRawClusters
76     virtual Int_t GetNRawClusters() const {return fNRawClusters;}
77     // Determins if digit i has a neighbor and if so that neighor index is j.
78     virtual void AddCluster(Int_t branch,AliITSRawCluster *c);
79     virtual void AddCluster(Int_t branch,AliITSRawCluster *c,
80                             AliITSRecPoint &rp);
81     virtual void   FillCluster(AliITSRawCluster *,Int_t) {}// fiil cluster
82     virtual void   FillCluster(AliITSRawCluster *cluster) {// fill cluster
83         FillCluster(cluster,1);}
84     virtual void FindCluster(Int_t,Int_t,AliITSRawCluster *) {}// find cluster
85     //
86     virtual void SetModule(Int_t module){fModule = module;}// Set module number
87     virtual Int_t GetModule()const{return fModule;}// Returns module number
88     //
89     // RecPoints
90     // Given a cluster of digits, creates the nessesary RecPoint. May also
91     // do some peak separation.
92     virtual void CreateRecPoints(TObjArray *,Int_t){};
93     // Others
94     virtual void  SetMap(AliITSMap *m) {fMap=m;}// map
95     AliITSMap* Map(){return fMap;}// map
96     virtual Int_t GetNperMax() const {return fNperMax;}// returns fNperMax
97     // returns fDeclusterFlag
98     virtual Int_t GetDeclusterFlag()const{return fDeclusterFlag;} 
99     // returns fClusterSize
100     virtual Int_t GetClusterSize() const {return fClusterSize;} 
101     virtual Int_t GetNPeaks() const {return fNPeaks;}// returns fNPeaks
102     //
103     virtual Bool_t IsNeighbor(TObjArray *digs,Int_t i,Int_t j[]) const;
104     virtual void Decluster(AliITSRawCluster *) {}// Decluster
105     // Set max. Number of cells per local cluster
106     virtual void SetNperMax(Int_t npermax=3) {fNperMax = npermax;}
107     //Decluster
108     virtual void SetDeclusterFlag(Int_t flag=1){fDeclusterFlag=flag;}
109         // Set max. cluster size ; bigger clusters will be rejected
110     virtual void SetClusterSize(Int_t clsize=3) {fClusterSize = clsize;}
111     virtual void CalibrateCOG() {}// Self Calibration of COG 
112     virtual void CorrectCOG(){}// correct COG
113     virtual Bool_t Centered(AliITSRawCluster *) const {return kTRUE;}// cluster
114     //split by local maxima
115     virtual void SplitByLocalMaxima(AliITSRawCluster *){}
116     // IO functions
117     void Print(ostream *os); // Class ascii print function
118     void Read(istream *os);  // Class ascii read function
119
120     // Conversion from RecPoints to V2Clusters
121     void RecPoints2Clusters(const TClonesArray *points, Int_t idx, TClonesArray *clusters);
122
123  
124   protected:
125     // methods 
126     static void CheckLabels(Int_t lab[3]);
127     void Init();                      
128     AliITSClusterFinder(const AliITSClusterFinder &source); // copy constructor
129     // assignment operator
130     AliITSClusterFinder& operator=(const AliITSClusterFinder &source);
131    // data members       
132     Int_t              fDebug;         //! Debug flag/level
133     Int_t              fModule;        //! Module number to be reconstuctted
134     TClonesArray       *fDigits;       //! digits
135     Int_t              fNdigits;       //! num of digits
136
137     AliITSresponse     *fResponse;     //! response
138     AliITSsegmentation *fSegmentation; //! segmentation
139     TClonesArray       *fClusters;     //! Array of clusters
140     Int_t              fNRawClusters;  //! in case we split the cluster
141                                        // and want to keep track of 
142                                        // the cluster which was splitted
143     AliITSMap          *fMap;          //! map
144     AliITS             *fITS;          //! pointer to the ITS      
145     Int_t              fNperMax;       //! NperMax
146     Int_t              fDeclusterFlag; //! DeclusterFlag
147     Int_t              fClusterSize;   //! ClusterSize
148     Int_t              fNPeaks;        //! NPeaks  
149     // Data members needed to fill AliCluster objects
150     Float_t fYshift[2200];       // y-shifts of detector local coor. systems 
151     Float_t fZshift[2200];       // z-shifts of detector local coor. systems 
152     Int_t fNdet[2200];           // detector index  
153     Int_t fNlayer[2200];         // detector layer
154
155     ClassDef(AliITSClusterFinder,4) //Class for clustering and reconstruction of space points
156 };
157 // Input and output functions for standard C++ input/output.
158 ostream &operator<<(ostream &os,AliITSClusterFinder &source);
159 istream &operator>>(istream &os,AliITSClusterFinder &source);
160 #endif