First commit of EMCAL Track matching code (A. Pulvirenti)
authorjklay <jklay@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Oct 2006 05:49:22 +0000 (05:49 +0000)
committerjklay <jklay@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Oct 2006 05:49:22 +0000 (05:49 +0000)
EMCAL/AliEMCALTrack.cxx [new file with mode: 0755]
EMCAL/AliEMCALTrack.h [new file with mode: 0755]
EMCAL/AliEMCALTracker.cxx [new file with mode: 0644]
EMCAL/AliEMCALTracker.h [new file with mode: 0644]
EMCAL/EMCALLinkDefrec.h
EMCAL/libEMCALrec.pkg

diff --git a/EMCAL/AliEMCALTrack.cxx b/EMCAL/AliEMCALTrack.cxx
new file mode 100755 (executable)
index 0000000..7fd8236
--- /dev/null
@@ -0,0 +1,183 @@
+//========================================================================
+// Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. 
+//                                                                        
+// Author: The ALICE Off-line Project.                                    
+// Contributors are mentioned in the code where appropriate.              
+//                                                                        
+// Permission to use, copy, modify and distribute this software and its   
+// documentation strictly for non-commercial purposes is hereby granted   
+// without fee, provided that the above copyright notice appears in all   
+// copies and that both the copyright notice and this permission notice   
+// appear in the supporting documentation. The authors make no claims     
+// about the suitability of this software for any purpose. It is          
+// provided "as is" without express or implied warranty.                  
+//========================================================================  
+//                       
+//                       Class AliEMCALTrack 
+//                      ---------------------
+//    A class implementing a track which is propagated to EMCAL and 
+//    matches and EMCAL cluster. 
+//    This track object will not update Kalman parameters, but it 
+//    allows for track propagation and suitable energy loss correction,
+//    even in an environment with a variable magnetic field, which is not
+//    well managed in the AliExternalTrackParam class.
+// ------------------------------------------------------------------------
+// author: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
+//=========================================================================
+
+#include "Riostream.h"
+
+#include "AliLog.h"
+#include "AliTracker.h"
+#include "AliESDtrack.h" 
+
+#include "AliEMCALTrack.h"
+
+Bool_t AliEMCALTrack::fgUseOuterParams = kTRUE;
+
+ClassImp(AliEMCALTrack)
+//
+//------------------------------------------------------------------------------
+//
+AliEMCALTrack::AliEMCALTrack() 
+  : AliExternalTrackParam(),
+    fClusterIndex(-1),
+    fClusterDist(1000.0),
+    fMass(0.0),
+    fSeedIndex(-1),
+    fSeedLabel(-1)
+{
+       //
+       // Default constructor.
+       // Sets to meaningless values the indexes corresponding to
+       // ESD seed track and matched cluster.
+       //
+}
+//
+//------------------------------------------------------------------------------
+//
+AliEMCALTrack::AliEMCALTrack(const AliEMCALTrack& t) 
+  : AliExternalTrackParam(t),
+    fClusterIndex(t.fClusterIndex),
+    fClusterDist(t.fClusterDist),
+    fMass(t.fMass),
+    fSeedIndex(t.fSeedIndex),
+    fSeedLabel(t.fSeedLabel)
+{
+       //
+       // Copy constructor.
+       //
+       }
+//
+//------------------------------------------------------------------------------
+//
+AliEMCALTrack::AliEMCALTrack(const AliESDtrack& t) 
+  : AliExternalTrackParam(),
+    fClusterIndex(-1),
+    fClusterDist(1000.0),
+    fMass(t.GetMass()),
+    fSeedIndex(-1),
+    fSeedLabel(t.GetLabel())
+{
+       //
+       // Constructor from AliESDtrack
+       //
+
+       // parameters are chosen according to static variable fUseOuterParams
+       Double_t alpha, x, params[5], cov[15];
+       if (fgUseOuterParams) {
+               t.GetOuterExternalParameters(alpha, x, params);
+               t.GetOuterExternalCovariance(cov);
+       }
+       else {
+               alpha = t.GetAlpha();
+               t.GetExternalParameters(x, params);
+               t.GetExternalCovariance(cov);
+       }
+       
+       if (alpha < -TMath::Pi()) alpha += TMath::TwoPi();
+       else if (alpha >= TMath::Pi()) alpha -= TMath::TwoPi();
+       
+       // set this accordingly
+       Set(x, alpha, params, cov);
+}              
+//
+//------------------------------------------------------------------------------
+//
+AliEMCALTrack& AliEMCALTrack::operator=(const AliEMCALTrack &t)
+{
+       //
+       // Assignment operator
+       // Works like copy constructor
+       //
+       
+       fClusterIndex = t.fClusterIndex;
+       fClusterDist = t.fClusterDist;
+       
+       fMass = t.fMass;
+       
+       fSeedIndex = t.fSeedIndex;
+       fSeedLabel = t.fSeedLabel;
+
+       return *this;
+}
+//
+//------------------------------------------------------------------------------
+//
+Int_t AliEMCALTrack::Compare(const TObject *obj) const 
+{
+       //
+       // Tracks compared wrt their distance from matched point
+       //
+       
+       AliEMCALTrack *that = (AliEMCALTrack*)obj;
+       
+       Double_t thisDist = GetClusterDist();
+       Double_t thatDist = that->GetClusterDist();
+       
+       if (thisDist > thatDist) return 1;
+       else if (thisDist < thatDist) return -1;
+       return 0;
+}
+//
+//------------------------------------------------------------------------------
+//
+Double_t AliEMCALTrack::GetBz() const 
+{
+       //
+       // returns Bz component of the magnetic field in kG,
+       // at the point where track is actually propagated
+       //
+       
+       Double_t r[3];
+       
+       if (AliTracker::UniformField()) {
+               return AliTracker::GetBz();
+       }
+       else {
+               GetXYZ(r);
+               return AliTracker::GetBz(r);
+       }
+}
+//
+//------------------------------------------------------------------------------
+//
+Bool_t AliEMCALTrack::PropagateTo(Double_t xk, Double_t eqWidth, Double_t x0)
+{
+       //
+       // Propagates a track to the plane defined by x='xk'.
+       // Second parameter represents the percent width of radiation length
+       // crossed by the track.
+       // Third parameter is the reference radiation length used (default: Si).
+       // Track propagation includes computing energy loss (modifies curvature)
+       // and multiple scattering perturbation (alters covariance matrix).
+       // Method returns kFALSE when something goes wrong with computations.
+       //
+       
+       Double_t field = GetBz();
+       
+       if (!AliExternalTrackParam::PropagateTo(xk, field)) return kFALSE;
+       if (!AliExternalTrackParam::CorrectForMaterial(eqWidth, x0, GetMass())) return kFALSE;
+
+       return kTRUE;            
+}     
diff --git a/EMCAL/AliEMCALTrack.h b/EMCAL/AliEMCALTrack.h
new file mode 100755 (executable)
index 0000000..beffc24
--- /dev/null
@@ -0,0 +1,67 @@
+//========================================================================  
+// Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved.  
+// See cxx source for full Copyright notice                                
+//========================================================================  
+//                       
+//                       Class AliEMCALTrack 
+//                      ---------------------
+// Implementation of a track to be used for EMCAL track matching.
+// This object is used to find track intersection with EMCAL surface
+// in order to find the most well matched EMCAL cluster to associate to it.              
+// NO Kalman-like parameter updating is done.
+//
+// ------------------------------------------------------------------------
+// author: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
+//=========================================================================
+
+#ifndef AliEMCALTRACK_H
+#define AliEMCALTRACK_H
+
+#include "AliExternalTrackParam.h"
+
+class AliESDtrack;
+
+class AliEMCALTrack : public AliExternalTrackParam
+{
+public:
+
+       AliEMCALTrack();
+       AliEMCALTrack(const AliEMCALTrack& t);
+       AliEMCALTrack(const AliESDtrack& t);
+       AliEMCALTrack& operator=(const AliEMCALTrack &t);
+       
+       Int_t    Compare(const TObject *o) const;
+       
+       Double_t GetBz() const;
+       Int_t    GetClusterIndex() const {return fClusterIndex;}
+       Double_t GetClusterDist() const {return fClusterDist;}
+       Double_t GetMass() const {return fMass;}
+       Int_t    GetSeedIndex() const {return fSeedIndex;}
+       Int_t    GetSeedLabel() const {return fSeedLabel;}
+               
+       Bool_t   IsSortable() const {return kTRUE;}
+       Bool_t   PropagateTo(Double_t xr, Double_t d, Double_t x0=21.82);
+                       
+       void     SetClusterIndex(Int_t idx) {fClusterIndex=idx;}
+       void     SetClusterDist(Double_t dist) {fClusterDist=dist;}
+       void     SetMass(Double_t mass) {fMass=mass;}
+       void     SetSeedIndex(Int_t index) {fSeedIndex=index;}
+       void     SetSeedLabel(Int_t label) {fSeedLabel=label;}
+               
+       static void SetUseOuterParams(Bool_t doit=kTRUE) {fgUseOuterParams=doit;}
+
+protected:
+       
+       static  Bool_t    fgUseOuterParams;    // use outer parameters from AliESDtrack?
+               Int_t     fClusterIndex;       // index of matched cluster (if any)
+               Double_t  fClusterDist;        // distance between track propagation and matched cluster
+                       Double_t  fMass;               // mass hypothesis (in GeV/c2)
+               Int_t     fSeedIndex;          // index of imported ESD track in its owner AliESD
+               Int_t     fSeedLabel;          // label of imported ESD track
+private:
+       
+       ClassDef(AliEMCALTrack, 0) // track implementation for EMCAL matching
+
+};                     
+
+#endif
diff --git a/EMCAL/AliEMCALTracker.cxx b/EMCAL/AliEMCALTracker.cxx
new file mode 100644 (file)
index 0000000..e12dd5d
--- /dev/null
@@ -0,0 +1,914 @@
+//========================================================================
+// Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. 
+//                                                                        
+// Author: The ALICE Off-line Project.                                    
+// Contributors are mentioned in the code where appropriate.              
+//                                                                        
+// Permission to use, copy, modify and distribute this software and its   
+// documentation strictly for non-commercial purposes is hereby granted   
+// without fee, provided that the above copyright notice appears in all   
+// copies and that both the copyright notice and this permission notice   
+// appear in the supporting documentation. The authors make no claims     
+// about the suitability of this software for any purpose. It is          
+// provided "as is" without express or implied warranty.                  
+//======================================================================== 
+//                       
+//                       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)
+//=========================================================================
+
+#include <Riostream.h>
+#include <iomanip>
+
+#include <TFile.h>
+#include <TTree.h>
+#include <TMath.h>
+#include <TList.h>
+#include <TString.h>
+#include <TVector3.h>
+#include <TClonesArray.h>
+
+#include "AliLog.h"
+#include "AliESD.h"
+#include "AliESDtrack.h"
+#include "AliKalmanTrack.h"
+#include "AliEMCALRecPoint.h"
+#include "AliRunLoader.h"
+#include "AliEMCALTrack.h"
+#include "AliEMCALLoader.h"
+#include "AliEMCALTracker.h"
+
+ClassImp(AliEMCALTracker)
+//
+//------------------------------------------------------------------------------
+//
+AliEMCALTracker::AliEMCALTracker() 
+  : AliTracker(),
+    fNPropSteps(0),
+    fTrackCorrMode(kTrackCorrNone),
+    fCutX(50.0),
+    fCutY(50.0),
+    fCutZ(50.0),
+    fCutAlphaMin(-200.0),
+    fCutAlphaMax(200.0),
+    fCutAngle(100.0),
+    fMaxDist(100.0),
+    fRho(1.0),
+    fX0(1.0),
+    fTracks(0),
+    fClusters(0),
+    fMatches(0)
+{
+       //
+       // Default constructor.
+       // Initializes al simple data members to default values,
+       // and all collections to NULL.
+       // Output file name is set to a default value.
+       //
+}
+//
+//------------------------------------------------------------------------------
+//
+AliEMCALTracker::AliEMCALTracker(const AliEMCALTracker& copy) 
+  : AliTracker(),
+    fNPropSteps(copy.fNPropSteps),
+    fTrackCorrMode(copy.fTrackCorrMode),
+    fCutX(copy.fCutX),
+    fCutY(copy.fCutY),
+    fCutZ(copy.fCutZ),
+    fCutAlphaMin(copy.fCutAlphaMin),
+    fCutAlphaMax(copy.fCutAlphaMax),
+    fCutAngle(copy.fCutAngle),
+    fMaxDist(copy.fMaxDist),
+    fRho(copy.fRho),
+    fX0(copy.fX0),
+    fTracks((TObjArray*)copy.fTracks->Clone()),
+    fClusters((TObjArray*)copy.fClusters->Clone()),
+    fMatches((TList*)copy.fMatches->Clone())
+{
+       //
+       // Copy constructor
+       // Besides copying all parameters, duplicates all collections.
+       //
+}
+//
+//------------------------------------------------------------------------------
+//
+AliEMCALTracker& AliEMCALTracker::operator=(const AliEMCALTracker& copy)
+{
+       //
+       // Assignment operator.
+       // Besides copying all parameters, duplicates all collections.  
+       //
+       
+       fCutX = copy.fCutX;
+       fCutY = copy.fCutY;
+       fCutZ = copy.fCutZ;
+       fCutAlphaMin = copy.fCutAlphaMin;
+       fCutAlphaMax = copy.fCutAlphaMax;
+       fCutAngle = copy.fCutAngle;
+       fMaxDist = copy.fMaxDist;
+       
+       fTracks = (TObjArray*)copy.fTracks->Clone();
+       fClusters = (TObjArray*)copy.fClusters->Clone();
+       fMatches = (TList*)copy.fMatches->Clone();
+       
+       return (*this);
+}
+//
+//------------------------------------------------------------------------------
+//
+void AliEMCALTracker::Clear(Option_t* option)
+{
+       //
+       // Clearing method
+       // Clears all specified arrays and the containers themselves.
+       //
+
+       TString opt(option);
+       Bool_t clearTracks = opt.Contains("TRACKS");
+       Bool_t clearClusters = opt.Contains("CLUSTERS");
+       Bool_t clearMatches = opt.Contains("MATCHES");
+       if (opt.Contains("ALL")) {
+               clearTracks = kTRUE;
+               clearClusters = kTRUE;
+               clearMatches = kTRUE;
+       }
+       
+       if (fTracks != 0x0 && clearTracks) {
+               if (!fTracks->IsEmpty()) fTracks->Delete();
+               delete fTracks;
+               fTracks = 0;
+       }
+       if (fClusters != 0x0 && clearClusters) {
+               if (!fClusters->IsEmpty()) fClusters->Delete();
+               delete fClusters;
+               fClusters = 0;
+       }
+       if (fMatches != 0x0 && clearMatches) {
+               if (!fMatches->IsEmpty()) fMatches->Delete();
+               delete fMatches;
+               fMatches = 0;
+       }
+}
+//
+//------------------------------------------------------------------------------
+//
+Int_t AliEMCALTracker::LoadClusters(TTree *cTree) 
+{
+       //
+       // Load EMCAL clusters in the form of AliEMCALRecPoint,
+       // from simulation temporary files.
+       // (When included in reconstruction chain, this method is used automatically)
+       //
+       
+       Clear("CLUSTERS");
+
+       TBranch *branch = cTree->GetBranch("EMCALECARP");
+       if (!branch) {
+               AliError("can't get the branch with the EMCAL clusters");
+               return 1;
+       }
+       
+       TClonesArray dummy("AliEMCALRecPoint", 10000);
+       TClonesArray *clusters = &dummy;
+       branch->SetAddress(&clusters);
+       Int_t nClusters = (Int_t)clusters->GetEntries();
+       
+       cTree->GetEvent(0);
+       fClusters = new TObjArray(0);
+       for (Int_t i = 0; i < nClusters; i++) {
+               AliEMCALRecPoint *cluster = (AliEMCALRecPoint*)clusters->At(i);
+               if (!cluster) continue;
+               if (cluster->GetClusterType() != AliESDCaloCluster::kClusterv1) continue;
+               AliEMCALMatchCluster *matchCluster = new AliEMCALMatchCluster(i, cluster);
+               fClusters->AddLast(matchCluster);
+       }
+       if (fClusters->IsEmpty()) {
+               AliError("No clusters collected");
+               return 1;
+       }
+       
+       AliInfo(Form("Collected %d clusters", fClusters->GetEntries()));
+
+       return 0;
+}
+//
+//------------------------------------------------------------------------------
+//
+Int_t AliEMCALTracker::LoadClusters(AliESD *esd) 
+{
+       //
+       // Load EMCAL clusters in the form of AliESDCaloClusters,
+       // from an AliESD object.
+       //
+
+       // make sure that tracks/clusters collections are empty
+       Clear("CLUSTERS");
+       
+       Int_t start = esd->GetFirstEMCALCluster();
+       Int_t nClustersEMC = esd->GetNumberOfEMCALClusters();
+       Int_t end = start + nClustersEMC;
+       
+       fClusters = new TObjArray(0);
+               
+       Int_t i;
+       for (i = start; i < end; i++) {
+               AliESDCaloCluster *cluster = esd->GetCaloCluster(i);
+               if (!cluster) continue;
+               if (cluster->GetClusterType() != AliESDCaloCluster::kClusterv1) continue;
+               AliEMCALMatchCluster *matchCluster = new AliEMCALMatchCluster(i, cluster);
+               fClusters->AddLast(matchCluster);
+       }
+       if (fClusters->IsEmpty()) {
+               AliError("No clusters collected");
+               return 1;
+       }
+       
+       AliInfo(Form("Collected %d clusters", fClusters->GetEntries()));
+
+       return 0;
+}
+//
+//------------------------------------------------------------------------------
+//
+Int_t AliEMCALTracker::LoadTracks(AliESD *esd)
+{
+       //
+       // Load ESD tracks.
+       //
+       
+       Clear("TRACKS");
+       
+       Int_t nTracks = esd->GetNumberOfTracks();
+       fTracks = new TObjArray(0);
+       
+       Int_t i, j;
+       Bool_t isKink;
+       Double_t alpha; 
+       for (i = 0; i < nTracks; i++) {
+               AliESDtrack *esdTrack = esd->GetTrack(i);
+               // set by default the value corresponding to "no match"
+               esdTrack->SetEMCALcluster(-99999);
+//             if (esdTrack->GetLabel() < 0) continue;
+//             if (!(esdTrack->GetStatus() & AliESDtrack::kTOFout)) continue;
+               isKink = kFALSE;
+               for (j = 0; j < 3; j++) {
+                       if (esdTrack->GetKinkIndex(j) > 0) isKink = kTRUE;
+               }
+               if (isKink) continue;
+               AliEMCALTrack *track = new AliEMCALTrack(*esdTrack);
+               // check alpha and reject the tracks which fall outside EMCAL acceptance
+               alpha = track->GetAlpha() * TMath::RadToDeg();
+               if (alpha >  -155.0 && alpha < 67.0) {
+                       delete track;
+                       continue;
+               }
+               track->SetSeedIndex(i);
+               track->SetSeedLabel(esdTrack->GetLabel());
+               fTracks->AddLast(track);
+       }
+       if (fTracks->IsEmpty()) {
+               AliError("No tracks collected");
+               return 1;
+       }
+       
+       AliInfo(Form("Collected %d tracks", fTracks->GetEntries()));
+
+       return 0;
+}
+//
+//------------------------------------------------------------------------------
+//
+Int_t AliEMCALTracker::PropagateBack(AliESD* esd)
+{
+       //
+       // Main operation method.
+       // Gets external AliESD containing tracks to be matched.
+       // After executing match finding, stores in the same ESD object all infos
+       // and releases the object for further reconstruction steps.
+       //
+       
+       if (!esd) {
+               AliError("NULL ESD passed");
+               return 1;
+       }
+       
+       // step 1: 
+       // if cluster array is empty, cluster are collected
+       // from the passed ESD, and work is done with ESDCaloClusters
+       Int_t okLoadClusters;
+       if (!fClusters || (fClusters && fClusters->IsEmpty())) {
+               AliInfo("Cluster array is empty. Loading clusters...");
+               okLoadClusters = LoadClusters(esd);
+               if (okLoadClusters) return 2;
+       }
+       
+       // step 2:
+       // collect ESD tracks
+       Int_t okLoadTracks = LoadTracks(esd);
+       if (okLoadTracks) return 3;
+       
+       // step 3:
+       // each track is propagated to the "R" position of each cluster.
+       // The closest cluster is assigned as match.
+       // IF no clusters lie within the maximum allowed distance, no matches are assigned.
+       Int_t nMatches = CreateMatches();
+       if (!nMatches) {
+               AliInfo("No good matches found.");
+               return 4;
+       }
+       else {
+               AliInfo(Form("Found %d matches", nMatches));
+       }
+       
+       // step 4:
+       // when more than 1 track share the same matched cluster, only the closest one is kept.
+       Int_t nRemoved = SolveCompetitions();
+       AliInfo(Form("Removed %d duplicate matches", nRemoved));
+       if (nRemoved >= nMatches) {
+               AliError("Removed ALL matches! Check the algorithm or data. Nothing to save");
+               return 5;
+       }
+       
+       // step 5:
+       // save obtained information setting the 'fEMCALindex' field of AliESDtrack object
+       Int_t nSaved = 0, trackID;
+       TListIter iter(fMatches);
+       AliEMCALMatch *match = 0;
+       while ( (match = (AliEMCALMatch*)iter.Next()) ) {
+               if (!match->CanBeSaved()) continue;
+               AliEMCALTrack *track = (AliEMCALTrack*)fTracks->At(match->GetIndexT());
+               AliEMCALMatchCluster *cluster = (AliEMCALMatchCluster*)fClusters->At(match->GetIndexC());
+               trackID = track->GetSeedIndex();
+               AliESDtrack *esdTrack = esd->GetTrack(trackID);
+               if (!esdTrack) continue;
+               if (esdTrack->GetLabel() == cluster->Label()) {
+                       esdTrack->SetEMCALcluster(cluster->Index());
+               }
+               else {
+                       esdTrack->SetEMCALcluster(-cluster->Index());
+               }
+               nSaved++;
+       }
+       /*
+       AliEMCALTrack *track = 0;
+       TObjArrayIter tracks(fTracks);
+       while ( (track = (AliEMCALTrack*)tracks.Next()) ) {
+               trackID = track->GetSeedIndex();
+               clusterID = track->GetMatchedClusterIndex();
+               AliESDtrack *esdTrack = esd->GetTrack(trackID);
+               if (!esdTrack) continue;
+               if (clusterID < 0) {
+                       esdTrack->SetEMCALcluster(-99999);
+               }
+               else {
+                       AliEMCALMatchCluster *cluster = (AliEMCALMatchCluster*)fClusters->At(clusterID);
+                       if (!cluster) continue;
+                       if (esdTrack->GetLabel() == cluster->Label()) {
+                               nGood++;
+                               esdTrack->SetEMCALcluster(cluster->Index());
+                       }
+                       else {
+                               esdTrack->SetEMCALcluster(-cluster->Index());
+                       }
+                       nSaved++;
+               }
+       }
+       */
+       AliInfo(Form("Saved %d matches", nSaved));
+
+       return 0;
+}
+//
+//------------------------------------------------------------------------------
+//
+void AliEMCALTracker::SetTrackCorrectionMode(Option_t *option)
+{
+       //
+       // Set track correction mode
+       // gest the choice in string format and converts into 
+       // internal enum
+       //
+       
+       TString opt(option);
+       opt.ToUpper();
+       
+       if (!opt.CompareTo("NONE")) {
+               fTrackCorrMode = kTrackCorrNone;
+       }
+       else if (!opt.CompareTo("MMB")) {
+               fTrackCorrMode = kTrackCorrMMB;
+       }
+       else if (!opt.CompareTo("FIXED")) {
+               fTrackCorrMode = kTrackCorrFixed;
+       }
+       else {
+               cerr << "E-AliEMCALTracker::SetTrackCorrectionMode '" << option << "': Unrecognized option" << endl;
+       }
+}
+
+//
+//------------------------------------------------------------------------------
+//
+Double_t AliEMCALTracker::AngleDiff(Double_t angle1, Double_t angle2)
+{
+       // 
+       // [PRIVATE]
+       // Given two angles in radiants, it converts them in the range 0-2pi
+       // then computes their true difference, i.e. if the difference a1-a2
+       // results to be larger than 180 degrees, it returns 360 - diff.
+       //
+       
+       if (angle1 < 0.0) angle1 += TMath::TwoPi();
+       if (angle1 > TMath::TwoPi()) angle1 -= TMath::TwoPi();
+       if (angle2 < 0.0) angle2 += TMath::TwoPi();
+       if (angle2 > TMath::TwoPi()) angle2 -= TMath::TwoPi();
+       
+       Double_t diff = TMath::Abs(angle1 - angle2);
+       if (diff > TMath::Pi()) diff = TMath::TwoPi() - diff;
+       
+       if (angle2 > angle1) diff = -diff;
+       
+       return diff;
+}
+//
+//------------------------------------------------------------------------------
+//
+Double_t AliEMCALTracker::CheckPair
+(AliEMCALTrack *track, AliEMCALMatchCluster *cl)
+{
+       //
+       // Given a track and a cluster,
+       // propagates the first to the radius of the second.
+       // Then, checks the propagation point against all cuts.
+       // If at least a cut is not passed, a valuer equal to 
+       // twice the maximum allowed distance is passed (so the value returned
+       // will not be taken into account when creating matches)
+       //
+       
+       // TEMP
+       Bool_t isTrue = kFALSE;
+//     if (tr->GetSeedLabel() == cl->Label()) {
+//             isTrue = kTRUE;
+//             cout << "TRUE MATCH!!!" << endl;
+//     }
+       
+       // copy track into temporary variable
+       AliEMCALTrack *tr = new AliEMCALTrack(*track);
+       
+       Double_t distance = 2.0 * fMaxDist;
+       
+       // check against cut on difference 'alpha - phi'
+       Double_t phi = TMath::ATan2(cl->Y(), cl->X());
+       phi = AngleDiff(phi, tr->GetAlpha());
+       if (phi < fCutAlphaMin || phi > fCutAlphaMax) return distance;
+       
+       // try to propagate to cluster radius
+       // (return the 'distance' value if it fails)
+       Double_t pos[3], &x = pos[0], &y = pos[1], &z = pos[2];
+       Double_t x0, rho;
+       tr->GetXYZ(pos);
+       Double_t rt = TMath::Sqrt(x*x + y*y);
+       Double_t rc = TMath::Sqrt(cl->X()*cl->X() + cl->Y()*cl->Y());
+       
+       if (fTrackCorrMode == kTrackCorrMMB) {
+               Double_t pos1[3], pos2[3], param[6];
+               pos1[0] = x;
+               pos1[1] = y;
+               pos1[2] = z;
+               pos2[0] = cl->X();
+               pos2[1] = cl->Y();
+               pos2[2] = cl->Z();
+               AliKalmanTrack::MeanMaterialBudget(pos1, pos2, param);
+               rho = param[0];
+               x0 = param[1];
+       }
+       else if (fTrackCorrMode == kTrackCorrFixed) {
+               rho = fRho;
+               x0 = fX0;
+       }
+       else {
+               rho = 0.0;
+               x0 = 0.0;
+       }
+       if (fNPropSteps) {
+               Int_t i;
+               Double_t r;
+               cout.setf(ios::fixed);
+               cout.precision(5);
+               if (isTrue) cout << "Init : " << rt << ' ' << x << ' ' << y << ' ' << z << endl;
+               for (i = 0; i < fNPropSteps; i++) {
+                       r = rt + (rc - rt) * ((Double_t)(i+1)/(Double_t)fNPropSteps);
+                       if (!tr->PropagateTo(r, x0, rho)) return distance;
+                       tr->GetXYZ(pos);
+                       if (isTrue) cout << "Step : " << r << ' ' << x << ' ' << y << ' ' << z << endl;
+               }
+               if (isTrue) cout << "Clstr: " << rc << ' ' << cl->X() << ' ' << cl->Y() << ' ' << cl->Z() << endl;
+       }
+       else {
+               // when no steps are used, no correction makes sense
+               if (!tr->PropagateTo(rc, 0.0, 0.0)) return distance;
+       }
+       
+       // get global propagation of track at end of propagation
+       tr->GetXYZ(pos);
+       
+       // check angle cut
+       TVector3 vc(cl->X(), cl->Y(), cl->Z());
+       TVector3 vt(x, y, z);
+       Double_t angle = TMath::Abs(vc.Angle(vt)) * TMath::RadToDeg();
+       if (angle > fCutAngle) {
+               //cout << "angle" << endl;
+               return distance;
+       }
+               
+       // compute differences wr to each coordinate
+       x -= cl->X();
+       if (x > fCutX) {
+               //cout << "cut X" << endl;
+               return distance;
+       }
+       y -= cl->Y();
+       if (y > fCutY) {
+               //cout << "cut Y" << endl;
+               return distance;
+       }
+       z -= cl->Z();
+       if (z > fCutZ) {
+               //cout << "cut Z" << endl;
+               return distance;
+       }
+       
+       // compute true distance
+       distance = TMath::Sqrt(x*x + y*y + z*z);
+       //Double_t temp = CheckPairV2(tr, cl);
+       //if (temp < distance) return temp; else 
+       
+       // delete temporary object
+       delete tr;
+       
+       return distance;
+}
+//
+//------------------------------------------------------------------------------
+//
+Double_t AliEMCALTracker::CheckPairV2
+(AliEMCALTrack *tr, AliEMCALMatchCluster *cl)
+{
+       //
+       // Given a track and a cluster,
+       // propagates the first to the radius of the second.
+       // Then, checks the propagation point against all cuts.
+       // If at least a cut is not passed, a valuer equal to 
+       // twice the maximum allowed distance is passed (so the value returned
+       // will not be taken into account when creating matches)
+       //
+       
+       // TEMP
+//     Bool_t isTrue = kFALSE;
+//     if (tr->GetSeedLabel() == cl->Label()) {
+//             isTrue = kTRUE;
+//             cout << "TRUE MATCH!!!" << endl;
+//     }
+       
+       Double_t distance = 2.0 * fMaxDist;
+       
+       Double_t x0, rho;
+       if (fTrackCorrMode == kTrackCorrMMB) {
+               Double_t pos1[3], pos2[3], param[6];
+               tr->GetXYZ(pos1);
+//             pos1[0] = x;
+//             pos1[1] = y;
+//             pos1[2] = z;
+               pos2[0] = cl->X();
+               pos2[1] = cl->Y();
+               pos2[2] = cl->Z();
+               AliKalmanTrack::MeanMaterialBudget(pos1, pos2, param);
+               rho = param[0];
+               x0 = param[1];
+       }
+       else if (fTrackCorrMode == kTrackCorrFixed) {
+               rho = fRho;
+               x0 = fX0;
+       }
+       else {
+               rho = 0.0;
+               x0 = 0.0;
+       }
+       
+       // check against cut on difference 'alpha - phi'
+       Double_t phi = TMath::ATan2(cl->Y(), cl->X());
+       phi = AngleDiff(phi, tr->GetAlpha());
+       if (phi < fCutAlphaMin || phi > fCutAlphaMax) return distance;
+       
+       // get cluster position and put them into a vector
+       TVector3 vc(cl->X(), cl->Y(), cl->Z());
+       // rotate the vector in order to put all clusters on a plane intersecting 
+       // vertically the X axis; the angle depends on the sector
+       Double_t clusterRot, clusterPhi = vc.Phi() * TMath::RadToDeg();
+       if (clusterPhi < 0.0) clusterPhi += 360.0;
+       if (clusterPhi < 100.0) {
+               clusterRot = -90.0;
+       }
+       else if (clusterPhi < 120.0) {
+               clusterRot = -110.0;
+       }
+       else if (clusterPhi < 140.0) {
+               clusterRot = -130.0;
+       }
+       else if (clusterPhi < 160.0) {
+               clusterRot = -150.0;
+       }
+       else if (clusterPhi < 180.0) {
+               clusterRot = -170.0;
+       }
+       else {
+               clusterRot = -190.0;
+       }
+       vc.RotateZ(clusterRot * TMath::DegToRad());
+       // generate a track from the ESD track selected
+       AliEMCALTrack *track = new AliEMCALTrack(*tr);
+       // compute the 'phi' coordinate of the intersection point to 
+       // the EMCAL surface
+       Double_t x = vc.X();
+       Double_t y;
+       track->GetYAt(vc.X(), track->GetBz(), y);
+       Double_t tmp = x*TMath::Cos(track->GetAlpha()) - y*TMath::Sin(track->GetAlpha());
+       y = x*TMath::Sin(track->GetAlpha()) + y*TMath::Cos(track->GetAlpha());
+       x = tmp;
+       Double_t trackPhi = TMath::ATan2(y, x) * TMath::RadToDeg();
+       // compute phi difference
+       Double_t dphi = trackPhi - clusterPhi;
+       if (TMath::Abs(dphi) > 180.0) {
+               dphi = 360.0 - TMath::Abs(dphi);
+               if (clusterPhi > trackPhi) dphi = -dphi;
+       }
+       // propagate track to the X position of rotated cluster
+       // and get the vector of X, Y, Z in the local ref. frame of the track
+       track->PropagateTo(vc.X(), x0, rho);
+       TVector3 vt(track->GetX(), track->GetY(), track->GetZ());
+       vt.RotateZ((clusterPhi - trackPhi) * TMath::DegToRad());
+       TVector3 vdiff = vt-vc;
+               
+       // compute differences wr to each coordinate
+       if (vdiff.X() > fCutX) return distance;
+       if (vdiff.Y() > fCutY) return distance;
+       if (vdiff.Z() > fCutZ) return distance;
+       
+       // compute true distance
+       distance = vdiff.Mag();
+       return distance;
+}
+//
+//------------------------------------------------------------------------------
+//
+Int_t AliEMCALTracker::CreateMatches()
+{
+       //
+       // Creation of matches between tracks and clusters.
+       // For each ESD track collected by ReadESD(), an AliEMCALTrack is made.
+       // If it finds a cluster close enough to its propagation to EMCAL,
+       // which passes all cuts, its index is stored.
+       // If many clusters are found which satisfy the criteria described above, 
+       // only the closest one is stored.
+       // At this level, it is possible that two tracks share the same cluster.
+       //
+       
+       // if matches collection is already present, it is deleted
+       if (fMatches) {
+               fMatches->Delete();
+               delete fMatches;
+       }
+       fMatches = new TList;
+       
+       // initialize counters and indexes
+       Int_t count = 0;
+       Int_t ic, nClusters = (Int_t)fClusters->GetEntries();
+       Int_t it, nTracks = fTracks->GetEntries();
+       
+       // external loop on clusters, internal loop on tracks
+       Double_t dist;
+       for (ic = 0; ic < nClusters; ic++) {
+               cout << "\rMatching cluster " << ic+1 << " of " << nClusters << flush;
+               AliEMCALMatchCluster *cluster = (AliEMCALMatchCluster*)fClusters->At(ic);
+               for (it = 0; it < nTracks; it++) {
+                       AliEMCALTrack *track = (AliEMCALTrack*)fTracks->At(it);
+                       dist = CheckPair(track, cluster);
+                       if (dist <= fMaxDist) {
+                               AliEMCALMatch *candidate = new AliEMCALMatch;
+                               candidate->SetIndexT(it);
+                               candidate->SetIndexC(ic);
+                               candidate->SetDistance(dist);
+                               fMatches->Add(candidate);
+                               count++;
+                       }
+               }
+       }
+       cout << endl;           
+       
+       /*
+       // loop on clusters and tracks
+       Int_t icBest;
+       Double_t dist, distBest;
+       for (it = 0; it < nTracks; it++) {
+               AliEMCALTrack *track = (AliEMCALTrack*)fTracks->At(it);
+               if (!track) continue;
+               icBest = -1;
+               distBest = fMaxDist;
+               for (ic = 0; ic < nClusters; ic++) {
+                       AliEMCALMatchCluster *cluster = (AliEMCALMatchCluster*)fClusters->At(ic);
+                       if (!cluster) continue;
+                       dist = CheckPair(track, cluster);
+                       if (dist < distBest) {
+                               distBest = dist;
+                               icBest = ic;
+                       }
+               }
+               if (icBest >= 0) {
+                       track->SetMatchedClusterIndex(icBest);
+                       track->SetMatchedClusterDist(distBest);
+                       count++;
+               }
+               else {
+                       track->SetMatchedClusterIndex(-1);
+               }
+       }
+       */
+       
+       return count;
+}
+//
+//------------------------------------------------------------------------------
+//
+Int_t AliEMCALTracker::SolveCompetitions()
+{
+       //
+       // Match selector.
+       // The match list is sorted from the best to the worst match, w.r. to the 
+       // distance between track prolongation and cluster position.
+       // Based on this criterion, starting from the first (best) match, a flag
+       // is set to both the involved track and cluster, and all matches containing
+       // an already used track or cluster are removed, leaving only the best match
+       // for each cluster.
+       //
+       
+       // sort matches with respect to track-cluster distance
+       fMatches->Sort(kSortAscending);
+       
+       // keep track of eliminated matches
+       Int_t count = 0;
+       
+       // initialize flags to check repetitions
+       Int_t ic, nClusters = (Int_t)fClusters->GetEntries();
+       Int_t it, nTracks = fTracks->GetEntries();
+       Bool_t *usedC = new Bool_t[nClusters];
+       Bool_t *usedT = new Bool_t[nTracks];
+       for (ic = 0; ic < nClusters; ic++) usedC[ic] = kFALSE;
+       for (it = 0; it < nTracks; it++) usedT[it] = kFALSE;
+       
+       // loop on matches
+       TListIter iter(fMatches);
+       AliEMCALMatch *match = 0;
+       while ( (match = (AliEMCALMatch*)iter.Next()) ) {
+               ic = match->GetIndexC();
+               it = match->GetIndexT();
+               if (!usedT[it] && !usedC[ic]) {
+                       usedT[it] = kTRUE;
+                       usedC[ic] = kTRUE;
+                       match->CanBeSaved() = kTRUE;
+               }
+               else {
+                       count++;
+               }
+       }
+       
+       /*
+       Int_t it1, it2, nTracks = (Int_t)fTracks->GetEntries();
+       AliEMCALTrack *track1 = 0, *track2 = 0;
+       for (it1 = 0; it1 < nTracks; it1++) {
+               track1 = (AliEMCALTrack*)fTracks->At(it1);
+               if (!track1) continue;
+               if (track1->GetMatchedClusterIndex() < 0) continue;
+               for (it2 = it1+1; it2 < nTracks; it2++) {
+                       track2 = (AliEMCALTrack*)fTracks->At(it2);
+                       if (!track2) continue;
+                       if (track2->GetMatchedClusterIndex() < 0) continue;
+                       if (track1->GetMatchedClusterIndex() != track2->GetMatchedClusterIndex()) continue;
+                       count++;
+                       if (track1->GetMatchedClusterDist() < track2->GetMatchedClusterDist()) {
+                               track2->SetMatchedClusterIndex(-1);
+                       }
+                       else if (track2->GetMatchedClusterDist() < track1->GetMatchedClusterDist()) {
+                               track1->SetMatchedClusterIndex(-1);
+                       }
+               }
+       }
+       */
+       
+       return count;
+}
+//
+//------------------------------------------------------------------------------
+//
+void AliEMCALTracker::UnloadClusters() 
+{
+       //
+       // Free memory from clusters
+       //
+       
+       Clear("CLUSTERS");
+}
+//
+//------------------------------------------------------------------------------
+//
+AliEMCALTracker::AliEMCALMatchCluster::AliEMCALMatchCluster(Int_t index, AliEMCALRecPoint *recPoint)
+  : fIndex(index),
+    fLabel(recPoint->GetPrimaryIndex()),
+    fX(0.),
+    fY(0.),
+    fZ(0.)
+{
+       //
+       // Translates an AliEMCALRecPoint object into the internal format.
+       // Index of passed cluster in its native array must be specified.
+       //
+       TVector3 clpos;
+       recPoint->GetGlobalPosition(clpos);
+       
+       fX = clpos.X();
+       fY = clpos.Y();
+       fZ = clpos.Z();
+}
+//
+//------------------------------------------------------------------------------
+//
+AliEMCALTracker::AliEMCALMatchCluster::AliEMCALMatchCluster(Int_t index, AliESDCaloCluster *caloCluster)
+  : fIndex(index),
+    fLabel(caloCluster->GetPrimaryIndex()),
+    fX(0.),
+    fY(0.),
+    fZ(0.)
+{
+       //
+       // Translates an AliESDCaloCluster object into the internal format.
+       // Index of passed cluster in its native array must be specified.
+       //
+       Float_t clpos[3];
+       caloCluster->GetGlobalPosition(clpos);
+       
+       fX = (Double_t)clpos[0];
+       fY = (Double_t)clpos[1];
+       fZ = (Double_t)clpos[2];
+}
+//
+//------------------------------------------------------------------------------
+//
+Int_t AliEMCALTracker::AliEMCALMatch::Compare(const TObject *obj) const 
+{
+       //
+       // Tracks compared wrt their distance from matched point
+       //
+       
+       AliEMCALTracker::AliEMCALMatch *that = (AliEMCALTracker::AliEMCALMatch*)obj;
+       
+       Double_t thisDist = fDistance;
+       Double_t thatDist = that->GetDistance();
+       
+       if (thisDist > thatDist) return 1;
+       else if (thisDist < thatDist) return -1;
+       return 0;
+}
+
+AliEMCALTracker::AliEMCALMatch::AliEMCALMatch() 
+  : TObject(),
+    fCanBeSaved(kFALSE), 
+    fIndexC(0), 
+    fIndexT(0), 
+    fDistance(0.)
+{
+  //default constructor
+
+}
+
+AliEMCALTracker::AliEMCALMatch::AliEMCALMatch(const AliEMCALMatch& copy)
+  : TObject(),
+    fCanBeSaved(copy.fCanBeSaved),
+    fIndexC(copy.fIndexC),
+    fIndexT(copy.fIndexT),
+    fDistance(copy.fDistance)
+{
+  //copy ctor
+}
diff --git a/EMCAL/AliEMCALTracker.h b/EMCAL/AliEMCALTracker.h
new file mode 100644 (file)
index 0000000..79b7876
--- /dev/null
@@ -0,0 +1,139 @@
+//========================================================================  
+// 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"
+
+class TList;
+class TObjArray;
+class AliESD;
+class AliESDCaloCluster;
+class AliEMCALTrack;
+class AliEMCALRecPoint;
+
+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(AliESD*) {return -1;}
+       virtual Int_t       LoadClusters(TTree*);
+               Int_t       LoadClusters(AliESD* esd);
+               Int_t       LoadTracks(AliESD* esd);
+       virtual Int_t       PropagateBack(AliESD* esd);
+       virtual Int_t       RefitInward(AliESD*) {return -1;}
+       virtual void        UnloadClusters();
+       virtual AliCluster* GetCluster(Int_t) const {return NULL;};
+       void                SetCorrection(Double_t rho, Double_t x0) {fRho=rho;fX0=x0;}
+       void                SetCutAlpha(Double_t min, Double_t max) {fCutAlphaMin=min;fCutAlphaMax=max;}
+       void                SetCutAngle(Double_t value) {fCutAngle=value;}
+       void                SetCutX(Double_t value) {fCutX=value;}
+       void                SetCutY(Double_t value) {fCutY=value;}
+       void                SetCutZ(Double_t value) {fCutZ=value;}
+       void                SetMaxDistance(Double_t value) {fMaxDist=value;}
+       void                SetNumberOfSteps(Int_t n) {fNPropSteps=n;if(!n)SetTrackCorrectionMode("NONE");}
+       void                SetTrackCorrectionMode(Option_t *option);
+       
+       class  AliEMCALMatchCluster : public TObject
+       {
+       public:
+                          AliEMCALMatchCluster(Int_t ID, AliEMCALRecPoint *recPoint);
+                                  AliEMCALMatchCluster(Int_t ID, AliESDCaloCluster *caloCluster);
+               virtual   ~AliEMCALMatchCluster() { }
+               Int_t&     Index() {return fIndex;}
+               Int_t&     Label() {return fLabel;}
+               Double_t&  X() {return fX;}
+               Double_t&  Y() {return fY;}
+               Double_t&  Z() {return fZ;}
+       private:
+               Int_t     fIndex;  // index of cluster in its native container (ESD or TClonesArray)
+               Int_t     fLabel;  // track label of assigned cluster
+               Double_t  fX;      // global X position
+               Double_t  fY;      // global Y position
+               Double_t  fZ;      // global Z position
+       };
+       
+       class  AliEMCALMatch : public TObject
+       {
+       public:
+                         AliEMCALMatch();
+                         AliEMCALMatch(const AliEMCALMatch& copy);
+                        ~AliEMCALMatch() { }
+               Bool_t&   CanBeSaved() {return fCanBeSaved;}
+               Int_t     Compare(const TObject *obj) const;
+               Double_t  GetDistance() {return fDistance;}
+               Int_t     GetIndexC() {return fIndexC;}
+               Int_t     GetIndexT() {return fIndexT;}
+               Bool_t    IsSortable() const {return kTRUE;}
+               void      SetIndexC(Int_t icl) {fIndexC=icl;}
+               void      SetIndexT(Int_t itr) {fIndexT=itr;}
+               void      SetDistance(Double_t dist) {fDistance=dist;}
+       private:
+               Bool_t     fCanBeSaved;  // when true, this match can be saved, otherwise it will not be
+               Int_t      fIndexC;      // cluster index in 'fClusters' array
+               Int_t      fIndexT;      // track index in 'fTracks' array
+               Double_t   fDistance;    // track - cluster distance
+       };
+
+private:
+
+       Double_t   AngleDiff(Double_t angle1, Double_t angle2);
+       Double_t   CheckPair(AliEMCALTrack *tr, AliEMCALMatchCluster *cluster);
+       Double_t   CheckPairV2(AliEMCALTrack *tr, AliEMCALMatchCluster *cluster);
+       Int_t      CreateMatches();
+       Int_t      SolveCompetitions();
+       
+       enum ETrackCorr { 
+               kTrackCorrNone  = 0, // do not correct for energy loss
+               kTrackCorrMMB   = 1, // use MeanMaterialBudget() function to evaluate correction
+               kTrackCorrFixed = 2  // use fixed "X0" and "rho" parameters to correct
+       };
+       
+       Int_t       fNPropSteps;      // number of propagation steps (when correcting). If =0 no correction is done
+       ETrackCorr  fTrackCorrMode;   // track correction mode
+       
+       Double_t    fCutX;                    // cut on X difference
+       Double_t    fCutY;                    // cut on Y difference
+       Double_t    fCutZ;                    // cut on Z difference
+       Double_t    fCutAlphaMin;     // cut on difference between track 'alpha' and phi
+       Double_t    fCutAlphaMax;     // cut on difference between track 'alpha' and phi
+       Double_t    fCutAngle;        // cut on angle between track projection and cluster
+       Double_t    fMaxDist;         // maximum allowed total distance between track proj an cluster
+       
+       Double_t    fRho;             // energy correction: density
+       Double_t    fX0;              // energy correction: radiation length
+
+       TObjArray  *fTracks;          //! collection of ESD tracks
+       TObjArray  *fClusters;        //! collection of EMCAL clusters (ESDCaloCluster or EMCALRecPoint)
+       TList      *fMatches;         //! collection of matches between tracks and clusters
+       
+       ClassDef(AliEMCALTracker, 1)  // EMCAL "tracker"
+};
+
+#endif
index e19f8dc..b521aee 100644 (file)
@@ -6,5 +6,7 @@
 
 #pragma link C++ class AliEMCALReconstructor+;
 #pragma link C++ class AliEMCALClusterizerv1+;
+#pragma link C++ class AliEMCALTrack+;
+#pragma link C++ class AliEMCALTracker+;
 
 #endif
index 968ca6d..964486d 100644 (file)
@@ -2,6 +2,8 @@
 SRCS =\
 AliEMCALReconstructor.cxx \
 AliEMCALClusterizerv1.cxx \
+AliEMCALTrack.cxx \
+AliEMCALTracker.cxx
 
 HDRS= $(SRCS:.cxx=.h)