Instead just bit-flag marking used clusters store ID's of ESDtracks for
authorshahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Aug 2010 11:58:11 +0000 (11:58 +0000)
committershahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Aug 2010 11:58:11 +0000 (11:58 +0000)
further analysis of combinatorials

ITS/AliITSMultReconstructor.cxx
ITS/AliITSMultReconstructor.h
STEER/AliMultiplicity.cxx
STEER/AliMultiplicity.h

index 72451c6861bd3332adcf8509fa28466273704038..e4fd5846215ec89b772d4d45f8bc8db772c66f1a 100644 (file)
@@ -727,7 +727,7 @@ void AliITSMultReconstructor::CreateMultiplicityObject()
   //
   for (int i=fNTracklets;i--;)  {
     float* tlInfo = fTracklets[i];
   //
   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--;) {
   }
   //  
   for (int i=fNSingleCluster;i--;) {
@@ -796,7 +796,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];
     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]];
     //
     for (int ic=0;ic<nclLayer;ic++) {
       AliITSRecPoint* cluster = (AliITSRecPoint*)clArr[index[ic]];
@@ -1013,7 +1013,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
   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);
     FlagIfSecondary(track,vtx);
   }
   FlagV0s(vtx);
@@ -1021,15 +1021,20 @@ 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
   //
 {
   // RS: flag the SPD clusters of the track if it is useful for the multiplicity estimation
   //
+  const UShort_t kMaxTrID = 0xffff - 1; // max possible track id
+  if (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
   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;
   for (int i=AliESDfriendTrack::kMaxITScluster;i--;) {
     // note: i>=6 is for extra clusters
     if (idx[i]<0) continue;
index c8e5b092a3b2961a8fd471ca715878ec00be5ece..a9e643f83d28a8e012f78be657663b631e3946ac 100644 (file)
@@ -46,7 +46,7 @@ public:
   void FindTracklets(const Float_t* vtx); 
   void LoadClusterFiredChips(TTree* tree);
   void FlagClustersInOverlapRegions(Int_t ic1,Int_t ic2);
   void FindTracklets(const Float_t* vtx); 
   void LoadClusterFiredChips(TTree* tree);
   void FlagClustersInOverlapRegions(Int_t ic1,Int_t ic2);
-  void FlagTrackClusters(const AliESDtrack* track);
+  void FlagTrackClusters(Int_t id);
   void FlagIfSecondary(AliESDtrack* track, const AliVertex* vtx);
   void FlagV0s(const AliESDVertex *vtx);
   void ProcessESDTracks();
   void FlagIfSecondary(AliESDtrack* track, const AliVertex* vtx);
   void FlagV0s(const AliESDVertex *vtx);
   void ProcessESDTracks();
@@ -129,8 +129,8 @@ protected:
   AliESDEvent*      fESDEvent;              //! pointer to ESD event
   TTree*            fTreeRP;                //! ITS recpoints
 
   AliESDEvent*      fESDEvent;              //! pointer to ESD event
   TTree*            fTreeRP;                //! ITS recpoints
 
-  Char_t*       fUsedClusLay1;               // RS: flag of clusters usage in ESD tracks: 0=unused, bit0=TPC/ITS+ITSSA, bit1=ITSSA_Pure
-  Char_t*       fUsedClusLay2;               // RS: flag of clusters usage in ESD tracks: 0=unused, bit0=TPC/ITS+ITSSA, bit1=ITSSA_Pure
+  UInt_t*       fUsedClusLay1;               // RS: flag of clusters usage in ESD tracks: 0=unused, else ID+1 in word0=TPC/ITS+ITSSA, word1=ITSSA_Pure
+  UInt_t*       fUsedClusLay2;               // RS: flag of clusters usage in ESD tracks: 0=unused, else ID+1 word0=TPC/ITS+ITSSA, word1=ITSSA_Pure
 
   Float_t*      fClustersLay1;               // clusters in the 1st layer of ITS 
   Float_t*      fClustersLay2;               // clusters in the 2nd layer of ITS 
 
   Float_t*      fClustersLay1;               // clusters in the 1st layer of ITS 
   Float_t*      fClustersLay2;               // clusters in the 2nd layer of ITS 
@@ -200,7 +200,7 @@ protected:
 
   void LoadClusterArrays(TTree* tree);
 
 
   void LoadClusterArrays(TTree* tree);
 
-  ClassDef(AliITSMultReconstructor,7)
+  ClassDef(AliITSMultReconstructor,8)
 };
 
 #endif
 };
 
 #endif
index 7bfd0b8572eccd78783d03e2013ba69f6c654749..1e833d5f1f2df42bbd14e40a7cbcc0344b79da67 100644 (file)
@@ -11,6 +11,8 @@ AliMultiplicity::AliMultiplicity():
   fNsingle(0),
   fLabels(0),
   fLabelsL2(0),
   fNsingle(0),
   fLabels(0),
   fLabelsL2(0),
+  fUsedClusS(0),
+  fUsedClusT(0),
   fTh(0),
   fPhi(0),
   fDeltTh(0),
   fTh(0),
   fPhi(0),
   fDeltTh(0),
@@ -34,6 +36,8 @@ AliMultiplicity::AliMultiplicity(Int_t ntr, Float_t *th,  Float_t *ph, Float_t *
   fNsingle(ns),
   fLabels(0),
   fLabelsL2(0),
   fNsingle(ns),
   fLabels(0),
   fLabelsL2(0),
+  fUsedClusS(0),
+  fUsedClusT(0),
   fTh(0),
   fPhi(0),
   fDeltTh(0),
   fTh(0),
   fPhi(0),
   fDeltTh(0),
@@ -84,6 +88,8 @@ AliMultiplicity::AliMultiplicity(Int_t ntr, Int_t ns, Short_t nfcL1, Short_t nfc
   fNsingle(ns),
   fLabels(0),
   fLabelsL2(0),
   fNsingle(ns),
   fLabels(0),
   fLabelsL2(0),
+  fUsedClusS(0),
+  fUsedClusT(0),
   fTh(0),
   fPhi(0),
   fDeltTh(0),
   fTh(0),
   fPhi(0),
   fDeltTh(0),
@@ -102,6 +108,8 @@ AliMultiplicity::AliMultiplicity(Int_t ntr, Int_t ns, Short_t nfcL1, Short_t nfc
     fPhi      = new Double_t [ntr];
     fDeltTh   = new Double_t [ntr];
     fDeltPhi  = new Double_t [ntr];
     fPhi      = new Double_t [ntr];
     fDeltTh   = new Double_t [ntr];
     fDeltPhi  = new Double_t [ntr];
+    fUsedClusT = new ULong64_t[ntr];
+
     for(Int_t i=fNtracks;i--;){
       fTh[i]=fPhi[i]=fDeltTh[i]=fDeltPhi[i] = 0;
       fLabels[i] = fLabelsL2[i] = 0;
     for(Int_t i=fNtracks;i--;){
       fTh[i]=fPhi[i]=fDeltTh[i]=fDeltPhi[i] = 0;
       fLabels[i] = fLabelsL2[i] = 0;
@@ -111,6 +119,7 @@ AliMultiplicity::AliMultiplicity(Int_t ntr, Int_t ns, Short_t nfcL1, Short_t nfc
     fThsingle  = new Double_t [ns];
     fPhisingle = new Double_t [ns];
     fLabelssingle = new Int_t [ns];
     fThsingle  = new Double_t [ns];
     fPhisingle = new Double_t [ns];
     fLabelssingle = new Int_t [ns];
+    fUsedClusS = new UInt_t[ns];
     for(Int_t i=fNsingle;i--;) fThsingle[i] = fPhisingle[i] = fLabelssingle[i] = 0;
   }
   fFiredChips[0] = nfcL1;
     for(Int_t i=fNsingle;i--;) fThsingle[i] = fPhisingle[i] = fLabelssingle[i] = 0;
   }
   fFiredChips[0] = nfcL1;
@@ -126,6 +135,8 @@ AliMultiplicity::AliMultiplicity(const AliMultiplicity& m):
   fNsingle(m.fNsingle),
   fLabels(0),
   fLabelsL2(0),
   fNsingle(m.fNsingle),
   fLabels(0),
   fLabelsL2(0),
+  fUsedClusS(0),
+  fUsedClusT(0),
   fTh(0),
   fPhi(0),
   fDeltTh(0),
   fTh(0),
   fPhi(0),
   fDeltTh(0),
@@ -155,6 +166,9 @@ AliMultiplicity &AliMultiplicity::operator=(const AliMultiplicity& m){
   if(fThsingle)delete [] fThsingle;fThsingle = 0;
   if(fPhisingle)delete [] fPhisingle;fPhisingle = 0;
   if(fLabelssingle)delete [] fLabelssingle;fLabelssingle = 0;
   if(fThsingle)delete [] fThsingle;fThsingle = 0;
   if(fPhisingle)delete [] fPhisingle;fPhisingle = 0;
   if(fLabelssingle)delete [] fLabelssingle;fLabelssingle = 0;
+  if(fUsedClusS) delete[] fUsedClusS; fUsedClusS = 0;
+  if(fUsedClusT) delete[] fUsedClusT; fUsedClusT = 0;
+
   Duplicate(m);
 
   return *this;
   Duplicate(m);
 
   return *this;
@@ -185,6 +199,8 @@ void AliMultiplicity::Duplicate(const AliMultiplicity& m){
     fDeltPhi = new Double_t[fNtracks];
     fLabels = new Int_t[fNtracks];
     fLabelsL2 = new Int_t[fNtracks];
     fDeltPhi = new Double_t[fNtracks];
     fLabels = new Int_t[fNtracks];
     fLabelsL2 = new Int_t[fNtracks];
+    if (m.fUsedClusT) fUsedClusT = new ULong64_t[fNtracks];
+    else fUsedClusT = 0;
   }
   else {
     fTh = 0;
   }
   else {
     fTh = 0;
@@ -199,6 +215,8 @@ void AliMultiplicity::Duplicate(const AliMultiplicity& m){
     fThsingle = new Double_t[fNsingle];
     fPhisingle = new Double_t[fNsingle];
     fLabelssingle = new Int_t[fNsingle];
     fThsingle = new Double_t[fNsingle];
     fPhisingle = new Double_t[fNsingle];
     fLabelssingle = new Int_t[fNsingle];
+    if (m.fUsedClusS) fUsedClusS = new UInt_t[fNsingle];
+    else fUsedClusS = 0;
   }
   else {
     fThsingle = 0;
   }
   else {
     fThsingle = 0;
@@ -214,16 +232,13 @@ void AliMultiplicity::Duplicate(const AliMultiplicity& m){
   if(m.fThsingle)memcpy(fThsingle,m.fThsingle,fNsingle*sizeof(Double_t));
   if(m.fPhisingle)memcpy(fPhisingle,m.fPhisingle,fNsingle*sizeof(Double_t));
   if(m.fLabelssingle)memcpy(fLabelssingle,m.fLabelssingle,fNsingle*sizeof(Int_t));
   if(m.fThsingle)memcpy(fThsingle,m.fThsingle,fNsingle*sizeof(Double_t));
   if(m.fPhisingle)memcpy(fPhisingle,m.fPhisingle,fNsingle*sizeof(Double_t));
   if(m.fLabelssingle)memcpy(fLabelssingle,m.fLabelssingle,fNsingle*sizeof(Int_t));
+  if(fUsedClusS) memcpy(fUsedClusS,m.fUsedClusS,fNsingle*sizeof(UInt_t));
+  if(fUsedClusT) memcpy(fUsedClusT,m.fUsedClusT,fNtracks*sizeof(ULong64_t));
   fFiredChips[0] = m.fFiredChips[0];
   fFiredChips[1] = m.fFiredChips[1];
   for(Int_t ilayer = 0; ilayer < 6; ilayer++){
     fITSClusters[ilayer] = m.fITSClusters[ilayer];
   }
   fFiredChips[0] = m.fFiredChips[0];
   fFiredChips[1] = m.fFiredChips[1];
   for(Int_t ilayer = 0; ilayer < 6; ilayer++){
     fITSClusters[ilayer] = m.fITSClusters[ilayer];
   }
-
-  fUsedClusT[0] = m.fUsedClusT[0];
-  fUsedClusT[1] = m.fUsedClusT[1];
-  fUsedClusS[0] = m.fUsedClusS[0];
-  fUsedClusS[1] = m.fUsedClusS[1];
   
   fFastOrFiredChips = m.fFastOrFiredChips;
   fClusterFiredChips = m.fClusterFiredChips;
   
   fFastOrFiredChips = m.fFastOrFiredChips;
   fClusterFiredChips = m.fClusterFiredChips;
@@ -241,6 +256,8 @@ AliMultiplicity::~AliMultiplicity(){
   if(fThsingle)delete [] fThsingle;fThsingle = 0;
   if(fPhisingle)delete [] fPhisingle;fPhisingle = 0;
   if(fLabelssingle)delete [] fLabelssingle;fLabelssingle = 0;
   if(fThsingle)delete [] fThsingle;fThsingle = 0;
   if(fPhisingle)delete [] fPhisingle;fPhisingle = 0;
   if(fLabelssingle)delete [] fLabelssingle;fLabelssingle = 0;
+  if(fUsedClusS) delete[] fUsedClusS; fUsedClusS = 0;
+  if(fUsedClusT) delete[] fUsedClusT; fUsedClusT = 0;
 }
 
 //______________________________________________________________________
 }
 
 //______________________________________________________________________
@@ -257,15 +274,13 @@ void AliMultiplicity::Clear(Option_t*)
   if(fThsingle)delete [] fThsingle;fThsingle = 0;
   if(fPhisingle)delete [] fPhisingle;fPhisingle = 0;
   if(fLabelssingle)delete [] fLabelssingle;fLabelssingle = 0;
   if(fThsingle)delete [] fThsingle;fThsingle = 0;
   if(fPhisingle)delete [] fPhisingle;fPhisingle = 0;
   if(fLabelssingle)delete [] fLabelssingle;fLabelssingle = 0;
+  if(fUsedClusS) delete[] fUsedClusS; fUsedClusS = 0;
+  if(fUsedClusT) delete[] fUsedClusT; fUsedClusT = 0;
   fNtracks = fNsingle = 0;
   for (int i=6;i--;) fITSClusters[0] = 0;
   fFiredChips[0] = fFiredChips[1] = 0;
   fFastOrFiredChips.ResetAllBits(kTRUE);
   fClusterFiredChips.ResetAllBits(kTRUE);
   fNtracks = fNsingle = 0;
   for (int i=6;i--;) fITSClusters[0] = 0;
   fFiredChips[0] = fFiredChips[1] = 0;
   fFastOrFiredChips.ResetAllBits(kTRUE);
   fClusterFiredChips.ResetAllBits(kTRUE);
-  fUsedClusT[0].ResetAllBits(kTRUE);
-  fUsedClusT[1].ResetAllBits(kTRUE);
-  fUsedClusS[0].ResetAllBits(kTRUE);
-  fUsedClusS[1].ResetAllBits(kTRUE);
   //
 }
 
   //
 }
 
@@ -321,7 +336,7 @@ UInt_t AliMultiplicity::GetNumberOfITSClusters(Int_t layMin, Int_t layMax) const
 }
 
 //______________________________________________________________________
 }
 
 //______________________________________________________________________
-void AliMultiplicity::SetTrackletData(Int_t id, const Float_t* tlet, UInt_t bits)
+void AliMultiplicity::SetTrackletData(Int_t id, const Float_t* tlet, UInt_t trSPD1, UInt_t trSPD2)
 {
   // fill tracklet data
   if (id>=fNtracks) {AliError(Form("Number of declared tracklets %d < %d",fNtracks,id)); return;}
 {
   // fill tracklet data
   if (id>=fNtracks) {AliError(Form("Number of declared tracklets %d < %d",fNtracks,id)); return;}
@@ -330,35 +345,89 @@ void AliMultiplicity::SetTrackletData(Int_t id, const Float_t* tlet, UInt_t bits
   fDeltPhi[id] = tlet[2];
   fDeltTh[id]  = tlet[3];
   fLabels[id]   = Int_t(tlet[4]);
   fDeltPhi[id] = tlet[2];
   fDeltTh[id]  = tlet[3];
   fLabels[id]   = Int_t(tlet[4]);
-  fLabelsL2[id] = Int_t(tlet[5]);  
-  if (bits&BIT(0)) fUsedClusT[0].SetBitNumber(id);
-  if (bits&BIT(1)) fUsedClusT[1].SetBitNumber(id);
+  fLabelsL2[id] = Int_t(tlet[5]);
+  fUsedClusT[id] = (((ULong64_t)trSPD2)<<32) + trSPD1;
+  printf("(%d %d)(%d %d)\n",trSPD1&0xffff,trSPD1>>16, trSPD2&0xffff, trSPD2>>16);
   //
 }
 
 //______________________________________________________________________
   //
 }
 
 //______________________________________________________________________
-void AliMultiplicity::SetSingleClusterData(Int_t id, const Float_t* scl, UInt_t bits)
+void AliMultiplicity::SetSingleClusterData(Int_t id, const Float_t* scl, UInt_t tr)
 {
   // fill single cluster data
   if (id>=fNsingle) {AliError(Form("Number of declared singles %d < %d",fNsingle,id)); return;}
   fThsingle[id]  = scl[0];
   fPhisingle[id] = scl[1];
   fLabelssingle[id] = scl[2]; 
 {
   // fill single cluster data
   if (id>=fNsingle) {AliError(Form("Number of declared singles %d < %d",fNsingle,id)); return;}
   fThsingle[id]  = scl[0];
   fPhisingle[id] = scl[1];
   fLabelssingle[id] = scl[2]; 
-  if (bits&BIT(0)) fUsedClusS[0].SetBitNumber(id);
-  if (bits&BIT(1)) fUsedClusS[1].SetBitNumber(id);
+  fUsedClusS[id] = tr;
   //
 }
 
   //
 }
 
+//______________________________________________________________________
+Bool_t AliMultiplicity::FreeClustersTracklet(Int_t i, Int_t mode) const
+{
+  // return kTRUE if the tracklet was not used by the track (on any of layers) of type mode: 0=TPC/ITS or ITS_SA, 1=ITS_SA_Pure
+  if (!fUsedClusT || mode<0 || mode>1 || i<0 || i>fNtracks) return kFALSE;
+  const ULong64_t kMask0 = 0x0000ffff0000ffff;
+  const ULong64_t kMask1 = 0xffff0000ffff0000;
+  return (fUsedClusT[i]&(mode ? kMask1:kMask0)) == 0;
+}
+
+//______________________________________________________________________
+Bool_t AliMultiplicity::GetTrackletTrackIDs(Int_t i, Int_t mode, Int_t &spd1, Int_t &spd2) const
+{
+  // set spd1 and spd2 to ID's of the tracks using the clusters of the tracklet (-1 if not used)
+  // Mode: 0=TPC/ITS or ITS_SA, 1=ITS_SA_Pure tracks
+  // return false if the neither of clusters is used
+  //
+  // note: stored value:  [(idSAPureSPD2+1)<<16+(idTPCITS/SA_SPD2+1)]<<32 +  [(idSAPureSPD1+1)<<16+(idTPCITS/SA_SPD1+1)]
+  if (!fUsedClusT || mode<0 || mode>1 || i<0 || i>fNtracks) {spd1 = spd2 = -1; return kFALSE;}
+  spd1 = (fUsedClusT[i]&0xffffffff);
+  spd2 = (fUsedClusT[i]>>32);
+  if (mode) {
+    spd1 >>= 16;
+    spd2 >>= 16;
+  }
+  else {
+    spd1 &= 0xffff;
+    spd2 &= 0xffff;
+  }
+  spd1--; // we are storing id+1
+  spd2--;
+  return !(spd1<0&&spd2<0);
+}
+
+//______________________________________________________________________
+Bool_t AliMultiplicity::FreeSingleCluster(Int_t i, Int_t mode) const
+{
+  // return kTRUE if the cluster was not used by the track of type mode: 0=TPC/ITS or ITS_SA, 1=ITS_SA_Pure
+  if (!fUsedClusS || mode<0 || mode>1 || i<0 || i>fNsingle) return kFALSE;
+  const UInt_t kMask0 = 0x0000ffff;
+  const UInt_t kMask1 = 0xffff0000;
+  return (fUsedClusS[i]&(mode ? kMask1:kMask0)) == 0;
+}
+
+//______________________________________________________________________
+Bool_t AliMultiplicity::GetSingleClusterTrackID(Int_t i, Int_t mode, Int_t &tr) const
+{
+  // set tr to id of the track using the single clusters  (-1 if not used)
+  // Mode: 0=TPC/ITS or ITS_SA, 1=ITS_SA_Pure tracks
+  // return false if the cluster is not used
+  //
+  // note: stored value:  [(idSAPure+1)<<16+(idTPCITS/SA+1)]
+  if (!fUsedClusS || mode<0 || mode>1 || i<0 || i>fNsingle) {tr = -1; return kFALSE;}
+  tr = fUsedClusS[i];
+  if (mode) tr >>= 16;
+  else      tr &= 0xffff;
+  return (--tr)>=0; // we are storing id+1
+}
+
 //______________________________________________________________________
 void AliMultiplicity::CompactBits()
 {
   // sqeeze bit contrainers to minimum
   fFastOrFiredChips.Compact();
   fClusterFiredChips.Compact();
 //______________________________________________________________________
 void AliMultiplicity::CompactBits()
 {
   // sqeeze bit contrainers to minimum
   fFastOrFiredChips.Compact();
   fClusterFiredChips.Compact();
-  fUsedClusT[0].Compact();
-  fUsedClusT[1].Compact();
-  fUsedClusS[0].Compact();
-  fUsedClusS[1].Compact();
 }
 
 //______________________________________________________________________
 }
 
 //______________________________________________________________________
@@ -367,17 +436,23 @@ void AliMultiplicity::Print(Option_t *opt) const
   // print
   printf("N.tracklets: %4d N.singles: %4d\n",fNtracks,fNsingle);
   TString opts = opt; opts.ToLower();
   // print
   printf("N.tracklets: %4d N.singles: %4d\n",fNtracks,fNsingle);
   TString opts = opt; opts.ToLower();
+  int t0spd1=-1,t1spd1=-1,t0spd2=-1,t1spd2=-1;
+  //
   if (opts.Contains("t")) {
   if (opts.Contains("t")) {
-    for (int i=0;i<fNtracks;i++) 
-      printf("T#%3d| Th:%+6.3f Phi:%+6.3f DTh:%+6.3f DPhi:%+6.3f L1:%4d L2:%4d U0:%d U1:%d\n",
-            i,fTh[i],fPhi[i],fDeltTh[i],fDeltPhi[i],fLabels[i],fLabelsL2[i],
-            FreeClustersTracklet(i,0),FreeClustersTracklet(i,1));
+    for (int i=0;i<fNtracks;i++) {
+      GetTrackletTrackIDs(i,0,t0spd1,t0spd2);
+      GetTrackletTrackIDs(i,1,t1spd1,t1spd2);
+      printf("T#%3d| Eta:%+5.2f Th:%+6.3f Phi:%+6.3f DTh:%+6.3f DPhi:%+6.3f L1:%4d L2:%4d U:L1[%5d/%5d] L2[%5d/%5d]\n",
+            i,GetEta(i),fTh[i],fPhi[i],fDeltTh[i],fDeltPhi[i],fLabels[i],fLabelsL2[i],t0spd1,t1spd1,t0spd2,t1spd2);
+    }
   }
   if (opts.Contains("s")) {
   }
   if (opts.Contains("s")) {
-    for (int i=0;i<fNsingle;i++) 
-      printf("S#%3d| Th:%+6.3f Phi:%+6.3f L:%4d U0:%d U1:%d\n",
-            i,fThsingle[i],fPhisingle[i],fLabelssingle[i], 
-            FreeClustersTracklet(i,0),FreeClustersTracklet(i,1));
+    for (int i=0;i<fNsingle;i++) {
+      GetSingleClusterTrackID(i,0,t0spd1);
+      GetSingleClusterTrackID(i,1,t1spd1);
+      printf("S#%3d| Th:%+6.3f Phi:%+6.3f L:%4d U:[%5d/%5d]\n",
+            i,fThsingle[i],fPhisingle[i],fLabelssingle[i], t0spd1,t1spd1);
+    }
   }
   //
 }
   }
   //
 }
index 7bb595f5fdecf6bd14d8c0a54fdda5a0cd641d01..8c99c3fea6058fb88ad8aca7a87408b75d7c399d 100644 (file)
@@ -53,8 +53,8 @@ class AliMultiplicity : public TObject {
   void  SetLabelSingle(Int_t i, Int_t label);
 
 
   void  SetLabelSingle(Int_t i, Int_t label);
 
 
-  Bool_t FreeClustersTracklet(Int_t i, Int_t mode) const {return (mode>=0&&mode<2&&i>=0&&i<fNtracks) ? !fUsedClusT[mode].TestBitNumber(i):kFALSE;}
-  Bool_t FreeSingleCluster(Int_t i, Int_t mode)    const {return (mode>=0&&mode<2&&i>=0&&i<fNsingle) ? !fUsedClusS[mode].TestBitNumber(i):kFALSE;}
+  Bool_t FreeClustersTracklet(Int_t i, Int_t mode) const;
+  Bool_t FreeSingleCluster(Int_t i, Int_t mode)    const;
 
   
 // methods to access single cluster information
 
   
 // methods to access single cluster information
@@ -85,7 +85,8 @@ class AliMultiplicity : public TObject {
   const TBits & GetFiredChipMap() const {return fClusterFiredChips;}
   Bool_t TestFiredChipMap(UInt_t chipKey) const {return fClusterFiredChips.TestBitNumber(chipKey);}
 
   const TBits & GetFiredChipMap() const {return fClusterFiredChips;}
   Bool_t TestFiredChipMap(UInt_t chipKey) const {return fClusterFiredChips.TestBitNumber(chipKey);}
 
-
+  Bool_t GetTrackletTrackIDs(Int_t i, Int_t mode, Int_t &spd1, Int_t &spd2) const;
+  Bool_t GetSingleClusterTrackID(Int_t i, Int_t mode, Int_t &tr) const;
 
   // array getters
   Double_t* GetTheta()       const {return (Double_t*)fTh;}
 
   // array getters
   Double_t* GetTheta()       const {return (Double_t*)fTh;}
@@ -98,8 +99,8 @@ class AliMultiplicity : public TObject {
   Int_t*    GetLabels2()     const {return (Int_t*)fLabelsL2;}
   Int_t*    GetLabelsSingle()      const {return (Int_t*)fLabelssingle;} 
   
   Int_t*    GetLabels2()     const {return (Int_t*)fLabelsL2;}
   Int_t*    GetLabelsSingle()      const {return (Int_t*)fLabelssingle;} 
   
-  void SetTrackletData(Int_t id, const Float_t* tlet, UInt_t bits);
-  void SetSingleClusterData(Int_t id, const Float_t* scl,UInt_t bits);
+  void SetTrackletData(Int_t id, const Float_t* tlet, UInt_t trSPD1, UInt_t trSPD2);
+  void SetSingleClusterData(Int_t id, const Float_t* scl,UInt_t tr);
   void CompactBits();
 
   virtual void Print(Option_t *opt="") const;
   void CompactBits();
 
   virtual void Print(Option_t *opt="") const;
@@ -112,6 +113,8 @@ class AliMultiplicity : public TObject {
                              // with a tracklet on SPD layer 2
   Int_t *fLabels;            //[fNtracks] array with labels of cluster in L1 used for tracklet
   Int_t *fLabelsL2;          //[fNtracks] array with labels of cluster in L2 used for tracklet
                              // with a tracklet on SPD layer 2
   Int_t *fLabels;            //[fNtracks] array with labels of cluster in L1 used for tracklet
   Int_t *fLabelsL2;          //[fNtracks] array with labels of cluster in L2 used for tracklet
+  UInt_t* fUsedClusS;        //[fNtracks] id+1 of the tracks using cluster, coded as (TPC/ITS+ITS_SA)+(ITS_SA_PURE<<16)
+  ULong64_t* fUsedClusT;     //[fNtracks] id+1 of the tracks using clusters, coded as (TPC/ITS+ITS_SA)+(ITS_SA_PURE<<16) for SPD1 and SPD2 in low and high parts
   Double32_t *fTh;           //[fNtracks] array with theta values
   Double32_t *fPhi;          //[fNtracks] array with phi values
   Double32_t *fDeltTh;       //[fNtracks] array with delta theta values
   Double32_t *fTh;           //[fNtracks] array with theta values
   Double32_t *fPhi;          //[fNtracks] array with phi values
   Double32_t *fDeltTh;       //[fNtracks] array with delta theta values
@@ -123,10 +126,8 @@ class AliMultiplicity : public TObject {
   UInt_t fITSClusters[6];    // Number of ITS cluster per layer
   TBits fFastOrFiredChips;   // Map of FastOr fired chips
   TBits fClusterFiredChips;  // Map of fired chips (= at least one cluster)
   UInt_t fITSClusters[6];    // Number of ITS cluster per layer
   TBits fFastOrFiredChips;   // Map of FastOr fired chips
   TBits fClusterFiredChips;  // Map of fired chips (= at least one cluster)
-  TBits fUsedClusT[2];       // flag that at least one of tracklets clusters is used by TPC/ITS+ITS_SA (0) or ITS_SA_PURE tracks (1)
-  TBits fUsedClusS[2];       // flag that the single clusters is used by TPC/ITS+ITS_SA (0) or ITS_SA_PURE tracks
 
 
-  ClassDef(AliMultiplicity,14);
+  ClassDef(AliMultiplicity,15);
 };
 
 inline Int_t AliMultiplicity::GetLabel(Int_t i, Int_t layer) const
 };
 
 inline Int_t AliMultiplicity::GetLabel(Int_t i, Int_t layer) const