// - RS: Clusters are sorted in Z in roder to have the same numbering as in the ITS reco
// - RS: Clusters used by ESDtrack are flagged, this information is passed to AliMulitiplicity object
// when storing the tracklets and single cluster info
+// - MN: first MC label of single clusters stored
//_________________________________________________________________________
#include <TClonesArray.h>
//____________________________________________________________________
void AliITSMultReconstructor::Reconstruct(AliESDEvent* esd, TTree* treeRP)
-{
- //
- // - calls LoadClusterArrays that finds the position of the clusters
- // (in global coord)
- // - convert the cluster coordinates to theta, phi (seen from the
- // interaction vertex).
- // - makes an array of tracklets
- //
- // After this method has been called, the clusters of the two layers
- // and the tracklets can be retrieved by calling the Get'er methods.
-
+{
if (!treeRP) { AliError(" Invalid ITS cluster tree !\n"); return; }
if (!esd) {AliError("ESDEvent is not available, use old reconstructor"); return;}
// reset counters
void AliITSMultReconstructor::Reconstruct(TTree* clusterTree, Float_t* vtx, Float_t* /* vtxRes*/) {
//
// RS NOTE - this is old reconstructor invocation, to be used from VertexFinder
- //
- // - calls LoadClusterArray that finds the position of the clusters
- // (in global coord)
- // - convert the cluster coordinates to theta, phi (seen from the
- // interaction vertex).
- // - makes an array of tracklets
- //
- // After this method has been called, the clusters of the two layers
- // and the tracklets can be retrieved by calling the Get'er methods.
+
if (fMult) delete fMult; fMult = 0;
fNClustersLay1 = 0;
fNClustersLay2 = 0;
//____________________________________________________________________
void AliITSMultReconstructor::FindTracklets(const Float_t *vtx)
{
+
+ // - calls LoadClusterArrays that finds the position of the clusters
+ // (in global coord)
+ // - convert the cluster coordinates to theta, phi (seen from the
+ // interaction vertex).
+ // - makes an array of tracklets
+ //
+ // After this method has been called, the clusters of the two layers
+ // and the tracklets can be retrieved by calling the Get'er methods.
+
+
// Find tracklets converging to vertex
//
LoadClusterArrays(fTreeRP);
// Loop on layer 1
for (Int_t iC1=0; iC1<fNClustersLay1; iC1++) {
- // already used or in the overlap ?
- if (associatedLay1[iC1] != 0 || fOverlapFlagClustersLay1[iC1]) continue;
+ // already used ?
+ if (associatedLay1[iC1] != 0) continue;
found++;
// Loop on layer 2
for (Int_t iC2=0; iC2<fNClustersLay2; iC2++) {
- // in the overlap ?
- if (fOverlapFlagClustersLay2[iC2]) continue;
float* clPar2 = GetClusterLayer2(iC2);
if (blacklist[iC1]) {
}
// find the difference in angles
- Double_t dTheta = TMath::Abs(clPar2[kClTh] - clPar1[kClTh]);
+ Double_t dTheta = TMath::Abs(clPar2[kClTh] - clPar1[kClTh]);
Double_t dPhi = TMath::Abs(clPar2[kClPh] - clPar1[kClPh]);
// take into account boundary condition
if (dPhi>pi) dPhi=2.*pi-dPhi;
fSClusters[fNSingleCluster] = new Float_t[kClNPar];
fSClusters[fNSingleCluster][kSCTh] = clPar1[kClTh];
fSClusters[fNSingleCluster][kSCPh] = clPar1[kClPh];
+ fSClusters[fNSingleCluster][kSCLab] = clPar1[kClMC0];
fSClusters[fNSingleCluster][kSCID] = iC1;
AliDebug(1,Form(" Adding a single cluster %d (cluster %d of layer 1)",
fNSingleCluster, iC1));
//
for (int i=fNTracklets;i--;) {
float* tlInfo = fTracklets[i];
- fMult->SetTrackletData(i,tlInfo, fUsedClusLay1[int(tlInfo[kClID1])]|fUsedClusLay2[int(tlInfo[kClID2])]);
+ fMult->SetTrackletData(i,tlInfo, fUsedClusLay1[int(tlInfo[kClID1])],fUsedClusLay2[int(tlInfo[kClID2])]);
}
//
for (int i=fNSingleCluster;i--;) {
// - store them in the internal arrays
// - count the number of cluster-fired chips
//
- // RS: This method was strongly modified wrt original by Jan Fiete. In order to have the same numbering
+ // RS: This method was strongly modified wrt original. In order to have the same numbering
// of clusters as in the ITS reco I had to introduce sorting in Z
// Also note that now the clusters data are stored not in float[6] attached to float**, but in 1-D array
Float_t* clustersLay = new Float_t[nclLayer*kClNPar];
Int_t* detectorIndexClustersLay = new Int_t[nclLayer];
Bool_t* overlapFlagClustersLay = new Bool_t[nclLayer];
- Char_t* usedClusLay = new Char_t[nclLayer];
+ UInt_t* usedClusLay = new UInt_t[nclLayer];
//
for (int ic=0;ic<nclLayer;ic++) {
AliITSRecPoint* cluster = (AliITSRecPoint*)clArr[index[ic]];
//____________________________________________________________________
void
AliITSMultReconstructor::LoadClusterFiredChips(TTree* itsClusterTree) {
- // This method
+ // This method
// - gets the clusters from the cluster tree
// - counts the number of (cluster)fired chips
fNFiredChips[0] = 0;
fNFiredChips[1] = 0;
- AliITSsegmentationSPD seg;
+ AliITSsegmentationSPD seg;
AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance();
TClonesArray* itsClusters=rpcont->FetchClusters(0,itsClusterTree);
if(!rpcont->IsSPDActive()){
for(Int_t itr=0; itr<ntracks; itr++) {
AliESDtrack* track = fESDEvent->GetTrack(itr);
if (!track->IsOn(AliESDtrack::kITSin)) continue; // use only tracks propagated in ITS to vtx
- FlagTrackClusters(track);
+ FlagTrackClusters(itr);
FlagIfSecondary(track,vtx);
}
FlagV0s(vtx);
}
//____________________________________________________________________
-void AliITSMultReconstructor::FlagTrackClusters(const AliESDtrack* track)
+void AliITSMultReconstructor::FlagTrackClusters(Int_t id)
{
// RS: flag the SPD clusters of the track if it is useful for the multiplicity estimation
//
+ const UInt_t kMaskL = 0x0000ffff;
+ const UInt_t kMaskH = 0xffff0000;
+ const UInt_t kMaxTrID = kMaskL - 1; // max possible track id
+ if (UInt_t(id)>kMaxTrID) return;
+ const AliESDtrack* track = fESDEvent->GetTrack(id);
Int_t idx[12];
if ( track->GetITSclusters(idx)<3 ) return; // at least 3 clusters must be used in the fit
+ UInt_t *uClus[2] = {fUsedClusLay1,fUsedClusLay2};
+ //
+ UInt_t mark = id+1;
+ if (track->IsOn(AliESDtrack::kITSpureSA)) mark <<= 16;
//
- char mark = track->IsOn(AliESDtrack::kITSpureSA) ? kITSSAPBit : kITSTPCBit;
- char *uClus[2] = {fUsedClusLay1,fUsedClusLay2};
for (int i=AliESDfriendTrack::kMaxITScluster;i--;) {
// note: i>=6 is for extra clusters
if (idx[i]<0) continue;
int layID= (idx[i] & 0xf0000000) >> 28;
if (layID>1) continue; // SPD only
int clID = (idx[i] & 0x0fffffff);
+ //
+ if ( track->IsOn(AliESDtrack::kITSpureSA) ) {
+ if (uClus[layID][clID]&kMaskH) {
+ AliWarning(Form("Tracks %5d and %5d share cluster %6d of lr%d",id,int(uClus[layID][clID]>>16)-1,clID,layID));
+ uClus[layID][clID] &= kMaskL;
+ }
+ }
+ else if (uClus[layID][clID]&kMaskL) {
+ AliWarning(Form("Tracks %5d and %5d share cluster %6d of lr%d",id,int(uClus[layID][clID]&kMaskL)-1,clID,layID));
+ uClus[layID][clID] &= kMaskH;
+ }
uClus[layID][clID] |= mark;
}
//