- if (fHit.size()<fClustersUnused+count) fHit.resize(fClustersUnused+count);
- assert(fHit.size()>=fClustersUnused+count);
- for (Int_t i=0;(UInt_t)i<count;i++)
- {
- fHit[i+fClustersUnused].Reset();
- fHit[i+fClustersUnused].Read(hits[i]);
- }
- fClustersUnused += count;
+ if(fClusterCutZ == -1){
+ 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;
+ }
+ fHit[i+fClustersUnused].Reset();
+ fHit[i+fClustersUnused].Read(hits[i]);
+ }
+ fClustersUnused += count;
+ }
+ else{
+ //Skipping clusters with high Z.
+ UInt_t skipped=0;
+
+ 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;
+ }
+ fHit[i+fClustersUnused-skipped].Reset();
+ fHit[i+fClustersUnused-skipped].Read(hits[i]);
+ }
+ fClustersUnused += count - skipped;
+ fHit.resize(fClustersUnused);
+ }