1 //========================================================================
2 // Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved.
3 // See cxx source for full Copyright notice
4 //========================================================================
6 // Class AliEMCALTracker
7 // -----------------------
8 // Implementation of the track matching method between barrel tracks and
10 // Besides algorithm implementation, some cuts are required to be set
11 // in order to define, for each track, an acceptance window where clusters
12 // are searched to find best match (if any).
13 // The class accepts as input an ESD container, and works directly on it,
14 // simply setting, for each of its tracks, the fEMCALindex flag, for each
15 // track which is matched to a cluster.
16 // In order to use method, one must launch PropagateBack().
18 // ------------------------------------------------------------------------
19 // author: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
20 //=========================================================================
22 #ifndef ALIEMCALTRACKER_H
23 #define ALIEMCALTRACKER_H
25 #include "AliTracker.h"
32 class AliESDCaloCluster;
34 class AliEMCALRecPoint;
35 class AliEMCALGeometry;
37 class AliEMCALTracker : public AliTracker
42 AliEMCALTracker(const AliEMCALTracker &t);
43 AliEMCALTracker& operator=(const AliEMCALTracker &source);
45 virtual ~AliEMCALTracker() {Clear();}
47 virtual void Clear(Option_t *option="ALL");
48 virtual Int_t Clusters2Tracks(AliESDEvent*) {return -1;}
49 void InitParameters();
50 virtual Int_t LoadClusters(TTree*);
51 Int_t LoadClusters(AliESDEvent* esd);
52 Int_t LoadTracks(AliESDEvent* esd);
53 virtual Int_t PropagateBack(AliESDEvent* esd);
54 virtual Int_t RefitInward(AliESDEvent*) {return -1;}
55 virtual void UnloadClusters();
56 virtual AliCluster* GetCluster(Int_t) const {return NULL;};
57 TTree* SearchTrueMatches();
58 void SetCorrection(Double_t rho, Double_t x0) {fRho=rho;fX0=x0;}
59 void SetCutAlpha(Double_t min, Double_t max) {fCutAlphaMin=min;fCutAlphaMax=max;}
60 void SetCutAngle(Double_t value) {fCutAngle=value;}
61 void SetCutX(Double_t value) {fCutX=value;}
62 void SetCutY(Double_t value) {fCutY=value;}
63 void SetCutZ(Double_t value) {fCutZ=value;}
64 void SetGeometry(AliEMCALGeometry *geom) {fGeom=geom;}
65 void SetMaxDistance(Double_t value) {fMaxDist=value;}
66 void SetCutNITS(Double_t value) {fCutNITS=value;}
67 void SetCutNTPC(Double_t value) {fCutNTPC=value;}
68 void SetNumberOfSteps(Int_t n) {fNPropSteps=n;if(!n)SetTrackCorrectionMode("NONE");}
69 void SetTrackCorrectionMode(Option_t *option);
70 TVector3 FindExtrapolationPoint(Double_t x, Double_t y, Double_t z, AliESDtrack *track);
76 class AliEMCALMatchCluster : public TObject
79 AliEMCALMatchCluster(Int_t ID, AliEMCALRecPoint *recPoint);
80 AliEMCALMatchCluster(Int_t ID, AliESDCaloCluster *caloCluster);
81 virtual ~AliEMCALMatchCluster() { }
82 //----------------------------------------------------------------------------
83 Int_t Index() const {return fIndex;}
84 Int_t Label() const {return fLabel;}
85 Double_t X() const {return fX;}
86 Double_t Y() const {return fY;}
87 Double_t Z() const {return fZ;}
88 Double_t Phi() const {return TMath::ATan2(fY, fX);}
90 Int_t fIndex; // index of cluster in its native container (ESD or TClonesArray)
91 Int_t fLabel; // track label of assigned cluster
92 Double_t fX; // global X position
93 Double_t fY; // global Y position
94 Double_t fZ; // global Z position
97 class AliEMCALMatch : public TObject
101 AliEMCALMatch(const AliEMCALMatch& copy);
102 virtual ~AliEMCALMatch() { }
103 //----------------------------------------------------------------------------
104 Bool_t& CanBeSaved() {return fCanBeSaved;}
105 Int_t Compare(const TObject *obj) const;
106 Double_t GetDistance() const {return fDistance;}
107 Double_t GetPt() const {return fPt;}
108 Int_t GetIndexC() const {return fIndexC;}
109 Int_t GetIndexT() const {return fIndexT;}
110 Bool_t IsSortable() const {return kTRUE;}
111 void SetIndexC(Int_t icl) {fIndexC=icl;}
112 void SetIndexT(Int_t itr) {fIndexT=itr;}
113 void SetDistance(Double_t dist) {fDistance=dist;}
114 void SetPt(Double_t pt) {fPt=pt;}
116 Bool_t fCanBeSaved; // when true, this match can be saved, otherwise it will not be
117 Int_t fIndexC; // cluster index in 'fClusters' array
118 Int_t fIndexT; // track index in 'fTracks' array
119 Double_t fDistance; // track - cluster distance
120 Double_t fPt; // track pt
125 Double_t AngleDiff(Double_t angle1, Double_t angle2);
126 Double_t CheckPair(AliEMCALTrack *tr, AliEMCALMatchCluster *cluster);
127 Double_t CheckPairV2(AliEMCALTrack *tr, AliEMCALMatchCluster *cluster);
128 Double_t CheckPairV3(AliEMCALTrack *tr, AliEMCALMatchCluster *cluster);
129 Int_t CreateMatches();
130 Bool_t PropagateToEMCAL(AliEMCALTrack *tr);
131 Int_t SolveCompetitions();
134 kTrackCorrNone = 0, // do not correct for energy loss
135 kTrackCorrMMB = 1, // use MeanMaterialBudget() function to evaluate correction
136 kTrackCorrFixed = 2 // use fixed "X0" and "rho" parameters to correct
139 Int_t fNPropSteps; // number of propagation steps (when correcting). If =0 no correction is done
140 ETrackCorr fTrackCorrMode; // track correction mode
142 Double_t fCutX; // cut on X difference
143 Double_t fCutY; // cut on Y difference
144 Double_t fCutZ; // cut on Z difference
145 Double_t fCutAlphaMin; // cut on difference between track 'alpha' and phi
146 Double_t fCutAlphaMax; // cut on difference between track 'alpha' and phi
147 Double_t fCutAngle; // cut on angle between track projection and cluster
148 Double_t fMaxDist; // maximum allowed total distance between track proj an cluster
149 Double_t fCutNITS; // mimimum number of track hits in the ITS
150 Double_t fCutNTPC; // mimimum number of track hits in the TPC
152 Double_t fRho; // energy correction: density
153 Double_t fX0; // energy correction: radiation length
155 TObjArray *fTracks; //! collection of tracks
156 TObjArray *fClusters; //! collection of EMCAL clusters (ESDCaloCluster or EMCALRecPoint)
157 TList *fMatches; //! collection of matches between tracks and clusters
159 AliEMCALGeometry *fGeom; //! EMCAL geometry
161 ClassDef(AliEMCALTracker, 3) // EMCAL "tracker"