]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFClusterFinder.h
Macro to Create pulser run data from an LDC
[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 "TObject.h"
10
11 class TClonesArray;
12 class TFile;
13 class TTree;
14
15 class AliLoader;
16 class AliRunLoader;
17 class AliRawReader;
18
19 class AliTOFGeometry;
20 class AliTOFcluster;
21 class AliTOFcalib;
22
23 class AliTOFClusterFinder : public TObject
24 {
25
26   enum {kTofMaxCluster=77777}; //maximal number of the TOF clusters
27
28  public:
29
30   AliTOFClusterFinder(AliTOFcalib *calib);
31   AliTOFClusterFinder(AliRunLoader* runLoader, AliTOFcalib *calib);
32   AliTOFClusterFinder(const AliTOFClusterFinder &source); // copy constructor
33   AliTOFClusterFinder& operator=(const AliTOFClusterFinder &source); // ass. op.
34   virtual ~AliTOFClusterFinder();
35
36   void Digits2RecPoints(TTree* digitsTree, TTree* clusterTree);
37   void Digits2RecPoints(Int_t ievt);
38   void Digits2RecPoints(AliRawReader *rawReader, TTree *clustersTree);
39   void Digits2RecPoints(Int_t ievt, AliRawReader *rawReader);
40   void Raw2Digits(Int_t ievt, AliRawReader *rawReader); // temporary solution
41   void Raw2Digits(AliRawReader *rawReader, TTree* digitsTree); 
42   void FillRecPoint();
43   void ResetRecpoint();
44   void Load();
45   void LoadClusters();
46   void UnLoad();
47   void UnLoadClusters();
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
54  protected:
55   AliRunLoader *fRunLoader;      // Pointer to Run Loader
56   AliLoader    *fTOFLoader;      // Pointer to specific detector loader
57
58   TTree        *fTreeD;          // Digits tree
59   TTree        *fTreeR;          // Reconstructed points
60
61   AliTOFcluster *fTofClusters[kTofMaxCluster];  // pointers to the TOF clusters
62
63   TClonesArray *fDigits;         // List of digits
64   TClonesArray *fRecPoints;      // List of reconstructed points
65
66   Int_t fNumberOfTofClusters;    // Number of TOF Clusters
67
68  private:
69
70   //Int_t InsertCluster(Int_t *aa, Double_t *bb);    // Fills TofClusters Array
71   //Int_t InsertCluster(Int_t *aa, Double_t *bb, Int_t *cc, Int_t d); // Fills TofClusters Array
72   Int_t InsertCluster(AliTOFcluster *tofCluster);    // Fills TofClusters Array
73   Int_t FindClusterIndex(Double_t z) const; // Returns cluster index 
74   void  CalibrateRecPoint(); // Apply calibration pars to Clusters
75
76   Int_t fVerbose;  //Verbose level (0:no msg, 1:msg, 2:digits in txt files)
77   Bool_t fDecoderVersion;   //setting whether to use the new decoder version 
78                             // -true -> new version
79                             // -false ->old version  (default value!!)
80   AliTOFcalib *fTOFcalib;       // pointer to the TOF calibration info
81
82   ClassDef(AliTOFClusterFinder,4) // To run TOF clustering
83 };
84 #endif
85