]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - VZERO/AliVZEROBuffer.cxx
Protection against the zero magnetic field and cleanup in the corresponding component...
[u/mrichter/AliRoot.git] / VZERO / AliVZEROBuffer.cxx
index 05c414b0de961d48a08421c076c9a1280c91c51d..ea68b6ca6d9197d08c397bf26a4e64f4899f140b 100644 (file)
@@ -131,7 +131,7 @@ void AliVZEROBuffer::WriteBunchNumbers() {
 }
 
 //_____________________________________________________________________________
-void AliVZEROBuffer::WriteChannel(Int_t cell, UInt_t ADC, UInt_t /*Time*/, Bool_t integrator){
+void AliVZEROBuffer::WriteChannel(Int_t cell, UInt_t ADC, Float_t /*Time*/, Bool_t integrator){
   // It writes VZERO charge information into a raw data file. 
   // Being called by Digits2Raw
   
@@ -229,14 +229,24 @@ void AliVZEROBuffer::WriteBeamScalers() {
 }
 
 //_____________________________________________________________________________
-void AliVZEROBuffer::WriteTiming(Int_t /*cell*/, UInt_t /* ADC*/, UInt_t Time){
+void AliVZEROBuffer::WriteTiming(Int_t /*cell*/, UInt_t /* ADC*/, Float_t Time){
   // It writes the timing information into a raw data file. 
   // Being called by Digits2Raw
 
   UInt_t data = 0;
+  Int_t  coarse1, coarse2, fine;
 
   // Writes the timing information
-  data = Time & 0xfff;
+//  data = Time & 0xfff;
+  
+  coarse1 = int( Time/25.0 );
+  coarse2 = int( (Time - 25*coarse1)/(25.0/8.0) );
+  fine    = int( (Time - 25*coarse1 -(25.0/8.0)*coarse2)/(25.0/256.0) );
+  
+  data  = (coarse1 & 0xf) << 8;
+  data |= (coarse2 & 0x7) << 5;  
+  data |= (fine & 0x1f);   
+  
   // The signal width is not available the digits!
   // To be added soon
   // data |= (width & 0x7f) << 12;