]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Modification of the calibration software
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Jun 2008 15:15:17 +0000 (15:15 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Jun 2008 15:15:17 +0000 (15:15 +0000)
(better treatment of zerro suppressed data)
+
Modifications due to the new RCU firmware

(Jens Wiechula)

AliTPCCalibCE.cxx.diff      Added functionality to set the peak finding range, noise thresholds and specify whether the data are zero suppressed.
AliTPCCalibCE.h.diff        Added functionality to set the peak finding range, noise thresholds and specify whether the data are zero suppressed.
AliTPCCalibPulser.cxx.diff  Added functionality to specify whether the data are zero suppressed.
AliTPCCalibPulser.h.diff    Added functionality to specify whether the data are zero suppressed.
AliTPCMonitorAltro.h.diff   Added support for the new RCU firmware.
AliTPCMonitor.cxx.diff      Remove baseline and noise calculation to speed up code, fix problem reading zero suppressed data.

TPC/AliTPCCalibCE.cxx
TPC/AliTPCCalibCE.h
TPC/AliTPCCalibPulser.cxx
TPC/AliTPCCalibPulser.h
TPC/AliTPCMonitor.cxx
TPC/AliTPCMonitorAltro.h

index ac8df4239a29c17901cabc8b8503ca203fd36805..4d368e29f06477bb8896c76fe88c50e416adf1fa 100644 (file)
@@ -275,6 +275,7 @@ END_HTML */
 #include <TFile.h>
 
 //AliRoot includes
+#include "AliLog.h"
 #include "AliRawReader.h"
 #include "AliRawReaderRoot.h"
 #include "AliRawReaderDate.h"
@@ -308,6 +309,11 @@ AliTPCCalibCE::AliTPCCalibCE() :
     fNbinsRMS(100),
     fXminRMS(0.1),
     fXmaxRMS(5.1),
+    fPeakMinus(2),
+    fPeakPlus(3),
+    fNoiseThresholdMax(5.),
+    fNoiseThresholdSum(8.),
+    fIsZeroSuppressed(kFALSE),
     fLastSector(-1),
     fROC(AliTPCROC::Instance()),
     fMapping(NULL),
@@ -363,6 +369,7 @@ AliTPCCalibCE::AliTPCCalibCE() :
     // AliTPCSignal default constructor
     //
 //    fHTime0 = new TH1F("hTime0Event","hTime0Event",(fLastTimeBin-fFirstTimeBin)*10,fFirstTimeBin,fLastTimeBin);
+    fParam->Update();
 }
 //_____________________________________________________________________
 AliTPCCalibCE::AliTPCCalibCE(const AliTPCCalibCE &sig) :
@@ -378,6 +385,11 @@ AliTPCCalibCE::AliTPCCalibCE(const AliTPCCalibCE &sig) :
     fNbinsRMS(sig.fNbinsRMS),
     fXminRMS(sig.fXminRMS),
     fXmaxRMS(sig.fXmaxRMS),
+    fPeakMinus(sig.fPeakMinus),
+    fPeakPlus(sig.fPeakPlus),
+    fNoiseThresholdMax(sig.fNoiseThresholdMax),
+    fNoiseThresholdSum(sig.fNoiseThresholdSum),
+    fIsZeroSuppressed(sig.fIsZeroSuppressed),
     fLastSector(-1),
     fROC(AliTPCROC::Instance()),
     fMapping(NULL),
@@ -509,6 +521,7 @@ AliTPCCalibCE::AliTPCCalibCE(const AliTPCCalibCE &sig) :
     fVEventTime.SetElements(sig.fVEventTime.GetMatrixArray());
     fVEventNumber.SetElements(sig.fVEventNumber.GetMatrixArray());
 
+    fParam->Update();
 }
 //_____________________________________________________________________
 AliTPCCalibCE& AliTPCCalibCE::operator = (const  AliTPCCalibCE &source)
@@ -568,6 +581,11 @@ Int_t AliTPCCalibCE::Update(const Int_t icsector,
     // assumes that it is looped over consecutive time bins of one pad
     //
 
+    //temp
+//    if (icsector<36) return 0;
+//    if (icsector%36>17) return 0;
+
+
   if (icRow<0) return 0;
   if (icPad<0) return 0;
   if (icTimeBin<0) return 0;
@@ -617,7 +635,7 @@ void AliTPCCalibCE::FindPedestal(Float_t part)
        }
 
        if ( fPedestalROC&&fPadNoiseROC ){
-           fPadPedestal = fPedestalROC->GetValue(fCurrentChannel);
+           fPadPedestal = fPedestalROC->GetValue(fCurrentChannel)*fIsZeroSuppressed;
            fPadNoise    = fPadNoiseROC->GetValue(fCurrentChannel);
             noPedestal   = kFALSE;
        }
@@ -627,6 +645,9 @@ void AliTPCCalibCE::FindPedestal(Float_t part)
     //if we are not running with pedestal database, or for the current sector there is no information
     //available, calculate the pedestal and noise on the fly
     if ( noPedestal ) {
+       fPadPedestal = 0;
+       fPadNoise    = 0;
+        if ( fIsZeroSuppressed ) return;
        const Int_t kPedMax = 100;  //maximum pedestal value
        Float_t  max    =  0;
        Float_t  maxPos =  0;
@@ -672,8 +693,6 @@ void AliTPCCalibCE::FindPedestal(Float_t part)
                rms  +=histo[median+idelta]*(median+idelta)*(median+idelta);
            }
        }
-       fPadPedestal = 0;
-       fPadNoise    = 0;
        if ( count > 0 ) {
            mean/=count;
            rms    = TMath::Sqrt(TMath::Abs(rms/count-mean*mean));
@@ -693,7 +712,7 @@ void AliTPCCalibCE::FindCESignal(TVectorD &param, Float_t &qSum, const TVectorF
 
     Float_t ceQmax  =0, ceQsum=0, ceTime=0, ceRMS=0;
     Int_t   cemaxpos       = 0;
-    Float_t ceSumThreshold = 8.*fPadNoise;  // threshold for the signal sum
+    Float_t ceSumThreshold = fNoiseThresholdSum*fPadNoise;  // threshold for the signal sum
     const Int_t    kCemin  = 4;             // range for the analysis of the ce signal +- channels from the peak
     const Int_t    kCemax  = 7;
 
@@ -768,12 +787,12 @@ void AliTPCCalibCE::FindLocalMaxima(TVectorF &maxima)
     //
     // Find local maxima on the pad signal and Histogram them
     //
-  Float_t ceThreshold = 5.*TMath::Max(fPadNoise,Float_t(1.));  // threshold for the signal
+  Float_t ceThreshold = fNoiseThresholdMax*TMath::Max(fPadNoise,Float_t(1.));  // threshold for the signal
     Int_t   count       = 0;
-    Int_t   tminus      = 2;
-    Int_t   tplus       = 3;
-    for (Int_t i=fLastTimeBin-tplus-1; i>=fFirstTimeBin+tminus; --i){
-       if ( (fPadSignal[i]-fPadPedestal)>ceThreshold && IsPeak(i,tminus,tplus) ){
+//    Int_t   tminus      = 2;
+//    Int_t   tplus       = 3;
+    for (Int_t i=fLastTimeBin-fPeakPlus-1; i>=fFirstTimeBin+fPeakMinus; --i){
+       if ( (fPadSignal[i]-fPadPedestal)>ceThreshold && IsPeak(i,fPeakMinus,fPeakPlus) ){
          if (count<maxima.GetNrows()){
            maxima.GetMatrixArray()[count++]=i;
            GetHistoTmean(fCurrentSector,kTRUE)->Fill(i);
@@ -795,6 +814,8 @@ void AliTPCCalibCE::ProcessPad()
     FindLocalMaxima(maxima);
     if ( (fNevents == 0) || (fOldRunNumber!=fRunNumber) ) return;  // return because we don't have Time0 info for the CE yet
 
+    if ( !GetTMeanEvents(fCurrentSector) ) return; //return if we don't have time 0 info, eg if only one side has laser
+
     TVectorD param(3);
     Float_t  qSum;
     FindCESignal(param, qSum, maxima);
@@ -835,6 +856,8 @@ void AliTPCCalibCE::EndEvent()
     //check if last pad has allready been processed, if not do so
     if ( fMaxTimeBin>-1 ) ProcessPad();
 
+//    AliDebug(5,
+
     TVectorD param(3);
     TMatrixD dummy(3,3);
 //    TVectorF vMeanTime(72);
@@ -863,8 +886,9 @@ void AliTPCCalibCE::EndEvent()
        TH1S *hMeanT    = GetHistoTmean(iSec); //histogram with local maxima position information
        if ( !hMeanT ) continue;
         //continue if not enough data is filled in the meanT histogram. This is the case if we do not have a laser event.
-        if ( hMeanT->GetEntries() < fROC->GetNChannels(iSec)*2/3 ){
-          hMeanT->Reset();
+       if ( hMeanT->GetEntries() < fROC->GetNChannels(iSec)*2/3 ){
+           hMeanT->Reset();
+           AliDebug(3,Form("Skipping sec. '%02d': Not enough statistics\n",iSec));
           continue;
         }
 
@@ -1061,24 +1085,24 @@ Bool_t AliTPCCalibCE::ProcessEventFast(AliTPCRawStreamFast *rawStreamFast)
   ResetEvent();
   Bool_t withInput = kFALSE;
   while ( rawStreamFast->NextDDL() ){
-      while ( rawStreamFast->NextChannel() ){
-         Int_t isector  = rawStreamFast->GetSector();                       //  current sector
-         Int_t iRow     = rawStreamFast->GetRow();                          //  current row
-         Int_t iPad     = rawStreamFast->GetPad();                          //  current pad
-
-         while ( rawStreamFast->NextBunch() ){
-            Int_t startTbin = (Int_t)rawStreamFast->GetStartTimeBin();
-            Int_t endTbin = (Int_t)rawStreamFast->GetEndTimeBin();
-            for (Int_t iTimeBin = startTbin; iTimeBin < endTbin; iTimeBin++){
-                 Float_t signal=(Float_t)rawStreamFast->GetSignals()[iTimeBin-startTbin];
-                 Update(isector,iRow,iPad,iTimeBin+1,signal);
-                 withInput = kTRUE;
-             }
-         }
+    while ( rawStreamFast->NextChannel() ){
+      Int_t isector  = rawStreamFast->GetSector();                       //  current sector
+      Int_t iRow     = rawStreamFast->GetRow();                          //  current row
+      Int_t iPad     = rawStreamFast->GetPad();                          //  current pad
+
+      while ( rawStreamFast->NextBunch() ){
+        Int_t startTbin = (Int_t)rawStreamFast->GetStartTimeBin();
+        Int_t endTbin = (Int_t)rawStreamFast->GetEndTimeBin();
+        for (Int_t iTimeBin = startTbin; iTimeBin < endTbin; iTimeBin++){
+          Float_t signal=(Float_t)rawStreamFast->GetSignals()[iTimeBin-startTbin];
+         Update(isector,iRow,iPad,iTimeBin+1,signal);
+         withInput = kTRUE;
+       }
       }
+    }
   }
   if (withInput){
-      EndEvent();
+    EndEvent();
   }
   return withInput;
 }
index 29f6c8abd25eb4cbcbae7400545bfa1d54ea909a..b7a8ffd1a30c5894d9aa2408eeafdd03e3e3aee3 100644 (file)
@@ -72,6 +72,11 @@ public:
     const Float_t GetMeanQrms() {return fMeanQrms;}
     const Float_t GetMeanRMSrms() {return fMeanRMSrms;}
 
+    const Int_t   GetPeakDetectionMinus(){return fPeakMinus;}
+    const Int_t   GetPeakDetectionPlus(){return fPeakPlus;}
+    const Float_t GetNnoiseThresholdMax() {return fNoiseThresholdMax;}
+    const Float_t GetNnoiseThresholdSum() {return fNoiseThresholdSum;}
+
     TH1S* GetHistoTmean(Int_t sector, Bool_t force=kFALSE);           // get refernce histogram
 
     //needed here to merge ClibCE objects
@@ -94,6 +99,10 @@ public:
     void  SetRangeRefT0 (Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsT0  = nBins; fXminT0  = xMin; fXmaxT0  = xMax; }   //Set range for T0 reference histograms
     void  SetRangeRefRMS(Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsRMS = nBins; fXminRMS = xMin; fXmaxRMS = xMax; }   //Set range for T0 reference histograms
     //
+    void  SetRangePeakDetection(Int_t minus, Int_t plus) { fPeakMinus=minus; fPeakPlus=plus;}
+    void  SetNnoiseThresholdMax(Float_t n) {fNoiseThresholdMax=n;}
+    void  SetNnoiseThresholdSum(Float_t n) {fNoiseThresholdSum=n;}
+    //
     void  SetTimeStampEvent(Double_t timestamp){ fTimeStamp = timestamp; }
     void  SetRunNumber(Double_t eventnumber){ fRunNumber = eventnumber; }
 
@@ -103,11 +112,16 @@ public:
 
     void  SetPedestalDatabase(AliTPCCalPad *pedestalTPC, AliTPCCalPad *padNoiseTPC) {fPedestalTPC = pedestalTPC; fPadNoiseTPC = padNoiseTPC;}
 
+    void  SetIsZeroSuppressed(Bool_t zs=kTRUE) { fIsZeroSuppressed=zs; }
+
     Int_t GetFirstTimeBin()   const { return fFirstTimeBin;  }
     Int_t GetLastTimeBin()    const { return fLastTimeBin;   }
 
     Int_t GetNeventsProcessed() const { return fNevents; }
 
+    Bool_t GetIsZeroSuppressed() const { return fIsZeroSuppressed; }
+
+
     void Merge(AliTPCCalibCE *ce);
 
     TGraph *MakeGraphTimeCE(Int_t sector, Int_t xVariable=0, Int_t fitType=0, Int_t fitParameter=0);
@@ -128,6 +142,12 @@ private:
     Int_t   fNbinsRMS;                //  Number of bins for T0 reference histogram
     Float_t fXminRMS;                 //  xmin   of T0 reference histogram
     Float_t fXmaxRMS;                 //  xmax   of T0 reference histogram
+    Int_t   fPeakMinus;               //  Consecutive timebins on rising edge to be regarded as a signal
+    Int_t   fPeakPlus;                //  Consecutive timebins on falling edge to be regarded as a signal
+    Float_t fNoiseThresholdMax;       //  Analysis Treshold for signal finding: Max>fNoiseThresholdMax*PadNoise
+    Float_t fNoiseThresholdSum;       //  Analysis Treshold for signal finding: Sum>fNoiseThresholdSum*PadNoise
+
+    Bool_t  fIsZeroSuppressed;        //  If data is Zero Suppressed -> Don't subtrakt pedestals!
 
     Int_t     fLastSector;            //! Last sector processed
 
@@ -225,7 +245,7 @@ private:
     TVectorF* GetPadRMSEvent(Int_t sector, Bool_t force=kFALSE);
     TVectorF* GetPadPedestalEvent(Int_t sector, Bool_t force=kFALSE);
 
-    ClassDef(AliTPCCalibCE,6)  //Implementation of the TPC Central Electrode calibration
+    ClassDef(AliTPCCalibCE,7)  //Implementation of the TPC Central Electrode calibration
 
 };
 
index ecd648f0009972be10a63c0a077eec751252e8f2..73d41bfc5274b74cff15ea59f28522ff326b9866 100644 (file)
@@ -213,6 +213,7 @@ AliTPCCalibPulser::AliTPCCalibPulser() :
     fNbinsRMS(100),
     fXminRMS(0.1),
     fXmaxRMS(5.1),
+    fIsZeroSuppressed(kFALSE),
     fLastSector(-1),
     fROC(AliTPCROC::Instance()),
     fMapping(NULL),
@@ -251,6 +252,7 @@ AliTPCCalibPulser::AliTPCCalibPulser() :
     // AliTPCSignal default constructor
     //
 
+    fParam->Update();
 }
 //_____________________________________________________________________
 AliTPCCalibPulser::AliTPCCalibPulser(const AliTPCCalibPulser &sig) :
@@ -266,6 +268,7 @@ AliTPCCalibPulser::AliTPCCalibPulser(const AliTPCCalibPulser &sig) :
     fNbinsRMS(sig.fNbinsRMS),
     fXminRMS(sig.fXminRMS),
     fXmaxRMS(sig.fXmaxRMS),
+    fIsZeroSuppressed(sig.fIsZeroSuppressed),
     fLastSector(-1),
     fROC(AliTPCROC::Instance()),
     fMapping(NULL),
@@ -336,6 +339,7 @@ AliTPCCalibPulser::AliTPCCalibPulser(const AliTPCCalibPulser &sig) :
        }
     }
 
+    fParam->Update();
 }
 //_____________________________________________________________________
 AliTPCCalibPulser& AliTPCCalibPulser::operator = (const  AliTPCCalibPulser &source)
@@ -510,6 +514,7 @@ void AliTPCCalibPulser::FindPedestal(Float_t part)
            fPadNoise    = rms;
        } 
     }
+    fPadPedestal*=(Float_t)(!fIsZeroSuppressed);
 }
 //_____________________________________________________________________
 void AliTPCCalibPulser::FindPulserSignal(TVectorD &param, Float_t &qSum)
@@ -687,28 +692,26 @@ Bool_t AliTPCCalibPulser::ProcessEventFast(AliTPCRawStreamFast *rawStreamFast)
   // Event Processing loop - AliTPCRawStream
   //
   ResetEvent();
-
   Bool_t withInput = kFALSE;
-
   while ( rawStreamFast->NextDDL() ){
-      while ( rawStreamFast->NextChannel() ){
-         Int_t isector  = rawStreamFast->GetSector();                       //  current sector
-         Int_t iRow     = rawStreamFast->GetRow();                          //  current row
-         Int_t iPad     = rawStreamFast->GetPad();                          //  current pad
-
-         while ( rawStreamFast->NextBunch() ){
-             Int_t startTbin = (Int_t)rawStreamFast->GetStartTimeBin();
-              Int_t endTbin = (Int_t)rawStreamFast->GetEndTimeBin();
-             for (Int_t iTimeBin = startTbin; iTimeBin < endTbin; iTimeBin++){
-                 Float_t signal=(Float_t)rawStreamFast->GetSignals()[iTimeBin-startTbin];
-                 Update(isector,iRow,iPad,iTimeBin+1,signal);
-                 withInput = kTRUE;
-             }
-         }
+    while ( rawStreamFast->NextChannel() ){
+      Int_t isector  = rawStreamFast->GetSector();                       //  current sector
+      Int_t iRow     = rawStreamFast->GetRow();                          //  current row
+      Int_t iPad     = rawStreamFast->GetPad();                          //  current pad
+
+      while ( rawStreamFast->NextBunch() ){
+        Int_t startTbin = (Int_t)rawStreamFast->GetStartTimeBin();
+       Int_t endTbin = (Int_t)rawStreamFast->GetEndTimeBin();
+       for (Int_t iTimeBin = startTbin; iTimeBin < endTbin; iTimeBin++){
+          Float_t signal=(Float_t)rawStreamFast->GetSignals()[iTimeBin-startTbin];
+          Update(isector,iRow,iPad,iTimeBin+1,signal);
+          withInput = kTRUE;
+       }
       }
+    }
   }
   if (withInput){
-      EndEvent();
+    EndEvent();
   }
   return withInput;
 }
index 7fa6e8ff98b2581c2a16ad413b7a5c3a3f18c8db..7a271784d77af261263746e80de77042618968ec 100644 (file)
@@ -74,12 +74,16 @@ public:
 
     void  SetDebugLevel(Short_t debug=1){ fDebugLevel = debug;}
 
+    void  SetIsZeroSuppressed(Bool_t zs=kTRUE){ fIsZeroSuppressed=zs;}
+
     void  SetPedestalDatabase(AliTPCCalPad *pedestalTPC, AliTPCCalPad *padNoiseTPC) {fPedestalTPC = pedestalTPC; fPadNoiseTPC = padNoiseTPC;}
     void  SetOutliers(AliTPCCalPad *outliers)  {fOutliers = outliers;}
 
     Int_t GetFirstTimeBin()   const { return fFirstTimeBin;  }
     Int_t GetLastTimeBin()    const { return fLastTimeBin;   }
 
+    Bool_t GetIsZeroSupperssed() const { return fIsZeroSuppressed; }
+
     void Merge(AliTPCCalibPulser *sig);
 
     void DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
@@ -102,6 +106,8 @@ private:
     Float_t fXminRMS;                 //  xmin   of T0 reference histogram
     Float_t fXmaxRMS;                 //  xmax   of T0 reference histogram
 
+    Bool_t  fIsZeroSuppressed;        //  if data is zero suppressed
+
     Int_t     fLastSector;            //! Last sector processed
 
 
@@ -175,7 +181,7 @@ private:
     TVectorF* GetPadPedestalEvent(Int_t sector, Bool_t force=kFALSE);
 
 
-  ClassDef(AliTPCCalibPulser,2)           //Implementation of the TPC pulser calibration
+  ClassDef(AliTPCCalibPulser,3)           //Implementation of the TPC pulser calibration
 };
 
 
index dcaea80f37125ceab9634ea5de8b4d0e5399478a..2521774eb3e0ac37309116c0358cc0d780ef8137 100755 (executable)
@@ -752,7 +752,7 @@ Int_t AliTPCMonitor::ReadDataDATESubEventLoop(AliTPCMonitorDateFormat* dateform,
          
          eventPtr = dateform->GetFirstDataPointer();
          eventPtrUI = (UInt_t *) eventPtr;
-         Int_t payload = dateform->GetPayloadSize();
+         Int_t payload = dateform->GetPayloadSize(); // 40Bit words
          
          if(fVerb)DumpHeader(dateform);          
          if(fVerb) cout << "Check sector and fEqId  " << endl;
@@ -767,7 +767,7 @@ Int_t AliTPCMonitor::ReadDataDATESubEventLoop(AliTPCMonitorDateFormat* dateform,
          if(CheckEqId(secid,fEqId)) 
            {
              if(fVerb) cout << " init altro " << endl;
-             AliTPCMonitorAltro* altro  = new AliTPCMonitorAltro((UInt_t *)eventPtrUI,(payload/4),1);
+             AliTPCMonitorAltro* altro  = new AliTPCMonitorAltro((UInt_t *)eventPtrUI,(payload/4),1); //hier
              altro->SetWrite10Bit(GetWrite10Bit());
              altro->SetActFilename(GetFile());
              if(fVerb) cout << " allocated 10bit " << endl;
@@ -910,7 +910,7 @@ void AliTPCMonitor::FillHistsDecode(AliTPCMonitorAltro* altro ,Int_t rcupatch, I
   Double_t  hrms             = 0.0;
   Double_t  hmean            = 0.0;
   Int_t     supnextpos        = 0;
-  TH1D*     hbase             =  new TH1D("hbase","hbase",GetTimeBins(),0.5,(GetTimeBins()+0.5));
+//  TH1D*     hbase             =  new TH1D("hbase","hbase",GetTimeBins(),0.5,(GetTimeBins()+0.5));
  
   while(lastpos>0) 
     {
@@ -926,7 +926,8 @@ void AliTPCMonitor::FillHistsDecode(AliTPCMonitorAltro* altro ,Int_t rcupatch, I
       fPad[fChannelIter][0] = nextHwAddress ;
       
       if(fPadMapHw[nextHwAddress]!=-1 ) 
-       {
+      {
+          return;
          //Int_t hw_before1 = fPad[fChannelIter-2][0];
          //Int_t hw_before2 = fPad[fChannelIter-3][0];
          
@@ -966,7 +967,7 @@ void AliTPCMonitor::FillHistsDecode(AliTPCMonitorAltro* altro ,Int_t rcupatch, I
       sum           = 0.0;
       sumn          = 0;
       
-      hbase->Reset();
+//      hbase->Reset();
       
       for(Int_t iterwords = 0 ; iterwords< nwords ; iterwords++) 
        {
@@ -978,23 +979,25 @@ void AliTPCMonitor::FillHistsDecode(AliTPCMonitorAltro* altro ,Int_t rcupatch, I
              samplebins   =  0;
              timestamp    =  entries[blockpos-iterwords-1];
              iterwords++;
+              sampleiter-=2;
            }
          else 
            {
              ntime = timestamp-samplebins;
              adc   = entries[blockpos-iterwords];
              fPad[fChannelIter][ntime]  = adc;
-             if( (adc!=0)  && (ntime>=GetRangeBaseMin()  ) && (ntime<GetRangeBaseMax()    ))  {hbase->Fill(adc)        ;}
+//           if( (adc!=0)  && (ntime>=GetRangeBaseMin()  ) && (ntime<GetRangeBaseMax()    ))  {hbase->Fill(adc)        ;}
              if( (adc>max) && (ntime>=GetRangeMaxAdcMin()) && (ntime<GetRangeMaxAdcMax()  ))  {max = adc;maxx = ntime ;}
              if(              (ntime>=GetRangeSumMin())    && (ntime<GetRangeSumMax()     ))  {sum+=adc; sumn++;}
              samplebins++;
+              sampleiter--;
            }
        }
       
-      hmean = hbase->GetMean();
-      hbase->GetXaxis()->SetRangeUser(hmean- hmean/3 , hmean + hmean/3);
-      hmean =  hbase->GetMean();
-      hrms  = hbase->GetRMS();
+//      hmean = hbase->GetMean();
+//      hbase->GetXaxis()->SetRangeUser(hmean- hmean/3 , hmean + hmean/3);
+//      hmean =  hbase->GetMean();
+//      hrms  = hbase->GetRMS();
 
       if(       GetPedestals()==1) fHistAddrMaxAdc->SetBinContent(  nextHwAddress,max- hmean);
       else                         fHistAddrMaxAdc->SetBinContent(  nextHwAddress,max        );
@@ -1025,7 +1028,7 @@ void AliTPCMonitor::FillHistsDecode(AliTPCMonitorAltro* altro ,Int_t rcupatch, I
       fChannelIter++;
       if(nextpos<0)  { AliError("Error :  next pos < 0 "); break  ;}
     }
-  delete hbase;
+//  delete hbase;
   return ;
 }
 
index 3adb98618712b316504c8fa307c7c4e35bf0c571..224bbec1bc6ed8bedccb13e4589fb742c336ba87 100755 (executable)
@@ -36,8 +36,8 @@ class AliTPCMonitorAltro : public TNamed {
 
     Long64_t*    Get40BitArray();
     Short_t     *Get10BitArray();     
-    Int_t        Get40BitArraySize()     const { return fmemory[fsize-1];}  
-    Int_t        Get10BitArraySize()     const { return fmemory[fsize-1]*4;}  
+    Int_t        Get40BitArraySize()     const { return fmemory[fsize-GetRCUTrailerSize()];}   //hier ändern
+    Int_t        Get10BitArraySize()     const { return fmemory[fsize-GetRCUTrailerSize()]*4;}  //number of 10 bit words from trailer
     Char_t*      GetActFileName()        const { return ffilename;}
     
     static Int_t GetHwMaskFEC()                { return fgkHwMaskFEC;}
@@ -56,6 +56,8 @@ class AliTPCMonitorAltro : public TNamed {
     Int_t        GetTrailerBlockPos()    const { return fTrailerBlockPos ;}
     Int_t        GetTrailerPos()         const { return fTrailerPos      ;} 
 
+    Int_t        GetRCUTrailerSize()     const { Int_t ts=(fmemory[fsize-1]>>16==0xaaaa)*(fmemory[fsize-1]&0x3F); return (ts>0)?ts:1;}
+
     void         SetDataOffset(Int_t val){ foffset     =val ;} 
     void         SetWrite10Bit(Int_t wr) { fwrite10bit =wr  ;}
     
@@ -82,7 +84,7 @@ class AliTPCMonitorAltro : public TNamed {
     Int_t                    fTrailerDataPos;                                           // from Trailer: position of first adc value 
     Int_t                    fTrailerBlockPos;                                          // from Trailer: number of 40 bit words for channel
     Int_t                    fTrailerPos;                                               // trailer position
-    
+
     Int_t                    fNextPos;                                                  // position of next trailer
     Char_t*                  ffilename;                                                 // name of processed file