1 #ifndef ALITOFCLUSTERFINDERV1_H
2 #define ALITOFCLUSTERFINDERV1_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5 // AliTOFClusterFinderV1 Class
6 // Task: Transform digits/raw data to TOF Clusters, to fill TOF RecPoints
7 // and feed TOF tracking
11 #include "AliTOFGeometry.h"
12 #include "AliTOFRawStream.h"
24 class AliTOFClusterFinderV1 : public TObject
27 enum {kTofMaxCluster=77777}; //maximal number of the TOF clusters
31 AliTOFClusterFinderV1(AliTOFcalib *calib);
32 AliTOFClusterFinderV1(const AliTOFClusterFinderV1 &source); // copy constructor
33 AliTOFClusterFinderV1& operator=(const AliTOFClusterFinderV1 &source); // ass. op.
34 virtual ~AliTOFClusterFinderV1();
36 void Digits2RecPoints(TTree* digitsTree, TTree* clusterTree);
37 void Digits2RecPoints(AliRawReader *rawReader, TTree *clustersTree);
38 void Raw2Digits(AliRawReader *rawReader, TTree* digitsTree);
40 AliTOFClusterFinderV1(AliRunLoader* runLoader, AliTOFcalib *calib);
41 void Digits2RecPoints(Int_t iEvent);
42 void Digits2RecPoints(Int_t ievt, AliRawReader *rawReader);
43 void Raw2Digits(Int_t ievt, AliRawReader *rawReader);
48 void SetVerbose(Int_t Verbose){fVerbose=Verbose;} // To set the verbose level
49 void SetDecoderVersion(Int_t version){fDecoderVersion=version;} // To set the decoder version
50 Bool_t GetDecoderVersion() const {return fDecoderVersion;} // To get the decoder version
51 //UShort_t GetClusterVolIndex(Int_t *ind) const; //Volume Id getter
52 void GetClusterPars(Int_t *ind, Double_t *pos, Double_t *cov) const; //cluster par getter
53 void GetClusterPars(/*Bool_t check,*/ Int_t counter, Int_t **ind, Double_t *weight,
54 Double_t *pos, Double_t *cov) const; //cluster par getter
56 void FindOnePadClusterPerStrip(Int_t nSector, Int_t nPlate, Int_t nStrip);
57 void FindClustersWithoutTOT(Int_t nSector, Int_t nPlate, Int_t nStrip);
58 void FindClustersPerStrip(Int_t nSector, Int_t nPlate, Int_t nStrip, Int_t group);
60 void FindClusters34(Int_t nSector, Int_t nPlate, Int_t nStrip);
61 void FindClusters23(Int_t nSector, Int_t nPlate, Int_t nStrip);
62 void FindClusters24(Int_t nSector, Int_t nPlate, Int_t nStrip);
64 void SetMaxDeltaTime(Int_t a) {fMaxDeltaTime = a;}; // to set deltaTime [bin number]
65 void SetMaxDeltaTime(Float_t a) {fMaxDeltaTime = (Int_t)(a/AliTOFGeometry::TdcBinWidth());}; // to set deltaTime [ps]
66 Int_t GetMaxDeltaTime() {return fMaxDeltaTime;};
69 class AliTOFselectedDigit {
70 friend class AliTOFClusterFinderV1;
88 AliTOFselectedDigit(Int_t *ind, Double_t h1, Double_t h2, Double_t h3, Double_t h4, Int_t idx, Int_t *l)
95 fDetectorIndex[0]=ind[0];
96 fDetectorIndex[1]=ind[1];
97 fDetectorIndex[2]=ind[2];
98 fDetectorIndex[3]=ind[3];
99 fDetectorIndex[4]=ind[4];
106 Double_t GetTDC() const {return fTDC;} // digit TOF
107 Double_t GetADC() const {return fADC;} // digit ADC
108 Double_t GetTOT() const {return fTOT;} // digit TOT
109 Double_t GetWeight() const {return fWeight;} // digit weight
110 Int_t GetTrackLabel(Int_t n) const {return fTrackLabel[n];} // Labels of tracks in digit
111 Int_t GetDetectorIndex(Int_t n) const {return fDetectorIndex[n];} // Digit Detector Index n
112 Int_t GetIndex() const {return fIndex;} // Digit Index
116 Int_t fDetectorIndex[5]; //digit detector indices (sector, plate, strip, padX, padZ)
117 Double_t fTDC; //TDC count
118 Double_t fADC; //ADC count
119 Double_t fTOT; //TOT count
120 Double_t fWeight; //weight
121 Int_t fIndex; //index of the digit in the TOF digit tree
122 Int_t fTrackLabel[3]; //track labels
128 AliRunLoader *fRunLoader; // Pointer to Run Loader
129 AliTOFcluster *fTofClusters[kTofMaxCluster]; // pointers to the TOF clusters
130 TClonesArray *fDigits; // List of digits
131 TClonesArray *fRecPoints; // List of reconstructed points
132 Int_t fNumberOfTofClusters; // Number of TOF Clusters
133 Int_t fNumberOfTofDigits; // Number of TOF Digits
137 Int_t fMaxDeltaTime; // max time difference in between two tof
138 // measurements for two neighbouring pads
140 Int_t InsertCluster(AliTOFcluster *tofCluster); // Fills TofClusters Array
141 Int_t FindClusterIndex(Double_t z) const; // Returns cluster index
142 Bool_t MakeSlewingCorrection(Int_t *detectorIndex, Int_t tofDigitToT, Int_t tofDigitTdc,
144 void TOFclusterError(/*Bool_t check,*/ Int_t counter, Int_t **ind, Double_t *weight,
145 Double_t ppos[], Double_t cov[]) const;
147 void AverageCalculations(Int_t number, Float_t *interestingX,
148 Float_t *interestingY, Float_t *interestingZ,
149 Double_t *interestingTOF, Double_t *interestingTOT,
150 Double_t *interestingADC, Double_t *interestingWeight,
151 Int_t *parTOF, Double_t *posClus, Bool_t &check);
153 Int_t fVerbose; // Verbose level (0:no msg, 1:msg, 2:digits in txt files)
154 Bool_t fDecoderVersion; // setting whether to use the new decoder version
155 // -true -> new version
156 // -false ->old version (default value!!)
157 AliTOFcalib *fTOFcalib; // pointer to the TOF calibration info
158 AliTOFDigitMap* fTOFdigitMap; // TOF digit map pointer
159 AliTOFGeometry *fTOFGeometry; // pointer to the TOF geometry
160 TTree *fTOFdigits; // pointer to the TOF digit tree
162 AliTOFRawStream fTOFRawStream; // AliTOFRawStream variable
164 ClassDef(AliTOFClusterFinderV1,2) // To run TOF clustering