catch invalid HC information and return position from link instead
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 Aug 2010 18:02:08 +0000 (18:02 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 Aug 2010 18:02:08 +0000 (18:02 +0000)
TRD/AliTRDrawStream.cxx

index 9ada058..1009781 100644 (file)
@@ -410,7 +410,12 @@ Int_t AliTRDrawStream::NextChamber(AliTRDdigitsManager *digMgr, UInt_t ** /* tra
           (((fCurrStackMask & (1 << fCurrSlot)) == 0) || 
            ((fCurrLinkMask[fCurrSlot] & (1 << fCurrLink))) == 0));
 
-  return (fCurrSm * 30 + fCurrStack * 6 + fCurrLayer);
+  // return chamber information from HC if it is valid
+  // otherwise return information from link position
+  if (fCurrSm < 0 || fCurrSm > 17 || fCurrStack < 0 || fCurrStack > 4 || fCurrLayer < 0 || fCurrLayer > 5)
+    return ((fCurrEquipmentId-1024) + fCurrSlot * 6 + fCurrLink/2);
+  else
+    return (fCurrSm * 30 + fCurrStack * 6 + fCurrLayer);
 }