for (Int_t i=0; i<21;i++) cv[i]=0;
for(Int_t itr=0; itr<event->GetNumberOfTracks(); itr++)
{
- AliExternalTrackParam *trackParam=0;
+ AliExternalTrackParam *trackParam = 0;
//If the input event is ESD, the starting point for extrapolation is TPCOut, if available, or TPCInner
if(esdevent)
if(friendTrack && friendTrack->GetTPCOut())
{
//Use TPC Out as starting point if it is available
- trackParam= new AliExternalTrackParam(*friendTrack->GetTPCOut());
+ trackParam= const_cast<AliExternalTrackParam*>(friendTrack->GetTPCOut());
}
else
{
//Otherwise use TPC inner
- trackParam = new AliExternalTrackParam(*esdTrack->GetInnerParam());
+ trackParam = const_cast<AliExternalTrackParam*>(esdTrack->GetInnerParam());
}
}
if(!clusterArr){// get clusters from event
for(Int_t icl=0; icl<event->GetNumberOfCaloClusters(); icl++)
{
- AliExternalTrackParam *trkPamTmp = new AliExternalTrackParam(*trackParam);//Retrieve the starting point every time before the extrapolation
AliVCluster *cluster = (AliVCluster*) event->GetCaloCluster(icl);
- if(geom && !IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells())) continue;
+ if(geom && !IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells())) continue;
+ AliExternalTrackParam trkPamTmp(*trackParam);//Retrieve the starting point every time before the extrapolation
Float_t tmpEta=-999, tmpPhi=-999;
- if(!ExtrapolateTrackToCluster(trkPamTmp, cluster, tmpEta, tmpPhi)) continue;
+ if(!ExtrapolateTrackToCluster(&trkPamTmp, cluster, tmpEta, tmpPhi)) continue;
if(fCutEtaPhiSum)
{
Float_t tmpR=TMath::Sqrt(tmpEta*tmpEta + tmpPhi*tmpPhi);
printf("Error: please specify your cut criteria\n");
printf("To cut on sqrt(dEta^2+dPhi^2), use: SwitchOnCutEtaPhiSum()\n");
printf("To cut on dEta and dPhi separately, use: SwitchOnCutEtaPhiSeparate()\n");
+ if(aodevent && trackParam) delete trackParam;
return;
}
- delete trkPamTmp;
}//cluster loop
} else { // external cluster array, not from ESD event
for(Int_t icl=0; icl<clusterArr->GetEntriesFast(); icl++)
{
- AliExternalTrackParam *trkPamTmp = new AliExternalTrackParam(*trackParam);//Retrieve the starting point every time before the extrapolation
AliVCluster *cluster = (AliVCluster*) clusterArr->At(icl);
if(!cluster->IsEMCAL()) continue;
+ AliExternalTrackParam trkPamTmp (*trackParam);//Retrieve the starting point every time before the extrapolation
Float_t tmpEta=-999, tmpPhi=-999;
- if(!ExtrapolateTrackToCluster(trkPamTmp, cluster, tmpEta, tmpPhi)) continue;
+ if(!ExtrapolateTrackToCluster(&trkPamTmp, cluster, tmpEta, tmpPhi)) continue;
if(fCutEtaPhiSum)
{
Float_t tmpR=TMath::Sqrt(tmpEta*tmpEta + tmpPhi*tmpPhi);
printf("Error: please specify your cut criteria\n");
printf("To cut on sqrt(dEta^2+dPhi^2), use: SwitchOnCutEtaPhiSum()\n");
printf("To cut on dEta and dPhi separately, use: SwitchOnCutEtaPhiSeparate()\n");
+ if(aodevent && trackParam) delete trackParam;
return;
}
- delete trkPamTmp;
}//cluster loop
}// external list of clusters
fResidualPhi ->AddAt(dPhiMax,matched);
matched++;
}
- delete trackParam;
+ if(aodevent && trackParam) delete trackParam;
}//track loop
AliDebug(2,Form("Number of matched pairs = %d !\n",matched));
if(!trackParam) return index;
for(Int_t icl=0; icl<event->GetNumberOfCaloClusters(); icl++)
{
- AliExternalTrackParam *trkPamTmp = new AliExternalTrackParam(*trackParam);//Retrieve the starting point every time before the extrapolation
AliVCluster *cluster = (AliVCluster*) event->GetCaloCluster(icl);
- if(geom && !IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells())) continue;
+ if(geom && !IsGoodCluster(cluster,geom,(AliVCaloCells*)event->GetEMCALCells())) continue;
+ AliExternalTrackParam trkPamTmp (*trackParam);//Retrieve the starting point every time before the extrapolation
Float_t tmpEta=-999, tmpPhi=-999;
- if(!ExtrapolateTrackToCluster(trkPamTmp, cluster, tmpEta, tmpPhi)) continue;
+ if(!ExtrapolateTrackToCluster(&trkPamTmp, cluster, tmpEta, tmpPhi)) continue;
if(fCutEtaPhiSum)
{
Float_t tmpR=TMath::Sqrt(tmpEta*tmpEta + tmpPhi*tmpPhi);
printf("To cut on dEta and dPhi separately, use: SwitchOnCutEtaPhiSeparate()\n");
return -1;
}
- delete trkPamTmp;
}//cluster loop
return index;
}
// If the esdFriend is available, use the TPCOuter point as the starting point of extrapolation
// Otherwise use the TPCInner point
- AliExternalTrackParam *trkParam;
+ AliExternalTrackParam *trkParam = 0;
const AliESDfriendTrack* friendTrack = track->GetFriendTrack();
if(friendTrack && friendTrack->GetTPCOut())
trkParam = const_cast<AliExternalTrackParam*>(friendTrack->GetTPCOut());
Double_t trkPos[3];
Float_t clsPos[3];
- AliExternalTrackParam *trkParamTmp = new AliExternalTrackParam(*trkParam);
+ 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);
+ trkParamTmp.Rotate(alpha);
//extrapolation is done here
- if(!AliTrackerBase::PropagateTrackToBxByBz(trkParamTmp, vec.X(), track->GetMass(), GetRecParam()->GetExtrapolateStep(), kFALSE, 0.8, -1))
+ if(!AliTrackerBase::PropagateTrackToBxByBz(&trkParamTmp, vec.X(), track->GetMass(), GetRecParam()->GetExtrapolateStep(), kFALSE, 0.8, -1))
return kFALSE;
//Calculate the residuals
- trkParamTmp->GetXYZ(trkPos);
- delete trkParamTmp;
+ trkParamTmp.GetXYZ(trkPos);
TVector3 clsPosVec(clsPos[0],clsPos[1],clsPos[2]);
TVector3 trkPosVec(trkPos[0],trkPos[1],trkPos[2]);