]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFDecoder.cxx
move TVirtualDecayer->Init() to class initializer
[u/mrichter/AliRoot.git] / TOF / AliTOFDecoder.cxx
index 078102456ecc29ccde51b039a22ee55967dee558..c71d00a75c33cacd04c46b55648f8bfea723aac2 100644 (file)
@@ -50,6 +50,7 @@ TOF Raw Data decoder
 #include "AliTOFDecoder.h"
 #include "AliTOFGeometry.h"
 #include "AliRawDataHeader.h"
+#include "AliRawDataHeaderV3.h"
 #include "AliTOFRawDataFormat.h"
 
 ClassImp(AliTOFDecoder)
@@ -76,6 +77,10 @@ AliTOFDecoder::AliTOFDecoder() :
   fSpiderCurrentTDC(-1)
 {
   //default constructor
+
+  for (Int_t chan=0;chan<N_CHANNEL;chan++)
+    fSpiderLeadingFlag[chan] = kFALSE;
+
 }
 
 //_________________________________________________________________
@@ -100,6 +105,10 @@ AliTOFDecoder::AliTOFDecoder(AliTOFHitDataBuffer *DataBuffer, AliTOFHitDataBuffe
   fSpiderCurrentTDC(-1)
 {
   //another constructor
+
+  for (Int_t chan=0;chan<N_CHANNEL;chan++)
+    fSpiderLeadingFlag[chan] = kFALSE;
+
 }
 
 //_________________________________________________________________
@@ -124,6 +133,9 @@ AliTOFDecoder::AliTOFDecoder(const AliTOFDecoder &source) :
   fSpiderCurrentTDC(source.fSpiderCurrentTDC)
 {
   //copy constructor
+
+  for (Int_t chan=0;chan<N_CHANNEL;chan++)
+    fSpiderLeadingFlag[chan] = source.fSpiderLeadingFlag[chan];
   
 }
 
@@ -154,6 +166,9 @@ AliTOFDecoder::operator = (const AliTOFDecoder &source)
   fSpiderCurrentSlotID = source.fSpiderCurrentSlotID;
   fSpiderCurrentChain = source.fSpiderCurrentChain;
   fSpiderCurrentTDC = source.fSpiderCurrentTDC;
+  for (Int_t chan=0;chan<N_CHANNEL;chan++)
+    fSpiderLeadingFlag[chan] = source.fSpiderLeadingFlag[chan];
+  
   return *this;
 }
 
@@ -163,7 +178,7 @@ AliTOFDecoder::~AliTOFDecoder()
 //_________________________________________________________________
 
 Bool_t
-AliTOFDecoder::Decode(const UInt_t *rawData, Int_t nWords, const AliRawDataHeader *cdh)
+AliTOFDecoder::Decode(const UInt_t *rawData, Int_t nWords, const AliRawDataHeader *cdh, const AliRawDataHeaderV3 *cdhV3)
 {
   /* main decoding routine.
    * it loops over nWords 32-bit words 
@@ -202,10 +217,13 @@ AliTOFDecoder::Decode(const UInt_t *rawData, Int_t nWords, const AliRawDataHeade
   Short_t  currentBunchID = -1;
   Short_t  currentL0BCID = -1;
   Short_t  currentMiniEventID = cdh ? cdh->GetMiniEventID() : (Short_t)(-1);
+  currentMiniEventID = cdhV3 ? cdhV3->GetMiniEventID() : currentMiniEventID;
   Short_t  currentEventID1 = cdh ? cdh->GetEventID1() : (Short_t)(-1);
-  AliDebug(1, Form("EvID1 = %d, EvID2 = %d, currentMiniEventID = %d", currentEventID1, cdh->GetEventID2(), currentMiniEventID));
-  if (!cdh)
+  currentEventID1 = cdhV3 ? cdhV3->GetEventID1() : currentEventID1;
+  if (!cdh && !cdhV3)
     AliWarning("CDH not valid: deltaBunchID not reliable ");
+  else
+    AliDebug(1, Form("EvID1 = %d, EvID2 = %d, currentMiniEventID = %d", currentEventID1, cdh? cdh->GetEventID2() : cdhV3->GetEventID2(), currentMiniEventID));
 
   /*** V2718 patch ***/
   if (fV2718Patch){
@@ -920,7 +938,7 @@ void AliTOFDecoder::GetArrayDDL(Int_t* array, Int_t ddl){
 }
 
 //------------------------------------------------------------
-void AliTOFDecoder::PrintStack(const UInt_t *rawData, Int_t nWords, const AliRawDataHeader *cdh)
+void AliTOFDecoder::PrintStack(const UInt_t *rawData, Int_t nWords, const AliRawDataHeader *cdh, const AliRawDataHeaderV3 *cdhV3)
 {
   /* It loops over nWords 32-bit words 
    * starting at *rawData and prints them in 0x format.
@@ -928,10 +946,14 @@ void AliTOFDecoder::PrintStack(const UInt_t *rawData, Int_t nWords, const AliRaw
    */
 
  Short_t  currentMiniEventID = cdh ? cdh->GetMiniEventID() : (Short_t)(-1);
+ currentMiniEventID = cdhV3 ? cdhV3->GetMiniEventID() : currentMiniEventID;
  Short_t  currentEventID1 = cdh ? cdh->GetEventID1() : (Short_t)(-1);
- AliDebug(1, Form("EvID1 = %d, EvID2 = %d, currentMiniEventID = %d", currentEventID1, cdh->GetEventID2(), currentMiniEventID));
- if (!cdh)
-     AliWarning("CDH not valid: deltaBunchID not reliable ");
+ currentEventID1 = cdhV3 ? cdhV3->GetEventID1() : currentEventID1;
+ if (!cdh && !cdhV3)
+   AliWarning("CDH not valid: deltaBunchID not reliable ");
+ else
+   AliDebug(1, Form("EvID1 = %d, EvID2 = %d, currentMiniEventID = %d", currentEventID1, cdh ? cdh->GetEventID2() : cdhV3->GetEventID2(), currentMiniEventID));
+
  AliInfo("Printing raw data stack for current equipment\n");
  AliInfo("  wordN  -  Hex Word "); 
  //loop over raw data