]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSClusterFinderSSD.h
Problem with the HP compilers fixed.
[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 <TObject.h>
8 #include <TArrayS.h>
9 #include <TClonesArray.h>
10 #include <TRandom.h>
11 #include <TMath.h>
12
13 #include "AliITS.h"
14 #include "AliITSclusterSSD.h"
15 #include "AliITSpackageSSD.h"
16 #include "AliITSClusterFinder.h"
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   TClonesArray       *fDigits;      //Pointer to TClonesArray of digits
109
110   TClonesArray       *fRecPoints;   //Pointer to TClonesArray of rec points
111   
112         
113   TClonesArray    *fClusterP;    //
114   Int_t            fNClusterP;   //Number of P side clusters in the array
115                 
116   TClonesArray    *fClusterN;    //Number of N side clusters in the array
117   Int_t            fNClusterN; 
118     
119   TClonesArray    *fPackages;    //packages  
120   Int_t            fNPackages;
121     
122   TArrayI         *fDigitsIndexP;       //Digits on P side
123   Int_t            fNDigitsP;           //Number of Digits on P side
124                 
125   TArrayI         *fDigitsIndexN;       //Digits on N side
126   Int_t            fNDigitsN;           //Number of Digits on N side
127
128
129   Float_t          fPitch;              //Strip pitch
130   Float_t          fTanP;               //Pside stereo angle tangent
131   Float_t          fTanN;               //Nside stereo angle tangent
132
133 /*************************************************/
134 /**  parameters for reconstruction            ****/
135 /**  to be tune when slow simulation raliable ****/
136 /*************************************************/ 
137   
138   Float_t falpha1; 
139   Float_t falpha2;
140   Float_t falpha3;
141
142     
143   static const Bool_t SIDEP=kTRUE;
144   static const Bool_t SIDEN=kFALSE;
145   static const Float_t PNsignalRatio = 7./8.;
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