]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDRawStream.h
Fixes for reading zero-suppressed data. Also fixes to simulated raw
[u/mrichter/AliRoot.git] / FMD / AliFMDRawStream.h
index c2fa594310230080a538e20dfc0828107b085c4e..68fda921335b5029b14b606dd333f76cf1103403 100644 (file)
@@ -1,53 +1,65 @@
-// -*- mode: c++ -*- 
-//
-// 
 #ifndef ALIFMDRAWSTREAM_H
 #define ALIFMDRAWSTREAM_H
-
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
+ * reserved. 
+ *
+ * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
+ *
+ * See cxx source for full Copyright notice                               
+ */
+//____________________________________________________________________
+//
+// Class to read ALTRO formated data from an AliRawReader.  
+// This class is mostly here to set AliAltroRawStream::fNoAltroMapping
+// to false.   Furthermore, it defines the utility function
+// ReadChannel to read in a full ALTRO channel.  The data is unpacked
+// into the passed array.  
+//
+/** @file    AliFMDRawStream.h
+    @author  Christian Holm Christensen <cholm@nbi.dk>
+    @date    Tue Mar 28 12:53:26 2006
+    @brief   Class to read ALTRO formated data from an AliRawReader. 
+*/
 #ifndef ALIALTRORAWSTREAM_H
 # include <AliAltroRawStream.h>
 #endif 
 
 
-// TPC to FMD translations 
-// 
-//    TPC                FMD
-//    ----------+-----------
-//    pad+time  |      strip
-//    row       |     sector
-//    sector    |       ring
-// 
+/** @class AliFMDRawStream 
+    @brief Class to read ALTRO formated data from an AliRawReader.  
+    This class is mostly here to set
+    AliAltroRawStream::fNoAltroMapping to false.   Furthermore, it
+    defines the utility function ReadChannel to read in a full ALTRO
+    channel.  The data is unpacked into the passed array. 
+ */
 class AliFMDRawStream : public AliAltroRawStream 
 {
-private:
-  UShort_t fSampleRate; // # of ALTRO samples per VA1_ALICE clock
-  // UChar_t* fMyData;
-  // Int_t    fMyPosition;
-  // Int_t    fMyCount;
-  // Int_t    fMyBunchLength;
-  Int_t    fPrevTime;
-protected:
-  // UShort_t Get10BitWord(UChar_t* buffer, Int_t position) const;
 public:
+  /** Constructor 
+      @param reader Raw reader to use */
   AliFMDRawStream(AliRawReader* reader);
+  /** Destructor  */
+  virtual ~AliFMDRawStream() {}
 
-  Short_t Sector()      const { return fRow; }
-  Char_t  Ring()        const { return (fSector == 0 ? 'I' : 'O'); }
-  Short_t Strip()       const { return fPad + fTime / fSampleRate; }
-  Short_t PrevSector()  const { return fPrevRow; }
-  Char_t  PrevRing()    const { return (fPrevSector == 0 ? 'I' : 'O'); }
-  Short_t PrevStrip()   const { return fPrevPad + fPrevTime/fSampleRate; }
-
-  Bool_t  IsNewRing()   const { return (fSector != fPrevSector); }
-  Bool_t  IsNewSector() const { return (fRow != fPrevRow) || IsNewRing(); }
-  Bool_t  IsNewStrip()  const { return(Strip() != PrevStrip())||IsNewSector();}
-    
-  Short_t Count()      const { return fSignal; }
-  Short_t SampleRate() const { return fSampleRate; }
-  
-  virtual Bool_t   Next();
+  /** Read one ALTRO channel from the raw reader
+      @param ddl  On return, the DDL
+      @param addr On return, the hardware address
+      @param len  On return, the number of entries filled in @a data
+      @param data On return, the read ADC channels.
+      @return @c true on success */
+  virtual Bool_t ReadChannel(UInt_t& ddl, UInt_t& addr, 
+                            UInt_t& len, volatile UShort_t* data);
+protected:
   
   ClassDef(AliFMDRawStream, 0) // Read raw FMD Altro data 
 };
 
 #endif
+//____________________________________________________________________
+//
+// Local Variables:
+//   mode: C++
+// End:
+//
+// EOF
+//