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