]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCclustererMI.h
Transition to NewIO
[u/mrichter/AliRoot.git] / TPC / AliTPCclustererMI.h
1 #ifndef ALITPCCLUSTERERMI_H
2 #define ALITPCCLUSTERERMI_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
11 //-------------------------------------------------------
12 //                       TPC clusterer
13 //
14 //   Origin: Marian Ivanov  
15 //-------------------------------------------------------
16 #include <Rtypes.h>
17 #include <TObject.h>
18 #define kMAXCLUSTER 2500
19
20 class TFile;
21 class AliTPCParam;
22 class AliTPCclusterMI;
23 class AliTPCClustersRow;
24 class AliSimDigits;
25 class TTree;
26
27 class AliTPCclustererMI : public TObject{
28 public:
29   AliTPCclustererMI();
30   virtual void Digits2Clusters(const AliTPCParam *par, Int_t eventn=1);
31   virtual void SetInput(TTree * tree);  // set input tree with digits    
32   virtual void SetOutput(TTree * tree); //set output tree with 
33 private:
34   Bool_t IsMaximum(Int_t k, Int_t max, const Int_t *bins); 
35   void MakeCluster2(Int_t k,Int_t max,Int_t *bins,UInt_t m,
36    AliTPCclusterMI &c);  
37   void MakeCluster(Int_t k,Int_t max,Int_t *bins,UInt_t m,
38    AliTPCclusterMI &c); 
39   Float_t  GetSigmaY2(Int_t iz);
40   Float_t  GetSigmaZ2(Int_t iz);
41   Float_t  FitMax(Float_t vmatrix[5][5], Float_t y, Float_t z, Float_t sigmay, Float_t sigmaz);
42   void AddCluster(AliTPCclusterMI &c);  // add the cluster to the array
43   void UnfoldCluster(Int_t * matrix[7], Float_t recmatrix[5][5], 
44                      Float_t & meani, Float_t & meanj, Float_t & sum, Float_t &overlap );
45
46
47
48   Int_t * fBins;       //!digits array
49   Int_t * fResBins;    //!digits array with res. after 1 finder
50   Int_t fLoop;         //loop - cf in 2 loops
51   Int_t fMaxBin;
52   Int_t fMaxTime;
53   Int_t fMaxPad;
54   Int_t fSector;      //!current sector
55   Float_t fSign;      //!current sign 
56   Float_t fRx;        // current radius
57   Float_t fPadWidth;  // the width of the pad
58   Float_t fPadLength;  // the width of the pad
59   Float_t fZWidth;     //the z bin width
60
61   TTree * fInput;   //!input  tree with digits - object not owner
62   TTree * fOutput;   //!output tree with digits - object not owner
63   AliTPCClustersRow * fRowCl;  //! current cluster row
64   AliSimDigits * fRowDig;      //! current digits row
65   const AliTPCParam * fParam;        //! tpc parameters
66   Int_t fNcluster;             // number of clusters - for given row
67   ClassDef(AliTPCclustererMI,1)  // Time Projection Chamber digits
68 };
69
70 inline Bool_t AliTPCclustererMI::IsMaximum(Int_t q,Int_t max,const Int_t *bins){
71   //is this a local maximum ?
72   if (bins[-max] >= q) return kFALSE;
73   if (bins[-1  ] >= q) return kFALSE; 
74   if (bins[+max] > q) return kFALSE; 
75   if (bins[+1  ] > q) return kFALSE; 
76   if (bins[-max-1] >= q) return kFALSE;
77   if (bins[+max-1] >= q) return kFALSE; 
78   if (bins[+max+1] > q) return kFALSE; 
79   if (bins[-max+1] >= q) return kFALSE;
80   return kTRUE; 
81 }
82
83
84
85 //-----------------------------------------------------------------
86
87 #endif
88
89