ROOT logo
#ifndef ALITOFCLUSTERFINDER_H
#define ALITOFCLUSTERFINDER_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */
// AliTOFClusterFinder Class
// Task: Transform digits/raw data to TOF Clusters, to fill TOF RecPoints
// and feed TOF tracking 

#include "TTask.h"

#include "AliTOFRawStream.h"

class TClonesArray;
class TFile;
class TTree;

class AliLoader;
class AliRunLoader;
class AliRawReader;
class AliTOFrawData;

class AliTOFGeometry;
class AliTOFcluster;
class AliTOFcalib;

class AliTOFClusterFinder : public TTask
{

  enum {kTofMaxCluster=77777}; //maximal number of the TOF clusters

 public:

  AliTOFClusterFinder(AliTOFcalib *calib);
  AliTOFClusterFinder(AliRunLoader* runLoader, AliTOFcalib *calib);
  AliTOFClusterFinder(const AliTOFClusterFinder &source); // copy constructor
  AliTOFClusterFinder& operator=(const AliTOFClusterFinder &source); // ass. op.
  virtual ~AliTOFClusterFinder();

  void Digits2RecPoints(TTree* digitsTree, TTree* clusterTree);
  void Digits2RecPoints(Int_t ievt);
  void Digits2RecPoints(AliRawReader *rawReader, TTree *clustersTree);
  void Digits2RecPoints(Int_t ievt, AliRawReader *rawReader);
  void Raw2Digits(Int_t ievt, AliRawReader *rawReader); // temporary solution
  void Raw2Digits(AliRawReader *rawReader, TTree* digitsTree); 
  void FillRecPoint();
  void ResetRecpoint();
  void Load();
  void LoadClusters();
  void UnLoad();
  void UnLoadClusters();
  void SetVerbose(Int_t Verbose){fVerbose=Verbose;} // To set the verbose level
  void SetDecoderVersion(Int_t version){fDecoderVersion=version;} // To set the decoder version
  Int_t GetDecoderVersion() const {return fDecoderVersion;} // To get the decoder version
  UShort_t  GetClusterVolIndex(const Int_t * const ind) const; //Volume Id getter
  void GetClusterPars(Int_t *ind, Double_t *pos, Double_t *cov) const; //cluster par getter
  Int_t GetNumberOfTOFclusters() const {return fNumberOfTofClusters;} // number of clusters getter
  Int_t GetNumberOfTOFtrgPads() const {return fNumberOfTofTrgPads;} // number of pads getter

 protected:
  AliRunLoader *fRunLoader;      // Pointer to Run Loader
  AliLoader    *fTOFLoader;      // Pointer to specific detector loader

  TTree        *fTreeD;          // Digits tree
  TTree        *fTreeR;          // Reconstructed points

  AliTOFcluster *fTofClusters[kTofMaxCluster];  // pointers to the TOF clusters

  TClonesArray *fDigits;         // List of digits
  TClonesArray *fRecPoints;      // List of reconstructed points

  Int_t fNumberOfTofClusters;    // Number of TOF Clusters
  Int_t fNumberOfTofTrgPads;  // Number of TOF trigger pads

 private:
  void  FillTOFtriggerMap(Int_t iDDL, AliTOFrawData *tofRawDatum);

  //Int_t InsertCluster(Int_t *aa, Double_t *bb);    // Fills TofClusters Array
  //Int_t InsertCluster(Int_t *aa, Double_t *bb, Int_t *cc, Int_t d); // Fills TofClusters Array
  Int_t InsertCluster(AliTOFcluster *tofCluster);    // Fills TofClusters Array
  Int_t FindClusterIndex(Double_t z) const; // Returns cluster index 
  void  CalibrateRecPoint(UInt_t timestamp = 0); // Apply calibration pars to Clusters

  Int_t fVerbose;           // Verbose level (0:no msg,
                            //  1:msg, 2:digits in txt files)
  Int_t fDecoderVersion;   //setting whether to use the new decoder version 
  AliTOFcalib *fTOFcalib;         // pointer to the TOF calibration info
  AliTOFRawStream fTOFRawStream; // AliTOFRawStream variable

  ClassDef(AliTOFClusterFinder,8) // To run TOF clustering
};
#endif

 AliTOFClusterFinder.h:1
 AliTOFClusterFinder.h:2
 AliTOFClusterFinder.h:3
 AliTOFClusterFinder.h:4
 AliTOFClusterFinder.h:5
 AliTOFClusterFinder.h:6
 AliTOFClusterFinder.h:7
 AliTOFClusterFinder.h:8
 AliTOFClusterFinder.h:9
 AliTOFClusterFinder.h:10
 AliTOFClusterFinder.h:11
 AliTOFClusterFinder.h:12
 AliTOFClusterFinder.h:13
 AliTOFClusterFinder.h:14
 AliTOFClusterFinder.h:15
 AliTOFClusterFinder.h:16
 AliTOFClusterFinder.h:17
 AliTOFClusterFinder.h:18
 AliTOFClusterFinder.h:19
 AliTOFClusterFinder.h:20
 AliTOFClusterFinder.h:21
 AliTOFClusterFinder.h:22
 AliTOFClusterFinder.h:23
 AliTOFClusterFinder.h:24
 AliTOFClusterFinder.h:25
 AliTOFClusterFinder.h:26
 AliTOFClusterFinder.h:27
 AliTOFClusterFinder.h:28
 AliTOFClusterFinder.h:29
 AliTOFClusterFinder.h:30
 AliTOFClusterFinder.h:31
 AliTOFClusterFinder.h:32
 AliTOFClusterFinder.h:33
 AliTOFClusterFinder.h:34
 AliTOFClusterFinder.h:35
 AliTOFClusterFinder.h:36
 AliTOFClusterFinder.h:37
 AliTOFClusterFinder.h:38
 AliTOFClusterFinder.h:39
 AliTOFClusterFinder.h:40
 AliTOFClusterFinder.h:41
 AliTOFClusterFinder.h:42
 AliTOFClusterFinder.h:43
 AliTOFClusterFinder.h:44
 AliTOFClusterFinder.h:45
 AliTOFClusterFinder.h:46
 AliTOFClusterFinder.h:47
 AliTOFClusterFinder.h:48
 AliTOFClusterFinder.h:49
 AliTOFClusterFinder.h:50
 AliTOFClusterFinder.h:51
 AliTOFClusterFinder.h:52
 AliTOFClusterFinder.h:53
 AliTOFClusterFinder.h:54
 AliTOFClusterFinder.h:55
 AliTOFClusterFinder.h:56
 AliTOFClusterFinder.h:57
 AliTOFClusterFinder.h:58
 AliTOFClusterFinder.h:59
 AliTOFClusterFinder.h:60
 AliTOFClusterFinder.h:61
 AliTOFClusterFinder.h:62
 AliTOFClusterFinder.h:63
 AliTOFClusterFinder.h:64
 AliTOFClusterFinder.h:65
 AliTOFClusterFinder.h:66
 AliTOFClusterFinder.h:67
 AliTOFClusterFinder.h:68
 AliTOFClusterFinder.h:69
 AliTOFClusterFinder.h:70
 AliTOFClusterFinder.h:71
 AliTOFClusterFinder.h:72
 AliTOFClusterFinder.h:73
 AliTOFClusterFinder.h:74
 AliTOFClusterFinder.h:75
 AliTOFClusterFinder.h:76
 AliTOFClusterFinder.h:77
 AliTOFClusterFinder.h:78
 AliTOFClusterFinder.h:79
 AliTOFClusterFinder.h:80
 AliTOFClusterFinder.h:81
 AliTOFClusterFinder.h:82
 AliTOFClusterFinder.h:83
 AliTOFClusterFinder.h:84
 AliTOFClusterFinder.h:85
 AliTOFClusterFinder.h:86
 AliTOFClusterFinder.h:87
 AliTOFClusterFinder.h:88
 AliTOFClusterFinder.h:89
 AliTOFClusterFinder.h:90
 AliTOFClusterFinder.h:91
 AliTOFClusterFinder.h:92