]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSClusterFinderSSD.h
Fixed bug with GetCovMatrix returning a pointer to a deleted local array.
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinderSSD.h
1 #ifndef ALIITSCLUSTERFINDERSSD_H
2 #define ALIITSCLUSTERFINDERSSD_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6
7 #include <TArrayS.h>
8 #include <TRandom.h>
9 #include <TMath.h>
10
11 //#include "AliITSclusterSSD.h"
12 //#include "AliITSpackageSSD.h"
13 #include "AliITSClusterFinder.h"
14
15 class AliITSclusterSSD;
16 class AliITSpackageSSD;
17
18
19 class AliITSClusterFinderSSD: public AliITSClusterFinder 
20 {
21     
22 public:       
23     
24   AliITSClusterFinderSSD(AliITSsegmentation *seg, TClonesArray *digits, TClonesArray *recp);
25                 
26   virtual ~AliITSClusterFinderSSD();
27
28
29   void FindRawClusters();
30
31     
32   void SetAlpha1(Float_t a) {fAlpha1 =a;}
33   void SetAlpha2(Float_t a) {fAlpha2 =a;}
34   void SetAlpha3(Float_t a) {fAlpha3 =a;}
35
36
37
38  protected:
39    
40   void      InitReconstruction();
41   Bool_t    CreateNewRecPoint(Float_t P, Float_t dP, Float_t N, Float_t dN,
42                               Float_t Sig,Float_t dSig,
43                               AliITSclusterSSD *clusterP, AliITSclusterSSD *clusterN,
44                               Stat_t prob);
45   Bool_t   CreateNewRecPoint(AliITSclusterSSD *clusterP, AliITSclusterSSD *clusterN, Stat_t prob);
46   
47   AliITSclusterSSD* GetPSideCluster(Int_t idx);
48   AliITSclusterSSD* GetNSideCluster(Int_t idx);
49   AliITSclusterSSD* GetCluster(Int_t idx, Bool_t side);
50
51
52   void      FindNeighbouringDigits();
53   void      SeparateOverlappedClusters();
54   void      SplitCluster(TArrayI *list, Int_t nsplits, Int_t index, Bool_t side);
55   Int_t     SortDigitsP(Int_t start, Int_t end);
56   Int_t     SortDigitsN(Int_t start, Int_t end);
57   void      FillDigitsIndex();
58   void      SortDigits();
59   void      FillClIndexArrays(Int_t* arrayP, Int_t *arrayN);
60   void      SortClusters(Int_t* arrayP, Int_t *arrayN);
61   Int_t     SortClustersP(Int_t start, Int_t end,Int_t *array);
62   Int_t     SortClustersN(Int_t start, Int_t end,Int_t *array);
63   void      ConsumeClusters();
64   void      ClustersToPackages();
65   void      PackagesToPoints();
66   void      ReconstructNotConsumedClusters();
67   Bool_t    Strip2Local( Float_t stripP, Float_t stripN, Float_t &Z,Float_t &X);
68   Float_t   GetClusterZ(AliITSclusterSSD* clust);
69   Bool_t    IsCrossing(AliITSclusterSSD* p, AliITSclusterSSD* n);
70   //returns index of best combination in "comb"
71   Int_t     GetBestComb(Int_t** comb,Int_t Ncomb, Int_t Ncl, AliITSpackageSSD * pkg);
72
73   //get point that have best signal ratio
74   void      GetBestMatchingPoint(Int_t & ip, Int_t & in, AliITSpackageSSD* pkg );                                       
75   
76   //calculates Distance To Perfect Matching Line
77   Float_t   DistToPML(Float_t psig, Float_t nsig){ return  (TMath::Abs( (7.0*nsig - 8.0*psig )/10.630146) );}
78   
79   
80   Int_t     GetDiff(Float_t *retx, Float_t *rety) {return 0;}
81   
82   void      CalcStepFactor(Float_t Psteo, Float_t Nsteo );
83   
84 /*************************************************/
85 /**  methods for resolving packages           ****/
86 /*************************************************/ 
87 //names may not be meaningful for all, see implementations for descriptions
88
89   void      ResolveSimplePackage(AliITSpackageSSD *pkg);
90   void      ResolvePackageWithOnePSideCluster(AliITSpackageSSD *pkg);
91   void      ResolvePackageWithOneNSideCluster(AliITSpackageSSD *pkg);
92   void      ResolveTwoForTwoPackage(AliITSpackageSSD *pkg);
93
94   void      ResolveClusterWithOneCross(AliITSpackageSSD *pkg,
95                                   Int_t clusterIndex, Bool_t clusterSide);
96
97   void      ResolvePClusterWithOneCross(AliITSpackageSSD *pkg, Int_t clusterIndex);
98   void      ResolveNClusterWithOneCross(AliITSpackageSSD *pkg, Int_t clusterIndex);
99   Bool_t    ResolvePackageBestCombin(AliITSpackageSSD *pkg);
100   void      ResolveOneBestMatchingPoint(AliITSpackageSSD *pkg);
101
102   Bool_t GetCrossing(Float_t &x, Float_t &z);     //x, y of strips crossing
103   void   GetCrossingError(Float_t&, Float_t&);    //x, y of strips crossing errors
104
105   // Data memebers
106
107   AliITS          *fITS;          //!Pointer to AliITS object
108
109   TClonesArray    *fRecPoints;    //!Pointer to TClonesArray of rec points  
110         
111   TClonesArray    *fClusterP;     //!
112   Int_t            fNClusterP;    //!Number of P side clusters in the array
113                 
114   TClonesArray    *fClusterN;     //!Number of N side clusters in the array
115   Int_t            fNClusterN;    //!
116     
117   TClonesArray    *fPackages;     //!packages  
118   Int_t            fNPackages;    //!
119     
120   TArrayI         *fDigitsIndexP; //!Digits on P side
121   Int_t            fNDigitsP;      //!Number of Digits on P side
122                 
123   TArrayI         *fDigitsIndexN;  //!Digits on N side
124   Int_t            fNDigitsN;      //!Number of Digits on N side
125
126
127   Float_t          fPitch;         //!Strip pitch
128   Float_t          fTanP;          //!Pside stereo angle tangent
129   Float_t          fTanN;          //!Nside stereo angle tangent
130
131 /*************************************************/
132 /**  parameters for reconstruction            ****/
133 /**  to be tune when slow simulation raliable ****/
134 /*************************************************/ 
135   
136   Float_t fAlpha1;         //!
137   Float_t fAlpha2;         //!
138   Float_t fAlpha3;         //!
139   Float_t fPNsignalRatio;  //!
140
141     
142   static const Bool_t fgkSIDEP;  //!
143   static const Bool_t fgkSIDEN;  //!
144
145
146   Int_t fSFF;              //!forward stepping factor 
147   Int_t fSFB;              //!backward stepping factor 
148
149 public:
150     ClassDef(AliITSClusterFinderSSD, 1) //Class for clustering and reconstruction of space points in SSDs 
151
152 };
153
154
155 #endif