code cleanup: remove unused data in HLTTRDTracklet (clusters indexes) (Theo)
[u/mrichter/AliRoot.git] / HLT / TRD / AliHLTTRDTracklet.cxx
index 60dcae97ab3f04173d3a86eca513f19432025e08..3552157355374d759be03379dd6e995192584f26 100644 (file)
@@ -5,21 +5,19 @@
 //============================================================================
 AliHLTTRDTracklet::AliHLTTRDTracklet():
   fN(0),
-  fDet(-1),
   fdX(-1),
   fS2Y(-1),
   fPt(-1),
-  fPad3(-1),
-  fPad2(-1),
   fX0(-1),
   fC(-1),
   fChi2(-1),
+  fDet(-1),
+  fCount(0),
 #if defined(__HP_aCC) || defined(__DECCXX) || defined(__SUNPRO_CC)
-  fSize(sizeof(AliHLTTRDTracklet)-sizeof(IndexAndCluster)),
+  fSize(sizeof(AliHLTTRDTracklet)-sizeof(AliHLTTRDCluster)),
 #else
-  fSize(sizeof(AliHLTTRDTracklet)),
+  fSize(sizeof(AliHLTTRDTracklet))
 #endif
-  fCount(0)
 {
   InitArrays();
 }
@@ -30,21 +28,19 @@ AliHLTTRDTracklet::AliHLTTRDTracklet():
 //============================================================================
 AliHLTTRDTracklet::AliHLTTRDTracklet(const AliTRDseedV1* const inTracklet):
   fN(inTracklet->fN),
-  fDet(inTracklet->fDet),
   fdX(inTracklet->fdX),
   fS2Y(inTracklet->fS2Y),
   fPt(inTracklet->fPt),
-  fPad3(inTracklet->fPad[3]),
-  fPad2(inTracklet->fPad[2]),
   fX0(inTracklet->fX0),
   fC(inTracklet->fC),
   fChi2(inTracklet->fChi2),
+  fDet(inTracklet->fDet),
+  fCount(0),
 #if defined(__HP_aCC) || defined(__DECCXX) || defined(__SUNPRO_CC)
-  fSize(sizeof(AliHLTTRDTracklet)-sizeof(IndexAndCluster)),
+  fSize(sizeof(AliHLTTRDTracklet)-sizeof(AliHLTTRDCluster)),
 #else
-  fSize(sizeof(AliHLTTRDTracklet)),
+  fSize(sizeof(AliHLTTRDTracklet))
 #endif
-  fCount(0)
 {
   CopyDataMembers(inTracklet);
 }
@@ -63,6 +59,10 @@ void AliHLTTRDTracklet::CopyDataMembers(const AliTRDseedV1* const inTracklet)
     fYfit[i]   = inTracklet->fYfit[i];
     fZfit[i]   = inTracklet->fZfit[i];
   }
+
+  for (Int_t i=0; i < 3; i++){
+    fPad[i] = inTracklet->fPad[i];
+  }
   
   for (Int_t i=0; i < AliPID::kSPECIES; i++){
     fProb[i] = inTracklet->fProb[i];
@@ -72,10 +72,9 @@ void AliHLTTRDTracklet::CopyDataMembers(const AliTRDseedV1* const inTracklet)
     {
       AliTRDcluster* trdCluster = inTracklet->GetClusters(iTimeBin);
       if (trdCluster){
-       fClusters[fCount].Index = inTracklet->fIndexes[iTimeBin];
-       new (&fClusters[fCount].Cluster) AliHLTTRDCluster(trdCluster);
+       new (&fClusters[fCount]) AliHLTTRDCluster(trdCluster);
        fCount++;
-       fSize += sizeof(IndexAndCluster);
+       fSize += sizeof(AliHLTTRDCluster);
       }
     }
   
@@ -89,11 +88,10 @@ void AliHLTTRDTracklet::CopyDataMembers(const AliTRDseedV1* const inTracklet)
 void AliHLTTRDTracklet::ExportTRDTracklet(AliTRDseedV1* const outTracklet) const
 {
   //outTracklet->Reset(); we always use a fresh trdtracklet as input, so this is useless
+  outTracklet->SetBit(AliTRDseedV1::kOwner);
 
   outTracklet->fN      = fN;
   outTracklet->fDet    = fDet;
-  outTracklet->fPad[3] = fPad3;
-  outTracklet->fPad[2] = fPad2;
   outTracklet->fdX     = fdX;
   outTracklet->fX0     = fX0;
   outTracklet->fS2Y    = fS2Y;
@@ -108,16 +106,19 @@ void AliHLTTRDTracklet::ExportTRDTracklet(AliTRDseedV1* const outTracklet) const
     outTracklet->fZfit[i]   = fZfit[i];
   }
 
+  for (Int_t i=0; i < 3; i++){
+    outTracklet->fPad[i] = fPad[i];
+  }
+
   for (Int_t i=0; i < AliPID::kSPECIES; i++){
     outTracklet->fProb[i] = fProb[i];
   }
 
   for (UInt_t iCluster=0; iCluster < fCount; iCluster++){
     AliTRDcluster *trdCluster = new AliTRDcluster();
-    fClusters[iCluster].Cluster.ExportTRDCluster(trdCluster);
+    fClusters[iCluster].ExportTRDCluster(trdCluster);
     outTracklet->fClusters[iCluster] = trdCluster;
-    outTracklet->fIndexes[iCluster] = fClusters[iCluster].Index;
-    iCluster++;
+    outTracklet->fIndexes[iCluster] = iCluster;
   }
 }
 
@@ -148,10 +149,9 @@ void AliHLTTRDTracklet::Print(Bool_t printClusters) const
   printf("      fDet %i; fPt %f; fdX %f fN %i\n", fDet, fPt, fdX, fN);
 
   if(!printClusters) return;
-  for (UInt_t iCount=0, iCluster = 0; iCluster < fCount; iCount++){
-    printf(" [%i] ",iCount);
-    fClusters[iCluster].Cluster.Print();
-    iCluster++;
+  for (UInt_t iCluster = 0; iCluster < fCount; iCluster++){
+    printf(" [%i] ",iCluster);
+    fClusters[iCluster].Print();
   }
 }
 
@@ -176,3 +176,4 @@ void AliHLTTRDTracklet::Print(Bool_t printClusters) const
     
 //   }
 // }
+