]>
Commit | Line | Data |
---|---|---|
fe17d4cb | 1 | //======================================================================== |
2 | // Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. | |
3 | // See cxx source for full Copyright notice | |
4 | //======================================================================== | |
5 | // | |
6 | // Class AliEMCALTracker | |
7 | // ----------------------- | |
8 | // Implementation of the track matching method between barrel tracks and | |
9 | // EMCAL clusters. | |
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(). | |
17 | // | |
18 | // ------------------------------------------------------------------------ | |
19 | // author: A. Pulvirenti (alberto.pulvirenti@ct.infn.it) | |
20 | //========================================================================= | |
21 | ||
22 | #ifndef ALIEMCALTRACKER_H | |
23 | #define ALIEMCALTRACKER_H | |
24 | ||
25 | #include "AliTracker.h" | |
6d05130c | 26 | #include "TMath.h" |
fe17d4cb | 27 | class TList; |
c61f0e70 | 28 | class TTree; |
fe17d4cb | 29 | class TObjArray; |
af885e0f | 30 | class AliESDEvent; |
fe17d4cb | 31 | class AliESDCaloCluster; |
32 | class AliEMCALTrack; | |
33 | class AliEMCALRecPoint; | |
c61f0e70 | 34 | class AliEMCALGeometry; |
8ba062b1 | 35 | class AliEMCALRecParam; |
fe17d4cb | 36 | |
37 | class AliEMCALTracker : public AliTracker | |
38 | { | |
39 | public: | |
40 | ||
41 | AliEMCALTracker(); | |
42 | AliEMCALTracker(const AliEMCALTracker &t); | |
43 | AliEMCALTracker& operator=(const AliEMCALTracker &source); | |
44 | ||
45 | virtual ~AliEMCALTracker() {Clear();} | |
46 | ||
47 | virtual void Clear(Option_t *option="ALL"); | |
af885e0f | 48 | virtual Int_t Clusters2Tracks(AliESDEvent*) {return -1;} |
8ba062b1 | 49 | void InitParameters(); |
fe17d4cb | 50 | virtual Int_t LoadClusters(TTree*); |
af885e0f | 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;} | |
fe17d4cb | 55 | virtual void UnloadClusters(); |
56 | virtual AliCluster* GetCluster(Int_t) const {return NULL;}; | |
c61f0e70 | 57 | TTree* SearchTrueMatches(); |
fe17d4cb | 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;} | |
c61f0e70 | 64 | void SetGeometry(AliEMCALGeometry *geom) {fGeom=geom;} |
fe17d4cb | 65 | void SetMaxDistance(Double_t value) {fMaxDist=value;} |
66 | void SetNumberOfSteps(Int_t n) {fNPropSteps=n;if(!n)SetTrackCorrectionMode("NONE");} | |
67 | void SetTrackCorrectionMode(Option_t *option); | |
68 | ||
c61f0e70 | 69 | enum { |
70 | kUnmatched = -99999 | |
71 | }; | |
72 | ||
fe17d4cb | 73 | class AliEMCALMatchCluster : public TObject |
74 | { | |
75 | public: | |
c61f0e70 | 76 | AliEMCALMatchCluster(Int_t ID, AliEMCALRecPoint *recPoint); |
77 | AliEMCALMatchCluster(Int_t ID, AliESDCaloCluster *caloCluster); | |
78 | virtual ~AliEMCALMatchCluster() { } | |
79 | //---------------------------------------------------------------------------- | |
b9560ae2 | 80 | Int_t Index() const {return fIndex;} |
81 | Int_t Label() const {return fLabel;} | |
82 | Double_t X() const {return fX;} | |
83 | Double_t Y() const {return fY;} | |
84 | Double_t Z() const {return fZ;} | |
85 | Double_t Phi() const {return TMath::ATan2(fY, fX);} | |
fe17d4cb | 86 | private: |
87 | Int_t fIndex; // index of cluster in its native container (ESD or TClonesArray) | |
88 | Int_t fLabel; // track label of assigned cluster | |
89 | Double_t fX; // global X position | |
90 | Double_t fY; // global Y position | |
91 | Double_t fZ; // global Z position | |
92 | }; | |
93 | ||
94 | class AliEMCALMatch : public TObject | |
95 | { | |
96 | public: | |
c61f0e70 | 97 | AliEMCALMatch(); |
98 | AliEMCALMatch(const AliEMCALMatch& copy); | |
99 | virtual ~AliEMCALMatch() { } | |
100 | //---------------------------------------------------------------------------- | |
fe17d4cb | 101 | Bool_t& CanBeSaved() {return fCanBeSaved;} |
102 | Int_t Compare(const TObject *obj) const; | |
b9560ae2 | 103 | Double_t GetDistance() const {return fDistance;} |
104 | Double_t GetPt() const {return fPt;} | |
105 | Int_t GetIndexC() const {return fIndexC;} | |
106 | Int_t GetIndexT() const {return fIndexT;} | |
fe17d4cb | 107 | Bool_t IsSortable() const {return kTRUE;} |
108 | void SetIndexC(Int_t icl) {fIndexC=icl;} | |
109 | void SetIndexT(Int_t itr) {fIndexT=itr;} | |
110 | void SetDistance(Double_t dist) {fDistance=dist;} | |
c61f0e70 | 111 | void SetPt(Double_t pt) {fPt=pt;} |
fe17d4cb | 112 | private: |
113 | Bool_t fCanBeSaved; // when true, this match can be saved, otherwise it will not be | |
114 | Int_t fIndexC; // cluster index in 'fClusters' array | |
115 | Int_t fIndexT; // track index in 'fTracks' array | |
116 | Double_t fDistance; // track - cluster distance | |
c61f0e70 | 117 | Double_t fPt; // track pt |
fe17d4cb | 118 | }; |
119 | ||
120 | private: | |
121 | ||
122 | Double_t AngleDiff(Double_t angle1, Double_t angle2); | |
123 | Double_t CheckPair(AliEMCALTrack *tr, AliEMCALMatchCluster *cluster); | |
124 | Double_t CheckPairV2(AliEMCALTrack *tr, AliEMCALMatchCluster *cluster); | |
c61f0e70 | 125 | Double_t CheckPairV3(AliEMCALTrack *tr, AliEMCALMatchCluster *cluster); |
fe17d4cb | 126 | Int_t CreateMatches(); |
c61f0e70 | 127 | Bool_t PropagateToEMCAL(AliEMCALTrack *tr); |
fe17d4cb | 128 | Int_t SolveCompetitions(); |
129 | ||
130 | enum ETrackCorr { | |
131 | kTrackCorrNone = 0, // do not correct for energy loss | |
132 | kTrackCorrMMB = 1, // use MeanMaterialBudget() function to evaluate correction | |
133 | kTrackCorrFixed = 2 // use fixed "X0" and "rho" parameters to correct | |
134 | }; | |
135 | ||
136 | Int_t fNPropSteps; // number of propagation steps (when correcting). If =0 no correction is done | |
137 | ETrackCorr fTrackCorrMode; // track correction mode | |
138 | ||
139 | Double_t fCutX; // cut on X difference | |
140 | Double_t fCutY; // cut on Y difference | |
141 | Double_t fCutZ; // cut on Z difference | |
142 | Double_t fCutAlphaMin; // cut on difference between track 'alpha' and phi | |
143 | Double_t fCutAlphaMax; // cut on difference between track 'alpha' and phi | |
144 | Double_t fCutAngle; // cut on angle between track projection and cluster | |
145 | Double_t fMaxDist; // maximum allowed total distance between track proj an cluster | |
146 | ||
147 | Double_t fRho; // energy correction: density | |
148 | Double_t fX0; // energy correction: radiation length | |
149 | ||
c61f0e70 | 150 | TObjArray *fTracks; //! collection of tracks |
fe17d4cb | 151 | TObjArray *fClusters; //! collection of EMCAL clusters (ESDCaloCluster or EMCALRecPoint) |
152 | TList *fMatches; //! collection of matches between tracks and clusters | |
153 | ||
c61f0e70 | 154 | AliEMCALGeometry *fGeom; //! EMCAL geometry |
8ba062b1 | 155 | static AliEMCALRecParam* fgkRecParam; // track-matching parameters for EMCAL |
c61f0e70 | 156 | |
8ba062b1 | 157 | ClassDef(AliEMCALTracker, 2) // EMCAL "tracker" |
fe17d4cb | 158 | }; |
159 | ||
160 | #endif |