]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDRawStream.cxx
data DCS fro new preprocessor
[u/mrichter/AliRoot.git] / FMD / AliFMDRawStream.cxx
index 7c47e9591b704c83df5d060c6e50f2d9eed9d3f0..7502788bbb8427b06b0decb95b206c612e7b0061 100644 (file)
 // and the sample rate should be set explicitly. 
 //
 #include "AliFMDRawStream.h"           // ALIFMDRAWSTREAM_H
-#include <AliRawReader.h>              // ALIRAWREADER_H
+// #include <AliRawReader.h>           // ALIRAWREADER_H
 #include "AliFMDParameters.h"
-#include <AliLog.h>
-#include <iomanip>
-#include <iostream>
+// #include <AliLog.h>
+#include "AliFMDDebug.h" // Better debug macros
+// #include <iomanip>
+// #include <iostream>
 
 //____________________________________________________________________
 ClassImp(AliFMDRawStream)
@@ -42,9 +43,10 @@ ClassImp(AliFMDRawStream)
 AliFMDRawStream::AliFMDRawStream(AliRawReader* reader) 
   : AliAltroRawStream(reader)
 {
+  // CTOR 
   fNoAltroMapping = kFALSE;
   // Select FMD DDL's 
-  SelectRawData(AliFMDParameters::kBaseDDL>>8);
+  SelectRawData("FMD");
 }
 
 //_____________________________________________________________________________
@@ -52,21 +54,30 @@ Bool_t
 AliFMDRawStream::ReadChannel(UInt_t& ddl, UInt_t& addr, 
                             UInt_t& len, UShort_t* data)
 {
+  // Read one channel and return.   Returns 0 when there's no more
+  // data. 
   Int_t        l         = 0;
   static Int_t last      = 0xFFFF; // 0xFFFF means signal is used
   Bool_t       next      = kTRUE;
   do {
     Int_t signal = last;
     if (last > 0x3FF) {
-      AliDebug(30, Form("Last is 0x%x, so reading a new word", last));
+      AliFMDDebug(30, ("Last is 0x%x, so reading a new word", last));
       next   = Next();
-      if (!next) break;
+      if(!next){
+       AliFMDDebug(15, ("Read word # %d (!next)", l));
+       addr = GetPrevHWAddress();
+       ddl  = GetPrevDDLNumber();
+       len  = l+1; // Need to add one - l points to last valid index
+       last = signal;
+       break;
+      }
       signal = GetSignal();
       if (GetHWAddress() != GetPrevHWAddress() && GetPrevHWAddress() >= 0) {
-       AliDebug(15, Form("New hardware address, was 0x%x, now 0x%x", 
+       AliFMDDebug(15, ("New hardware address, was 0x%x, now 0x%x", 
                          GetPrevHWAddress(), GetHWAddress()));
        addr = GetPrevHWAddress();
-       ddl  = AliFMDParameters::kBaseDDL + GetPrevDDLNumber();
+       ddl  = GetPrevDDLNumber();
        len  = l+1; // Need to add one - l points to last valid index
        last = signal;
        break;