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