Correction to the digitization in order to use the full offset at the level of TDC...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 21 Jun 2011 11:26:38 +0000 (11:26 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 21 Jun 2011 11:26:38 +0000 (11:26 +0000)
VZERO/AliVZERODigitizer.cxx
VZERO/AliVZERODigitizer.h

index 7afd883..193206e 100644 (file)
@@ -205,6 +205,11 @@ Bool_t AliVZERODigitizer::Init()
                       phase->GetMeanPhase()+
                       delays->GetBinContent(i+1)+
                       kV0Offset);
+    fClockOffset[i] = (((Float_t)fCalibData->GetRollOver(board)-
+                       (Float_t)fCalibData->GetTriggerCountOffset(board))*25.0+
+                      fCalibData->GetTimeOffset(i)-
+                      l1Delay+
+                      kV0Offset);
 
     fTime[i] = new Float_t[fNBins[i]];
     memset(fTime[i],0,fNBins[i]*sizeof(Float_t));
@@ -467,11 +472,12 @@ void AliVZERODigitizer::DigitizeSDigits()
          }
        }
       }
-      Float_t tadc = t - kClockOffset - fCalibData->GetTimeOffset(ipmt);
+      Float_t tadc = t - fClockOffset[ipmt];
       Int_t clock = kNClocks/2 - Int_t(tadc/25.0);
       if (clock >= 0 && clock < kNClocks)
        fAdc[ipmt][clock] += fTime[ipmt][iBin]/kChargePerADC;
     }
+    AliDebug(1,Form("Channel %d Offset %f Time %f",ipmt,fClockOffset[ipmt],fLeadingTime[ipmt]));
     Int_t board = AliVZEROCalibData::GetBoardNumber(ipmt);
     if (ltFound && ttFound) {
       fTimeWidth[ipmt] = fCalibData->GetWidthResolution(board)*
@@ -487,6 +493,7 @@ void AliVZERODigitizer::DigitizeSDigits()
   for (Int_t j=0; j<64; ++j){
     for (Int_t iClock = 0; iClock < kNClocks; ++iClock) {
       Int_t integrator = (iClock + fEvenOrOdd) % 2;
+      AliDebug(1,Form("ADC %d %d %f",j,iClock,fAdc[j][iClock]));
       fAdc[j][iClock]  += gRandom->Gaus(fAdcPedestal[j][integrator], fAdcSigma[j][integrator]);
     }
   }
index 5ed9fc7..1c2d90e 100644 (file)
@@ -94,6 +94,7 @@ class AliVZERODigitizer: public AliDigitizer {
    Int_t    fNBinsLT[64];            //! Number of bins in fTime container (match window only)
    Float_t  fBinSize[64];            //! Bin size in fTime container
    Float_t  fHptdcOffset[64];        //! HPTDC time offsets channel by channel
+   Float_t  fClockOffset[64];        //! Clock offsets channel by channel
 
    Float_t *fTime[64];               //! Main container used in digitization
    Int_t    fLabels[64][3];          //! Container for MC labels
@@ -102,7 +103,7 @@ class AliVZERODigitizer: public AliDigitizer {
    DigiTask_t fTask;                 //! The task (to be) executed by the digitizer
    AliVZERO  *fVZERO;                //! Pointer to AliDetector object
 
-   ClassDef(AliVZERODigitizer,6)     // digitizer for VZERO
+   ClassDef(AliVZERODigitizer,7)     // digitizer for VZERO
 
 };