1 #ifndef ALITPCCLUSTERER_H
2 #define ALITPCCLUSTERER_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
11 //-------------------------------------------------------
14 // Origin: Marian Ivanov
15 //-------------------------------------------------------
18 #include <AliTPCRecoParam.h>
19 #define kMAXCLUSTER 2500
24 class AliTPCRecoParam;
25 class AliTPCclusterMI;
26 class AliTPCClustersRow;
30 class TTreeSRedirector;
31 class AliRawEventHeaderBase;
34 class AliTPCclusterer : public TObject{
36 AliTPCclusterer(const AliTPCParam* par, const AliTPCRecoParam * recoParam = 0);
37 virtual ~AliTPCclusterer();
38 virtual void Digits2Clusters();
39 virtual void Digits2Clusters(AliRawReader* rawReader);
40 virtual void SetInput(TTree * tree); // set input tree with digits
41 virtual void SetOutput(TTree * tree); // set output tree with
42 virtual void FillRow(); // fill the output container - Tree or TObjArray
43 TObjArray * GetOutputArray(){return fOutputArray;}
44 TClonesArray * GetOutputClonesArray(){return fOutputClonesArray;}
46 void StoreInClonesArray(Bool_t bOutput = kTRUE) {fBClonesArray = bOutput;} // store output clusters in TClonesArray
48 void SetUseHLTClusters(Int_t useHLTClusters) {fUseHLTClusters = useHLTClusters;} // set usage from HLT clusters from rec.C options
51 AliTPCclusterer(const AliTPCclusterer ¶m); // copy constructor
52 AliTPCclusterer &operator = (const AliTPCclusterer & param); //assignment
54 Bool_t IsMaximum(Float_t k, Int_t max, const Float_t *bins) const;
55 void MakeCluster2(Int_t k,Int_t max,Float_t *bins,UInt_t m,
57 void MakeCluster(Int_t k,Int_t max,Float_t *bins,UInt_t m,
59 Float_t GetSigmaY2(Int_t iz);
60 Float_t GetSigmaZ2(Int_t iz);
61 Float_t FitMax(Float_t vmatrix[5][5], Float_t y, Float_t z, Float_t sigmay, Float_t sigmaz);
62 void AddCluster(AliTPCclusterMI &c, Float_t *matrix, Int_t pos); // add the cluster to the array
63 void UnfoldCluster(Float_t * matrix[7], Float_t recmatrix[5][5],
64 Float_t & meani, Float_t & meanj, Float_t & sum, Float_t &overlap );
65 void FindClusters(AliTPCCalROC * noiseROC);
66 Bool_t AcceptCluster(AliTPCclusterMI*c);
67 Double_t ProcesSignal(Float_t * signal, Int_t nchannels, Int_t id[3], Double_t &rms, Double_t &pedestalCalib);
68 void ProcessSectorData();
69 Int_t ReadHLTClusters();
71 Float_t * fBins; //!digits array
72 Int_t * fSigBins; //!digits array containg only timebins above threshold
73 Int_t fNSigBins;//!size of fSigBins
74 Int_t fLoop; //loop - cf in 2 loops
75 Int_t fMaxBin; //current ( for current sector) maximal bin
76 Int_t fMaxTime; //current ( for current sector) maximal time
77 Int_t fMaxPad; //current ( for current sector) maximal pad
78 Int_t fSector; //!current sector
79 Int_t fRow; //!current row
80 Float_t fSign; //!current sign
81 Float_t fRx; // current radius
82 Float_t fPadWidth; // the width of the pad
83 Float_t fPadLength; // the width of the pad
84 Float_t fZWidth; //the z bin width
85 Bool_t fPedSubtraction; // perform pedestal subtraction or not
86 AliRawEventHeaderBase *fEventHeader; //! event header information
87 UInt_t fTimeStamp; // Time Stamp
88 UInt_t fEventType; // Event Type
89 TTree * fInput; //!input tree with digits - object not owner
90 TTree * fOutput; //!output tree with digits - object not owner
91 TObjArray *fOutputArray; //! output TObjArray with pointers arrays of cluster
92 TClonesArray *fOutputClonesArray; //! output TClonesArray with clusters
93 AliTPCClustersRow * fRowCl; //! current cluster row
94 AliSimDigits * fRowDig; //! current digits row
95 const AliTPCParam * fParam; //! tpc parameters
96 Int_t fNcluster; // number of clusters - for given row
97 Int_t fNclusters; // tot number of clusters
98 TTreeSRedirector *fDebugStreamer; //!debug streamer
99 const AliTPCRecoParam * fRecoParam; //! reconstruction parameters
100 Bool_t fBDumpSignal; // dump signal flag
101 Bool_t fBClonesArray; // output clusters stored in TClonesArray
102 Int_t fUseHLTClusters; // use HLT clusters instead of offline clusters
104 // Non-persistent arrays
106 Float_t** fAllBins; //! All sector bins
107 Int_t** fAllSigBins;//! All signal bins in a sector
108 Int_t* fAllNSigBins;//! Number of signal bins in a sector
109 TObject* fHLTClusterAccess;// interface to HLT clusters
111 ClassDef(AliTPCclusterer,0) // TPC cluster finder
114 inline Bool_t AliTPCclusterer::IsMaximum(Float_t q,Int_t max,const Float_t *bins) const {
115 //is this a local maximum ?
116 if (bins[-max] >= q) return kFALSE;
117 if (bins[-1 ] >= q) return kFALSE;
118 if (bins[+max] > q) return kFALSE;
119 if (bins[+1 ] > q) return kFALSE;
120 if (bins[-max-1] >= q) return kFALSE;
121 if (bins[+max-1] >= q) return kFALSE;
122 if (bins[+max+1] > q) return kFALSE;
123 if (bins[-max+1] >= q) return kFALSE;
126 if (fRecoParam->GetClusterMaxRange(1)>0){ //local maxima in z on more than 1 time bin
127 if (bins[-2] > q) return kFALSE;
128 if (bins[ 2] > q) return kFALSE;
130 if (fRecoParam->GetClusterMaxRange(0)>0){ //local maxima in y on more than pad
131 if (bins[-2*max] > q) return kFALSE;
132 if (bins[ 2*max] > q) return kFALSE;
140 //-----------------------------------------------------------------