1 #ifndef ALITRDCLUSTERIZER_H
2 #define ALITRDCLUSTERIZER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 ////////////////////////////////////////////////////////////////////////////
10 // TRD cluster finder //
12 ////////////////////////////////////////////////////////////////////////////
27 class AliTRDarraySignal;
28 class AliTRDdigitsManager;
29 class AliTRDSignalIndex;
30 class AliTRDtransform;
32 class AliTRDReconstructor;
33 class AliTRDCalSingleChamberStatus;
35 class AliTRDclusterizer : public TNamed
42 kIsHLT = BIT(12), // are we just in HLT?
43 kIsLUT = BIT(13), // are we using look up table for center of the cluster?
44 kOwner = BIT(14), // is the clusterizer owner of the clusters?
45 kAddLabels = BIT(15) // Should clusters have MC labels?
56 MaxStruct():Row(-1),Col(0),Time(0),padStatus(0),FivePad(kFALSE)
58 MaxStruct &operator=(const MaxStruct &a)
59 {Row=a.Row; Col=a.Col; Time=a.Time; padStatus=a.padStatus; FivePad=a.FivePad;
60 memcpy(Signals, a.Signals, 3*sizeof(Signals[0])); return *this;}
63 AliTRDclusterizer(const AliTRDReconstructor *const rec = 0x0);
64 AliTRDclusterizer(const Text_t* name, const Text_t* title, const AliTRDReconstructor *const rec = 0x0);
65 AliTRDclusterizer(const AliTRDclusterizer &c);
66 virtual ~AliTRDclusterizer();
67 AliTRDclusterizer &operator=(const AliTRDclusterizer &c);
69 virtual void Copy(TObject &c) const;
71 virtual Bool_t Open(const Char_t *name, Int_t nEvent = 0);
72 virtual Bool_t OpenInput(Int_t nEvent = 0);
73 virtual Bool_t OpenOutput();
74 virtual Bool_t OpenOutput(TTree *clusterTree);
76 virtual Bool_t ReadDigits();
77 virtual Bool_t ReadDigits(AliRawReader *rawReader);
78 virtual Bool_t ReadDigits(TTree *digitsTree);
80 virtual Bool_t WriteClusters(Int_t det);
81 void ResetRecPoints();
82 virtual TClonesArray *RecPoints();
83 Bool_t WriteTracklets(Int_t det);
85 virtual Bool_t Raw2Clusters(AliRawReader *rawReader);
86 virtual Bool_t Raw2ClustersChamber(AliRawReader *rawReader);
88 virtual Bool_t MakeClusters();
89 virtual Bool_t MakeClusters(Int_t det);
91 virtual Bool_t AddLabels(const Int_t idet, const Int_t firstClusterROC, const Int_t nClusterROC);
92 virtual Bool_t SetAddLabels(const Bool_t kset) { SetBit(kAddLabels, kset); return TestBit(kAddLabels); } // should we assign labels to clusters
93 virtual void SetRawVersion(const Int_t iver) { fRawVersion = iver; } // set the expected raw data version
94 void SetReconstructor(const AliTRDReconstructor *rec) {fReconstructor = rec;}
95 static UChar_t GetStatus(Short_t &signal);
96 Int_t GetAddedClusters() {return fNoOfClusters;}
98 virtual Bool_t IsClustersOwner() const {return TestBit(kOwner);}
99 void SetClustersOwner(Bool_t own=kTRUE) {SetBit(kOwner, own); if(!own) {fRecPoints = 0x0; fNoOfClusters=0;} }
103 void DeConvExp (const Double_t *const source, Double_t *const target
104 ,const Int_t nTimeTotal, const Int_t nexp);
105 void TailCancelation();
107 virtual Float_t Unfold(Double_t eps, Int_t layer, Double_t *padSignal) const;
108 Double_t GetCOG(Double_t signal[5]) const;
110 Double_t LUTposition(Int_t ilayer, Double_t ampL, Double_t ampC, Double_t ampR) const;
112 void SetPadStatus(const UChar_t status, UChar_t &encoding);
113 UChar_t GetPadStatus(UChar_t encoding) const;
114 Int_t GetCorruption(UChar_t encoding) const;
116 Bool_t IsMaximum(const MaxStruct &Max, UChar_t &padStatus, Short_t *const Signals); //for const correctness reasons not const parameters are given separately
117 Bool_t FivePadCluster(MaxStruct &ThisMax, MaxStruct &NeighbourMax);
118 void CreateCluster(const MaxStruct &Max);
119 inline void CalcAdditionalInfo(const MaxStruct &Max, Short_t *const signals, Int_t &nPadCount);
120 virtual void AddClusterToArray(AliTRDcluster *cluster);
122 const AliTRDReconstructor *fReconstructor; //! reconstructor
123 AliRunLoader *fRunLoader; //! Run Loader
124 TTree *fClusterTree; //! Tree with the cluster
125 TClonesArray *fRecPoints; //! Array of clusters
127 TTree *fTrackletTree; //! Tree for tracklets
129 AliTRDdigitsManager *fDigitsManager; //! TRD digits manager
131 UInt_t **fTrackletContainer; //! tracklet container
133 Int_t fRawVersion; // Expected raw version of the data - default is 2
135 AliTRDtransform *fTransform; //! Transforms the reconstructed space points
137 Int_t fLUTbin; // Number of bins of the LUT
138 Double_t *fLUT; //! The lookup table
140 AliTRDarrayADC *fDigits; // Array holding the digits
141 AliTRDSignalIndex *fIndexes; // Array holding the indexes to the digits
142 Float_t fADCthresh; // ADC thresholds: There is no ADC threshold anymore, and simParam should not be used in clusterizer. KO
143 Float_t fMaxThresh; // Threshold value for the maximum
144 Float_t fSigThresh; // Threshold value for the digit signal
145 Float_t fMinMaxCutSigma; // Threshold value for the maximum (cut noise)
146 Float_t fMinLeftRightCutSigma; // Threshold value for the sum pad (cut noise)
147 Int_t fLayer; // Current layer of the detector
148 Int_t fDet; // Current detecor
149 UShort_t fVolid; // Volume ID
150 Int_t fColMax; // Number of Colums in one detector
151 Int_t fTimeTotal; // Number of time bins
152 AliTRDCalROC *fCalGainFactorROC; // Calibration object with pad wise values for the gain factors
153 Float_t fCalGainFactorDetValue;// Calibration value for chamber wise noise
154 AliTRDCalROC *fCalNoiseROC; // Calibration object with pad wise values for the noise
155 Float_t fCalNoiseDetValue; // Calibration value for chamber wise noise
156 AliTRDCalSingleChamberStatus *fCalPadStatusROC; // Calibration object with the pad status
157 Int_t fClusterROC; // The index to the first cluster of a given ROC
158 Int_t firstClusterROC; // The number of cluster in a given ROC
159 Int_t fNoOfClusters; // Number of Clusters already processed and still owned by the clusterizer
161 ClassDef(AliTRDclusterizer,6) // TRD clusterfinder