]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALTracker.h
fixing coverity and compiler warning
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTracker.h
index d53cb7bfa29e29f46378ebc984a622f94b1ef20f..8ccedf04b58d0e8482e6153b9d02c8987121b152 100644 (file)
-#ifndef AliEMCALTracker_h
-#define AliEMCALTracker_h
+//========================================================================  
+// 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)
+//=========================================================================
 
-//-------------------------------------------------------------------------
-//                          EMCAL tracker.
-// Matches ESD tracks with the EMCAL and makes the PID.  
-// Currently, has only one function implemented : PropagateBack(AliESD*).
-//-------------------------------------------------------------------------
+#ifndef ALIEMCALTRACKER_H
+#define ALIEMCALTRACKER_H
 
-#include <AliTracker.h>
-#include <AliLog.h>
-
-class AliCluster;
-class AliESD;
+#include "AliTracker.h"
+#include <TMath.h>
+#include <TVector3.h>
+class TList;
 class TTree;
-class AliRunLoader;
+class TObjArray;
+class AliESDEvent;
+class AliVCluster;
+class AliESDCaloCluster;
+class AliEMCALRecPoint;
+class AliEMCALGeometry;
 
-class AliEMCALTracker : public AliTracker
+class AliEMCALTracker : public AliTracker 
 {
 public:
-  AliEMCALTracker():AliTracker()   {fRunLoader=0;}
-  AliEMCALTracker(AliRunLoader *loader):AliTracker() {fRunLoader=loader;}
-  virtual ~AliEMCALTracker()       {AliDebug(1,"Start.");}
-
-  Int_t Clusters2Tracks(AliESD *) {AliDebug(1,"Start.");return 0;}
-  Int_t RefitInward(AliESD *)     {AliDebug(1,"Start.");return 0;}
-  void UnloadClusters()           {AliDebug(1,"Start.");}
-  AliCluster *GetCluster(Int_t ) const {AliDebug(1,"Start.");return 0;}
-  Int_t PropagateBack(AliESD *);
-  Int_t LoadClusters(TTree *) {AliDebug(1,"Start.");return 0;}
 
-  static void                SetDebug()   { fgDebug = kTRUE ; }
-  static void                ResetDebug() { fgDebug = kFALSE ; }
-  static Bool_t              Debug() { return fgDebug ; }
+       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);
 
+       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:
-  static Bool_t fgDebug ;    //! Verbosity controller
-  AliRunLoader *fRunLoader;  //! Pointer to the run loader
-  ClassDef(AliEMCALTracker,0)
+       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
+       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
+
+       TObjArray  *fTracks;          //! collection of tracks
+       TObjArray  *fClusters;        //! collection of EMCAL clusters (ESDCaloCluster or EMCALRecPoint)
+       
+       AliEMCALGeometry *fGeom;      //! EMCAL geometry
+       
+       ClassDef(AliEMCALTracker, 6)  // EMCAL "tracker"
 };
 
 #endif