]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSMultReconstructor.cxx
AliWarnig changed to AliDebug in case of tracks sharing clusters - Savannah bug 74366
[u/mrichter/AliRoot.git] / ITS / AliITSMultReconstructor.cxx
index 72451c6861bd3332adcf8509fa28466273704038..dad473ec31b6f4277831c3bd5eddd0aa6eff1058 100644 (file)
@@ -113,6 +113,7 @@ fPhiShift(0),
 fRemoveClustersFromOverlaps(0),
 fPhiOverlapCut(0),
 fZetaOverlapCut(0),
+fPhiRotationAngle(0),
 //
 fCutPxDrSPDin(0.1),
 fCutPxDrSPDout(0.15),
@@ -161,6 +162,7 @@ fhphiClustersLay1(0){
     SetRemoveClustersFromOverlaps(AliITSReconstructor::GetRecoParam()->GetTrackleterRemoveClustersFromOverlaps());
     SetPhiOverlapCut(AliITSReconstructor::GetRecoParam()->GetTrackleterPhiOverlapCut());
     SetZetaOverlapCut(AliITSReconstructor::GetRecoParam()->GetTrackleterZetaOverlapCut());
+    SetPhiRotationAngle(AliITSReconstructor::GetRecoParam()->GetTrackleterPhiRotationAngle());
     //
     SetCutPxDrSPDin(AliITSReconstructor::GetRecoParam()->GetMultCutPxDrSPDin());
     SetCutPxDrSPDout(AliITSReconstructor::GetRecoParam()->GetMultCutPxDrSPDout());
@@ -190,6 +192,8 @@ fhphiClustersLay1(0){
     SetRemoveClustersFromOverlaps();
     SetPhiOverlapCut();
     SetZetaOverlapCut();
+    SetPhiRotationAngle();
+
     //
     SetCutPxDrSPDin();
     SetCutPxDrSPDout();
@@ -266,6 +270,7 @@ fPhiShift(0),
 fRemoveClustersFromOverlaps(0),
 fPhiOverlapCut(0),
 fZetaOverlapCut(0),
+fPhiRotationAngle(0),
 //
 fCutPxDrSPDin(0.1),
 fCutPxDrSPDout(0.15),
@@ -419,7 +424,8 @@ 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). 
+  //   interaction vertex). Clusters in the inner layer can be now
+  //   rotated for combinatorial studies 
   // - makes an array of tracklets 
   //   
   // After this method has been called, the clusters of the two layers
@@ -483,7 +489,7 @@ void AliITSMultReconstructor::FindTracklets(const Float_t *vtx)
     
     clPar[kClTh] = TMath::ACos(z/r);                   // Store Theta
     clPar[kClPh] = TMath::Pi() + TMath::ATan2(-y,-x);  // Store Phi
-    
+    clPar[kClPh] = clPar[kClPh] + fPhiRotationAngle;//rotation of inner layer for comb studies  
     if (fHistOn) {
       Float_t eta = clPar[kClTh];
       eta= TMath::Tan(eta/2.);
@@ -727,7 +733,7 @@ void AliITSMultReconstructor::CreateMultiplicityObject()
   //
   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--;) {
@@ -751,7 +757,6 @@ void AliITSMultReconstructor::LoadClusterArrays(TTree* itsClusterTree)
   // 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
-  
   AliDebug(1,"Loading clusters and cluster-fired chips ...");
   
   fNClustersLay1 = 0;
@@ -796,7 +801,7 @@ void AliITSMultReconstructor::LoadClusterArrays(TTree* itsClusterTree)
     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]];
@@ -1013,7 +1018,7 @@ void AliITSMultReconstructor::ProcessESDTracks()
   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);
@@ -1021,21 +1026,39 @@ void AliITSMultReconstructor::ProcessESDTracks()
 }
 
 //____________________________________________________________________
-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) {
+       AliDebug(2,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) {
+      AliDebug(2,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;
   }
   //
@@ -1187,3 +1210,4 @@ Bool_t AliITSMultReconstructor::CanBeElectron(const AliESDtrack* trc) const
     pid[AliPID::kElectron]>fCutMinElectronProbESD;
   //
 }
+