]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Correcting bugs (Gaute):
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 20 Nov 2008 13:38:42 +0000 (13:38 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 20 Nov 2008 13:38:42 +0000 (13:38 +0000)
- TPCSliceTracker handles corrupted input data (https://savannah.cern.ch/bugs/?30969)
- TPCSliceTracker and GlobalMerger handle SOR/EOR and special events
  (https://savannah.cern.ch/bugs/?39605)

HLT/TPCLib/AliHLTTPCConfMapper.cxx
HLT/TPCLib/AliHLTTPCConfMapper.h
HLT/TPCLib/AliHLTTPCGlobalMergerComponent.cxx
HLT/TPCLib/AliHLTTPCSliceTrackerComponent.cxx

index 647f833a13e28a2847b34dfee13ce2b291e13393..6a42af76e9a6584ba65d919bc695c8c9dfc3b120 100644 (file)
@@ -172,6 +172,12 @@ void AliHLTTPCConfMapper::InitSector(Int_t sector,Int_t *rowrange,Float_t *etara
 }
 
 Bool_t AliHLTTPCConfMapper::ReadHits(UInt_t count, AliHLTTPCSpacePointData* hits )
+{
+  //read hits with ReadHitsChecked  
+  return ReadHitsChecked(count,hits,0);
+}
+
+Bool_t AliHLTTPCConfMapper::ReadHitsChecked(UInt_t count, AliHLTTPCSpacePointData* hits, unsigned int sizeInByte )
 {
   //read hits
   if(fClusterCutZ == -1){
@@ -179,6 +185,11 @@ Bool_t AliHLTTPCConfMapper::ReadHits(UInt_t count, AliHLTTPCSpacePointData* hits
     assert(fHit.size()>=fClustersUnused+count);
     for (Int_t i=0;(UInt_t)i<count;i++)
       {        
+       AliHLTTPCSpacePointData *hit = &hits[i];
+       if (sizeInByte>0 && ((AliHLTUInt8_t*)hit)+sizeof(AliHLTTPCSpacePointData)>((AliHLTUInt8_t*)hits)+sizeInByte) {
+         LOG(AliHLTTPCLog::kWarning,"AliHLTTPCConfMapper::ReadHits","")<<"Wrong size of data (" << sizeInByte << " byte), skipping array of AliHLTTPCSpacePointData" <<ENDLOG;;
+         break;
+       }
        fHit[i+fClustersUnused].Reset();
        fHit[i+fClustersUnused].Read(hits[i]);
       }
@@ -191,7 +202,12 @@ Bool_t AliHLTTPCConfMapper::ReadHits(UInt_t count, AliHLTTPCSpacePointData* hits
     if (fHit.size()<fClustersUnused+count) fHit.resize(fClustersUnused+count);
     assert(fHit.size()>=fClustersUnused+count);
     for (Int_t i=0;(UInt_t)i<count;i++)
-      {   
+      {  
+       AliHLTTPCSpacePointData *hit = &hits[i];
+       if (sizeInByte>0 && ((AliHLTUInt8_t*)hit)+sizeof(AliHLTTPCSpacePointData)>((AliHLTUInt8_t*)hits)+sizeInByte) {
+         LOG(AliHLTTPCLog::kWarning,"AliHLTTPCConfMapper::ReadHits","")<<"Wrong size of data (" << sizeInByte << " byte), skipping array of AliHLTTPCSpacePointData" <<ENDLOG;;
+         break;
+       }
        if(hits[i].fZ > fClusterCutZ || hits[i].fZ < -1*fClusterCutZ){
          ++skipped;
          continue;
index 4405d8e48deb90427b17135525c7f470f6140034..02ed2b70a4cb8d03b4112b5fba30b8ea735f2f16 100644 (file)
@@ -65,6 +65,7 @@ class AliHLTTPCConfMapper {
    * @return kTRUE if success.
    */
   Bool_t ReadHits(UInt_t count, AliHLTTPCSpacePointData* hits );
+  Bool_t ReadHitsChecked(UInt_t count, AliHLTTPCSpacePointData* hits,unsigned int sizeInByte );
   void ClusterLoop();
   void CreateTrack(AliHLTTPCConfMapPoint *hit);
   AliHLTTPCConfMapPoint *GetNextNeighbor(AliHLTTPCConfMapPoint *start_hit,AliHLTTPCConfMapTrack *track=NULL);
index 9009af30c724482d4364b85b246681447dc870ef..a7cef1643fbfc5896f159cfff1f5741e0cc4dc2f 100644 (file)
@@ -133,6 +133,9 @@ int AliHLTTPCGlobalMergerComponent::DoEvent( const AliHLTComponentEventData& evt
                                              AliHLTUInt32_t& size, AliHLTComponentBlockDataList& outputBlocks )
 {
   // see header file for class documentation
+
+  if (!IsDataEvent()) return 0;
+  
   int iResult=0;
   AliHLTUInt32_t capacity=size;
   size=0;
index 695f949381ac5ca74083ea798d367bbde0be4bad..d71cb1445e94ff3836935fc10e4de0d2126249ab 100644 (file)
@@ -414,6 +414,9 @@ int AliHLTTPCSliceTrackerComponent::DoEvent( const AliHLTComponentEventData& evt
                                              AliHLTUInt32_t& size, AliHLTComponentBlockDataList& outputBlocks )
 {
   // see header file for class documentation
+
+  if (!IsDataEvent()) return 0;
+  
   int iResult=0;
   AliHLTUInt32_t capacity=size;
   size=0;
@@ -608,7 +611,8 @@ int AliHLTTPCSliceTrackerComponent::DoEvent( const AliHLTComponentEventData& evt
            
        Logging( kHLTLogDebug, "HLT::TPCSliceTracker::DoEvent", "Reading hits",
                 "Reading hits for slice %d - patch %d", slice, patch );
-       fTracker->ReadHits( inPtrSP->fSpacePointCnt, inPtrSP->fSpacePoints );
+       //fTracker->ReadHits( inPtrSP->fSpacePointCnt, inPtrSP->fSpacePoints );
+       fTracker->ReadHitsChecked(inPtrSP->fSpacePointCnt, inPtrSP->fSpacePoints,iter->fSize );
        pIter++;
        }