]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCclustererMI.h
Eff c++
[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 AliTPCRecoParam;
23 class AliTPCclusterMI;
24 class AliTPCClustersRow;
25 class AliRawReader;
26 class AliSimDigits;
27 class TTree;
28 class TTreeSRedirector;
29 class  AliRawEventHeaderBase;
30
31 class AliTPCclustererMI : public TObject{
32 public:
33   AliTPCclustererMI(const AliTPCParam* par, const AliTPCRecoParam * recoParam = 0);
34   AliTPCclustererMI(const AliTPCclustererMI &param); // copy constructor
35   AliTPCclustererMI &operator = (const AliTPCclustererMI & param); //assignment
36   virtual ~AliTPCclustererMI();
37   virtual void Digits2Clusters();
38   virtual void Digits2Clusters(AliRawReader* rawReader);
39   virtual void SetOldRCUFormat(Bool_t rcuFormat = kFALSE)
40     { fIsOldRCUFormat = rcuFormat; };
41   virtual void SetInput(TTree * tree);  // set input tree with digits    
42   virtual void SetOutput(TTree * tree); //set output tree with 
43 private:
44   Bool_t IsMaximum(Float_t k, Int_t max, const Float_t *bins) const; 
45   void MakeCluster2(Int_t k,Int_t max,Float_t *bins,UInt_t m,
46    AliTPCclusterMI &c);  
47   void MakeCluster(Int_t k,Int_t max,Float_t *bins,UInt_t m,
48    AliTPCclusterMI &c); 
49   Float_t  GetSigmaY2(Int_t iz);
50   Float_t  GetSigmaZ2(Int_t iz);
51   Float_t  FitMax(Float_t vmatrix[5][5], Float_t y, Float_t z, Float_t sigmay, Float_t sigmaz);
52   void AddCluster(AliTPCclusterMI &c);  // add the cluster to the array
53   void UnfoldCluster(Float_t * matrix[7], Float_t recmatrix[5][5], 
54                      Float_t & meani, Float_t & meanj, Float_t & sum, Float_t &overlap );
55   void FindClusters();
56   Double_t  ProcesSignal(Float_t * signal, Int_t nchannels, Int_t id[3], Double_t &rms);
57   void DumpHistos();
58
59
60   Float_t * fBins;       //!digits array
61   Float_t * fResBins;    //!digits array with res. after 1 finder
62   Int_t fLoop;         //loop - cf in 2 loops
63   Int_t fMaxBin;       //current ( for current sector)  maximal bin
64   Int_t fMaxTime;      //current ( for current sector)  maximal time
65   Int_t fMaxPad;       //current ( for current sector)  maximal pad
66   Int_t fSector;      //!current sector
67   Int_t fRow;         //!current row
68   Float_t fSign;      //!current sign 
69   Float_t fRx;        // current radius
70   Float_t fPadWidth;  // the width of the pad
71   Float_t fPadLength;  // the width of the pad
72   Float_t fZWidth;     //the z bin width
73
74   Bool_t  fPedSubtraction; // perform pedestal subtraction or not
75   Bool_t  fIsOldRCUFormat; // assume old RCU raw data format
76   AliRawEventHeaderBase *fEventHeader; //! event header information
77   UInt_t  fTimeStamp;   // Time Stamp
78   UInt_t  fEventType;   // Event Type
79   TTree * fInput;   //!input  tree with digits - object not owner
80   TTree * fOutput;   //!output tree with digits - object not owner
81   AliTPCClustersRow * fRowCl;  //! current cluster row
82   AliSimDigits * fRowDig;      //! current digits row
83   const AliTPCParam * fParam;        //! tpc parameters
84   Int_t fNcluster;             // number of clusters - for given row
85   TObjArray * fAmplitudeHisto;          //! array of histograms of amplitudes
86   TTreeSRedirector *fDebugStreamer;     //!debug streamer
87   const AliTPCRecoParam  * fRecoParam;        //! reconstruction parameters
88   ClassDef(AliTPCclustererMI,1)  // Time Projection Chamber digits
89 };
90
91 inline Bool_t AliTPCclustererMI::IsMaximum(Float_t q,Int_t max,const Float_t *bins) const {
92   //is this a local maximum ?
93   if (bins[-max] >= q) return kFALSE;
94   if (bins[-1  ] >= q) return kFALSE; 
95   if (bins[+max] > q) return kFALSE; 
96   if (bins[+1  ] > q) return kFALSE; 
97   if (bins[-max-1] >= q) return kFALSE;
98   if (bins[+max-1] >= q) return kFALSE; 
99   if (bins[+max+1] > q) return kFALSE; 
100   if (bins[-max+1] >= q) return kFALSE;
101   return kTRUE; 
102 }
103
104
105
106 //-----------------------------------------------------------------
107
108 #endif
109
110