ROOT logo
//========================================================================  
// Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved.  
// See cxx source for full Copyright notice                                
//========================================================================  
//                       
//                       Class AliEMCALTracker 
//                      -----------------------
// Implementation of the track matching method between barrel tracks and
// EMCAL clusters.
// Besides algorithm implementation, some cuts are required to be set
// in order to define, for each track, an acceptance window where clusters
// are searched to find best match (if any).
// The class accepts as input an ESD container, and works directly on it,
// simply setting, for each of its tracks, the fEMCALindex flag, for each
// track which is matched to a cluster.
// In order to use method, one must launch PropagateBack().
//
// ------------------------------------------------------------------------
// author: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
//=========================================================================

#ifndef ALIEMCALTRACKER_H
#define ALIEMCALTRACKER_H

#include "AliTracker.h"
#include <TMath.h>
#include <TVector3.h>
class TList;
class TTree;
class TObjArray;
class AliESDEvent;
class AliVCluster;
class AliESDCaloCluster;
class AliEMCALRecPoint;
class AliEMCALGeometry;

class AliEMCALTracker : public AliTracker 
{
 public:
  AliEMCALTracker();
  AliEMCALTracker(const AliEMCALTracker &t);
  AliEMCALTracker& operator=(const AliEMCALTracker &source);
  virtual ~AliEMCALTracker() {Clear();}
	
  virtual void        Clear(Option_t *option="ALL");
  virtual Int_t       Clusters2Tracks(AliESDEvent*) {return -1;}
          void        InitParameters();
  virtual Int_t       LoadClusters(TTree*);
          Int_t       LoadClusters(AliESDEvent* esd);
	  Int_t       LoadTracks(AliESDEvent* esd);
  virtual Int_t       PropagateBack(AliESDEvent* esd);
  virtual Int_t       RefitInward(AliESDEvent*) {return -1;}
  virtual void        UnloadClusters();
  virtual AliCluster* GetCluster(Int_t) const {return NULL;}
          void        SetCutEta(Double_t value) {fCutEta=value;}
	  void        SetCutPhi(Double_t value) {fCutPhi=value;}
	  void        SetGeometry(AliEMCALGeometry *geom) {fGeom=geom;}
	  void        SetCutPt(Double_t value)   {fCutPt=value;}
	  void        SetCutNITS(Double_t value) {fCutNITS=value;}
	  void        SetCutNTPC(Double_t value) {fCutNTPC=value;}
	  void        SetStepLength(Float_t length) {fStep=length;}
	  void        SetTrackCorrectionMode(Option_t *option);
	  void        SetEMCalSurfaceDistance(Double_t d) {fEMCalSurfaceDistance = d;}

  enum {	kUnmatched = -99999 };
	
  class  AliEMCALMatchCluster : public TObject
  {
   public:
    AliEMCALMatchCluster(Int_t ID, AliEMCALRecPoint *recPoint);
    AliEMCALMatchCluster(Int_t ID, AliESDCaloCluster *caloCluster);
    virtual ~AliEMCALMatchCluster() { }
    //----------------------------------------------------------------------------
    Int_t     Index() const {return fIndex;}
    Double_t  X() const {return fX;}
    Double_t  Y() const {return fY;} 
    Double_t  Z() const {return fZ;}
   private:
    Int_t     fIndex;  // index of cluster in its native container (ESD or TClonesArray)
    Double_t  fX;      // global X position
    Double_t  fY;      // global Y position
    Double_t  fZ;      // global Z position
  };
   
 private:
  Int_t  FindMatchedCluster(AliESDtrack *track);
  enum ETrackCorr { 
    kTrackCorrNone  = 0, // do not correct for energy loss
    kTrackCorrMMB   = 1, // use MeanMaterialBudget() function to evaluate correction
  };

  Double_t    fCutPt;           // mimimum pT cut on tracks
  Double_t    fCutNITS;         // mimimum number of track hits in the ITS
  Double_t    fCutNTPC;         // mimimum number of track hits in the TPC
	
  Float_t     fStep;            // Length of each step in propagation
  ETrackCorr  fTrackCorrMode;   // Material budget correction mode
  Float_t     fEMCalSurfaceDistance; // EMCal surface distance
  Double_t    fClusterWindow;   // Select clusters in the window to be matched to tracks
  Double_t    fCutEta;	      // cut on eta difference
  Double_t    fCutPhi;	      // cut on phi difference
  Bool_t	    fITSTrackSA;      // If ITS Tracks	
	
  TObjArray  *fTracks;          //! collection of tracks
  TObjArray  *fClusters;        //! collection of EMCAL clusters (ESDCaloCluster or EMCALRecPoint)
	
  AliEMCALGeometry *fGeom;      //! EMCAL geometry
  
  ClassDef(AliEMCALTracker, 7)  // EMCAL "tracker"
};
#endif
 AliEMCALTracker.h:1
 AliEMCALTracker.h:2
 AliEMCALTracker.h:3
 AliEMCALTracker.h:4
 AliEMCALTracker.h:5
 AliEMCALTracker.h:6
 AliEMCALTracker.h:7
 AliEMCALTracker.h:8
 AliEMCALTracker.h:9
 AliEMCALTracker.h:10
 AliEMCALTracker.h:11
 AliEMCALTracker.h:12
 AliEMCALTracker.h:13
 AliEMCALTracker.h:14
 AliEMCALTracker.h:15
 AliEMCALTracker.h:16
 AliEMCALTracker.h:17
 AliEMCALTracker.h:18
 AliEMCALTracker.h:19
 AliEMCALTracker.h:20
 AliEMCALTracker.h:21
 AliEMCALTracker.h:22
 AliEMCALTracker.h:23
 AliEMCALTracker.h:24
 AliEMCALTracker.h:25
 AliEMCALTracker.h:26
 AliEMCALTracker.h:27
 AliEMCALTracker.h:28
 AliEMCALTracker.h:29
 AliEMCALTracker.h:30
 AliEMCALTracker.h:31
 AliEMCALTracker.h:32
 AliEMCALTracker.h:33
 AliEMCALTracker.h:34
 AliEMCALTracker.h:35
 AliEMCALTracker.h:36
 AliEMCALTracker.h:37
 AliEMCALTracker.h:38
 AliEMCALTracker.h:39
 AliEMCALTracker.h:40
 AliEMCALTracker.h:41
 AliEMCALTracker.h:42
 AliEMCALTracker.h:43
 AliEMCALTracker.h:44
 AliEMCALTracker.h:45
 AliEMCALTracker.h:46
 AliEMCALTracker.h:47
 AliEMCALTracker.h:48
 AliEMCALTracker.h:49
 AliEMCALTracker.h:50
 AliEMCALTracker.h:51
 AliEMCALTracker.h:52
 AliEMCALTracker.h:53
 AliEMCALTracker.h:54
 AliEMCALTracker.h:55
 AliEMCALTracker.h:56
 AliEMCALTracker.h:57
 AliEMCALTracker.h:58
 AliEMCALTracker.h:59
 AliEMCALTracker.h:60
 AliEMCALTracker.h:61
 AliEMCALTracker.h:62
 AliEMCALTracker.h:63
 AliEMCALTracker.h:64
 AliEMCALTracker.h:65
 AliEMCALTracker.h:66
 AliEMCALTracker.h:67
 AliEMCALTracker.h:68
 AliEMCALTracker.h:69
 AliEMCALTracker.h:70
 AliEMCALTracker.h:71
 AliEMCALTracker.h:72
 AliEMCALTracker.h:73
 AliEMCALTracker.h:74
 AliEMCALTracker.h:75
 AliEMCALTracker.h:76
 AliEMCALTracker.h:77
 AliEMCALTracker.h:78
 AliEMCALTracker.h:79
 AliEMCALTracker.h:80
 AliEMCALTracker.h:81
 AliEMCALTracker.h:82
 AliEMCALTracker.h:83
 AliEMCALTracker.h:84
 AliEMCALTracker.h:85
 AliEMCALTracker.h:86
 AliEMCALTracker.h:87
 AliEMCALTracker.h:88
 AliEMCALTracker.h:89
 AliEMCALTracker.h:90
 AliEMCALTracker.h:91
 AliEMCALTracker.h:92
 AliEMCALTracker.h:93
 AliEMCALTracker.h:94
 AliEMCALTracker.h:95
 AliEMCALTracker.h:96
 AliEMCALTracker.h:97
 AliEMCALTracker.h:98
 AliEMCALTracker.h:99
 AliEMCALTracker.h:100
 AliEMCALTracker.h:101
 AliEMCALTracker.h:102
 AliEMCALTracker.h:103
 AliEMCALTracker.h:104
 AliEMCALTracker.h:105
 AliEMCALTracker.h:106
 AliEMCALTracker.h:107
 AliEMCALTracker.h:108
 AliEMCALTracker.h:109
 AliEMCALTracker.h:110
 AliEMCALTracker.h:111