]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add a protection against empty chambers
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Jan 2008 16:36:43 +0000 (16:36 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Jan 2008 16:36:43 +0000 (16:36 +0000)
TRD/AliTRDrawData.cxx

index 80f0ee0b8ad7f86e1568e45907a227d6f12ee8ad..ebed36f421b6c29432a9c4cd58aedb46ba3c9c50 100644 (file)
@@ -191,24 +191,37 @@ Bool_t AliTRDrawData::Digits2Raw(AliTRDdigitsManager *digitsManager)
 
         // Get the digits array
         AliTRDdataArrayS *digits = (AliTRDdataArrayS *) digitsManager->GetDigits(iDet);
-        digits->Expand();
+        if (digits->HasData()) {
 
-        Int_t hcwords = 0;
-       Int_t rv = fFee->GetRAWversion();
+          digits->Expand();
 
-        // Process A side of the chamber
-       if ( rv >= 1 && rv <= 2 ) hcwords = ProduceHcDataV1andV2(digits,0,iDet,hcBuffer,kMaxHcWords);
-       if ( rv == 3 )            hcwords = ProduceHcDataV3     (digits,0,iDet,hcBuffer,kMaxHcWords);
+          Int_t hcwords = 0;
+         Int_t rv = fFee->GetRAWversion();
 
-        of->WriteBuffer((char *) hcBuffer, hcwords*4);
-        npayloadbyte += hcwords*4;
+          // Process A side of the chamber
+         if ( rv >= 1 && rv <= 2 ) {
+            hcwords = ProduceHcDataV1andV2(digits,0,iDet,hcBuffer,kMaxHcWords);
+         }
+         if ( rv == 3 ) { 
+            hcwords = ProduceHcDataV3     (digits,0,iDet,hcBuffer,kMaxHcWords);
+         }
+
+          of->WriteBuffer((char *) hcBuffer, hcwords*4);
+          npayloadbyte += hcwords*4;
+
+          // Process B side of the chamber
+         if ( rv >= 1 && rv <= 2 ) {
+            hcwords = ProduceHcDataV1andV2(digits,1,iDet,hcBuffer,kMaxHcWords);
+         }
+         if ( rv >= 3 ) {
+            hcwords = ProduceHcDataV3     (digits,1,iDet,hcBuffer,kMaxHcWords);
+         }
 
-        // Process B side of the chamber
-       if ( rv >= 1 && rv <= 2 ) hcwords = ProduceHcDataV1andV2(digits,1,iDet,hcBuffer,kMaxHcWords);
-       if ( rv >= 3 )            hcwords = ProduceHcDataV3     (digits,1,iDet,hcBuffer,kMaxHcWords);
+          of->WriteBuffer((char *) hcBuffer, hcwords*4);
+          npayloadbyte += hcwords*4;
+
+       }
 
-        of->WriteBuffer((char *) hcBuffer, hcwords*4);
-        npayloadbyte += hcwords*4;
       }
     }