fCutAlphaMin(-200.0),
fCutAlphaMax(200.0),
fCutAngle(100.0),
- fMaxDist(100.0),
+ fMaxDist(10.0),
fRho(1.0),
fX0(1.0),
fTracks(0),
//
TTree* AliEMCALTracker::SearchTrueMatches()
{
+ //Search through the list of
+ //track match candidates and clusters
+ //and look for true matches
+ //
+ //
if (!fClusters) return 0;
if (fClusters->IsEmpty()) return 0;
if (!fTracks) return 0;
{
//
// Clearing method
- // Clears all specified arrays and the containers themselves.
+ // Deletes all objects in arrays and the arrays themselves
//
TString opt(option);
- Bool_t doDelete = opt.Contains("DELETE");
Bool_t clearTracks = opt.Contains("TRACKS");
Bool_t clearClusters = opt.Contains("CLUSTERS");
Bool_t clearMatches = opt.Contains("MATCHES");
}
if (fTracks != 0x0 && clearTracks) {
- if (!doDelete) {
- fTracks->Clear();
- }
- else {
- if (!fTracks->IsEmpty()) fTracks->Delete();
- delete fTracks;
- fTracks = 0;
- }
+ fTracks->Delete();
+ delete fTracks;
+ fTracks = 0;
}
if (fClusters != 0x0 && clearClusters) {
- if (!doDelete) {
- fClusters->Clear();
- }
- else {
- if (!fClusters->IsEmpty()) fClusters->Delete();
- delete fClusters;
- fClusters = 0;
- }
+ fClusters->Delete();
+ delete fClusters;
+ fClusters = 0;
}
if (fMatches != 0x0 && clearMatches) {
- if (!doDelete) {
- fMatches->Clear();
- }
- else {
- if (!fMatches->IsEmpty()) fMatches->Delete();
- delete fMatches;
- fMatches = 0;
- }
+ fMatches->Delete();
+ delete fMatches;
+ fMatches = 0;
}
}
//
for (Int_t i = 0; i < nClusters; i++) {
AliEMCALRecPoint *cluster = (AliEMCALRecPoint*)clusters->At(i);
if (!cluster) continue;
- if (cluster->GetClusterType() != AliESDCaloCluster::kClusterv1) continue;
+ if (cluster->GetClusterType() != AliESDCaloCluster::kEMCALClusterv1) continue;
AliEMCALMatchCluster *matchCluster = new AliEMCALMatchCluster(i, cluster);
fClusters->AddLast(matchCluster);
}
if (fClusters->IsEmpty())
AliWarning("No clusters collected");
- AliInfo(Form("Collected %d clusters", fClusters->GetEntries()));
+ AliInfo(Form("Collected %d clusters (RecPoints)", fClusters->GetEntries()));
return 0;
}
for (i = start; i < end; i++) {
AliESDCaloCluster *cluster = esd->GetCaloCluster(i);
if (!cluster) continue;
- if (cluster->GetClusterType() != AliESDCaloCluster::kClusterv1) continue;
+ if (cluster->GetClusterType() != AliESDCaloCluster::kEMCALClusterv1) continue;
AliEMCALMatchCluster *matchCluster = new AliEMCALMatchCluster(i, cluster);
fClusters->AddLast(matchCluster);
}
if (fClusters->IsEmpty())
AliWarning("No clusters collected");
- AliInfo(Form("Collected %d clusters", fClusters->GetEntries()));
+ AliInfo(Form("Collected %d clusters from ESD", fClusters->GetEntries()));
return 0;
}
Int_t okLoadClusters, nClusters;
if (!fClusters || (fClusters && fClusters->IsEmpty())) {
okLoadClusters = LoadClusters(esd);
- if (okLoadClusters) return 2;
}
nClusters = fClusters->GetEntries();
// 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;
+ if (phi < fCutAlphaMin || phi > fCutAlphaMax){
+ delete tr;
+ return distance;
+ }
// try to propagate to cluster radius
// (return the 'distance' value if it fails)
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;
+ if (!tr->PropagateTo(r, x0, rho)){
+ delete tr;
+ return distance;
+ }
tr->GetXYZ(pos);
if (isTrue) cout << "Step : " << r << ' ' << x << ' ' << y << ' ' << z << endl;
}
else {
// when no steps are used, no correction makes sense
//if (!tr->PropagateTo(rc, 0.0, 0.0)) return distance;
- if (!tr->PropagateToGlobal(cl->X(), cl->Y(), cl->Z(), 0.0, 0.0)) return distance;
+ if (!tr->PropagateToGlobal(cl->X(), cl->Y(), cl->Z(), 0.0, 0.0)){
+ delete tr;
+ return distance;
+ }
/*
Bool_t propOK = kFALSE;
cout << "START" << endl;
if (angle > fCutAngle) {
//cout << "angle" << endl;
+ delete tr;
return distance;
}
x -= cl->X();
if (TMath::Abs(x) > fCutX) {
//cout << "cut X" << endl;
+ delete tr;
return distance;
}
y -= cl->Y();
if (TMath::Abs(y) > fCutY) {
//cout << "cut Y" << endl;
+ delete tr;
return distance;
}
z -= cl->Z();
if (TMath::Abs(z) > fCutZ) {
//cout << "cut Z" << endl;
+ delete tr;
return distance;
}
TVector3 vdiff = vt-vc;
// compute differences wr to each coordinate
+ delete track;
if (vdiff.X() > fCutX) return distance;
if (vdiff.Y() > fCutY) return distance;
if (vdiff.Z() > fCutZ) return distance;
}
*/
+ delete [] usedC;
+ delete [] usedT;
+
return count;
}
//
void AliEMCALTracker::UnloadClusters()
{
//
- // Free memory from clusters
+ // Free memory from all arrays
+ // This method is called after the local tracking step
+ // so we can safely delete everything
//
- Clear("CLUSTERS");
+ Clear();
}
//
//------------------------------------------------------------------------------