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 //
13 ////////////////////////////////////////////////
16 #include <TClonesArray.h>
20 class AliITSsegmentation;
21 class AliITSRawCluster;
24 class AliITSDetTypeRec;
26 //----------------------------------------------------------------------
27 class AliITSClusterFinder :public TObject{
29 AliITSClusterFinder(); // Default constructor
30 // Standard Constructor
31 AliITSClusterFinder(AliITSDetTypeRec* dettyp);
32 AliITSClusterFinder(AliITSDetTypeRec* dettyp,TClonesArray *digits);// Standard+ Constructor
33 virtual ~AliITSClusterFinder(); // Destructor
35 // Do the Reconstruction.
36 virtual void FindRawClusters(Int_t mod=0); // Finds cluster of digits.
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;}
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
53 virtual void SetClusters(TClonesArray *itsClusters){// set clusters
54 fClusters = itsClusters;fNRawClusters = fClusters->GetEntriesFast();}
56 virtual TClonesArray* Clusters(){return fClusters;}
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,
68 virtual void FillCluster(AliITSRawCluster *,Int_t) {}// fiil cluster
69 virtual void FillCluster(AliITSRawCluster *cluster) {// fill cluster
70 FillCluster(cluster,1);}
72 virtual void SetModule(Int_t module){fModule = module;}// Set module number
73 virtual Int_t GetModule()const {return fModule;}// Returns module number
76 // Given a cluster of digits, creates the nessesary RecPoint. May also
77 // do some peak separation.
78 virtual void CreateRecPoints(TObjArray *,Int_t){};
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
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;}
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 *){}
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);}
108 virtual void SetDetTypeRec(AliITSDetTypeRec* dtr) {fDetTypeRec=dtr;}
109 AliITSDetTypeRec* GetDetTypeRec() const {return fDetTypeRec;}
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
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 Int_t fNdet[2200]; // detector index
133 Int_t fNlayer[2200]; // detector layer
135 AliITSClusterFinder(const AliITSClusterFinder &source); // copy constructor
136 // assignment operator
137 AliITSClusterFinder& operator=(const AliITSClusterFinder &source);
140 ClassDef(AliITSClusterFinder,7) //Class for clustering and reconstruction of space points
142 // Input and output functions for standard C++ input/output.
143 ostream &operator<<(ostream &os,AliITSClusterFinder &source);
144 istream &operator>>(istream &os,AliITSClusterFinder &source);