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