]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFClusterFinder.h
ALIROOT-5420 Changes for CDH v3
[u/mrichter/AliRoot.git] / TOF / AliTOFClusterFinder.h
1 #ifndef ALITOFCLUSTERFINDER_H
2 #define ALITOFCLUSTERFINDER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5 // AliTOFClusterFinder Class
6 // Task: Transform digits/raw data to TOF Clusters, to fill TOF RecPoints
7 // and feed TOF tracking 
8
9 #include "TTask.h"
10
11 #include "AliTOFRawStream.h"
12
13 class TClonesArray;
14 class TFile;
15 class TTree;
16
17 class AliLoader;
18 class AliRunLoader;
19 class AliRawReader;
20 class AliTOFrawData;
21
22 class AliTOFGeometry;
23 class AliTOFcluster;
24 class AliTOFcalib;
25
26 class AliTOFClusterFinder : public TTask
27 {
28
29   enum {kTofMaxCluster=77777}; //maximal number of the TOF clusters
30
31  public:
32
33   AliTOFClusterFinder(AliTOFcalib *calib);
34   AliTOFClusterFinder(AliRunLoader* runLoader, AliTOFcalib *calib);
35   AliTOFClusterFinder(const AliTOFClusterFinder &source); // copy constructor
36   AliTOFClusterFinder& operator=(const AliTOFClusterFinder &source); // ass. op.
37   virtual ~AliTOFClusterFinder();
38
39   void Digits2RecPoints(TTree* digitsTree, TTree* clusterTree);
40   void Digits2RecPoints(Int_t ievt);
41   void Digits2RecPoints(AliRawReader *rawReader, TTree *clustersTree);
42   void Digits2RecPoints(Int_t ievt, AliRawReader *rawReader);
43   void Raw2Digits(Int_t ievt, AliRawReader *rawReader); // temporary solution
44   void Raw2Digits(AliRawReader *rawReader, TTree* digitsTree); 
45   void FillRecPoint();
46   void ResetRecpoint();
47   void Load();
48   void LoadClusters();
49   void UnLoad();
50   void UnLoadClusters();
51   void SetVerbose(Int_t Verbose){fVerbose=Verbose;} // To set the verbose level
52   void SetDecoderVersion(Int_t version){fDecoderVersion=version;} // To set the decoder version
53   Int_t GetDecoderVersion() const {return fDecoderVersion;} // To get the decoder version
54   UShort_t  GetClusterVolIndex(const Int_t * const ind) const; //Volume Id getter
55   void GetClusterPars(Int_t *ind, Double_t *pos, Double_t *cov) const; //cluster par getter
56   Int_t GetNumberOfTOFclusters() const {return fNumberOfTofClusters;} // number of clusters getter
57   Int_t GetNumberOfTOFtrgPads() const {return fNumberOfTofTrgPads;} // number of pads getter
58
59  protected:
60   AliRunLoader *fRunLoader;      // Pointer to Run Loader
61   AliLoader    *fTOFLoader;      // Pointer to specific detector loader
62
63   TTree        *fTreeD;          // Digits tree
64   TTree        *fTreeR;          // Reconstructed points
65
66   AliTOFcluster *fTofClusters[kTofMaxCluster];  // pointers to the TOF clusters
67
68   TClonesArray *fDigits;         // List of digits
69   TClonesArray *fRecPoints;      // List of reconstructed points
70
71   Int_t fNumberOfTofClusters;    // Number of TOF Clusters
72   Int_t fNumberOfTofTrgPads;  // Number of TOF trigger pads
73
74  private:
75   void  FillTOFtriggerMap(Int_t iDDL, AliTOFrawData *tofRawDatum);
76
77   //Int_t InsertCluster(Int_t *aa, Double_t *bb);    // Fills TofClusters Array
78   //Int_t InsertCluster(Int_t *aa, Double_t *bb, Int_t *cc, Int_t d); // Fills TofClusters Array
79   Int_t InsertCluster(AliTOFcluster *tofCluster);    // Fills TofClusters Array
80   Int_t FindClusterIndex(Double_t z) const; // Returns cluster index 
81   void  CalibrateRecPoint(UInt_t timestamp = 0); // Apply calibration pars to Clusters
82
83   Int_t fVerbose;           // Verbose level (0:no msg,
84                             //  1:msg, 2:digits in txt files)
85   Int_t fDecoderVersion;   //setting whether to use the new decoder version 
86   AliTOFcalib *fTOFcalib;         // pointer to the TOF calibration info
87   AliTOFRawStream fTOFRawStream; // AliTOFRawStream variable
88
89   ClassDef(AliTOFClusterFinder,8) // To run TOF clustering
90 };
91 #endif
92