+
+//____________________________________________________________________________
+AliPHOSTracker::AliPHOSTracker():
+ AliTracker()
+{
+ //--------------------------------------------------------------------
+ // The default constructor
+ //--------------------------------------------------------------------
+ for (Int_t i=0; i<5; i++)
+ fModules[i]=new TClonesArray("AliPHOSEmcRecPoint",777);
+}
+
+//____________________________________________________________________________
+AliPHOSTracker::~AliPHOSTracker()
+{
+ //--------------------------------------------------------------------
+ // The destructor
+ //--------------------------------------------------------------------
+ for (Int_t i=0; i<5; i++) {
+ (fModules[i])->Delete();
+ delete fModules[i];
+ }
+}
+
+//____________________________________________________________________________
+Int_t AliPHOSTracker::LoadClusters(TTree *cTree) {
+ //--------------------------------------------------------------------
+ // This function loads the PHOS clusters
+ //--------------------------------------------------------------------
+ TObjArray *arr=NULL;
+ TBranch *branch=cTree->GetBranch("PHOSEmcRP");
+ if (branch==0) {
+ AliError("No branch with the EMC clusters found !");
+ return 1;
+ }
+ branch->SetAddress(&arr);
+
+ Int_t nclusters=0;
+ Int_t nentr=(Int_t)branch->GetEntries();
+ for (Int_t i=0; i<nentr; i++) {
+ if (!branch->GetEvent(i)) continue;
+ Int_t ncl=arr->GetEntriesFast();
+ while (ncl--) {
+ AliPHOSEmcRecPoint *cl=(AliPHOSEmcRecPoint*)arr->UncheckedAt(ncl);
+
+ Int_t m=cl->GetPHOSMod();
+ if ((m<1)||(m>5)) {
+ AliError("Wrong module index !");
+ return 1;
+ }
+
+ // Here is how the alignment is treated
+ if (!cl->Misalign()) AliWarning("Can't misalign this cluster !");
+
+ cl->SetBit(14,kFALSE); // The clusters are not yet attached to any track
+
+ TClonesArray &module=*fModules[m-1];
+ Int_t idx=module.GetEntriesFast();
+ new (module[idx]) AliPHOSEmcRecPoint(*cl);
+
+ nclusters++;
+
+ }
+ }
+
+ Info("LoadClusters","Number of loaded clusters: %d",nclusters);
+
+ return 0;
+}
+
+//____________________________________________________________________________
+Int_t AliPHOSTracker::PropagateBack(AliESDEvent *esd) {
+ //--------------------------------------------------------------------