ROOT logo
#ifndef AliHMPIDReconHTA_h
#define AliHMPIDReconHTA_h

/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// AliHMPIDReconHTA                                                     //
//                                                                      //
// HMPID class to perfom pattern recognition based on Hough transfrom   //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


#include <TNamed.h>        //base class

class TClonesArray; //CkovAngle()
class AliESDtrack;  //CkovAngle()
class AliHMPIDParam;//General pourpose

class AliHMPIDReconHTA : public TNamed 
{
public : 
             AliHMPIDReconHTA();
    virtual ~AliHMPIDReconHTA();

// HTA hidden track algorithm
  void     InitVars         (Int_t n);                                                             //init space for variables
  void     DeleteVars       ()const;                                                               //delete variables
  void     InitDatabase     ();                                                                    //initialization of database
  void     FindBinDB        (Double_t x,Double_t y,Int_t &binX,Int_t &binY);                       //find indices of DB
  Bool_t   UniformDistrib   ();                                                                    //to check isotropy in phi Cerenkov
  void     FillZeroChan     ()const;                                                               //complete the DB
  Bool_t   CkovHiddenTrk    (AliESDtrack *pTrk,TClonesArray *pClu,Int_t index, Double_t nmean);    //Pattern recognition without trackinf information
  Bool_t   CluPreFilter     (TClonesArray *pClu               );                                   //Pre clustering filter to cut bkg clusters
  Bool_t   DoRecHiddenTrk   (                                 );                                   //Calling to the fitted procedures
  Bool_t   FindShape        (Double_t &thTrkRec,Double_t &phiTrkRec,Double_t &thetaCRec);          //Find shape of the ring
  Bool_t   ShapeModel       (Int_t np,Double_t *phiphot,Double_t *dist,Double_t &xA,Double_t &xB,Double_t &phiStart);//initial shape model for the cluster candidates
  Double_t VertParab        (Double_t x1,Double_t y1,Double_t x2, Double_t y2, Double_t x3, Double_t y3)const;//calculate the coord. of the min. for a parabole for 3 points
  Bool_t   FitFree          (Double_t thTrkRec,Double_t phiTrkRec);                                //Fit (th,ph) of the track and ckovFit as result
  Bool_t   FitRing          (Double_t thTrkRec,Double_t phiTrkRec);                                //Fit (th,ph) of the track 
  Double_t FindSimmPhi      ();                                                                    //find phi of the ring with min. dist. algorithm 
  Int_t    r2               (Double_t *coef, Double_t &x1, Double_t &x2);                          // solution of 2nd degree equation
  void     SetNClu          (Int_t nclu                          ) {fNClu=nclu;}                   //Setter for # of clusters
  void     SetClCk          (Int_t i,Bool_t what                 ) {fClCk[i]=what;}                //Setter for cluster flags 
  void     SetCkovFit       (Double_t ckov                       ) {fCkovFit=ckov;}                //Setter for ckov fitted
  void     SetCkovSig2      (Double_t rms                        ) {fCkovSig2=rms;}                //Setter for sigma2 ckov fitted
  void     SetTrkFit        (Double_t th,Double_t ph             ) {fThTrkFit = th;fPhTrkFit = ph;}//Setter for (th,ph) of the track
  void     SetNCluFit       (Int_t ncluFit                       ) {fNCluFit=ncluFit;}             //Setter for # of clusters used in the fit
  void     SetPhotAngles    (Int_t i,Double_t th, Double_t ph    ) {fPhiPhot[i]=ph;fThetaPhot[i]=th;} //Setter of the Cerenkov angles for a given photon
  void     SetFitStatus     (Bool_t status                       ) {fFitStatus = status;}          //Setter for fit status
  void     SetRadXY         (Double_t  x,Double_t y              ) {fRadX = x;fRadY = y;}          //Setter for (th,ph) of the track
  static void     FunMinPhot(Int_t&/* */,Double_t* /* */,Double_t &f,Double_t *par,Int_t iflag);   //Fit function to minimize thetaCer RMS/Sqrt(n) of n clusters
  Int_t CompactDB       (Int_t binX,Int_t binY) const {return fgDB[binX][binY];}                   //find compact word of DB
  Int_t    IdxMip       ()const {return fIdxMip;}                                                  //Getter index of MIP
  Double_t MipX         ()const {return fMipX;}                                                    //Getter of x MIP in LORS
  Double_t MipY         ()const {return fMipY;}                                                    //Getter of y MIP in LORS
  Double_t MipQ         ()const {return fMipQ;}                                                    //Getter of Q MIP
  Double_t RadX         ()const {return fRadX;}                                                    //Getter of x at RAD in LORS
  Double_t RadY         ()const {return fRadY;}                                                    //Getter of y at RAD in LORS
  Int_t    NClu         ()const {return fNClu;}                                                    //Getter of cluster multiplicity
  Int_t    NCluFit      ()const {return fNCluFit;}                                                 //Getter of n. photons used to fit the ring
  Double_t XClu         (Int_t i)const {return fXClu[i];}                                          //Getter of x clu
  Double_t YClu         (Int_t i)const {return fYClu[i];}                                          //Getter of y clu
  Bool_t   ClCk         (Int_t i)const {return fClCk[i];}                                          //Getter of cluster flags
  Double_t PhotPhi      (Int_t i)const {return fPhiPhot[i];}                                       //Getter of the Phi   Cerenkov angle for a given photon
  Double_t PhotTheta    (Int_t i)const {return fThetaPhot[i];}                                     //Getter of the Theta Cerenkov angle for a given photon
  Bool_t   FitStatus    ()const {return fFitStatus;}                                               //Getter of status of the fit
  Double_t CkovFit      ()const {return fCkovFit;}                                                 //Getter of ckov angle fitted
  Double_t ThTrkIn      ()const {return fThTrkIn;}                                                 //Getter of theta started of the track
  Double_t PhTrkIn      ()const {return fPhTrkIn;}                                                 //Getter of phi started of the track
  Double_t ThTrkFit     ()const {return fThTrkFit;}                                                //Getter of theta fitted of the track
  Double_t PhTrkFit     ()const {return fPhTrkFit;}                                                //Getter of phi fitted of the track
//
protected:
//
  Double_t fMipX;                              //mip X position for Hidden Track Algorithm  
  Double_t fMipY;                              //mip Y position for Hidden Track Algorithm
  Double_t fMipQ;                              //mip Q          for Hidden Track Algorithm
  Double_t fRadX;                              //rad X position for Hidden Track Algorithm  
  Double_t fRadY;                              //rad Y position for Hidden Track Algorithm
  Int_t    fIdxMip;                            //mip index in the clus list
  Int_t    fNClu;                              //n clusters to fit
  Double_t *fXClu;                             //container for x clus position
  Double_t *fYClu;                             //container for y clus position
  Double_t *fPhiPhot;                          //container for phi clus
  Double_t *fThetaPhot;                        //container for theta Cerenkov clus
  Bool_t   *fClCk;                             //flag if cluster is used in fitting
  Double_t fThTrkIn;                           //theta started from ShapeModel
  Double_t fPhTrkIn;                           //phi   started from ShapeModel
  Double_t fThTrkFit;                          //theta fitted of the track
  Double_t fPhTrkFit;                          //phi   fitted of the track
  Double_t fCkovFit;                           //estimated ring Cherenkov angle
  Int_t    fNCluFit;                           //n clusters used to fit the ring
  Double_t fCkovSig2;                          //estimated error^2 on ring Cherenkov angle
  Bool_t   fFitStatus;                         //status of the fit 0=ok 1=still to be optimized
  
  AliHMPIDParam *fParam;                       //Pointer to AliHMPIDParam
  static Int_t fgDB[500][150];                 //tmp DB
//
private:
  AliHMPIDReconHTA(const AliHMPIDReconHTA& r);              //dummy copy constructor
  AliHMPIDReconHTA &operator=(const AliHMPIDReconHTA& r);   //dummy assignment operator
//
  ClassDef(AliHMPIDReconHTA,5)
};

#endif // #ifdef AliHMPIDReconHTA_cxx

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