fSClusters(0),
fNTracklets(0),
fNSingleCluster(0),
+fNSingleClusterSPD2(0),
fDPhiWindow(0),
fDThetaWindow(0),
fPhiShift(0),
fClustersLoaded(0),
fRecoDone(0),
fBuildRefs(kTRUE),
+ fStoreSPD2SingleCl(kFALSE),
fSPDSeg()
{
// default c-tor
fClArr[i] = 0;
for (int j=0;j<2;j++) fUsedClusLay[i][j] = 0;
fDetectorIndexClustersLay[i] = 0;
+ fClusterCopyIndex[i] = 0;
fOverlapFlagClustersLay[i] = 0;
fNClustersLay[i] = 0;
fClustersLay[i] = 0;
SetNStdDev(AliITSReconstructor::GetRecoParam()->GetTrackleterNStdDevCut());
SetScaleDThetaBySin2T(AliITSReconstructor::GetRecoParam()->GetTrackleterScaleDThetaBySin2T());
SetBuildRefs(AliITSReconstructor::GetRecoParam()->GetTrackleterBuildCl2TrkRefs());
+ SetStoreSPD2SingleCl(AliITSReconstructor::GetRecoParam()->GetTrackleterStoreSPD2SingleCl());
//
SetCutPxDrSPDin(AliITSReconstructor::GetRecoParam()->GetMultCutPxDrSPDin());
SetCutPxDrSPDout(AliITSReconstructor::GetRecoParam()->GetMultCutPxDrSPDout());
fSClusters(0),
fNTracklets(0),
fNSingleCluster(0),
+fNSingleClusterSPD2(0),
fDPhiWindow(0),
fDThetaWindow(0),
fPhiShift(0),
fClustersLoaded(0),
fRecoDone(0),
fBuildRefs(kTRUE),
+fStoreSPD2SingleCl(kFALSE),
fSPDSeg()
{
// Copy constructor :!!! RS ATTENTION: old c-tor reassigned the pointers instead of creating a new copy -> would crash on delete
for (int i=0;i<2;i++) {
delete[] fClustersLay[i];
delete[] fDetectorIndexClustersLay[i];
+ delete[] fClusterCopyIndex[i];
delete[] fOverlapFlagClustersLay[i];
delete fClArr[i];
for (int j=0;j<2;j++) delete fUsedClusLay[i][j];
fNClustersLay[1] = 0;
fNTracklets = 0;
fNSingleCluster = 0;
+ fNSingleClusterSPD2 = 0;
//
fESDEvent = esd;
fTreeRP = treeRP;
vtx = 0;
}
if(vtx){
- float vtxf[3] = {vtx->GetX(),vtx->GetY(),vtx->GetZ()};
+ float vtxf[3] = {static_cast<float>(vtx->GetX()),static_cast<float>(vtx->GetY()),static_cast<float>(vtx->GetZ())};
FindTracklets(vtxf);
}
else {
fNClustersLay[1] = 0;
fNTracklets = 0;
fNSingleCluster = 0;
+ fNSingleClusterSPD2 = 0;
//
if (!clusterTree) { AliError(" Invalid ITS cluster tree !\n"); return; }
//
fNClustersLay[1] = 0;
fNTracklets = 0;
fNSingleCluster = 0;
+ fNSingleClusterSPD2 = 0;
//
if (!clusterTree) { AliError(" Invalid ITS cluster tree !\n"); return; }
if (!clusterTreeMix) { AliError(" Invalid ITS cluster tree 2nd event !\n"); return; }
// Step2: store tracklets; remove used clusters
for (Int_t iC2=0; iC2<fNClustersLay[1]; iC2++) StoreTrackletForL2Cluster(iC2);
//
- // store unused single clusters of L1
+ // store unused single clusters of L1 (optionally for L2 too)
StoreL1Singles();
//
AliDebug(1,Form("%d tracklets found", fNTracklets));
//
fMult = new AliMultiplicity(fNTracklets,fNSingleCluster,fNFiredChips[0],fNFiredChips[1],fastOrFiredMap);
fMult->SetMultTrackRefs( fBuildRefs );
+ fMult->SetSPD2SinglesStored(fStoreSPD2SingleCl);
+ fMult->SetNumberOfSingleClustersSPD2(fNSingleClusterSPD2);
// store some details of reco:
fMult->SetScaleDThetaBySin2T(fScaleDTBySin2T);
fMult->SetDPhiWindow2(fDPhiWindow2);
fMult->SetSingleClusterData(i,clInfo);
//
if (!fBuildRefs) continue; // do we need references?
+ int ilr = i>=(fNSingleCluster-fNSingleClusterSPD2) ? 1:0;
int clID = int(clInfo[kSCID]);
for (int itp=0;itp<2;itp++) {
- if (!fStoreRefs[0][itp]) continue;
- int nref = fUsedClusLay[0][itp]->GetReferences(clID,shared,100);
+ if (!fStoreRefs[ilr][itp]) continue;
+ int nref = fUsedClusLay[ilr][itp]->GetReferences(clID,shared,100);
if (!nref) continue;
else if (nref==1) refsc[itp]->AddReference(i,shared[0]);
else refsc[itp]->AddReferences(i,shared,nref);
}
}
+ //
if (fBuildRefs) fMult->AttachCluster2TrackRefs(refsc[0],refsc[1]);
fMult->CompactBits();
//
memset(fTracklets,0,nmaxT*sizeof(Float_t*));
//
if (fSClusters) delete[] fSClusters;
- fSClusters = new Float_t*[fNClustersLay[0]];
- memset(fSClusters,0,fNClustersLay[0]*sizeof(Float_t*));
+ int nSlots = GetStoreSPD2SingleCl() ? fNClustersLay[0]+fNClustersLay[1] : fNClustersLay[0];
+ fSClusters = new Float_t*[nSlots];
+ memset(fSClusters,0,nSlots*sizeof(Float_t*));
//
AliDebug(1,Form("(clusters in layer 1 : %d, layer 2: %d)",fNClustersLay[0],fNClustersLay[1]));
AliDebug(1,Form("(cluster-fired chips in layer 1 : %d, layer 2: %d)",fNFiredChips[0],fNFiredChips[1]));
branch = itsClusterTree->GetBranch("ITSRecPoints");
branch->SetAddress(&itsClusters);
if (!fClArr[il]) fClArr[il] = new TClonesArray("AliITSRecPoint",100);
+ delete[] fClusterCopyIndex[il];
}
//
// count clusters
Float_t* clustersLay = new Float_t[nclLayer*kClNPar];
Int_t* detectorIndexClustersLay = new Int_t[nclLayer];
Bool_t* overlapFlagClustersLay = new Bool_t[nclLayer];
+ if (fCreateClustersCopy) fClusterCopyIndex[il] = new Int_t[nclLayer];
//
for (int ic=0;ic<nclLayer;ic++) {
AliITSRecPoint* cluster = (AliITSRecPoint*)clArr[index[ic]];
detectorIndexClustersLay[ic] = cluster->GetDetectorIndex();
overlapFlagClustersLay[ic] = kFALSE;
for (Int_t i=3;i--;) clPar[kClMC0+i] = cluster->GetLabel(i);
+ if (fCreateClustersCopy) fClusterCopyIndex[il][ic] = index[ic];
}
clArr.Clear();
delete[] z;
{
// Flags clusters in the overlapping regions
Float_t distClSameMod=0.;
- Float_t distClSameModMin=0.;
- Int_t iClOverlap =0;
Float_t meanRadiusLay1 = 3.99335; // average radius inner layer
Float_t meanRadiusLay2 = 7.37935; // average radius outer layer;
distClSameMod = TMath::Sqrt(TMath::Power(deZproj/fZetaOverlapCut,2)+TMath::Power(dePhi/fPhiOverlapCut,2));
if (distClSameMod<=1.) fOverlapFlagClustersLay[0][iiC1]=kTRUE;
-// if (distClSameMod<=1.) {
-// if (distClSameModMin==0. || distClSameMod<distClSameModMin) {
-// distClSameModMin=distClSameMod;
-// iClOverlap=iiC1;
-// }
-// }
-
-
} // end adjacent modules
}
} // end Loop on inner layer clusters
-// if (distClSameModMin!=0.) fOverlapFlagClustersLay[0][iClOverlap]=kTRUE;
distClSameMod=0.;
- distClSameModMin=0.;
- iClOverlap =0;
// Loop on outer layer clusters
for (Int_t iiC2=0; iiC2<fNClustersLay[1]; iiC2++) {
if (!fOverlapFlagClustersLay[1][iiC2]) {
distClSameMod = TMath::Sqrt(TMath::Power(deZproj/fZetaOverlapCut,2)+TMath::Power(dePhi/fPhiOverlapCut,2));
if (distClSameMod<=1.) fOverlapFlagClustersLay[1][iiC2]=kTRUE;
-// if (distClSameMod<=1.) {
-// if (distClSameModMin==0. || distClSameMod<distClSameModMin) {
-// distClSameModMin=distClSameMod;
-// iClOverlap=iiC2;
-// }
-// }
-
} // end adjacent modules
}
} // end Loop on outer layer clusters
-// if (distClSameModMin!=0.) fOverlapFlagClustersLay[1][iClOverlap]=kTRUE;
-
}
//____________________________________________________________________
fhClustersDThetaAll->Fill(dTheta);
fhDPhiVsDThetaAll->Fill(dTheta, dPhi);
}
- Float_t d = CalcDist(dPhi,dTheta,clPar1[kClTh]); // make "elliptical" cut in Phi and Theta!
+ Float_t d = CalcDist(dPhi,clPar2[kClTh] - clPar1[kClTh],clPar1[kClTh]); // make "elliptical" cut in Phi and Theta!
// look for the minimum distance: the minimum is in iC2WithBestDist
if (d<fNStdDev && d<minDist) { minDist=d; iC2WithBestDist = iC2; }
}
}
}
//
+ if (GetStoreSPD2SingleCl()) {
+ for (Int_t iC2=0; iC2<fNClustersLay[1]; iC2++) {
+ if (fPartners[iC2]<0 || (fOverlapFlagClustersLay[0][fPartners[iC2]] || fOverlapFlagClustersLay[1][iC2])) {
+ float* clPar2 = GetClusterLayer2(iC2);
+ fSClusters[fNSingleCluster] = new Float_t[kClNPar];
+ fSClusters[fNSingleCluster][kSCTh] = clPar2[kClTh];
+ fSClusters[fNSingleCluster][kSCPh] = clPar2[kClPh];
+ fSClusters[fNSingleCluster][kSCLab] = clPar2[kClMC0];
+ fSClusters[fNSingleCluster][kSCID] = iC2;
+ AliDebug(1,Form(" Adding a single cluster %d (cluster %d of layer 2)",
+ fNSingleCluster, iC2));
+ fNSingleCluster++;
+ fNSingleClusterSPD2++;
+ }
+ }
+ }
+ //
}
//____________________________________________________________________
pid[AliPID::kElectron]>fCutMinElectronProbESD;
//
}
+
+//____________________________________________________________________
+AliITSRecPoint* AliITSMultReconstructor::GetRecPoint(Int_t lr, Int_t n) const
+{
+ // return a cluster of lr corresponding to orderer cluster index n
+ if (fClArr[lr] && fClusterCopyIndex[lr] && n<fNClustersLay[lr])
+ return (AliITSRecPoint*) fClArr[lr]->At(fClusterCopyIndex[lr][n]);
+ else {
+ AliError("To access the clusters SetCreateClustersCopy should have been called");
+ return 0;
+ }
+}