X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HLT%2Frec%2FAliRawReaderHLT.cxx;h=d7091da132c125160333358a12df97a57c35f663;hb=5c15a68b15868213d26579c32974ddf3ad334170;hp=0f20a5560971dce646cc9f9a81e4ac203b8e83f3;hpb=21743c3ae9c3e5ea434817c6998a6f8608a12e4e;p=u%2Fmrichter%2FAliRoot.git diff --git a/HLT/rec/AliRawReaderHLT.cxx b/HLT/rec/AliRawReaderHLT.cxx index 0f20a556097..d7091da132c 100644 --- a/HLT/rec/AliRawReaderHLT.cxx +++ b/HLT/rec/AliRawReaderHLT.cxx @@ -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(const_cast(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) { @@ -212,15 +215,24 @@ Bool_t AliRawReaderHLT::ReadHeader() break; } fHeader=const_cast(fpParentReader->GetDataHeader()); + fDataSize=fpParentReader->GetDataSize(); + fPosition=0; + fpData=NULL; // 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; } Bool_t AliRawReaderHLT::ReadNextData(UChar_t*& data) +{ + // see header file for class documentation + return ReadNextData(data, kTRUE); +} + +Bool_t AliRawReaderHLT::ReadNextData(UChar_t*& data, Bool_t readHeader) { // see header file for class documentation @@ -230,7 +242,7 @@ Bool_t AliRawReaderHLT::ReadNextData(UChar_t*& data) Bool_t result=kTRUE; // read new header if data already read - if (fPosition kFALSE + } while (ReadNextData(dummy, kFALSE)); return kFALSE; } @@ -395,6 +410,7 @@ void AliRawReaderHLT::SkipInvalid(Bool_t skip) fpParentReader->SkipInvalid(skip); } +/* void AliRawReaderHLT::SelectEvents(Int_t type) { // see header file for class documentation @@ -403,6 +419,7 @@ void AliRawReaderHLT::SelectEvents(Int_t type) AliRawReader::SelectEvents(type); fpParentReader->SelectEvents(type); } +*/ int AliRawReaderHLT::ScanOptions(const char* options) { @@ -447,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)) { } } } @@ -474,7 +495,7 @@ Bool_t AliRawReaderHLT::ReadNextHLTData() AliHLTOUTHandler* pHandler=fpHLTOUT->GetHandler(); if (pHandler) { if (dynamic_cast(pHandler)!=NULL) { - AliHLTOUT::AliHLTOUTLockGuard g(fpHLTOUT); + AliHLTOUT::AliHLTOUTSelectionGuard g(fpHLTOUT); fEquipmentId=pHandler->ProcessData(fpHLTOUT); fpData=NULL; fDataSize=pHandler->GetProcessedData(fpData); @@ -542,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::iterator detector=fDetectors.begin(); for (; detector!=fDetectors.end(); detector++) { int ddlOffset=AliDAQ::DdlIDOffset(*detector);