]>
Commit | Line | Data |
---|---|---|
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 */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
8 | //////////////////////////////////////////////////////////////////////////// | |
9 | // // | |
10 | // TRD cluster finder // | |
11 | // // | |
12 | //////////////////////////////////////////////////////////////////////////// | |
13 | ||
14 | #include <TNamed.h> | |
15 | ||
16 | class TFile; | |
17 | class TTree; | |
18 | class TClonesArray; | |
19 | ||
20 | class AliRunLoader; | |
21 | class AliRawReader; | |
22 | ||
23 | class AliTRD; | |
24 | class AliTRDcluster; | |
25 | ||
26 | class AliTRDarrayADC; | |
27 | class AliTRDarraySignal; | |
28 | class AliTRDdigitsManager; | |
29 | class AliTRDSignalIndex; | |
30 | class AliTRDtransform; | |
31 | class AliTRDCalROC; | |
32 | class AliTRDReconstructor; | |
33 | ||
34 | class AliTRDclusterizer : public TNamed | |
35 | { | |
36 | ||
37 | public: | |
38 | ||
39 | // steering flags | |
40 | enum{ | |
41 | kOwner = BIT(14) | |
42 | }; | |
43 | ||
44 | struct MaxStruct | |
45 | { | |
46 | Int_t Row; | |
47 | Int_t Col; | |
48 | Int_t Time; | |
49 | UChar_t padStatus; | |
50 | Float_t Signals[3]; | |
51 | MaxStruct():Row(0),Col(0),Time(0),padStatus(0) | |
52 | {} | |
53 | MaxStruct &operator=(const MaxStruct &a) | |
54 | {Row=a.Row; Col=a.Col; Time=a.Time; padStatus=a.padStatus; | |
55 | memcpy(Signals, a.Signals, 3*sizeof(Signals[0])); return *this;} | |
56 | }; | |
57 | ||
58 | AliTRDclusterizer(const AliTRDReconstructor *const rec = 0x0); | |
59 | AliTRDclusterizer(const Text_t* name, const Text_t* title, const AliTRDReconstructor *const rec = 0x0); | |
60 | AliTRDclusterizer(const AliTRDclusterizer &c); | |
61 | virtual ~AliTRDclusterizer(); | |
62 | AliTRDclusterizer &operator=(const AliTRDclusterizer &c); | |
63 | ||
64 | virtual void Copy(TObject &c) const; | |
65 | ||
66 | virtual Bool_t Open(const Char_t *name, Int_t nEvent = 0); | |
67 | virtual Bool_t OpenInput(Int_t nEvent = 0); | |
68 | virtual Bool_t OpenOutput(); | |
69 | virtual Bool_t OpenOutput(TTree *clusterTree); | |
70 | ||
71 | virtual Bool_t ReadDigits(); | |
72 | virtual Bool_t ReadDigits(AliRawReader *rawReader); | |
73 | virtual Bool_t ReadDigits(TTree *digitsTree); | |
74 | ||
75 | virtual Bool_t WriteClusters(Int_t det); | |
76 | void ResetRecPoints(); | |
77 | TClonesArray *RecPoints(); | |
78 | Bool_t WriteTracklets(Int_t det); | |
79 | ||
80 | virtual Bool_t Raw2Clusters(AliRawReader *rawReader); | |
81 | virtual Bool_t Raw2ClustersChamber(AliRawReader *rawReader); | |
82 | ||
83 | virtual Bool_t MakeClusters(); | |
84 | virtual Bool_t MakeClusters(Int_t det); | |
85 | ||
86 | virtual Bool_t AddLabels(const Int_t idet, const Int_t firstClusterROC, const Int_t nClusterROC); | |
87 | virtual Bool_t SetAddLabels(const Bool_t kset) { fAddLabels = kset; return fAddLabels; } // should we assign labels to clusters | |
88 | virtual void SetRawVersion(const Int_t iver) { fRawVersion = iver; } // set the expected raw data version | |
89 | void SetReconstructor(const AliTRDReconstructor *rec) {fReconstructor = rec;} | |
90 | static UChar_t GetStatus(Short_t &signal); | |
91 | ||
92 | Bool_t IsClustersOwner() const {return TestBit(kOwner);} | |
93 | void SetClustersOwner(Bool_t own=kTRUE) {SetBit(kOwner, own); if(!own) fRecPoints = 0x0;} | |
94 | ||
95 | protected: | |
96 | ||
97 | void DeConvExp (const Double_t *const source, Double_t *const target | |
98 | ,const Int_t nTimeTotal, const Int_t nexp); | |
99 | void TailCancelation(); | |
100 | ||
101 | virtual Float_t Unfold(Double_t eps, Int_t layer, Double_t *padSignal) const; | |
102 | Double_t GetCOG(Double_t signal[5]) const; | |
103 | void FillLUT(); | |
104 | Double_t LUTposition(Int_t ilayer, Double_t ampL, Double_t ampC, Double_t ampR) const; | |
105 | ||
106 | void SetPadStatus(const UChar_t status, UChar_t &encoding); | |
107 | UChar_t GetPadStatus(UChar_t encoding) const; | |
108 | Int_t GetCorruption(UChar_t encoding) const; | |
109 | ||
110 | Bool_t IsMaximum(const MaxStruct &Max, UChar_t &padStatus, Float_t *const Signals); //for const correctness reasons not const parameters are given separately | |
111 | Bool_t IsFivePadCluster(const MaxStruct &ThisMax, const MaxStruct &NeighbourMax, Float_t &ratio); // '' | |
112 | void CreateCluster(const MaxStruct &Max); | |
113 | ||
114 | const AliTRDReconstructor *fReconstructor; //! reconstructor | |
115 | AliRunLoader *fRunLoader; //! Run Loader | |
116 | TTree *fClusterTree; //! Tree with the cluster | |
117 | TClonesArray *fRecPoints; //! Array of clusters | |
118 | ||
119 | TTree *fTrackletTree; //! Tree for tracklets | |
120 | ||
121 | AliTRDdigitsManager *fDigitsManager; //! TRD digits manager | |
122 | ||
123 | UInt_t **fTrackletContainer; //! tracklet container | |
124 | ||
125 | Bool_t fAddLabels; // Should clusters have MC labels? | |
126 | Int_t fRawVersion; // Expected raw version of the data - default is 2 | |
127 | ||
128 | AliTRDtransform *fTransform; //! Transforms the reconstructed space points | |
129 | ||
130 | Int_t fLUTbin; // Number of bins of the LUT | |
131 | Double_t *fLUT; //! The lookup table | |
132 | ||
133 | AliTRDarrayADC *fDigitsIn; | |
134 | AliTRDSignalIndex *fIndexes; | |
135 | Float_t fADCthresh; // ADC thresholds: There is no ADC threshold anymore, and simParam should not be used in clusterizer. KO | |
136 | Float_t fMaxThresh; // Threshold value for the maximum | |
137 | Float_t fSigThresh; // Threshold value for the digit signal | |
138 | Float_t fMinMaxCutSigma; // Threshold value for the maximum (cut noise) | |
139 | Float_t fMinLeftRightCutSigma; // Threshold value for the sum pad (cut noise) | |
140 | Int_t fLayer; // Current layer of the detector | |
141 | Int_t fDet; // Current detecor | |
142 | UShort_t fVolid; // Volume ID | |
143 | Int_t fColMax; // Number of Colums in one detector | |
144 | Int_t fTimeTotal; // Number of time bins | |
145 | AliTRDCalROC *fCalGainFactorROC; // Calibration object with pad wise values for the gain factors | |
146 | Float_t fCalGainFactorDetValue;// Calibration value for chamber wise noise | |
147 | AliTRDCalROC *fCalNoiseROC; // Calibration object with pad wise values for the noise | |
148 | Float_t fCalNoiseDetValue; // Calibration value for chamber wise noise | |
149 | AliTRDarraySignal *fDigitsOut; | |
150 | Int_t fClusterROC; // The index to the first cluster of a given ROC | |
151 | Int_t firstClusterROC; // The number of cluster in a given ROC | |
152 | ||
153 | ClassDef(AliTRDclusterizer,6) // TRD clusterfinder | |
154 | ||
155 | }; | |
156 | ||
157 | #endif |