]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTCalibrationProcessor.cxx
Removed depricted histograms ... cleanup
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTCalibrationProcessor.cxx
index ea9fcc25ce7d15b19cf5201e5144cc49cc7bb959..61f2c8e56eddb395b46e47911a0ca8732d01acbd 100644 (file)
@@ -1,3 +1,4 @@
+// $Id$
 /**************************************************************************
  * This file is property of and copyright by the ALICE HLT Project        * 
  * ALICE Experiment at CERN, All rights reserved.                         *
@@ -33,6 +34,7 @@ using namespace std;
 
 #include "AliHLTCalibrationProcessor.h"
 #include "AliHLTMemoryFile.h"
+#include "AliHLTReadoutList.h"
 
 #include <cstdlib>
 #include <cerrno>
@@ -75,6 +77,10 @@ AliHLTCalibrationProcessor::~AliHLTCalibrationProcessor() {
 Int_t AliHLTCalibrationProcessor::DoInit( int argc, const char** argv ) {
   // see header file for class documentation
 
+  // TODO: revision of argument scan needed, adjust to the new base class
+  // methods for argument scan
+  // call the configuration from the default OCDB object before the argument
+  // scan to override in correct sequence
   Int_t iResult = 0;
   TString argument = "";
   TString parameter = "";
@@ -210,37 +216,6 @@ Int_t AliHLTCalibrationProcessor::DoEvent( const AliHLTComponentEventData& evtDa
 
   // ** if event Type is not SOR or EOR -> fill DDLNumber list and process data
   if ( ! blkEOR  && !blkSOR ) {
-    
-    // ** Set DDLNumber List
-    if ( trigData.fData != NULL) {
-      AliHLTEventTriggerData* trg = ( AliHLTEventTriggerData* ) trigData.fData;
-      if ( trg != NULL) {
-       AliHLTEventDDL list = (AliHLTEventDDL) trg->fReadoutList;        
-         
-       Int_t wordNdx = GetFirstUsedDDLWord(list);
-       if ( wordNdx >=0 ) {
-         
-         Int_t wordCount = 1;
-         // Handle special TPC and TOF case
-         if ( wordNdx == 3 )
-           wordCount = 8;
-         else if ( wordNdx == 12 )
-           wordCount = 3;
-         
-         // check word for word and binary OR it with existing DDLNumberList
-         for ( Int_t ndx = 0; ndx < wordCount; ndx++ ) {
-           AliHLTUInt32_t word = list.fList[wordNdx+ndx];
-       
-           // set only 4 bit into one Char_t
-           for ( Int_t charNdx = 0; charNdx < 8; charNdx++) {
-             fDDLNumber[(8*ndx)+charNdx] |= (Char_t) word & 0x0000000F;
-             word = word >> 4;
-           }
-         }
-       } // if ( wordNdx > 0 ) {
-      } // if ( trg != NULL) {
-    } // if ( trigData.fData != NULL) {
-    
     // ** ProcessData
     iResult = ProcessCalibration( evtData, blocks, trigData, outputPtr, size, outputBlocks );
     fEventCounter++; 
@@ -312,7 +287,7 @@ Int_t AliHLTCalibrationProcessor::ShipDataToFXS( const AliHLTComponentEventData&
  * ######################## CreateFXSHeader #####################
  */
 
-Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTFXSHeader &pHeader, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
+Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTFXSHeader &pHeader, const char* pDetector, const char* pFileID, const AliHLTReadoutList* pDDLList ) {
   // see header file for class documentation
 
   Int_t iResult = 0;
@@ -331,7 +306,7 @@ Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTFXSHeader &pHeader, con
   pHeader.fOrigin[gkAliHLTFXSHeaderfOriginSize-1] = 0;
 
   // ** Fill file ID
-  HLTInfo( "FXS Header FileID size max %i - actual %i .",gkAliHLTFXSHeaderfFileIDSize, strlen( pFileID ) );
+  HLTDebug( "FXS Header FileID size max %i - actual %i .",gkAliHLTFXSHeaderfFileIDSize, strlen( pFileID ) );
   strncpy ( pHeader.fFileID, pFileID, gkAliHLTFXSHeaderfFileIDSize ) ; 
 
   // To take care if fileIDs which are longer than gkAliHLTFXSHeaderfFileIDSize, write one 0 is cheaper than an if.
@@ -343,19 +318,23 @@ Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTFXSHeader &pHeader, con
   if ( pDDLList ) {
     // use user list
     
-    Int_t wordNdx = GetFirstUsedDDLWord( *(pDDLList) );
-    if ( wordNdx >=0 ) {
-         
-      Int_t wordCount = 1;
-      // Handle special TPC and TOF case
-      if ( wordNdx == 3 )
-       wordCount = 8;
-      else if ( wordNdx == 12 )
-       wordCount = 3;
-         
+    AliHLTReadoutList::EDetectorId detid = pDDLList->GetFirstUsedDetector();
+    Int_t wordNdx = AliHLTReadoutList::GetFirstWord(detid);
+    Int_t wordCount = AliHLTReadoutList::GetWordCount(detid);
+    
+    if (pDDLList->GetFirstUsedDetector(detid) != AliHLTReadoutList::kNoDetector or wordNdx < 0)
+    {
+      HLTError("DDLIDs for minimum of TWO detectors ( %s, %s ) set, this function works only for ONE detector.",
+          AliHLTReadoutList::DetectorIdToString(detid),
+          AliHLTReadoutList::DetectorIdToString(pDDLList->GetFirstUsedDetector(detid))
+        );
+      iResult = -1;
+    }
+    else
+    {
       // check word for word 
       for ( Int_t ndx = 0; ndx < wordCount; ndx++ ) {
-       AliHLTUInt32_t word = pDDLList->fList[wordNdx+ndx];
+       AliHLTUInt32_t word = pDDLList->Buffer()->fList[wordNdx+ndx];
        
        // set only 4 bit into one Char_t
        for ( Int_t charNdx = 0; charNdx < 8; charNdx++) {
@@ -363,9 +342,7 @@ Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTFXSHeader &pHeader, con
          word = word >> 4;
        }
       }
-    } // if ( wordNdx > 0 ) {
-    else
-      iResult = wordNdx;
+    }
   } //   if ( pDDLList ) {
 
   // -- fill header with ascii chars
@@ -379,13 +356,13 @@ Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTFXSHeader &pHeader, con
   }
   
   return iResult;
-}  // Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTXSHeader &pHeader, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
+}  // Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTXSHeader &pHeader, const char* pDetector, const char* pFileID, const AliHLTReadoutList* pDDLList ) {
 
 /*
  * ######################## PushToFXS #####################
  */
 
-Int_t AliHLTCalibrationProcessor::PushToFXS(TObject* pObject, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
+Int_t AliHLTCalibrationProcessor::PushToFXS(TObject* pObject, const char* pDetector, const char* pFileID, const AliHLTReadoutList* pDDLList ) {
   // see header file for class documentation
 
   Int_t iResult = 0;
@@ -424,9 +401,9 @@ Int_t AliHLTCalibrationProcessor::PushToFXS(TObject* pObject, const char* pDetec
 
   return iResult;
 
-} // Int_t AliHLTCalibrationProcessor::PushToFXS(TObject* pObject, const char* detector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
+} // Int_t AliHLTCalibrationProcessor::PushToFXS(TObject* pObject, const char* detector, const char* pFileID, const AliHLTReadoutList* pDDLList ) {
 
-Int_t AliHLTCalibrationProcessor::PushToFXS( void* pBuffer, int iSize, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
+Int_t AliHLTCalibrationProcessor::PushToFXS( void* pBuffer, int iSize, const char* pDetector, const char* pFileID, const AliHLTReadoutList* pDDLList ) {
   // see header file for class documentation
 
   Int_t iResult = 0;
@@ -439,5 +416,5 @@ Int_t AliHLTCalibrationProcessor::PushToFXS( void* pBuffer, int iSize, const cha
 
   return iResult;
 
-} // Int_t AliHLTCalibrationProcessor::PushToFXS(void* pBuffer, int iSize, const char* pDdetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
+} // Int_t AliHLTCalibrationProcessor::PushToFXS(void* pBuffer, int iSize, const char* pDdetector, const char* pFileID, const AliHLTReadoutList* pDDLList ) {