Adding the CTP time (mis)alignment from the OCDB into the sim/rec chain. Correcting...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Jul 2010 11:21:42 +0000 (11:21 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Jul 2010 11:21:42 +0000 (11:21 +0000)
VZERO/AliVZEROConst.h
VZERO/AliVZERODigitizer.cxx
VZERO/AliVZEROReconstructor.cxx

index 9f2fd90..249db70 100644 (file)
@@ -5,7 +5,7 @@
 
 const Float_t kIntTimeRes = 0.39; // intrinsic time resolution of the scintillator
 const Float_t kV0CDelayCables = 8.1; // delay cables on the C side (in ns)
-const Float_t kV0Offset = 1461.4; // general V0 offset between the TDCs and the trigger
+const Float_t kV0Offset = 1981.4; // general V0 offset between the TDCs and the trigger
 const Float_t kClockOffset = 62.0; // Sampling clock offset (in ns)
 const Int_t   kNClocks = 21; // Number of ADC clocks that are read out
 const Float_t kChargePerADC = 0.6e-12; // Charge per ADC
index 00e3a7e..7fe9308 100644 (file)
@@ -165,6 +165,11 @@ Bool_t AliVZERODigitizer::Init()
   AliCTPTimeParams *ctpParams = (AliCTPTimeParams*)entry->GetObject();
   Float_t l1Delay = (Float_t)ctpParams->GetDelayL1L0()*25.0;
 
+  AliCDBEntry *entry1 = AliCDBManager::Instance()->Get("GRP/CTP/TimeAlign");
+  if (!entry1) AliFatal("CTP time-alignment is not found in OCDB !");
+  AliCTPTimeParams *ctpTimeAlign = (AliCTPTimeParams*)entry1->GetObject();
+  l1Delay += ((Float_t)ctpTimeAlign->GetDelayL1L0()*25.0);
+
   AliCDBEntry *entry2 = AliCDBManager::Instance()->Get("VZERO/Calib/TimeDelays");
   if (!entry2) AliFatal("VZERO time delays are not found in OCDB !");
   TH1F *delays = (TH1F*)entry2->GetObject();
@@ -190,7 +195,7 @@ Bool_t AliVZERODigitizer::Init()
     fBinSize[i] = fCalibData->GetTimeResolution(board);
     fHptdcOffset[i] = (((Float_t)fCalibData->GetTriggerCountOffset(board)-
                        (Float_t)fCalibData->GetRollOver(board))*25.0+
-                      fCalibData->GetTimeOffset(i)+
+                      fCalibData->GetTimeOffset(i)-
                       l1Delay+
                       delays->GetBinContent(i+1)+
                       kV0Offset);
index b76fc62..76b4f24 100644 (file)
@@ -66,6 +66,11 @@ AliVZEROReconstructor:: AliVZEROReconstructor(): AliReconstructor(),
   AliCTPTimeParams *ctpParams = (AliCTPTimeParams*)entry->GetObject();
   Float_t l1Delay = (Float_t)ctpParams->GetDelayL1L0()*25.0;
 
+  AliCDBEntry *entry1 = AliCDBManager::Instance()->Get("GRP/CTP/TimeAlign");
+  if (!entry1) AliFatal("CTP time-alignment is not found in OCDB !");
+  AliCTPTimeParams *ctpTimeAlign = (AliCTPTimeParams*)entry1->GetObject();
+  l1Delay += ((Float_t)ctpTimeAlign->GetDelayL1L0()*25.0);
+
   AliCDBEntry *entry2 = AliCDBManager::Instance()->Get("VZERO/Calib/TimeDelays");
   if (!entry2) AliFatal("VZERO time delays are not found in OCDB !");
   TH1F *delays = (TH1F*)entry2->GetObject();
@@ -78,7 +83,7 @@ AliVZEROReconstructor:: AliVZEROReconstructor(): AliReconstructor(),
     Int_t board = AliVZEROCalibData::GetBoardNumber(i);
     fTimeOffset[i] = (((Float_t)fCalibData->GetTriggerCountOffset(board)-
                        (Float_t)fCalibData->GetRollOver(board))*25.0+
-                      fCalibData->GetTimeOffset(i)+
+                      fCalibData->GetTimeOffset(i)-
                       l1Delay+
                       delays->GetBinContent(i+1)+
                       kV0Offset);