//Track matching
fMatchedTrackIndex = new TArrayI();
fMatchedClusterIndex = new TArrayI();
- fResidualPhi = new TArrayF();
- fResidualEta = new TArrayF();
+ fResidualPhi = new TArrayF();
+ fResidualEta = new TArrayF();
InitTrackCuts();
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;
}
Double_t alpha = ((int)(vec.Phi()*TMath::RadToDeg()/20)+0.5)*20*TMath::DegToRad();
vec.RotateZ(-alpha); //Rotate the cluster to the local extrapolation coordinate system
trkParam->Rotate(alpha); //Rotate the track to the same local extrapolation system
- if(!AliTrackerBase::PropagateTrackToBxByBz(trkParam, vec.X(), fMass, fStep,kFALSE)) return kFALSE;
+ if(!AliTrackerBase::PropagateTrackToBxByBz(trkParam, vec.X(), fMass, fStep,kFALSE, 0.8, -1)) return kFALSE;
trkParam->GetXYZ(trkPos); //Get the extrapolated global position
TVector3 clsPosVec(clsPos[0],clsPos[1],clsPos[2]);