]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/scripts/TestAltroMapping.C
Fixes for reading zero-suppressed data. These should be propagated to
[u/mrichter/AliRoot.git] / FMD / scripts / TestAltroMapping.C
index 23722e79ec90bfc85fa0f780d0b3c73b7fef5a66..08b751d711915d0262efb4c1eab224422b95a551 100644 (file)
 # include <FMD/AliFMDAltroMapping.h>
 // # include <FMD/AliFMDUShortMap.h>
 // # include <FMD/AliFMDBoolMap.h>
+# include <AliLog.h>
 # include <TError.h>
 # include <iostream>
 #endif
-#define SHOW_ALL 1
+bool show_all=false;
+
 //____________________________________________________________________
 /** @ingroup ALTRO_test
     @param ddl 
@@ -112,25 +114,28 @@ CheckTrans(UShort_t det, Char_t ring, UShort_t sec, UShort_t str, UShort_t sam,
     ok = false;
     Warning("TestHWMap", "Sample # differ %d != %d", sam, osam);
   }
-#ifndef SHOW_ALL
-  if (!ok) 
-    PrintTrans(det,ring,sec,str,sam,
-              ddl,hwaddr,timebin,
-              odet,oring,osec,ostr,osam);
-#endif
+
+  if (!show_all) { 
+    if (!ok) 
+      PrintTrans(det,ring,sec,str,sam,
+                ddl,hwaddr,timebin,
+                odet,oring,osec,ostr,osam);
+  }
 }
 
 //____________________________________________________________________
 /** @ingroup ALTRO_test
  */
 void
-TestAltroMapping(Int_t min=2, Int_t max=0)
+TestAltroMapping(bool sa=false, Int_t min=1, Int_t max=3)
 {
+  show_all = sa;
+  // AliLog::SetModuleDebugLevel("FMD", 1);
   // if (min < 1 || min > 3) min = 1;
   if (max < min)          max = min;
   // AliFMDParameters* param = AliFMDParameters::Instance();
   AliFMDAltroMapping m;
-  UShort_t presamp  = 0;
+  UShort_t presamp  = 19;
   UShort_t oversamp = 4;
 
   for (UShort_t det = min; det <= max; det++) {
@@ -141,7 +146,7 @@ TestAltroMapping(Int_t min=2, Int_t max=0)
       for (UShort_t sec = 0; sec < nsec; sec++) {
        for (Short_t str = 0; str < nstr; str ++ /*= 128*/) {
          for(UShort_t sam = 0; sam < oversamp; sam++) {
-           UInt_t ddl, hwaddr;
+           UShort_t ddl, hwaddr;
            UShort_t timebin;
            if (!m.Detector2Hardware(det, ring, sec, str, sam, 
                                     presamp, oversamp, 
@@ -160,11 +165,10 @@ TestAltroMapping(Int_t min=2, Int_t max=0)
                      Addr2Str(ddl, hwaddr, timebin));
              continue;
            }
-#ifdef SHOW_ALL
-           PrintTrans(det,ring,sec,str,sam,
-                      ddl,hwaddr,timebin,
-                      odet,oring,osec,ostr,osam);
-#endif
+           if (show_all) 
+             PrintTrans(det,ring,sec,str,sam,
+                        ddl,hwaddr,timebin,
+                        odet,oring,osec,ostr,osam);
            CheckTrans(det,ring,sec,str,sam,
                       ddl,hwaddr,timebin,
                       odet,oring,osec,ostr,osam);