]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSRawStreamSDDBeamTest.cxx
Method AliITSRawStream::GetJitter is defined const as it should be. Classes AliITSRaw...
[u/mrichter/AliRoot.git] / ITS / AliITSRawStreamSDDBeamTest.cxx
similarity index 69%
rename from ITS/AliITSRawStreamSDDv2.cxx
rename to ITS/AliITSRawStreamSDDBeamTest.cxx
index efc54485fb2d3548a68d4ca1deb8c7e6dd95ba46..46dab01446274a252a16620841b4d7d6bc8b1f87 100644 (file)
@@ -1,5 +1,5 @@
 /**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
  * Author: The ALICE Off-line Project.                                    *
  * Contributors are mentioned in the code where appropriate.              *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/* $Id: $*/
 
 ///////////////////////////////////////////////////////////////////////////////
 ///
-/// This class provides access to ITS SDD digits in test beam raw data,
-/// for beam test of August 2004
+/// This class provides access to ITS SDD digits in beam test raw data
 ///
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "AliITSRawStreamSDDv2.h"
+#include "AliLog.h"
+#include "AliITSRawStreamSDDBeamTest.h"
 #include "AliRawReader.h"
 
-ClassImp(AliITSRawStreamSDDv2)
 
+ClassImp(AliITSRawStreamSDDBeamTest)
+  
+const UInt_t AliITSRawStreamSDDBeamTest::fgkCodeLength[8] =  {8, 18, 2, 3, 4, 5, 6, 7};
 
-AliITSRawStreamSDDv2::AliITSRawStreamSDDv2(AliRawReader* rawReader) :
-  AliITSRawStreamSDD(rawReader)
-    
+//______________________________________________________________________
+AliITSRawStreamSDDBeamTest::AliITSRawStreamSDDBeamTest(AliRawReader* rawReader) :
+  AliITSRawStream(rawReader),
+fData(0),
+fSkip(0),
+fEventId(0),
+fCarlosId(-1),
+fChannel(0),
+fJitter(0)
 {
 // create an object to read ITS SDD raw digits
-
-
   fRawReader->Reset();
   fRawReader->SelectEquipment(17, 204, 204);
+
+
+}
+
+//______________________________________________________________________
+UInt_t AliITSRawStreamSDDBeamTest::ReadBits()
+{
+// read bits from the given channel
+  UInt_t result = (fChannelData[fCarlosId][fChannel] & ((1<<fReadBits[fCarlosId][fChannel]) - 1));
+  fChannelData[fCarlosId][fChannel] >>= fReadBits[fCarlosId][fChannel]; 
+  fLastBit[fCarlosId][fChannel] -= fReadBits[fCarlosId][fChannel];
+  return result;
 }
 
+//______________________________________________________________________
+Int_t AliITSRawStreamSDDBeamTest::DecompAmbra(Int_t value) const
+{
+  // AMBRA decompression (from 8 to 10 bit)
+  
+  if ((value & 0x80) == 0) {
+    return value & 0x7f;
+  } else if ((value & 0x40) == 0) {
+    return 0x081 + ((value & 0x3f) << 1);
+  } else if ((value & 0x20) == 0) {
+    return 0x104 + ((value & 0x1f) << 3);
+  } else {
+    return 0x208 + ((value & 0x1f) << 4);
+  }
+  
+}
 
-Bool_t AliITSRawStreamSDDv2::Next()
+//______________________________________________________________________
+Bool_t AliITSRawStreamSDDBeamTest::Next()
 {
 // read the next raw digit
 // returns kFALSE if there is no digit left
 
   // skip the first 8 words
-  while (fSkip[0] < 8) {
+  while (fSkip < 8) {
     if (!fRawReader->ReadNextInt(fData)) return kFALSE;
     if ((fData >> 30) == 0x01) continue;  // JTAG word
-    if (fSkip[0] == 4) {
+    if (fSkip == 4) {
       if (fData != 0) {
        Error("Next", "data not valid: %8.8d", fData);
        return kFALSE;
       }
     }
-    fSkip[0]++;
+    fSkip++;
   }
 
   while (kTRUE) {
@@ -121,3 +157,5 @@ Bool_t AliITSRawStreamSDDv2::Next()
 }
 
 
+
+