]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCclustererMI.h
Corrected position of the second resistor chain
[u/mrichter/AliRoot.git] / TPC / AliTPCclustererMI.h
index 0b781a5e17d11b4e8c9dec0715d76fafc7667a24..475122a9e3ad1668cdfa3984c061eb241893d9d9 100644 (file)
 //-------------------------------------------------------
 #include <Rtypes.h>
 #include <TObject.h>
+#include <AliTPCRecoParam.h>
 #define kMAXCLUSTER 2500
 
 class TFile;
+class TClonesArray;
 class AliTPCParam;
 class AliTPCRecoParam;
 class AliTPCclusterMI;
@@ -28,7 +30,6 @@ class TTree;
 class TTreeSRedirector;
 class  AliRawEventHeaderBase;
 class AliTPCCalROC;
-class TVirtualFFT;
 
 class AliTPCclustererMI : public TObject{
 public:
@@ -37,11 +38,16 @@ public:
   AliTPCclustererMI &operator = (const AliTPCclustererMI & param); //assignment
   virtual ~AliTPCclustererMI();
   virtual void Digits2Clusters();
+  virtual void Digits2ClustersOld(AliRawReader* rawReader);
   virtual void Digits2Clusters(AliRawReader* rawReader);
-  virtual void SetOldRCUFormat(Bool_t rcuFormat = kFALSE)
-    { fIsOldRCUFormat = rcuFormat; };
-  virtual void SetInput(TTree * tree);  // set input tree with digits    
-  virtual void SetOutput(TTree * tree); //set output tree with 
+  virtual void SetInput(TTree * tree);  // set input tree with digits
+  virtual void SetOutput(TTree * tree); // set output tree with 
+  virtual void FillRow();               // fill the output container - Tree or TObjArray
+  TObjArray * GetOutputArray(){return fOutputArray;}
+  TClonesArray * GetOutputClonesArray(){return fOutputClonesArray;}
+
+  void StoreInClonesArray(Bool_t bOutput = kTRUE) {fBClonesArray = bOutput;} // store output clusters in TClonesArray
+
 private:
   Bool_t IsMaximum(Float_t k, Int_t max, const Float_t *bins) const; 
   void MakeCluster2(Int_t k,Int_t max,Float_t *bins,UInt_t m,
@@ -55,12 +61,13 @@ private:
   void UnfoldCluster(Float_t * matrix[7], Float_t recmatrix[5][5], 
                     Float_t & meani, Float_t & meanj, Float_t & sum, Float_t &overlap );
   void FindClusters(AliTPCCalROC * noiseROC);
+  Bool_t AcceptCluster(AliTPCclusterMI*c);
   Double_t  ProcesSignal(Float_t * signal, Int_t nchannels, Int_t id[3], Double_t &rms, Double_t &pedestalCalib);
-  void DumpHistos(); 
-  Int_t  TransformFFT(Float_t *input, Float_t threshold, Bool_t locMax, Float_t *freq, Float_t *re, Float_t *im, Float_t *mag, Float_t *phi);
-
+  void ProcessSectorData(Float_t** allBins, Int_t** allSigBins, Int_t*  allNSigBins);
+  
   Float_t * fBins;       //!digits array
-  Float_t * fResBins;    //!digits array with res. after 1 finder
+  Int_t   * fSigBins; //!digits array containg only timebins above threshold
+  Int_t     fNSigBins;//!size of fSigBins
   Int_t fLoop;         //loop - cf in 2 loops
   Int_t fMaxBin;       //current ( for current sector)  maximal bin
   Int_t fMaxTime;      //current ( for current sector)  maximal time
@@ -73,22 +80,24 @@ private:
   Float_t fPadLength;  // the width of the pad
   Float_t fZWidth;     //the z bin width
   Bool_t  fPedSubtraction; // perform pedestal subtraction or not
-  Bool_t  fIsOldRCUFormat; // assume old RCU raw data format
   AliRawEventHeaderBase *fEventHeader; //! event header information
   UInt_t  fTimeStamp;   // Time Stamp
   UInt_t  fEventType;   // Event Type
   TTree * fInput;   //!input  tree with digits - object not owner
   TTree * fOutput;   //!output tree with digits - object not owner
+  TObjArray *fOutputArray;     //! output TObjArray with pointers arrays of cluster
+  TClonesArray *fOutputClonesArray; //! output TClonesArray with clusters
   AliTPCClustersRow * fRowCl;  //! current cluster row
   AliSimDigits * fRowDig;      //! current digits row
   const AliTPCParam * fParam;        //! tpc parameters
   Int_t fNcluster;             // number of clusters - for given row
-  TObjArray * fAmplitudeHisto;          //! array of histograms of amplitudes
+  Int_t fNclusters;            // tot number of clusters
   TTreeSRedirector *fDebugStreamer;     //!debug streamer
   const AliTPCRecoParam  * fRecoParam;        //! reconstruction parameters
   Bool_t  fBDumpSignal; // dump signal flag
-  TVirtualFFT *fFFTr2c;                 //! Fast Furier transform object   
-  ClassDef(AliTPCclustererMI,1)  // Time Projection Chamber digits
+  Bool_t  fBClonesArray; // output clusters stored in TClonesArray 
+
+  ClassDef(AliTPCclustererMI,2)  // Time Projection Chamber digits
 };
 
 inline Bool_t AliTPCclustererMI::IsMaximum(Float_t q,Int_t max,const Float_t *bins) const {
@@ -101,6 +110,17 @@ inline Bool_t AliTPCclustererMI::IsMaximum(Float_t q,Int_t max,const Float_t *bi
   if (bins[+max-1] >= q) return kFALSE; 
   if (bins[+max+1] > q) return kFALSE; 
   if (bins[-max+1] >= q) return kFALSE;
+  //
+  //
+  if (fRecoParam->GetClusterMaxRange(1)>0){  //local maxima in z on more than 1 time bin 
+    if (bins[-2] > q) return kFALSE;
+    if (bins[ 2] > q) return kFALSE;
+  }
+  if (fRecoParam->GetClusterMaxRange(0)>0){  //local maxima in y on more than pad 
+    if (bins[-2*max] > q) return kFALSE;
+    if (bins[ 2*max] > q) return kFALSE;
+  }
+
   return kTRUE; 
 }