]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCclustererMI.h
Bug fix - chack the abs values
[u/mrichter/AliRoot.git] / TPC / AliTPCclustererMI.h
CommitLineData
1c53abe2 1#ifndef ALITPCCLUSTERERMI_H
2#define ALITPCCLUSTERERMI_H
3
722aa38c 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
1c53abe2 11//-------------------------------------------------------
12// TPC clusterer
13//
14// Origin: Marian Ivanov
15//-------------------------------------------------------
16#include <Rtypes.h>
17#include <TObject.h>
6fbe1e5c 18#include <AliTPCRecoParam.h>
1c53abe2 19#define kMAXCLUSTER 2500
20
21class TFile;
98ee6d31 22class TClonesArray;
1c53abe2 23class AliTPCParam;
194b0609 24class AliTPCRecoParam;
1c53abe2 25class AliTPCclusterMI;
26class AliTPCClustersRow;
f8aae377 27class AliRawReader;
1c53abe2 28class AliSimDigits;
29class TTree;
65c045f0 30class TTreeSRedirector;
ef4ad662 31class AliRawEventHeaderBase;
940ed1f0 32class AliTPCCalROC;
1c53abe2 33
34class AliTPCclustererMI : public TObject{
35public:
194b0609 36 AliTPCclustererMI(const AliTPCParam* par, const AliTPCRecoParam * recoParam = 0);
e046d791 37 AliTPCclustererMI(const AliTPCclustererMI &param); // copy constructor
38 AliTPCclustererMI &operator = (const AliTPCclustererMI & param); //assignment
65c045f0 39 virtual ~AliTPCclustererMI();
f8aae377 40 virtual void Digits2Clusters();
7c9528d8 41 virtual void Digits2ClustersOld(AliRawReader* rawReader);
f8aae377 42 virtual void Digits2Clusters(AliRawReader* rawReader);
7c9528d8 43 virtual void SetInput(TTree * tree); // set input tree with digits
ebe95b38 44 virtual void SetOutput(TTree * tree); // set output tree with
45 virtual void FillRow(); // fill the output container - Tree or TObjArray
46 TObjArray * GetOutputArray(){return fOutputArray;}
98ee6d31 47 TClonesArray * GetOutputClonesArray(){return fOutputClonesArray;}
48
49 void StoreInClonesArray(Bool_t bOutput = kTRUE) {fBClonesArray = bOutput;} // store output clusters in TClonesArray
50
1c53abe2 51private:
97f127bb 52 Bool_t IsMaximum(Float_t k, Int_t max, const Float_t *bins) const;
13116aec 53 void MakeCluster2(Int_t k,Int_t max,Float_t *bins,UInt_t m,
1c53abe2 54 AliTPCclusterMI &c);
13116aec 55 void MakeCluster(Int_t k,Int_t max,Float_t *bins,UInt_t m,
1c53abe2 56 AliTPCclusterMI &c);
57 Float_t GetSigmaY2(Int_t iz);
58 Float_t GetSigmaZ2(Int_t iz);
59 Float_t FitMax(Float_t vmatrix[5][5], Float_t y, Float_t z, Float_t sigmay, Float_t sigmaz);
03fe1804 60 void AddCluster(AliTPCclusterMI &c, Float_t *matrix, Int_t pos); // add the cluster to the array
13116aec 61 void UnfoldCluster(Float_t * matrix[7], Float_t recmatrix[5][5],
1c53abe2 62 Float_t & meani, Float_t & meanj, Float_t & sum, Float_t &overlap );
940ed1f0 63 void FindClusters(AliTPCCalROC * noiseROC);
eea36fac 64 Bool_t AcceptCluster(AliTPCclusterMI*c);
940ed1f0 65 Double_t ProcesSignal(Float_t * signal, Int_t nchannels, Int_t id[3], Double_t &rms, Double_t &pedestalCalib);
e7034a8b 66 void ProcessSectorData();
7c9528d8 67
13116aec 68 Float_t * fBins; //!digits array
5b33a7f5 69 Int_t * fSigBins; //!digits array containg only timebins above threshold
70 Int_t fNSigBins;//!size of fSigBins
1c53abe2 71 Int_t fLoop; //loop - cf in 2 loops
97f127bb 72 Int_t fMaxBin; //current ( for current sector) maximal bin
73 Int_t fMaxTime; //current ( for current sector) maximal time
74 Int_t fMaxPad; //current ( for current sector) maximal pad
1c53abe2 75 Int_t fSector; //!current sector
508541c7 76 Int_t fRow; //!current row
1c53abe2 77 Float_t fSign; //!current sign
78 Float_t fRx; // current radius
79 Float_t fPadWidth; // the width of the pad
80 Float_t fPadLength; // the width of the pad
81 Float_t fZWidth; //the z bin width
b6f060dc 82 Bool_t fPedSubtraction; // perform pedestal subtraction or not
ef4ad662 83 AliRawEventHeaderBase *fEventHeader; //! event header information
84 UInt_t fTimeStamp; // Time Stamp
85 UInt_t fEventType; // Event Type
1c53abe2 86 TTree * fInput; //!input tree with digits - object not owner
87 TTree * fOutput; //!output tree with digits - object not owner
ebe95b38 88 TObjArray *fOutputArray; //! output TObjArray with pointers arrays of cluster
98ee6d31 89 TClonesArray *fOutputClonesArray; //! output TClonesArray with clusters
1c53abe2 90 AliTPCClustersRow * fRowCl; //! current cluster row
91 AliSimDigits * fRowDig; //! current digits row
92 const AliTPCParam * fParam; //! tpc parameters
93 Int_t fNcluster; // number of clusters - for given row
98ee6d31 94 Int_t fNclusters; // tot number of clusters
65c045f0 95 TTreeSRedirector *fDebugStreamer; //!debug streamer
194b0609 96 const AliTPCRecoParam * fRecoParam; //! reconstruction parameters
7041b196 97 Bool_t fBDumpSignal; // dump signal flag
98ee6d31 98 Bool_t fBClonesArray; // output clusters stored in TClonesArray
99
e7034a8b 100 // Non-persistent arrays
101
102 Float_t** fAllBins; //! All sector bins
103 Int_t** fAllSigBins;//! All signal bins in a sector
104 Int_t* fAllNSigBins;//! Number of signal bins in a sector
105
106
9a090ccd 107 ClassDef(AliTPCclustererMI,2) // Time Projection Chamber digits
1c53abe2 108};
109
97f127bb 110inline Bool_t AliTPCclustererMI::IsMaximum(Float_t q,Int_t max,const Float_t *bins) const {
1c53abe2 111 //is this a local maximum ?
112 if (bins[-max] >= q) return kFALSE;
113 if (bins[-1 ] >= q) return kFALSE;
114 if (bins[+max] > q) return kFALSE;
115 if (bins[+1 ] > q) return kFALSE;
116 if (bins[-max-1] >= q) return kFALSE;
117 if (bins[+max-1] >= q) return kFALSE;
118 if (bins[+max+1] > q) return kFALSE;
119 if (bins[-max+1] >= q) return kFALSE;
6fbe1e5c 120 //
121 //
122 if (fRecoParam->GetClusterMaxRange(1)>0){ //local maxima in z on more than 1 time bin
123 if (bins[-2] > q) return kFALSE;
124 if (bins[ 2] > q) return kFALSE;
125 }
126 if (fRecoParam->GetClusterMaxRange(0)>0){ //local maxima in y on more than pad
127 if (bins[-2*max] > q) return kFALSE;
128 if (bins[ 2*max] > q) return kFALSE;
129 }
130
1c53abe2 131 return kTRUE;
132}
133
134
135
136//-----------------------------------------------------------------
137
138#endif
139
140