Update by Raphaelle
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Dec 2007 17:27:31 +0000 (17:27 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Dec 2007 17:27:31 +0000 (17:27 +0000)
TRD/AliTRDCalibPadStatus.cxx
TRD/AliTRDCalibPadStatus.h
TRD/AliTRDCalibraFillHisto.cxx
TRD/TRDPEDESTALda.cxx
TRD/TRDVDRIFTda.cxx

index 7ac08fc..4e7a7fe 100644 (file)
@@ -75,7 +75,7 @@
 //header file
 #include "AliLog.h"
 #include "AliTRDCalibPadStatus.h"
-#include "AliTRDRawStreamV2.h"
+#include "AliTRDrawStreamTB.h"
 #include "AliTRDgeometry.h"
 #include "AliTRDCommonParam.h"
 #include "./Cal/AliTRDCalROC.h"
@@ -210,7 +210,7 @@ Int_t AliTRDCalibPadStatus::UpdateHisto(const Int_t icdet, /*FOLD00*/
   return 0;
 }
 //_____________________________________________________________________
-Int_t AliTRDCalibPadStatus::ProcessEvent(AliTRDRawStreamV2 *rawStream, Bool_t nocheck)
+Int_t AliTRDCalibPadStatus::ProcessEvent(AliTRDrawStreamTB *rawStream, Bool_t nocheck)
 {
   //
   // Event Processing loop - AliTRDRawStreamCosmic
@@ -278,7 +278,7 @@ Int_t AliTRDCalibPadStatus::ProcessEvent(AliTRDRawStreamV2 *rawStream, Bool_t no
       Int_t iRow       = rawStream->GetRow();                            //  current row
       Int_t iRowMax    = rawStream->GetMaxRow();                         //  current rowmax
       Int_t iCol       = rawStream->GetCol();                            //  current col
-      
+     
 
       Int_t iADC       = 21-rawStream->GetADC();                            //  current ADC
       Int_t col        = 0;
@@ -297,9 +297,14 @@ Int_t AliTRDCalibPadStatus::ProcessEvent(AliTRDRawStreamV2 *rawStream, Bool_t no
       
       Int_t fin        = TMath::Min(nbtimebin,(iTimeBin+3));
       Int_t n          = 0;
-      
+     
+      //printf("det %d, row %d, signal[0] %d, signal[1] %d, signal [2] %d\n", idetector, iRow, signal[0], signal[1], signal[2]);
       for(Int_t k = iTimeBin; k < fin; k++){
-       if(signal[n]>0) UpdateHisto(idetector,iRow,iCol,signal[n],iRowMax,col,mcm);
+       if(signal[n]>0) {
+         UpdateHisto(idetector,iRow,iCol,signal[n],iRowMax,col,mcm);
+         //printf("Update with det %d, row %d, col %d, signal %d, rowmax %d, col %d, mcm %d\n",idetector,iRow,iCol,signal[n],iRowMax,col,mcm);
+       }
        n++;
       }
       
@@ -318,7 +323,7 @@ Int_t AliTRDCalibPadStatus::ProcessEvent(AliRawReader *rawReader, Bool_t nocheck
   //
 
 
-  AliTRDRawStreamV2 rawStream(rawReader);
+  AliTRDrawStreamTB rawStream(rawReader);
 
   rawReader->Select("TRD");
 
index 6a135cc..37cf10a 100644 (file)
@@ -20,7 +20,7 @@ class AliTRDCalDet;
 class AliTRDCalPad;
 class AliTRDCalROC;
 class AliTRDCalPadStatus;
-class AliTRDRawStreamV2;
+class AliTRDrawStreamTB;
 class AliTRDgeometry;
 
 struct eventHeaderStruct;
@@ -35,7 +35,7 @@ public:
 
   AliTRDCalibPadStatus& operator = (const  AliTRDCalibPadStatus &source);
 
-  Int_t ProcessEvent(AliTRDRawStreamV2 *rawStream, Bool_t nocheck = kFALSE);
+  Int_t ProcessEvent(AliTRDrawStreamTB *rawStream, Bool_t nocheck = kFALSE);
   Int_t ProcessEvent(AliRawReader    *rawReader, Bool_t nocheck = kFALSE);
   Int_t ProcessEvent(eventHeaderStruct   *event, Bool_t nocheck = kFALSE);
 
index 783ed48..4b1ddcf 100644 (file)
@@ -1243,7 +1243,7 @@ Int_t AliTRDCalibraFillHisto::ProcessEventDAQ(AliTRDrawStreamTB *rawStream, Bool
       if(((fMCMPrevious != imcm) || (fDetectorPreviousTrack != idetector) || (fROBPrevious != irob)) && (fDetectorPreviousTrack != -1)){
        
        // take the mean values and check the first time bin
-       for(Int_t j = 0; j < 21; j++){       
+       for(Int_t j = 0; j < 21; j++){      
          if(TMath::RMS(fTimeMax,phvalue[j]) != 0.0) mean[j] = TMath::Mean(fTimeMax,phvalue[j]);
          else mean[j] = 0.0;
          if(phvalue[j][0] > 200.0) first[j] = 1;
@@ -1277,8 +1277,11 @@ Int_t AliTRDCalibraFillHisto::ProcessEventDAQ(AliTRDrawStreamTB *rawStream, Bool
        }
 
        // reset
-       for(Int_t k = 0; k < 36; k++){
-         for(Int_t j = 0; j < 21; j++){
+       for(Int_t j = 0; j < 21; j++){
+           mean[j] = 0.0;
+           first[j] = 0;
+           select[j] = 0;
+           for(Int_t k = 0; k < 36; k++){
            phvalue[j][k] = baseline;
          }
        }
@@ -1293,19 +1296,21 @@ Int_t AliTRDCalibraFillHisto::ProcessEventDAQ(AliTRDrawStreamTB *rawStream, Bool
       if((fTimeMax != 0) && (nbtimebin != fTimeMax)) return 0;
       fTimeMax          = nbtimebin;
 
-      //baseline          = rawStream->GetCommonAdditive();                // common additive baseline
+      baseline          = rawStream->GetCommonAdditive();                // common additive baseline
      
       Int_t iTimeBin    = rawStream->GetTimeBin();                       //  current time bin
-      Int_t *signal     = rawStream->GetSignals();                       //  current ADC signal
+      Int_t *signal   = rawStream->GetSignals();                       //  current ADC signal
       Int_t col         = (rawStream->GetCol())%18;                      //  current COL MCM
-           
+      
+      //printf("detector %d, signal[0] %d, signal[1] %d, signal[2] %d, baseline %d\n",idetector,signal[0],signal[1],signal[2], baseline);
+     
       if((col < 0) || (col >= 21)) return 0;  
       if((imcm>=16) || (imcm < 0)) return 0;  
            
       Int_t fin     = TMath::Min(fTimeMax,(iTimeBin+3));
       Int_t n       = 0;
       for(Int_t itime = iTimeBin; itime < fin; itime++){
-       if(signal[n]> (baseline+3)) phvalue[col][itime] = signal[n];
+       phvalue[col][itime] = signal[n];
        n++;
       }
     }
@@ -1348,8 +1353,11 @@ Int_t AliTRDCalibraFillHisto::ProcessEventDAQ(AliTRDrawStreamTB *rawStream, Bool
       }
       
       // reset
-      for(Int_t k = 0; k < 36; k++){
-       for(Int_t j = 0; j < 21; j++){
+      for(Int_t j = 0; j < 21; j++){
+        mean[j] = 0.0;
+        first[j] = 0;
+        select[j] = 0;
+        for(Int_t k = 0; k < 36; k++){
          phvalue[j][k] = baseline;
        }
       }
@@ -1372,6 +1380,7 @@ Int_t AliTRDCalibraFillHisto::ProcessEventDAQ(AliTRDrawStreamTB *rawStream, Bool
          else mean[j] = 0.0;
          if(phvalue[j][0] > 200.0) first[j] = 1;
          else first[j] = 0;
+          //printf("meanvalue %f, first %d\n",mean[j],first[j]);
        }
        
        // select
@@ -1384,14 +1393,17 @@ Int_t AliTRDCalibraFillHisto::ProcessEventDAQ(AliTRDrawStreamTB *rawStream, Bool
        
       // fill
        for(Int_t j = 1; j < 20; j++){
-         if(select[j] == 1){
+         //printf("select %d\n",select[j]);
+          if(select[j] == 1){
            withInput = 2;
            for(Int_t k = 0; k < fTimeMax; k++){
              if((phvalue[j][k] >= phvalue[j-1][k]) && (phvalue[j][k] >= phvalue[j+1][k])){
+                printf("fill\n");
                UpdateDAQ(fDetectorPreviousTrack,0,0,k,(phvalue[j-1][k]+phvalue[j][k]+phvalue[j+1][k]),fTimeMax);
              }
              else{
                if((j < 19) && (phvalue[j+1][k] >= phvalue[j][k]) && (phvalue[j+1][k] >= phvalue[j+2][k])){
+                  printf("fill\n");
                  UpdateDAQ(fDetectorPreviousTrack,0,0,k,(phvalue[j][k]+phvalue[j+1][k]+phvalue[j+2][k]),fTimeMax);
                }
                else UpdateDAQ(fDetectorPreviousTrack,0,0,k,3*baseline,fTimeMax);
@@ -1401,8 +1413,11 @@ Int_t AliTRDCalibraFillHisto::ProcessEventDAQ(AliTRDrawStreamTB *rawStream, Bool
        }
        
        // reset
-       for(Int_t k = 0; k < 36; k++){
-         for(Int_t j = 0; j < 21; j++){
+       for(Int_t j = 0; j < 21; j++){
+          mean[j] = 0.0;
+          first[j] = 0;
+          select[j] = 0;
+          for(Int_t k = 0; k < 36; k++){
            phvalue[j][k] = baseline;
          }
        }
@@ -1414,21 +1429,24 @@ Int_t AliTRDCalibraFillHisto::ProcessEventDAQ(AliTRDrawStreamTB *rawStream, Bool
       
 
 
-      //baseline          = rawStream->GetCommonAdditive();                //  common baseline
+      baseline          = rawStream->GetCommonAdditive();                //  common baseline
       
       nbtimebin         = rawStream->GetNumberOfTimeBins();              //  number of time bins read from data
       Int_t iTimeBin    = rawStream->GetTimeBin();                       //  current time bin
-      Int_t *signal     = rawStream->GetSignals();                       //  current ADC signal
+      Int_t *signal   = rawStream->GetSignals();                       //  current ADC signal
       Int_t col         = (rawStream->GetCol())%18;                      //  current COL MCM
 
       Int_t fin     = TMath::Min(nbtimebin,(iTimeBin+3));
       Int_t n       = 0;
-      
+    
+      //printf("detector %d, signal[0] %d, signal[1] %d, signal[2] %d, baseline %d\n",idetector,signal[0],signal[1],signal[2], baseline);
+
+  
       if((col < 0) || (col >= 21)) return 0;  
       if((imcm>=16) || (imcm < 0)) return 0;  
       
       for(Int_t itime = iTimeBin; itime < fin; itime++){
-       if(signal[n]>13) phvalue[col][itime] = signal[n];
+       phvalue[col][itime] = signal[n];
        n++;
       }
     }
@@ -1471,8 +1489,11 @@ Int_t AliTRDCalibraFillHisto::ProcessEventDAQ(AliTRDrawStreamTB *rawStream, Bool
       }
       
       // reset
-      for(Int_t k = 0; k < 36; k++){
-       for(Int_t j = 0; j < 21; j++){
+      for(Int_t j = 0; j < 21; j++){
+          mean[j] = 0.0;
+          first[j] = 0;
+          select[j] = 0;
+          for(Int_t k = 0; k < 36; k++){
          phvalue[j][k] = baseline;
        }
       }
index 2c206f2..5891bc5 100644 (file)
@@ -74,9 +74,9 @@ int main(int argc, char **argv) {
   int nevents      =0;
  
   //Instance of AliCDBManager: needed by AliTRDRawStream
-  AliCDBManager *man = AliCDBManager::Instance();
-  man->SetDefaultStorage("local://$ALICE_ROOT");
-  man->SetRun(0);
+  //AliCDBManager *man = AliCDBManager::Instance();
+  //man->SetDefaultStorage("local://$ALICE_ROOT");
+  //man->SetRun(0);
   // AliTRDCalibPadStatus object
   AliTRDCalibPadStatus calipad = AliTRDCalibPadStatus();
   Bool_t passpadstatus = kTRUE;
@@ -86,8 +86,16 @@ int main(int argc, char **argv) {
   TStopwatch timer;
   timer.Start();
   
-  /* some warning less */
-  AliTRDrawStreamTB::SupressWarnings(kTRUE); 
+  // setting
+  // AliTRDrawStreamTB::SetNoDebug();
+  AliTRDrawStreamTB::SetNoErrorWarning();
+  AliTRDrawStreamTB::SetForceCleanDataOnly();
+  AliTRDrawStreamTB::AllowCorruptedData();
+  //AliTRDrawStreamTB::SetSkipCDH();
+  //AliTRDrawStreamTB::SetExtraWordsFix();
+  //AliTRDrawStreamTB::EnableDebugStream();
+  //AliTRDrawStreamTB::SetDumpHead(320);
+  //AliTRDrawStreamTB::SetDumpHead(80);
 
   /* read the data files */
   int n;
index d2be70d..b121c9f 100644 (file)
@@ -103,9 +103,16 @@ int main(int argc, char **argv) {
   Bool_t passvdrift  = kTRUE;    // if timebin okey
   Int_t  nbvdrift    = 0;     // number of events with entries for vdrift
 
-
-  /* some warning less */
-  AliTRDrawStreamTB::SupressWarnings(kTRUE);
+   // setting
+  // AliTRDrawStreamTB::SetNoDebug();
+  AliTRDrawStreamTB::SetNoErrorWarning();
+  AliTRDrawStreamTB::SetForceCleanDataOnly();
+  AliTRDrawStreamTB::AllowCorruptedData();
+  //AliTRDrawStreamTB::SetSkipCDH();
+  //AliTRDrawStreamTB::SetExtraWordsFix();
+  //AliTRDrawStreamTB::EnableDebugStream();
+  //AliTRDrawStreamTB::SetDumpHead(320);
+  //AliTRDrawStreamTB::SetDumpHead(80);
 
   
   /* main loop (infinite) */