]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
final channel to row col mapping plugged in
authorbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 13 Nov 2006 16:21:56 +0000 (16:21 +0000)
committerbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 13 Nov 2006 16:21:56 +0000 (16:21 +0000)
PMD/AliPMDDDLRawData.cxx
PMD/AliPMDRawStream.cxx
PMD/AliPMDRawStream.h

index 378f7e148f7c30d5d874fae3cf374a70750c3853..2a59aefe4bc43eb31177dddbfada6f1730e5b762 100644 (file)
@@ -535,25 +535,25 @@ void AliPMDDDLRawData::GetMCMCh(Int_t ddlno, Int_t row, Int_t col,
                                Int_t *endRowBus, Int_t *endColBus,
                                Int_t & busno, UInt_t &mcmno, UInt_t &chno)
 {
-  // This part will be modified once the final track layout on the PCB is
-  // designed. This will only change the coordinate of the individual cell
-
-  static const UInt_t kCh[16][4] = { {12, 13, 18, 19},
-                                    {11, 15, 17, 21},
-                                    {10, 14, 16, 22},
-                                    {8, 9, 20, 23},
-                                    {7, 4, 25, 24},
-                                    {6, 0, 30, 26},
-                                    {5, 1, 31, 27},
-                                    {3, 2, 29, 28},
-                                    {44, 45, 50, 51},
-                                    {43, 47, 49, 53},
-                                    {42, 46, 48, 54},
-                                    {40, 41, 52, 55},
-                                    {39, 36, 57, 56},
-                                    {38, 32, 62, 58},
-                                    {37, 33, 63, 59},
-                                    {35, 34, 61, 60} };
+  // This converts row col to hardware channel number
+  // This is the final version of mapping supplied by Mriganka
+
+  static const UInt_t kCh[16][4] = { {56, 58, 59, 57},
+                                    {54, 62, 61, 53},
+                                    {52, 60, 63, 51},
+                                    {48, 50, 55, 49},
+                                    {46, 40, 45, 47},
+                                    {44, 32, 35, 43},
+                                    {42, 34, 33, 41},
+                                    {38, 36, 37, 39},
+                                    {24, 26, 27, 25},
+                                    {22, 30, 29, 21},
+                                    {20, 28, 31, 19},
+                                    {16, 18, 23, 17},
+                                    {14, 8, 13, 15},
+                                    {12, 0, 3, 11},
+                                    {10, 2, 1, 9},
+                                    {6, 4, 5, 7} };
   
   Int_t irownew = row%16;
   Int_t icolnew = col%4;
index cf5ab6b454b523f4d07d78313e20cdec4369ebfe..885f9c937fac146ceaf56d37256a4e0ed6f29503 100644 (file)
@@ -81,19 +81,25 @@ AliPMDRawStream::~AliPMDRawStream()
 
 //_____________________________________________________________________________
 
-void AliPMDRawStream::DdlData(TObjArray *pmdddlcont)
+Bool_t AliPMDRawStream::DdlData(Int_t indexDDL, TObjArray *pmdddlcont)
 {
 // read the next raw digit
 // returns kFALSE if there is no digit left
 
   AliPMDddldata *pmdddldata;
 
-  //  Int_t indexDDL = 0;
-  //  fRawReader->Select(12, indexDDL, indexDDL);
   fRawReader->ReadHeader();
   Int_t  iddl  = fRawReader->GetDDLID();
   Int_t dataSize = fRawReader->GetDataSize();
   Int_t totaldataword = dataSize/4;
+  Int_t equipId = fRawReader->GetEquipmentId();
+
+  if (dataSize <= 0) return kFALSE;
+  if (indexDDL != iddl)
+    {
+      AliError("Mismatch in the DDL index");
+      return kFALSE;
+    }
 
   UInt_t *buffer;
   buffer = new UInt_t[totaldataword];
@@ -106,7 +112,6 @@ void AliPMDRawStream::DdlData(TObjArray *pmdddlcont)
 
   // --- Open the mapping file
 
-
   TString fileName(gSystem->Getenv("ALICE_ROOT"));
   if(iddl == 0)
     {
@@ -171,7 +176,7 @@ void AliPMDRawStream::DdlData(TObjArray *pmdddlcont)
     {
       infile >> modno;
       infile >> totPatchBus >> bPatchBus >> ePatchBus;
-
+      
       for(Int_t i=0; i<totPatchBus; i++)
        {
          infile >> ibus >> totmcm >> rows >> rowe >> cols >> cole;
@@ -185,6 +190,8 @@ void AliPMDRawStream::DdlData(TObjArray *pmdddlcont)
        }
     }
 
+
+
   infile.close();
 
 
@@ -207,16 +214,26 @@ void AliPMDRawStream::DdlData(TObjArray *pmdddlcont)
 
   Int_t ilowLimit = 0;
   Int_t iuppLimit = 0;
+
+  Int_t blRawDataLength = 0;
+  Int_t iwordcount = 0;
+
+
   for (Int_t iblock = 0; iblock < 2; iblock++)
     {
       ilowLimit = iuppLimit;
       iuppLimit = ilowLimit + kblHLen;
 
+
       for (Int_t i = ilowLimit; i < iuppLimit; i++)
        {
          blHeaderWord[i-ilowLimit] = (Int_t) buffer[i];
        }
+
       blockHeader.SetHeader(blHeaderWord);
+
+      blRawDataLength = blockHeader.GetRawDataLength();
+
       for (Int_t idsp = 0; idsp < 5; idsp++)
        {
          ilowLimit = iuppLimit;
@@ -224,6 +241,7 @@ void AliPMDRawStream::DdlData(TObjArray *pmdddlcont)
 
          for (Int_t i = ilowLimit; i < iuppLimit; i++)
            {
+             iwordcount++;
              dspHeaderWord[i-ilowLimit] = (Int_t) buffer[i];
            }
          dspHeader.SetHeader(dspHeaderWord);
@@ -236,6 +254,7 @@ void AliPMDRawStream::DdlData(TObjArray *pmdddlcont)
 
              for (Int_t i = ilowLimit; i < iuppLimit; i++)
                {
+                 iwordcount++;
                  pbusHeaderWord[i-ilowLimit] = (Int_t) buffer[i];
                }
              pbusHeader.SetHeader(pbusHeaderWord);
@@ -250,6 +269,7 @@ void AliPMDRawStream::DdlData(TObjArray *pmdddlcont)
 
              for (Int_t iword = ilowLimit; iword < iuppLimit; iword++)
                {
+                 iwordcount++;
                  data = buffer[iword];
 
                  Int_t isig =  data & 0x0FFF;
@@ -281,17 +301,23 @@ void AliPMDRawStream::DdlData(TObjArray *pmdddlcont)
                  pmdddlcont->Add(pmdddldata);
                  
                } // data word loop
+
+             if (iwordcount == blRawDataLength) break;
+
            } // patch bus loop
 
          if (dspHeader.GetPaddingWord() == 1) iuppLimit++;
+         if (iwordcount == blRawDataLength) break;
 
        } // end of DSP
+      if (iwordcount == blRawDataLength) break;
 
     } // end of BLOCK
 
   
   delete [] buffer;
 
+  return kTRUE;
 }
 //_____________________________________________________________________________
 void AliPMDRawStream::GetRowCol(Int_t ddlno, Int_t pbusid,
@@ -303,14 +329,15 @@ void AliPMDRawStream::GetRowCol(Int_t ddlno, Int_t pbusid,
 // decode: ddlno, patchbusid, mcmno, chno -> um, row, col
 
 
-  static const UInt_t kCh[64] = { 21, 25, 29, 28, 17, 24, 20, 16,
-                                 12, 13, 8, 4, 0, 1, 9, 5,
-                                 10, 6, 2, 3, 14, 7, 11, 15,
-                                 19, 18, 23, 27, 31, 30, 22, 26,
-                                 53, 57, 61, 60, 49, 56, 52, 48,
-                                 44, 45, 40, 36, 32, 33, 41, 37,
-                                 42, 38, 34, 35, 46, 39, 43, 47,
-                                 51, 50, 55, 59, 63, 62, 54, 58 };
+  static const UInt_t kCh[64] = { 53, 58, 57, 54, 61, 62, 60, 63,
+                                 49, 59, 56, 55, 52, 50, 48, 51,
+                                 44, 47, 45, 43, 40, 39, 36, 46,
+                                 32, 35, 33, 34, 41, 38, 37, 42,
+                                 21, 26, 25, 22, 29, 30, 28, 31,
+                                 17, 27, 24, 23, 20, 18, 16, 19,
+                                 12, 15, 13, 11,  8,  7,  4, 14,
+                                 0,   3,  1,  2,  9,  6,  5, 10 };
+
 
   Int_t rowcol  = kCh[chno];
   Int_t irownew = rowcol/4;
index 002c158e103765c3752a20f6b30ceca924f4734e..38aea85b166e5d310f0b3169a31699cf3d352206 100644 (file)
@@ -21,7 +21,7 @@ class AliPMDRawStream: public TObject {
     AliPMDRawStream(AliRawReader* rawReader);
     virtual ~AliPMDRawStream();
 
-    void DdlData(TObjArray *pmdddlcont);
+    Bool_t DdlData(Int_t indexDDL, TObjArray *pmdddlcont);
 
     enum {kDDLOffset = 0xC00};      // offset for DDL numbers
 
@@ -41,7 +41,7 @@ class AliPMDRawStream: public TObject {
     AliRawReader*    fRawReader;    // object for reading the raw data
 
 
-    ClassDef(AliPMDRawStream, 2)    // class for reading PMD raw digits
+    ClassDef(AliPMDRawStream, 3)    // class for reading PMD raw digits
 };
 
 #endif