]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/rec/AliRawReaderHLT.cxx
The description of changes:
[u/mrichter/AliRoot.git] / HLT / rec / AliRawReaderHLT.cxx
index 95323077590d4f73ae40961de02e6ffb79897a8d..d7091da132c125160333358a12df97a57c35f663 100644 (file)
@@ -34,6 +34,7 @@
 #include "AliHLTOUTHandler.h"
 #include "AliHLTOUTHandlerEquId.h"
 #include "AliHLTSystem.h"
+#include "AliHLTPluginBase.h"
 #include "AliLog.h"
 #include "AliDAQ.h"            // RAW, for detector names and equipment ids
 #include "TObjString.h"
@@ -45,7 +46,6 @@ ClassImp(AliRawReaderHLT)
 AliRawReaderHLT::AliRawReaderHLT(AliRawReader* pRawreader, const char* options)
   :
   AliRawReader(),
-  AliHLTReconstructorBase(),
   fpParentReader(pRawreader),
   fOptions(),
   fSystemOptions(),
@@ -58,7 +58,8 @@ AliRawReaderHLT::AliRawReaderHLT(AliRawReader* pRawreader, const char* options)
   fDetectors(),
   fpHLTOUT(NULL),
   fbReadFirst(true),
-  fpDataHandler(NULL)
+  fpDataHandler(NULL),
+  fpPluginBase(new AliHLTPluginBase)
 {
   // see header file for class documentation
   // or
@@ -73,6 +74,8 @@ AliRawReaderHLT::~AliRawReaderHLT()
 {
   // see header file for class documentation
   ReleaseHLTData();
+  if (fpPluginBase) delete fpPluginBase;
+  fpPluginBase=NULL;
 }
 
 UInt_t AliRawReaderHLT::GetType() const
@@ -190,13 +193,13 @@ Bool_t   AliRawReaderHLT::ReadHeader()
   // see header file for class documentation
   Bool_t result=kFALSE;
   Bool_t firstParentCycle=fbHaveHLTData;
-  while (fbHaveHLTData=(fbHaveHLTData && ReadNextHLTData())) {
+  while ((fbHaveHLTData=(fbHaveHLTData && ReadNextHLTData()))) {
     // all internal data variables set
     assert(fpData!=NULL);
     fHeader=reinterpret_cast<AliRawDataHeader*>(const_cast<AliHLTUInt8_t*>(fpData));
     fOffset=sizeof(AliRawDataHeader);
     fPosition=fOffset;
-    if (result=IsSelected()) break;
+    if ((result=IsSelected())) break;
   }
   firstParentCycle&=!fbHaveHLTData; // true if it just changed from true to false
   while (!result) {
@@ -218,7 +221,7 @@ Bool_t   AliRawReaderHLT::ReadHeader()
 
     // filter out all equipment ids which should be taken from the HLT stream
     int id=fpParentReader->GetEquipmentId();
-    if (result=!IsHLTInput(id)) break;
+    if ((result=!IsHLTInput(id))) break;
   }
   return result;
 }
@@ -461,12 +464,16 @@ Bool_t   AliRawReaderHLT::ReadNextHLTData()
   if (fbReadFirst || !fpHLTOUT) {
     if (!fpHLTOUT) {
     fpHLTOUT=new AliHLTOUTRawReader(fpParentReader);
-    if (result=(fpHLTOUT!=NULL)) {
-      AliHLTSystem* pSystem=GetInstance();
+    if ((result=(fpHLTOUT!=NULL))) {
+      if (!fpPluginBase) {
+       AliFatal("internal data error: can not get AliHLTSystem instance from plugin");
+       return false;
+      }
+      AliHLTSystem* pSystem=fpPluginBase->GetInstance();
       if (pSystem) {
        pSystem->ScanOptions(fSystemOptions.Data());
       }
-      if (result=(fpHLTOUT->Init()>=0)) {
+      if ((result=(fpHLTOUT->Init())>=0)) {
       }
     }
     }
@@ -556,7 +563,7 @@ Bool_t AliRawReaderHLT::EvaluateSelection()
 {
   // see header file for class documentation
   Bool_t bHaveHLTData=kFALSE;
-  if (bHaveHLTData=(fDetectors.size()>0)) {
+  if ((bHaveHLTData=(fDetectors.size())>0)) {
     vector<int>::iterator detector=fDetectors.begin();
     for (; detector!=fDetectors.end(); detector++) {
       int ddlOffset=AliDAQ::DdlIDOffset(*detector);