]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDmcmSim.cxx
AliTRDCalib.cxx .h -> skip all the event if the initialization is not ok for the...
[u/mrichter/AliRoot.git] / TRD / AliTRDmcmSim.cxx
index 2ec8488a533bedecc2627330b3456003d06826de..c260c53af8f49e81e51e945e366d21962adb124c 100644 (file)
@@ -88,6 +88,14 @@ AliTRDmcmSim::AliTRDmcmSim() :
   // AliTRDmcmSim default constructor
   // By default, nothing is initialized.
   // It is necessary to issue Init before use.
+
+  for (Int_t iDict = 0; iDict < 3; iDict++)
+    fDict[iDict] = 0x0;
+
+  fFitPtr[0] = 0;
+  fFitPtr[1] = 0;
+  fFitPtr[2] = 0;
+  fFitPtr[3] = 0;
 }
 
 AliTRDmcmSim::~AliTRDmcmSim() 
@@ -469,7 +477,7 @@ void AliTRDmcmSim::Draw(Option_t* const option)
       AliTRDtrackletMCM *trkl = (AliTRDtrackletMCM*) (*fTrackletArray)[iTrkl];
       Float_t padWidth = 0.635 + 0.03 * (fDetector % 6);
       Float_t offset   = padWidth/256. * ((((((fRobPos & 0x1) << 2) + (fMcmPos & 0x3)) * 18) << 8) - ((18*4*2 - 18*2 - 3) << 7)); // revert adding offset in FitTracklet
-      Int_t   ndrift   = fTrapConfig->GetDmemUnsigned(0xc025, fDetector, fRobPos, fMcmPos) >> 5; 
+      Int_t   ndrift   = fTrapConfig->GetDmemUnsigned(AliTRDtrapConfig::fgkDmemAddrNdrift, fDetector, fRobPos, fMcmPos) >> 5;
       Float_t slope    = trkl->GetdY() * 140e-4 / ndrift; 
 
       Int_t t0 = fTrapConfig->GetTrapReg(AliTRDtrapConfig::kTPFS);
@@ -668,7 +676,7 @@ Bool_t AliTRDmcmSim::GetHit(Int_t index, Int_t &channel, Int_t &timebin, Int_t &
                         (channel << 8) - ypos) 
     * (0.635 + 0.03 * (fDetector % 6))
     / 256.0;
-  label   = fHits[index].fLabel;
+  label   = fHits[index].fLabel[0];
 
   return kTRUE;
 }
@@ -701,6 +709,8 @@ Int_t AliTRDmcmSim::ProduceRawStream( UInt_t *buf, Int_t bufSize, UInt_t iEv) co
     return 0;
 
   UInt_t  x;
+  UInt_t  mcmHeader = 0;
+  UInt_t  adcMask = 0;
   Int_t   nw  = 0;  // Number of written words
   Int_t   of  = 0;  // Number of overflowed words
   Int_t   rawVer   = fFeeParam->GetRAWversion();
@@ -715,34 +725,38 @@ Int_t AliTRDmcmSim::ProduceRawStream( UInt_t *buf, Int_t bufSize, UInt_t iEv) co
   else 
     adc = fADCF;
   
-  // Produce MCM header
-  x = (1<<31) | (fRobPos << 28) | (fMcmPos << 24) | ((iEv % 0x100000) << 4) | 0xC;
-
-  if (nw < bufSize) {
-    buf[nw++] = x;
-  }
-  else {
-    of++;
-  }
-
   // Produce ADC mask : nncc cccm mmmm mmmm mmmm mmmm mmmm 1100
   //                           n : unused , c : ADC count, m : selected ADCs
-  if( rawVer >= 3 ) {
-    x = 0;
+  if( rawVer >= 3 &&
+      (fTrapConfig->GetTrapReg(AliTRDtrapConfig::kC15CPUA) & (1 << 13))) { // check for zs flag in TRAP configuration
     for( Int_t iAdc = 0 ; iAdc < fgkNADC ; iAdc++ ) {
       if( ~fZSMap[iAdc] != 0 ) { //  0 means not suppressed
-               x = x | (1 << (iAdc+4) );       // last 4 digit reserved for 1100=0xc
-               nActiveADC++;           // number of 1 in mmm....m
+       adcMask |= (1 << (iAdc+4) );    // last 4 digit reserved for 1100=0xc
+       nActiveADC++;           // number of 1 in mmm....m
       }
     }
-       x = x | (1 << 30) | ( ( 0x3FFFFFFC ) & (~(nActiveADC) << 25) ) | 0xC;   // nn = 01, ccccc are inverted, 0xc=1100
 
-    if (nw < bufSize) {
-      buf[nw++] = x;
-    }
-    else {
+    if ((nActiveADC == 0) &&
+       (fTrapConfig->GetTrapReg(AliTRDtrapConfig::kC15CPUA) & (1 << 8))) // check for DEH flag in TRAP configuration
+      return 0;
+
+    // assemble adc mask word
+    adcMask |= (1 << 30) | ( ( 0x3FFFFFFC ) & (~(nActiveADC) << 25) ) | 0xC;   // nn = 01, ccccc are inverted, 0xc=1100
+  }
+
+  // MCM header
+  mcmHeader = (1<<31) | (fRobPos << 28) | (fMcmPos << 24) | ((iEv % 0x100000) << 4) | 0xC;
+  if (nw < bufSize)
+    buf[nw++] = mcmHeader;
+  else
+    of++;
+
+  // ADC mask
+  if( adcMask != 0 ) {
+    if (nw < bufSize)
+      buf[nw++] = adcMask;
+    else
       of++;
-    }
   }
 
   // Produce ADC data. 3 timebins are packed into one 32 bits word
@@ -1141,7 +1155,7 @@ void AliTRDmcmSim::ZSMapping()
   }
 }
 
-void AliTRDmcmSim::AddHitToFitreg(Int_t adc, UShort_t timebin, UShort_t qtot, Short_t ypos, Int_t label
+void AliTRDmcmSim::AddHitToFitreg(Int_t adc, UShort_t timebin, UShort_t qtot, Short_t ypos, Int_t label[])
 {
   // Add the given hit to the fit register which is lateron used for 
   // the tracklet calculation. 
@@ -1172,7 +1186,9 @@ void AliTRDmcmSim::AddHitToFitreg(Int_t adc, UShort_t timebin, UShort_t qtot, Sh
   fHits[fNHits].fQtot = qtot;
   fHits[fNHits].fYpos = ypos;
   fHits[fNHits].fTimebin = timebin;
-  fHits[fNHits].fLabel = label;
+  fHits[fNHits].fLabel[0] = label[0];
+  fHits[fNHits].fLabel[1] = label[1];
+  fHits[fNHits].fLabel[2] = label[2];
   fNHits++;
 }
 
@@ -1188,7 +1204,7 @@ void AliTRDmcmSim::CalcFitreg()
   
   UShort_t timebin, adcch, adcLeft, adcCentral, adcRight, hitQual, timebin1, timebin2, qtotTemp;
   Short_t ypos, fromLeft, fromRight, found;
-  UShort_t qTotal[19]; // the last is dummy
+  UShort_t qTotal[19+1]; // the last is dummy
   UShort_t marked[6], qMarked[6], worse1, worse2;
   
   timebin1 = fTrapConfig->GetTrapReg(AliTRDtrapConfig::kTPFS); 
@@ -1342,16 +1358,16 @@ void AliTRDmcmSim::CalcFitreg()
         ypos = 128*(adcLeft - adcRight) / adcCentral;
         if (ypos < 0) ypos = -ypos;
         // make the correction using the position LUT
-        ypos = ypos + fTrapConfig->GetTrapReg((AliTRDtrapConfig::TrapReg_t) (AliTRDtrapConfig::kTPL00 + (ypos & 0x7F))); 
+        ypos = ypos + fTrapConfig->GetTrapReg((AliTRDtrapConfig::TrapReg_t) (AliTRDtrapConfig::kTPL00 + (ypos & 0x7F)),
+                                             fDetector, fRobPos, fMcmPos);
         if (adcLeft > adcRight) ypos = -ypos;
 
-        // label calculation
-        Int_t mcLabel = -1;
+        // label calculation (up to 3)
+        Int_t mcLabel[] = {-1, -1, -1};
         if (fDigitsManager) {
-          Int_t label[9] = { 0 }; // up to 9 different labels possible
-          Int_t count[9] = { 0 };
-          Int_t maxIdx = -1;
-          Int_t maxCount = 0;
+          const Int_t maxLabels = 9;
+          Int_t label[maxLabels] = { 0 }; // up to 9 different labels possible
+          Int_t count[maxLabels] = { 0 };
           Int_t nLabels = 0;
           Int_t padcol[3]; 
           padcol[0] = fFeeParam->GetPadColFromADC(fRobPos, fMcmPos, adcch);
@@ -1364,26 +1380,29 @@ void AliTRDmcmSim::CalcFitreg()
             for (Int_t iPad = 0; iPad < 3; iPad++) {
               if (padcol[iPad] < 0) 
                 continue;
-              Int_t currLabel = fDict[iDict]->GetData(padrow, padcol[iPad], timebin); //fDigitsManager->GetTrack(iDict, padrow, padcol, timebin, fDetector);
+              Int_t currLabel = fDict[iDict]->GetData(padrow, padcol[iPad], timebin);
              AliDebug(10, Form("Read label: %4i for det: %3i, row: %i, col: %i, tb: %i\n", currLabel, fDetector, padrow, padcol[iPad], timebin));
               for (Int_t iLabel = 0; iLabel < nLabels; iLabel++) {
                 if (currLabel == label[iLabel]) {
                   count[iLabel]++;
-                  if (count[iLabel] > maxCount) {
-                    maxCount = count[iLabel];
-                    maxIdx = iLabel;
-                  }
                   currLabel = -1;
                   break;
                 }
               } 
               if (currLabel >= 0) {
-                label[nLabels++] = currLabel;
+                label[nLabels] = currLabel;
+               count[nLabels] = 1;
+               nLabels++;
               }
             }
           }
-          if (maxIdx >= 0)
-            mcLabel = label[maxIdx];
+         Int_t index[2*maxLabels];
+         TMath::Sort(maxLabels, count, index);
+         for (Int_t i = 0; i < 3; i++) {
+           if (count[index[i]] <= 0)
+             break;
+           mcLabel[i] = label[index[i]];
+         }
         }
 
         // add the hit to the fitregister
@@ -1541,7 +1560,7 @@ void AliTRDmcmSim::FitTracklet()
       nHits   = fit0->fNhits + fit1->fNhits; // number of hits
       sumX    = fit0->fSumX  + fit1->fSumX;
       sumX2   = fit0->fSumX2 + fit1->fSumX2;
-      denom   = nHits*sumX2 - sumX*sumX;
+      denom   = ((Long64_t) nHits)*((Long64_t) sumX2) - ((Long64_t) sumX)*((Long64_t) sumX);
 
       mult    = mult / denom; // exactly like in the TRAP program
       q0      = fit0->fQ0    + fit1->fQ0;
@@ -1629,14 +1648,13 @@ void AliTRDmcmSim::FitTracklet()
         fMCMT[cpu] = (pid << 24) | (padrow << 20) | (slope << 13) | offset;
 
         // calculate MC label
-        Int_t mcLabel = -1;
+        Int_t mcLabel[] = { -1, -1, -1};
        Int_t nHits0 = 0;
        Int_t nHits1 = 0;
         if (fDigitsManager) {
-          Int_t label[30] = {0}; // up to 30 different labels possible
-          Int_t count[30] = {0};
-          Int_t maxIdx = -1;
-          Int_t maxCount = 0;
+         const Int_t maxLabels = 30;
+          Int_t label[maxLabels] = {0}; // up to 30 different labels possible
+          Int_t count[maxLabels] = {0};
           Int_t nLabels = 0;
           for (Int_t iHit = 0; iHit < fNHits; iHit++) {
             if ((fHits[iHit].fChannel - fFitPtr[cpu] < 0) ||
@@ -1651,24 +1669,29 @@ void AliTRDmcmSim::FitTracklet()
                fHits[iHit].fTimebin <  fTrapConfig->GetTrapReg(AliTRDtrapConfig::kTPQE1))
              nHits1++;
 
-            Int_t currLabel = fHits[iHit].fLabel;
-            for (Int_t iLabel = 0; iLabel < nLabels; iLabel++) {
-              if (currLabel == label[iLabel]) {
-                count[iLabel]++;
-                if (count[iLabel] > maxCount) {
-                  maxCount = count[iLabel];
-                  maxIdx = iLabel;
-                }
-                currLabel = -1;
-                break;
-              }
-            }
-            if (currLabel >= 0) {
-              label[nLabels++] = currLabel;
-            }
-          }
-          if (maxIdx >= 0)
-            mcLabel = label[maxIdx];
+           for (Int_t i = 0; i < 3; i++) {
+             Int_t currLabel = fHits[iHit].fLabel[i];
+             for (Int_t iLabel = 0; iLabel < nLabels; iLabel++) {
+               if (currLabel == label[iLabel]) {
+                 count[iLabel]++;
+                 currLabel = -1;
+                 break;
+               }
+             }
+             if (currLabel >= 0 && nLabels < maxLabels) {
+               label[nLabels] = currLabel;
+               count[nLabels]++;
+               nLabels++;
+             }
+           }
+         }
+         Int_t index[2*maxLabels];
+         TMath::Sort(maxLabels, count, index);
+         for (Int_t i = 0; i < 3; i++) {
+           if (count[index[i]] <= 0)
+             break;
+           mcLabel[i] = label[index[i]];
+         }
         }
         new ((*fTrackletArray)[fTrackletArray->GetEntriesFast()]) AliTRDtrackletMCM((UInt_t) fMCMT[cpu], fDetector*2 + fRobPos%2, fRobPos, fMcmPos);
         ((AliTRDtrackletMCM*) (*fTrackletArray)[fTrackletArray->GetEntriesFast()-1])->SetLabel(mcLabel);
@@ -1854,26 +1877,28 @@ Int_t AliTRDmcmSim::GetPID(Int_t q0, Int_t q1)
 
    UInt_t nBinsQ0 = fTrapConfig->GetDmemUnsigned(AliTRDtrapConfig::fgkDmemAddrLUTnbins);  // number of bins in q0 / 4 !!
    UInt_t pidTotalSize = fTrapConfig->GetDmemUnsigned(AliTRDtrapConfig::fgkDmemAddrLUTLength);
+   if(nBinsQ0==0 || pidTotalSize==0)  // make sure we don't run into trouble if one of the values is not configured
+      return 0;
 
    ULong_t corrQ0 = fTrapConfig->GetDmemUnsigned(AliTRDtrapConfig::fgkDmemAddrLUTcor0, fDetector, fRobPos, fMcmPos);
    ULong_t corrQ1 = fTrapConfig->GetDmemUnsigned(AliTRDtrapConfig::fgkDmemAddrLUTcor1, fDetector, fRobPos, fMcmPos);
+   if(corrQ0==0 || corrQ1==0)  // make sure we don't run into trouble if one of the values is not configured
+      return 0;
 
    addrQ0 = corrQ0;
    addrQ0 = (((addrQ0*q0)>>16)>>16); // because addrQ0 = (q0 * corrQ0) >> 32; does not work for unknown reasons
-   //   std::cout << "addrQ0: " << addrQ0 << ", q0: " << q0 << ", corrQ0: " << corrQ0 << std::endl;
 
    if(addrQ0 >= nBinsQ0) {  // check for overflow
-      AliDebug(5,Form("Overflow in q0: %i/4 is bigger then %i", addrQ0, nBinsQ0));
+      AliDebug(5,Form("Overflow in q0: %llu/4 is bigger then %u", addrQ0, nBinsQ0));
       addrQ0 = nBinsQ0 -1;
    } 
 
    addr = corrQ1;
    addr = (((addr*q1)>>16)>>16);
    addr = addrQ0 + nBinsQ0*addr; // because addr = addrQ0 + nBinsQ0* (((corrQ1*q1)>>32); does not work
-   //   std::cout << "addr: " <<  addr << ", q1: " << q1 << ", corrQ1: " << corrQ1 << std::endl;
 
    if(addr >= pidTotalSize) {
-      AliDebug(5,Form("Overflow in q1. Address %i/4 is bigger then %i", addr, pidTotalSize));
+      AliDebug(5,Form("Overflow in q1. Address %llu/4 is bigger then %u", addr, pidTotalSize));
       addr = pidTotalSize -1;
    } 
 
@@ -1885,81 +1910,6 @@ Int_t AliTRDmcmSim::GetPID(Int_t q0, Int_t q1)
 
 
 
-void AliTRDmcmSim::SetPIDLut(TH2F * const lut)
-{
-  // set a user-defined PID LUT from a 2D histogram
-
-   UInt_t nBinsQ0 = lut->GetNbinsX();
-   UInt_t nBinsQ1 = lut->GetNbinsY();
-
-   Double_t scaleQ0 = lut->GetNbinsX() / lut->GetXaxis()->GetXmax();
-   Double_t scaleQ1 = lut->GetNbinsY() / lut->GetYaxis()->GetXmax();
-   fTrapConfig->SetPIDscale(scaleQ0, scaleQ1);
-   SetPIDLutScaleDMEM();
-      
-   UInt_t fPIDsizeX = 0;
-   if(nBinsQ0%4==0)
-      fPIDsizeX=nBinsQ0/4;
-   else
-      fPIDsizeX = (nBinsQ0/4)+1;
-
-   fTrapConfig->SetDmem(AliTRDtrapConfig::fgkDmemAddrLUTnbins, nBinsQ0); // number of bins in q0
-   fTrapConfig->SetDmem(AliTRDtrapConfig::fgkDmemAddrLUTLength, nBinsQ0*nBinsQ1);  // total size of the table in BYTES (does work because each bin is 8 bit wide)
-
-   UInt_t buffer;
-   Int_t dmemAddr=0;
-   if(nBinsQ0*nBinsQ1/4 < AliTRDtrapConfig::fgkDmemAddrLUTEnd - AliTRDtrapConfig::fgkDmemAddrLUTStart)  {  // /4 because each memory address contains 4 LUT entries
-      for (UInt_t iy = 0; iy < nBinsQ1; iy++) {
-        for (UInt_t ix = 0; ix < fPIDsizeX; ix++) {
-           buffer=0;
-           for(UInt_t isub=0; isub<4; isub++) {
-              if(ix*4+isub<nBinsQ0) {
-                 buffer |= ((Int_t) (255. * lut->GetBinContent(ix*4+isub +1, iy +1))) << isub*8 ;
-                 //AliDebug(10, Form("x: %d, y: %d -- %d, %d \n", ix*4+isub, iy, lut->GetBinContent(ix*4+isub, iy), ((Int_t) (255. * lut->GetBinContent(ix*4+isub +1, iy +1)))));
-              }
-              else
-                 buffer |= 0<<isub*8;
-           }
-           dmemAddr = AliTRDtrapConfig::fgkDmemAddrLUTStart+ix+(iy*fPIDsizeX);
-           if(dmemAddr >= AliTRDtrapConfig::fgkDmemAddrLUTEnd) {
-              AliError("LUT table size is too big!");
-           }
-           else {
-              //              AliDebug(8,Form("x: %d, y: %d is memory address %d, setting to %d \n", ix, iy, dmemAddr, buffer));
-              fTrapConfig->SetDmem(AliTRDtrapConfig::fgkDmemAddrLUTStart+ix+(iy*fPIDsizeX), buffer);
-           }
-        }
-      }
-   }
-   else {
-      AliError("LUT table is too big!");
-   }
-}
-
-
-void AliTRDmcmSim::SetPIDLutScaleDMEM()
-{
-  // set scale factor for PID in DMEM
-
-   Double_t scaleQ[2];
-   fTrapConfig->GetPIDscale(scaleQ);
-   
-   ULong64_t scale = 1;
-   scale = scale<<32;
-
-   fTrapConfig->SetDmem(AliTRDtrapConfig::fgkDmemAddrLUTcor0, TMath::Nint(scale*scaleQ[0]));
-   fTrapConfig->SetDmem(AliTRDtrapConfig::fgkDmemAddrLUTcor1, TMath::Nint(scale*scaleQ[1]));
-}
-
-
-void AliTRDmcmSim::SetPIDLut(Int_t* /* lut */, Int_t /* nbinsq0 */, Int_t /* nbinsq1 */)
-{
-   ;
-}
-
-
-
-
 // help functions, to be cleaned up
 
 UInt_t AliTRDmcmSim::AddUintClipping(UInt_t a, UInt_t b, UInt_t nbits) const
@@ -2269,7 +2219,7 @@ void AliTRDmcmSim::PrintFitRegXml(ostream& os) const
        os << "   <c cpu=\"" << cpu << "\">" << std::endl;
        if(fFitPtr[cpu] != 31) {
           for(int adcch=fFitPtr[cpu]; adcch<fFitPtr[cpu]+2; adcch++) {
-             os << "    <ch chnr=\">" << adcch << "\">"<< std::endl;
+             os << "    <ch chnr=\"" << adcch << "\">"<< std::endl;
              os << "     <hits>"   << fFitReg[adcch].fNhits << "</hits>"<< std::endl;
              os << "     <q0>"     << fFitReg[adcch].fQ0/4 << "</q0>"<< std::endl;    // divided by 4 because in simulation we have 2 additional decimal places
              os << "     <q1>"     << fFitReg[adcch].fQ1/4 << "</q1>"<< std::endl;    // in the output 
@@ -2320,7 +2270,7 @@ void AliTRDmcmSim::PrintTrackletsXml(ostream& os) const
 
       }
       os << "      <trk> <pid>" << pid << "</pid>" << " <padrow>" << padrow << "</padrow>" 
-        << " <slope>" << slope << "</slope>" << " <offset>" << offset << "</offset>" << std::endl;
+        << " <slope>" << slope << "</slope>" << " <offset>" << offset << "</offset>" << "</trk>" << std::endl;
    }
 
    os << "    </m>" << std::endl;
@@ -2431,43 +2381,14 @@ void AliTRDmcmSim::PrintPidLutHuman()
    UInt_t nBinsQ0 = fTrapConfig->GetDmemUnsigned(AliTRDtrapConfig::fgkDmemAddrLUTnbins);
 
    std::cout << "nBinsQ0: " << nBinsQ0 << std::endl;
-   std::cout << "LUT table length: " << fTrapConfig->GetDmemUnsigned(AliTRDtrapConfig::fgkDmemAddrLUTLength)/4 << std::endl;
+   std::cout << "LUT table length: " << fTrapConfig->GetDmemUnsigned(AliTRDtrapConfig::fgkDmemAddrLUTLength) << std::endl;
  
    for(UInt_t addr=AliTRDtrapConfig::fgkDmemAddrLUTStart; addr< addrEnd; addr++) {
       result = fTrapConfig->GetDmemUnsigned(addr);
-      std::cout << addr << " # x: " << (addr-AliTRDtrapConfig::fgkDmemAddrLUTStart)%(nBinsQ0/4) << ", y: " <<(addr-AliTRDtrapConfig::fgkDmemAddrLUTStart)/nBinsQ0 << "  #  " <<((result>>0)&0xFF)/255.0 
-               << " | " << ((result>>8)&0xFF)/255.0
-               << " | " << ((result>>16)&0xFF)/255.0 << " | " << ((result>>24)&0xFF)/255.0 << std::endl;
-   }
-}
-
-
-void AliTRDmcmSim::PrintPidLutDatx(ostream& os) const
-{
-  // print PID LUT in datx format (to send to FEE)
-  
-   Double_t scaleQ[2];
-   fTrapConfig->GetPIDscale(scaleQ);
-   
-   ULong64_t scale = 1;
-   scale = scale<<32;
-
-   os << std::setw(5) << 27;          // cmd 
-   os << std::setw(8) << 4;           // scaleQ0
-   os << std::setw(12) << TMath::Nint(scale*scaleQ[0]);  // value
-   os << std::setw(8)  << 1 << std::endl;          // destination
-
-   os << std::setw(5) << 27;          // cmd 
-   os << std::setw(8) << 5;           // scaleQ1
-   os << std::setw(12) << TMath::Nint(scale*scaleQ[1]);  // value
-   os << std::setw(8)  << 1 << std::endl << std::endl;          // destination
-
-   fTrapConfig->PrintMemDatx(os, AliTRDtrapConfig::fgkDmemAddrLUTnbins);
-   fTrapConfig->PrintMemDatx(os, AliTRDtrapConfig::fgkDmemAddrLUTLength);
-
-   UInt_t addrStart = AliTRDtrapConfig::fgkDmemAddrLUTStart;
-   UInt_t addrEnd = addrStart +  (fTrapConfig->GetDmemUnsigned(AliTRDtrapConfig::fgkDmemAddrLUTLength)/4); // divided by 4 because each addr contains four values  
-   for(UInt_t addr=AliTRDtrapConfig::fgkDmemAddrLUTStart; addr< addrEnd; addr++) { 
-      fTrapConfig->PrintMemDatx(os, addr);
+      std::cout << addr << " # x: " << ((addr-AliTRDtrapConfig::fgkDmemAddrLUTStart)%((nBinsQ0)/4))*4 << ", y: " <<(addr-AliTRDtrapConfig::fgkDmemAddrLUTStart)/(nBinsQ0/4)
+               << "  #  " <<((result>>0)&0xFF)
+               << " | "  << ((result>>8)&0xFF)
+               << " | "  << ((result>>16)&0xFF)
+               << " | "  << ((result>>24)&0xFF) << std::endl;
    }
 }