]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TPCLib/AliHLTTPCTrackMCMarkerComponent.cxx
removing old CF configurations, ids redirected to HWCF; global tracking option enable...
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCTrackMCMarkerComponent.cxx
index 6e8ddfc504b78d0f902ebfb6ce24d01e68664e41..5ccf942921f0cb9abec2ab40abefab3bc4e5ed5c 100644 (file)
@@ -1,3 +1,5 @@
+// $Id$
+
 // **************************************************************************
 // This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 //***************************************************************************
 
-
-#if __GNUC__>= 3
-using namespace std;
-#endif
+/// @file   AliHLTTPCTrackMCMarkerComponent.cxx
+/// @author Matthias Kretz
+/// @date
+/// @brief  Marker component for TPC cluster mc labels.
+///
 
 #include "AliHLTTPCTrackMCMarkerComponent.h"
 #include "AliHLTTPCTransform.h"
-#include "AliHLTTPCTrackSegmentData.h"
-#include "AliHLTTPCTrack.h"
-#include "AliHLTTPCTrackArray.h"
 #include "AliHLTTPCTrackletDataFormat.h"
 #include "AliHLTTPCCADef.h"
 #include "AliHLTTPCDefinitions.h"
+#include "AliHLTTPCSpacePointData.h"
+#include "AliHLTTPCClusterMCData.h"
 
 #include "AliCDBEntry.h"
 #include "AliCDBManager.h"
@@ -35,11 +37,10 @@ using namespace std;
 #include "TObjArray.h"
 #include "AliHLTExternalTrackParam.h"
 #include "AliHLTTrackMCLabel.h"
-#include "AliHLTTPCClusterFinder.h"
 #include <climits>
 #include <cstdlib>
 #include <cerrno>
-
+#include <algorithm>
 
 // ROOT macro for the implementation of ROOT specific class methods
 ClassImp( AliHLTTPCTrackMCMarkerComponent )
@@ -48,6 +49,9 @@ ClassImp( AliHLTTPCTrackMCMarkerComponent )
 AliHLTTPCTrackMCMarkerComponent::AliHLTTPCTrackMCMarkerComponent()
 {
   // see header file for class documentation
+  for( int i=0; i<36*6; i++ ){
+    fClusterLabels[i] = 0;    
+  }
 }
 
 // Public functions to implement AliHLTComponent's interface.
@@ -240,22 +244,22 @@ Int_t AliHLTTPCTrackMCMarkerComponent::GetTrackMCLabel( unsigned int *hits, int
 
   for( Int_t ih=0; ih<nHits; ih++){
     UInt_t id = hits[ih];
-    int iSlice = id>>25;
-    int iPatch = (id>>22)&0x7; 
-    int iCluster = id&0x3fffff;
-    if( iSlice<0 || iSlice>36 || iPatch<0 || iPatch>5 ){
+    int iSlice = AliHLTTPCSpacePointData::GetSlice(id);
+    int iPatch = AliHLTTPCSpacePointData::GetPatch(id);
+    unsigned int iCluster = AliHLTTPCSpacePointData::GetNumber(id);
+    if( iSlice<0 || iSlice>=36 || iPatch<0 || iPatch>5 ){
       HLTError("Corrupted TPC cluster Id: slice %d, patch %d, cluster %d",
               iSlice, iPatch,iCluster );
       continue;
     }
-    AliHLTTPCClusterFinder::ClusterMCInfo *patchLabels = fClusterLabels[iSlice*6 + iPatch];
+    AliHLTTPCClusterMCData *patchLabels = fClusterLabels[iSlice*6 + iPatch];
     if( !patchLabels ) continue;
-    if( iCluster >= fNClusterLabels[iSlice*6 + iPatch] ){
+    if( iCluster >= patchLabels->fCount ){
       HLTError("TPC slice %d, patch %d: ClusterID==%d >= N MC labels==%d ",
-              iSlice, iPatch,iCluster, fNClusterLabels[iSlice*6 + iPatch] );
+              iSlice, iPatch,iCluster, patchLabels->fCount);
       continue;
     }
-    AliHLTTPCClusterFinder::ClusterMCInfo &lab = patchLabels[iCluster];            
+    AliHLTTPCClusterMCLabel &lab = patchLabels->fLabels[iCluster];         
     if ( lab.fClusterID[0].fMCID >= 0 ) labels.push_back( lab.fClusterID[0].fMCID );
     if ( lab.fClusterID[1].fMCID >= 0 ) labels.push_back( lab.fClusterID[1].fMCID );
     if ( lab.fClusterID[2].fMCID >= 0 ) labels.push_back( lab.fClusterID[2].fMCID );
@@ -306,7 +310,6 @@ int AliHLTTPCTrackMCMarkerComponent::DoEvent( const AliHLTComponentEventData &ev
 
   for( int i=0; i<36*6; i++ ){
     fClusterLabels[i] = 0;
-    fNClusterLabels[i] = 0;
   }
 
   int nBlocks = (int)evtData.fBlockCnt;
@@ -320,9 +323,8 @@ int AliHLTTPCTrackMCMarkerComponent::DoEvent( const AliHLTComponentEventData &ev
     if(iter->fDataType == AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo ) {
       Int_t slice=AliHLTTPCDefinitions::GetMinSliceNr(iter->fSpecification);
       Int_t patch=AliHLTTPCDefinitions::GetMinPatchNr(iter->fSpecification);
-      fClusterLabels[ slice*6 + patch] = (AliHLTTPCClusterFinder::ClusterMCInfo *)iter->fPtr;
-      fNClusterLabels[ slice*6 + patch] = iter->fSize/sizeof(AliHLTTPCClusterFinder::ClusterMCInfo);
-      nInputMCLabels+=fNClusterLabels[ slice*6 + patch];
+      fClusterLabels[ slice*6 + patch] = (AliHLTTPCClusterMCData*)iter->fPtr;
+      nInputMCLabels+=fClusterLabels[ slice*6 + patch]->fCount;
     }
   }