]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFFEEReader.cxx
bugfix: corrected calculation of slice and partition from track point Id
[u/mrichter/AliRoot.git] / TOF / AliTOFFEEReader.cxx
index 4c0a09e9b6b18c2f6cffb923caab898f5243f3fb..8cd7420dccbd193570c60ca90951a8315b79470d 100644 (file)
@@ -31,6 +31,7 @@
 #include "AliTOFFEElightConfig.h"
 #include "AliTOFRawStream.h"
 #include "AliTOFGeometry.h"
+#include "AliTOFcalibHisto.h"
 #include "AliLog.h"
 #include <fstream>
 
@@ -68,6 +69,7 @@ AliTOFFEEReader::AliTOFFEEReader(const AliTOFFEEReader &source) :
    *
    */
 
+  Reset();
   memcpy(fFEEConfig, source.fFEEConfig, sizeof(AliTOFFEEConfig));
   memcpy(fFEElightConfig, source.fFEElightConfig, sizeof(AliTOFFEElightConfig));
 }
@@ -120,6 +122,21 @@ AliTOFFEEReader::ResetChannelEnabledArray()
 
 //_______________________________________________________________
 
+void
+AliTOFFEEReader::ResetTriggerMaskArray()
+{
+  /*
+   *
+   * reset trigger mask array
+   *
+   */
+
+  for (Int_t iddl = 0; iddl < GetNumberOfDDLs(); iddl++)
+    fTriggerMask[iddl] = 0x0;
+}
+
+//_______________________________________________________________
+
 void
 AliTOFFEEReader::Reset()
 {
@@ -134,6 +151,9 @@ AliTOFFEEReader::Reset()
     fMatchingWindow[iIndex] = 0;
     fLatencyWindow[iIndex] = 0;
   }
+
+  for (Int_t iddl = 0; iddl < GetNumberOfDDLs(); iddl++)
+    fTriggerMask[iddl] = 0x0;
 }
 
 //_______________________________________________________________
@@ -243,14 +263,29 @@ AliTOFFEEReader::ParseFEElightConfig()
 
   AliInfo("parsing TOF FEElight config");
 
-  Int_t nEnabled = 0;
+  Reset();
+
+  AliTOFcalibHisto calibHisto;
+  calibHisto.LoadCalibHisto();
+
+  Int_t nEnabled = 0, index;
   AliTOFFEEchannelConfig *channelConfig = NULL;
-  for (Int_t i = 0; i < GetNumberOfIndexes(); i++) {
+  for (Int_t i = 0; i < GetNumberOfIndexesEO(); i++) {
     channelConfig = fFEElightConfig->GetChannelConfig(i);
-    if (channelConfig->IsEnabled())
-      nEnabled++;
-    fChannelEnabled[i] = channelConfig->IsEnabled();
-    fMatchingWindow[i] = channelConfig->GetMatchingWindow();
+    if (!channelConfig->IsEnabled()) continue;
+    /* get index DO from index EO */
+    index = (Int_t)calibHisto.GetCalibMap(AliTOFcalibHisto::kIndex, i);
+    if (index == -1) continue;
+    nEnabled++;
+    fChannelEnabled[index] = channelConfig->IsEnabled();
+    fMatchingWindow[index] = channelConfig->GetMatchingWindow();
+    fLatencyWindow[index] = channelConfig->GetLatencyWindow();
+  }
+
+  AliTOFFEEtriggerConfig *triggerConfig = NULL;
+  for (Int_t iddl = 0; iddl < GetNumberOfDDLs(); iddl++) {
+    triggerConfig = fFEElightConfig->GetTriggerConfig(iddl);
+    fTriggerMask[iddl] = triggerConfig->GetStatusMap();
   }
  
   return nEnabled;
@@ -376,7 +411,7 @@ AliTOFFEEReader::IsChannelEnabled(Int_t iDDL, Int_t iTRM, Int_t iChain, Int_t iT
 //_______________________________________________________________
 
 Int_t 
-AliTOFFEEReader::GetMatchingWindow(Int_t iDDL, Int_t iTRM, Int_t iChain, Int_t iTDC, Int_t iChannel) const
+AliTOFFEEReader::GetMatchingWindow(Int_t iDDL, Int_t iTRM, Int_t, Int_t, Int_t) const
 {
   /*
    *
@@ -392,8 +427,6 @@ AliTOFFEEReader::GetMatchingWindow(Int_t iDDL, Int_t iTRM, Int_t iChain, Int_t i
   AliTOFCrateConfig *crateConfig;
   AliTOFTRMConfig *trmConfig;
 
-  iChain = 0; iTDC = 0; iChannel = 0; /* dummy for the time being */
-  
   /* get and check fee config */
   if (!(feeConfig = GetFEEConfig()))
     return 0;
@@ -437,7 +470,7 @@ AliTOFFEEReader::DumpFEEConfig()
   AliInfo("dumping TOF FEE config");
   AliInfo("-------------------------------------");
   AliInfo(Form("version: %d", feeConfig->GetVersion()));
-  AliInfo(Form("dump time: %d", feeConfig->GetDumpTime()));
+  AliInfo(Form("dump time: %d", (Int_t)feeConfig->GetDumpTime()));
   AliInfo(Form("run number: %d", feeConfig->GetRunNumber()));
   AliInfo(Form("run type: %d", feeConfig->GetRunType()));
   AliInfo("-------------------------------------");