/**************************************************************************
+#/eliza17/alice/esdfiles/data/2011/LHC11a/000146805/ESDs/pass2_without_SDD/11000146805038.550/root_archive.zip#AliESDs.root
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
* Author: The ALICE Off-line Project. *
#include "AliEMCALClusterizerNxN.h"
#include "AliEMCALRecPoint.h"
#include "AliEMCALPID.h"
+#include "AliEMCALTracker.h"
#include "AliRawReader.h"
#include "AliCDBEntry.h"
#include "AliCDBManager.h"
// If the esdFriend is available, use the TPCOuter point as the starting point of extrapolation
// Otherwise use the TPCInner point
+
+ dEta = -999, dPhi = -999;
+
AliExternalTrackParam *trkParam = 0;
const AliESDfriendTrack* friendTrack = track->GetFriendTrack();
if(friendTrack && friendTrack->GetTPCOut())
trkParam = const_cast<AliExternalTrackParam*>(track->GetInnerParam());
if(!trkParam) return kFALSE;
- //Perform extrapolation
- Double_t trkPos[3];
- Float_t clsPos[3];
-
AliExternalTrackParam trkParamTmp (*trkParam);
- cluster->GetPosition(clsPos);
- TVector3 vec(clsPos[0],clsPos[1],clsPos[2]);
- Double_t alpha = ((int)(vec.Phi()*TMath::RadToDeg()/20)+0.5)*20*TMath::DegToRad();
- //Rotate to proper local coordinate
- vec.RotateZ(-alpha);
- trkParamTmp.Rotate(alpha);
- //extrapolation is done here
- if(!AliTrackerBase::PropagateTrackToBxByBz(&trkParamTmp, vec.X(), track->GetMass(), GetRecParam()->GetExtrapolateStep(), kFALSE, 0.8, -1))
- return kFALSE;
-
- //Calculate the residuals
- trkParamTmp.GetXYZ(trkPos);
-
- TVector3 clsPosVec(clsPos[0],clsPos[1],clsPos[2]);
- TVector3 trkPosVec(trkPos[0],trkPos[1],trkPos[2]);
-
- Double_t clsPhi = clsPosVec.Phi();
- if(clsPhi<0) clsPhi+=2*TMath::Pi();
- Double_t trkPhi = trkPosVec.Phi();
- if(trkPhi<0) trkPhi+=2*TMath::Pi();
-
- dPhi = clsPhi-trkPhi;
- dEta = clsPosVec.Eta()-trkPosVec.Eta();
+ if(!AliEMCALTracker::ExtrapolateTrackToCluster(&trkParamTmp, cluster, track->GetMass(), GetRecParam()->GetExtrapolateStep(), dEta, dPhi)) return kFALSE;
return kTRUE;
}