]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDDDLRawData.cxx
Using raw-data error log class in order to store data decoding errors.
[u/mrichter/AliRoot.git] / PMD / AliPMDDDLRawData.cxx
index 83fe31458928e045b0b8c426db3cd304e6c65e63..bdad7821105e52eb8620e171d66e010393eb2911 100644 (file)
@@ -355,12 +355,13 @@ void AliPMDDDLRawData::GetUMDigitsData(TTree *treeD, Int_t imodule,
                                       UInt_t busPatch[][1536])
 {
   // Retrives digits data UnitModule by UnitModule
+
   UInt_t baseword;
   UInt_t mcmno, chno;
   UInt_t adc;
   Int_t  det, smn, irow, icol;
   Int_t  parity;
-
+  
   const Int_t kMaxBus = 50;
   Int_t totPatchBus, bPatchBus, ePatchBus;
   Int_t ibus, totmcm, rows, cols, rowe, cole;
@@ -391,10 +392,6 @@ void AliPMDDDLRawData::GetUMDigitsData(TTree *treeD, Int_t imodule,
       modulePerDDL = 12;
     }
 
-
-
-
-
   TString fileName(gSystem->Getenv("ALICE_ROOT"));
 
   if(ddlno == 0)
@@ -519,9 +516,6 @@ void AliPMDDDLRawData::TransformS2H(Int_t smn, Int_t &irow, Int_t &icol)
       icolnew = icol;
     }
 
-  // In the new geometry always Geant (0,0) and Hardware (0,0) start
-  // from the top left corner
-
   irow = irownew;
   icol = icolnew;
 
@@ -561,8 +555,8 @@ void AliPMDDDLRawData::GetMCMCh(Int_t ddlno, Int_t row, Int_t col,
   Int_t icolnew = col%4;
   
   chno  = kCh[irownew][icolnew];
-
-
+  
+  
   for (Int_t ibus = beginPatchBus; ibus <= endPatchBus; ibus++)
     {
       Int_t srow = startRowBus[ibus];
@@ -573,109 +567,103 @@ void AliPMDDDLRawData::GetMCMCh(Int_t ddlno, Int_t row, Int_t col,
       if ((row >= srow && row <= erow) && (col >= scol && col <= ecol))
        {
          busno = ibus;
-
+         
          // Find out the MCM Number
          //
-
+         
          if (ddlno == 0 || ddlno == 1)
            {
              // PRE plane, SU Mod = 0, 1
-             Int_t rowdiff = endRowBus[ibus] - startRowBus[ibus];
-             if(rowdiff > 16)
+             mcmno = (col-scol)/4;
+             
+           }
+         else if (ddlno == 2 || ddlno == 3)
+           {
+             // PRE plane,  SU Mod = 2, 3
+             Int_t icolnew = (col - scol)/4;
+             mcmno = tmcm - 1 - icolnew;
+           }
+         else if (ddlno == 4 )
+           {
+             // CPV plane,  SU Mod = 0, 3 : ddl = 4
+             
+             if(ibus <= 17)
                {
                  Int_t midrow = srow + 16;
                  if(row >= srow && row < midrow)
                    {
                      mcmno = 12 + (col-scol)/4;
                    }
-                 else if(row >= midrow && row < erow)
+                 else if(row >= midrow && row <= erow)
+                 
                    {
                      mcmno = (col-scol)/4;
                    }
                }
-             else
-               {
-                 mcmno = (col-scol)/4;
-               }
-           } // end of ddl 0 and 1
-         else if (ddlno == 2)
-           {
-             // PRE plane,  SU Mod = 2
              
-             Int_t icolnew = (col - scol)/4;
-             mcmno = tmcm - 1 - icolnew;
-           }
-         else if (ddlno == 3)
-           {
-             // PRE plane,  SU Mod = 3
-             
-             Int_t icolnew = (col - scol)/4;
-             mcmno = tmcm - 1 - icolnew;
-           }
-         else if (ddlno == 4)
-           {
-             // CPV plane,  SU Mod = 0, 3 : ddl = 4
-             
-             if(ibus <= 20)
+             else if (ibus > 17)
                {
                  Int_t rowdiff = endRowBus[ibus] - startRowBus[ibus];
                  if(rowdiff > 16)
                    {
                      Int_t midrow = srow + 16;
-                     if(row >= srow && row < midrow)
+                     if (row >= midrow && row <= erow)
                        {
-                         mcmno = 12 + (col-scol)/4;
+                         mcmno = 12 + (ecol -col)/4;
                        }
-                     else if(row >= midrow && row < erow)
+                     else if (row >= srow && row < midrow)
                        {
-                         mcmno = (col-scol)/4;
+                         mcmno = (ecol - col)/4;
                        }
                    }
-                 else
+                 else if (rowdiff < 16) 
                    {
-                     mcmno = (col-scol)/4;
-                   }
-               }
-             else if (ibus > 20)
-               {
-                 Int_t icolnew = (col - scol)/4;
-                 mcmno = tmcm - 1 - icolnew;
+                     mcmno = (ecol - col)/4;
+                   } 
                }
            }
-         else if (ddlno == 5)
+         else if ( ddlno == 5)
            {
-             // CPV plane,  SU Mod = 2, 1 : ddl = 5
+             // CPV plane,  SU Mod = 0, 3 : ddl = 4
+             
+             if(ibus <= 17)
+               {
+                 Int_t midrow = srow + 16;
+                 if(row >= srow && row < midrow)
+                   {
+                     mcmno = 12 + (col-scol)/4;
+                   }
+                 else if(row >= midrow && row <= erow)
+                   {
+                     mcmno = (col-scol)/4;
+                   }
+               }
              
-             if(ibus <= 20)
+             else if (ibus > 17)
                {
                  Int_t rowdiff = endRowBus[ibus] - startRowBus[ibus];
                  if(rowdiff > 16)
                    {
                      Int_t midrow = srow + 16;
-                     if(row >= srow && row < midrow)
+                     if (row >= midrow && row <= erow)
                        {
-                         mcmno = 12 + (col-scol)/4;
+                         mcmno = 12 + (ecol -col)/4;
                        }
-                     else if(row >= midrow && row < erow)
+                     else if (row >= srow && row < midrow)
                        {
-                         mcmno = (col-scol)/4;
+                         mcmno = (ecol - col)/4;
                        }
                    }
-                 else
+                 else if (rowdiff < 16) 
                    {
-                     mcmno = (col-scol)/4;
-                   }
-               }
-             else if (ibus > 20)
-               {
-                 Int_t icolnew = (col - scol)/4;
-                 mcmno = tmcm - 1 - icolnew;
+                     mcmno = (ecol - col)/4;
+                   } 
                }
            }
-       }  
+       }
     }
-  
-}
+} 
+
 //____________________________________________________________________________
 
 Int_t AliPMDDDLRawData::ComputeParity(UInt_t baseword)
@@ -693,4 +681,3 @@ Int_t AliPMDDDLRawData::ComputeParity(UInt_t baseword)
 }
 
 //____________________________________________________________________________
-