3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE HLT Project *
5 //* ALICE Experiment at CERN, All rights reserved. *
7 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 //* for The ALICE HLT Project. *
10 //* Permission to use, copy, modify and distribute this software and its *
11 //* documentation strictly for non-commercial purposes is hereby granted *
12 //* without fee, provided that the above copyright notice appears in all *
13 //* copies and that both the copyright notice and this permission notice *
14 //* appear in the supporting documentation. The authors make no claims *
15 //* about the suitability of this software for any purpose. It is *
16 //* provided "as is" without express or implied warranty. *
17 //**************************************************************************
19 /** @file AliHLTOUT.cxx
20 @author Matthias Richter
22 @brief The control class for HLTOUT data.
27 #include "AliHLTOUT.h"
32 /** ROOT macro for the implementation of ROOT specific class methods */
35 AliHLTOUT::AliHLTOUT()
37 fSearchDataType(kAliHLTVoidDataType),
38 fSearchSpecification(kAliHLTVoidDataSpec),
39 fSearchHandlerType(AliHLTModuleAgent::kUnknownOutput),
40 fFlags(kSkipProcessed),
48 // see header file for class documentation
50 // refer to README to build package
52 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
55 AliHLTOUT::~AliHLTOUT()
57 // see header file for class documentation
58 if (CheckStatusFlag(kIsSubCollection)) {
59 fLog.LoggingVarargs(kHLTLogWarning, "AliHLTOUT", "~AliHLTOUT" , __FILE__ , __LINE__ , "severe internal error: collection has not been released, potential crash due to invalid pointer");
62 AliHLTOUT* AliHLTOUT::fgGlobalInstance=NULL;
66 // see header file for class documentation
68 SetStatusFlag(kCollecting);
69 if ((iResult=GenerateIndex())>=0) {
70 if ((iResult=InitHandlers())>=0) {
73 ClearStatusFlag(kCollecting);
77 int AliHLTOUT::GetNofDataBlocks()
79 // see header file for class documentation
80 return fBlockDescList.size();
83 int AliHLTOUT::SelectFirstDataBlock(AliHLTComponentDataType dt, AliHLTUInt32_t spec,
84 AliHLTModuleAgent::AliHLTOUTHandlerType handlerType,
87 // see header file for class documentation
90 fSearchSpecification=spec;
91 fSearchHandlerType=handlerType;
92 if (skipProcessed) SetStatusFlag(kSkipProcessed);
93 else ClearStatusFlag(kSkipProcessed);
94 return FindAndSelectDataBlock();
97 int AliHLTOUT::SelectNextDataBlock()
99 // see header file for class documentation
100 if (fCurrent>=fBlockDescList.size()) return -ENOENT;
102 return FindAndSelectDataBlock();
105 int AliHLTOUT::FindAndSelectDataBlock()
107 // see header file for class documentation
108 if (CheckStatusFlag(kLocked)) return -EPERM;
110 while (fCurrent<fBlockDescList.size() && iResult==-ENOENT) {
111 if (fBlockDescList[fCurrent]==fSearchDataType &&
112 (fSearchSpecification==kAliHLTVoidDataSpec || fBlockDescList[fCurrent]==fSearchSpecification) &&
113 (fSearchHandlerType==AliHLTModuleAgent::kUnknownOutput || FindHandlerDesc(fBlockDescList[fCurrent].GetIndex())==fSearchHandlerType) &&
114 (!CheckStatusFlag(kBlockSelection) || fBlockDescList[fCurrent].IsSelected()) &&
115 (!CheckStatusFlag(kSkipProcessed) || !fBlockDescList[fCurrent].IsProcessed())) {
116 iResult=fBlockDescList[fCurrent].GetIndex();
117 // TODO: check the byte order on the current system and the byte order of the
118 // data block, print warning when mismatch and user did not check
119 //AliHLTOUTByteOrder blockBO=CheckByteOrder();
122 if (blockBO!=fByteOrder) {
123 SetStatusFlag(kByteOrderWarning);
127 ClearStatusFlag(kByteOrderChecked);
129 // TODO: check the alignment on the current system and the alignment of the
130 // data block, print warning when mismatch and user did not check
131 ClearStatusFlag(kAlignmentChecked);
140 int AliHLTOUT::GetDataBlockDescription(AliHLTComponentDataType& dt, AliHLTUInt32_t& spec)
142 // see header file for class documentation
144 if (fCurrent<fBlockDescList.size()) {
146 dt=fBlockDescList[fCurrent];
147 spec=fBlockDescList[fCurrent];
152 const AliHLTOUT::AliHLTOUTHandlerListEntry& AliHLTOUT::GetDataBlockHandlerDesc()
154 // see header file for class documentation
155 return FindHandlerDesc(GetDataBlockIndex());
158 AliHLTModuleAgent::AliHLTOUTHandlerType AliHLTOUT::GetDataBlockHandlerType()
160 // see header file for class documentation
161 AliHLTModuleAgent::AliHLTOUTHandlerDesc desc=FindHandlerDesc(GetDataBlockIndex());
162 AliHLTModuleAgent::AliHLTOUTHandlerType type=desc;
166 AliHLTUInt32_t AliHLTOUT::GetDataBlockIndex()
168 // see header file for class documentation
169 if (fCurrent>=fBlockDescList.size()) return AliHLTOUTInvalidIndex;
170 return fBlockDescList[fCurrent].GetIndex();
173 int AliHLTOUT::GetDataBuffer(const AliHLTUInt8_t* &pBuffer, AliHLTUInt32_t& size)
175 // see header file for class documentation
179 if (fCurrent<fBlockDescList.size()) {
180 if ((iResult=fBlockDescList[fCurrent].GetDataBuffer(pBuffer, size))>=0) {
187 int AliHLTOUT::ReleaseDataBuffer(const AliHLTUInt8_t* pBuffer)
189 // see header file for class documentation
191 if (pBuffer==fpBuffer) {
194 fLog.LoggingVarargs(kHLTLogWarning, "AliHLTOUT", "ReleaseDataBuffer" , __FILE__ , __LINE__ , "buffer %p does not match the provided one %p", pBuffer, fpBuffer);
199 AliHLTModuleAgent* AliHLTOUT::GetAgent()
201 // see header file for class documentation
202 AliHLTModuleAgent* pAgent=NULL;
203 pAgent=FindHandlerDesc(GetDataBlockIndex());
207 AliHLTOUTHandler* AliHLTOUT::GetHandler()
209 // see header file for class documentation
210 AliHLTOUTHandler* pHandler=NULL;
211 pHandler=FindHandlerDesc(GetDataBlockIndex());
215 int AliHLTOUT::WriteESD(const AliHLTUInt8_t* /*pBuffer*/, AliHLTUInt32_t /*size*/, AliHLTComponentDataType /*dt*/, AliESDEvent* /*tgtesd*/) const
217 // see header file for class documentation
218 fLog.LoggingVarargs(kHLTLogWarning, "AliHLTOUT", "WriteESD" , __FILE__ , __LINE__ , "method not implemented in base class");
222 int AliHLTOUT::AddBlockDescriptor(const AliHLTOUTBlockDescriptor desc)
224 // see header file for class documentation
225 if (!CheckStatusFlag(kCollecting)) return -EPERM;
227 fBlockDescList.push_back(desc);
231 AliHLTOUT::AliHLTOUTByteOrder AliHLTOUT::CheckByteOrder()
233 // see header file for class documentation
234 if (fCurrent<fBlockDescList.size()) {
235 SetStatusFlag(kByteOrderChecked);
236 AliHLTOUT::AliHLTOUTByteOrder order=CheckBlockByteOrder(fBlockDescList[fCurrent].GetIndex());
239 return kInvalidByteOrder;
242 int AliHLTOUT::CheckAlignment(AliHLTOUT::AliHLTOUTDataType type)
244 // see header file for class documentation
245 if (fCurrent<fBlockDescList.size()) {
246 SetStatusFlag(kAlignmentChecked);
247 int alignment=CheckBlockAlignment(fBlockDescList[fCurrent].GetIndex(), type);
253 int AliHLTOUT::InitHandlers()
255 // see header file for class documentation
257 AliHLTOUTIndexList remnants;
259 for (int havedata=SelectFirstDataBlock(kAliHLTAnyDataType, kAliHLTVoidDataSpec); havedata>=0; havedata=SelectNextDataBlock()) {
261 remnants.push_back(GetDataBlockIndex());
262 AliHLTComponentDataType dt=kAliHLTVoidDataType;
263 AliHLTUInt32_t spec=kAliHLTVoidDataSpec;
264 if (GetDataBlockDescription(dt, spec)<0) break;
265 bool bHaveHandler=false;
266 for (AliHLTModuleAgent* pAgent=AliHLTModuleAgent::GetFirstAgent(); pAgent && iResult>=0; pAgent=AliHLTModuleAgent::GetNextAgent()) {
267 AliHLTModuleAgent::AliHLTOUTHandlerDesc handlerDesc;
268 if (pAgent->GetHandlerDescription(dt, spec, handlerDesc)>0) {
269 AliHLTOUTHandlerListEntry entry(pAgent->GetOutputHandler(dt, spec), handlerDesc, pAgent, GetDataBlockIndex());
270 InsertHandler(fDataHandlers, entry);
276 if (!bHaveHandler && (dt==kAliHLTDataTypeESDObject || dt==kAliHLTDataTypeESDTree)) {
277 // ESDs are handled by the framework
282 // warning if some of the data blocks are not selected by the kAliHLTAnyDataType
284 if (GetNofDataBlocks()>iCount) {
285 fLog.LoggingVarargs(kHLTLogWarning, "AliHLTOUT", "InitHandlers" , __FILE__ , __LINE__ , "incomplete data type in %d out of %d data block(s)", GetNofDataBlocks()-iCount, GetNofDataBlocks());
288 // warning if handler not found
289 if (remnants.size()>0) {
290 fLog.LoggingVarargs(kHLTLogWarning, "AliHLTOUT", "InitHandlers" , __FILE__ , __LINE__ , "no handlers found for %d data blocks out of %d", remnants.size(), iCount);
291 AliHLTOUTBlockDescriptorVector::iterator block=fBlockDescList.begin();
292 for (AliHLTOUTIndexList::iterator element=remnants.begin(); element!=remnants.end(); element++) {
293 for (int trials=0; trials<2; trials++) {
295 // we start searching the index from the current position in the block list
296 if ((*block).GetIndex()==*element) break;
297 } while ((++block)!=fBlockDescList.end());
298 if (block==fBlockDescList.end()) {
299 // rewind and try again
300 block=fBlockDescList.begin();
303 assert(block!=fBlockDescList.end());
304 if (block!=fBlockDescList.end()) {
305 //HLTDebug(" %s", AliHLTComponent::DataType2Text((AliHLTComponentDataType)*block).c_str());
312 int AliHLTOUT::InsertHandler(AliHLTOUTHandlerListEntryVector& list, const AliHLTOUTHandlerListEntry &entry)
314 // see header file for class documentation
316 AliHLTOUTHandlerListEntryVector::iterator element=list.begin();
317 for (; element!=list.end();
319 if (entry==(*element)) break;
321 if (element==list.end()) {
322 list.push_back(entry);
324 element->AddIndex(const_cast<AliHLTOUTHandlerListEntry&>(entry));
329 int AliHLTOUT::FillHandlerList(AliHLTOUTHandlerListEntryVector& list, AliHLTModuleAgent::AliHLTOUTHandlerType handlerType)
331 // see header file for class documentation
333 for (iResult=SelectFirstDataBlock(kAliHLTAnyDataType, kAliHLTVoidDataSpec, handlerType);
335 iResult=SelectNextDataBlock()) {
336 AliHLTComponentDataType dt=kAliHLTVoidDataType;
337 AliHLTUInt32_t spec=kAliHLTVoidDataSpec;
338 GetDataBlockDescription(dt, spec);
339 AliHLTOUTHandler* pHandler=GetHandler();
341 fLog.LoggingVarargs(kHLTLogWarning, "AliHLTOUT", "FillHandlerList" , __FILE__ , __LINE__ ,
342 "missing HLTOUT handler for block of type kChain: agent %s, data type %s, specification %#x, ... skipping data block",
343 GetAgent()?GetAgent()->GetModuleId():"invalid",
344 AliHLTComponent::DataType2Text(dt).c_str(), spec);
346 InsertHandler(list, GetDataBlockHandlerDesc());
349 // TODO: the return value of SelectFirst/NextDataBlock must be
350 // changed in order to avoid this check
351 if (iResult==-ENOENT) iResult=0;
356 int AliHLTOUT::RemoveEmptyDuplicateHandlers(AliHLTOUTHandlerListEntryVector& list)
358 // see header file for class documentation
360 AliHLTOUTHandlerListEntryVector::iterator element=list.begin();
361 while (element!=list.end()) {
362 if (element->IsEmpty()) {
363 AliHLTOUTHandler* pHandler=*element;
364 AliHLTModuleAgent* pAgent=*element;
365 AliHLTModuleAgent::AliHLTOUTHandlerDesc desc=*element;
366 if (FindHandler(list, desc)>=0) {
367 element=list.erase(element);
369 pAgent->DeleteOutputHandler(pHandler);
371 // we are already at the next element
380 int AliHLTOUT::FindHandler(AliHLTOUTHandlerListEntryVector& list, const AliHLTModuleAgent::AliHLTOUTHandlerDesc desc)
382 // see header file for class documentation
383 for (int i=0; i<(int)list.size(); i++) {
384 if (list[i]==desc) return i;
389 int AliHLTOUT::InvalidateBlocks(AliHLTOUTHandlerListEntryVector& list)
391 // see header file for class documentation
392 for (AliHLTOUTHandlerListEntryVector::iterator element=list.begin();
395 element->InvalidateBlocks();
400 const AliHLTOUT::AliHLTOUTHandlerListEntry& AliHLTOUT::FindHandlerDesc(AliHLTUInt32_t blockIndex)
402 // see header file for class documentation
403 AliHLTOUTHandlerListEntryVector::iterator element=fDataHandlers.begin();
404 while (element!=fDataHandlers.end()) {
405 if (element->HasIndex(blockIndex)) {
410 return const_cast<AliHLTOUT::AliHLTOUTHandlerListEntry&>(AliHLTOUT::AliHLTOUTHandlerListEntry::fgkVoidHandlerListEntry);
413 AliHLTOUT::AliHLTOUTHandlerListEntry::AliHLTOUTHandlerListEntry()
420 // see header file for class documentation
423 AliHLTOUT::AliHLTOUTHandlerListEntry::AliHLTOUTHandlerListEntry(AliHLTOUTHandler* pHandler,
424 AliHLTModuleAgent::AliHLTOUTHandlerDesc& handlerDesc,
425 AliHLTModuleAgent* pAgent,
426 AliHLTUInt32_t index)
429 fpHandlerDesc(new AliHLTModuleAgent::AliHLTOUTHandlerDesc),
433 // see header file for class documentation
434 *fpHandlerDesc=handlerDesc;
435 fBlocks.push_back(index);
438 AliHLTOUT::AliHLTOUTHandlerListEntry::AliHLTOUTHandlerListEntry(const AliHLTOUTHandlerListEntry& src)
440 fpHandler(src.fpHandler),
441 fpHandlerDesc(new AliHLTModuleAgent::AliHLTOUTHandlerDesc),
442 fpAgent(src.fpAgent),
445 // see header file for class documentation
446 *fpHandlerDesc=*src.fpHandlerDesc;
447 fBlocks.assign(src.fBlocks.begin(), src.fBlocks.end());
450 AliHLTOUT::AliHLTOUTHandlerListEntry::~AliHLTOUTHandlerListEntry()
452 // see header file for class documentation
453 if (fpHandlerDesc) delete fpHandlerDesc;
457 AliHLTOUT::AliHLTOUTHandlerListEntry& AliHLTOUT::AliHLTOUTHandlerListEntry::operator=(const AliHLTOUTHandlerListEntry& src)
459 // see header file for class documentation
460 fpHandler=src.fpHandler;
461 if (src.fpHandlerDesc)
462 *fpHandlerDesc=*src.fpHandlerDesc;
464 fBlocks.assign(src.fBlocks.begin(), src.fBlocks.end());
468 AliHLTUInt32_t AliHLTOUT::AliHLTOUTHandlerListEntry::operator[](int i) const
470 // see header file for class documentation
471 return (int)fBlocks.size()>i?fBlocks[i]:AliHLTOUTInvalidIndex;
474 bool AliHLTOUT::AliHLTOUTHandlerListEntry::operator==(const AliHLTOUTHandlerListEntry& entry) const
476 // see header file for class documentation
477 if (entry.fpHandler!=fpHandler || fpHandler==NULL) return false;
478 assert(entry.fpAgent==fpAgent);
479 if (entry.fpAgent!=fpAgent) return false;
483 bool AliHLTOUT::AliHLTOUTHandlerListEntry::operator==(const AliHLTModuleAgent::AliHLTOUTHandlerType handlerType) const
485 // see header file for class documentation
486 if (!fpHandlerDesc) return false;
487 return *fpHandlerDesc==handlerType;
490 bool AliHLTOUT::AliHLTOUTHandlerListEntry::operator==(const AliHLTModuleAgent::AliHLTOUTHandlerDesc desc) const
492 // see header file for class documentation
493 if (!fpHandlerDesc) return false;
494 return *fpHandlerDesc==desc;
497 void AliHLTOUT::AliHLTOUTHandlerListEntry::AddIndex(AliHLTOUT::AliHLTOUTHandlerListEntry &desc)
499 // see header file for class documentation
500 AliHLTOUTIndexList::iterator element;
501 for (element=desc.fBlocks.begin(); element!=desc.fBlocks.end(); element++) {
506 void AliHLTOUT::AliHLTOUTHandlerListEntry::AddIndex(AliHLTUInt32_t index)
508 // see header file for class documentation
509 fBlocks.push_back(index);
512 bool AliHLTOUT::AliHLTOUTHandlerListEntry::HasIndex(AliHLTUInt32_t index) const
514 // see header file for class documentation
515 AliHLTOUTIndexList::iterator element;
516 for (unsigned int i=0; i<fBlocks.size(); i++) {
517 if (fBlocks[i]==index) return true;
522 const AliHLTOUT::AliHLTOUTHandlerListEntry AliHLTOUT::AliHLTOUTHandlerListEntry::fgkVoidHandlerListEntry;
524 AliHLTUInt64_t AliHLTOUT::ByteSwap64(AliHLTUInt64_t src)
526 // see header file for class documentation
527 return ((src & 0xFFULL) << 56) |
528 ((src & 0xFF00ULL) << 40) |
529 ((src & 0xFF0000ULL) << 24) |
530 ((src & 0xFF000000ULL) << 8) |
531 ((src & 0xFF00000000ULL) >> 8) |
532 ((src & 0xFF0000000000ULL) >> 24) |
533 ((src & 0xFF000000000000ULL) >> 40) |
534 ((src & 0xFF00000000000000ULL) >> 56);
537 AliHLTUInt32_t AliHLTOUT::ByteSwap32(AliHLTUInt32_t src)
539 // see header file for class documentation
540 return ((src & 0xFFULL) << 24) |
541 ((src & 0xFF00ULL) << 8) |
542 ((src & 0xFF0000ULL) >> 8) |
543 ((src & 0xFF000000ULL) >> 24);
546 AliHLTOUT* AliHLTOUT::New(AliRawReader* pRawReader)
548 // see header file for class documentation
549 AliHLTOUT* instance=New("AliHLTOUTRawReader");
551 instance->SetParam(pRawReader);
556 AliHLTOUT* AliHLTOUT::New(TTree* pDigitTree, int event)
558 // see header file for class documentation
559 AliHLTOUT* instance=New("AliHLTOUTDigitReader");
561 instance->SetParam(pDigitTree, event);
566 AliHLTOUT* AliHLTOUT::New(const char* classname)
568 // see header file for class documentation
570 AliHLTOUT* instance=NULL;
573 ROOT::NewFunc_t pNewFunc=NULL;
575 pCl=TClass::GetClass(classname);
576 } while (!pCl && (iLibResult=gSystem->Load("libHLTRec.so"))==0);
578 if (pCl && (pNewFunc=pCl->GetNew())!=NULL) {
579 void* p=(*pNewFunc)(NULL);
581 instance=reinterpret_cast<AliHLTOUT*>(p);
583 log.Logging(kHLTLogError, "AliHLTOUT::New", "HLTOUT handling", "type cast to AliHLTOUT instance failed");
586 log.Logging(kHLTLogError, "AliHLTOUT::New", "HLTOUT handling", "can not create AliHLTOUT instance from class descriptor");
589 log.Logging(kHLTLogError, "AliHLTOUT::New", "HLTOUT handling", "can not find AliHLTOUT class descriptor");
592 log.Logging(kHLTLogError, "AliHLTOUT::New", "HLTOUT handling", "can not load libHLTrec library");
597 void AliHLTOUT::Delete(AliHLTOUT* pInstance)
599 // see header file for class documentation
600 if (!pInstance) return;
601 if (pInstance==fgGlobalInstance) return;
603 // check if the library is still there in order to have the
604 // destructor available
605 TClass* pCl1=TClass::GetClass("AliHLTOUTRawReader");
606 TClass* pCl2=TClass::GetClass("AliHLTOUTDigitReader");
607 if (!pCl1 && !pCl2) {
609 log.Logging(kHLTLogError, "AliHLTOUT::Delete", "HLTOUT handling", "potential memory leak: libHLTrec library not available, skipping destruction %p", pInstance);
616 void AliHLTOUT::SetParam(AliRawReader* /*pRawReader*/)
618 // see header file for class documentation
619 // default implementation, we should never get here
620 // this function can only be called from the class itsself and
621 // is intended to be used with the New functions. If we get into
622 // the default implementation there is a class mismatch.
624 fLog.LoggingVarargs(kHLTLogFatal, "AliHLTOUT", "SetParam" , __FILE__ , __LINE__ , "severe internal error: class mismatch");
627 void AliHLTOUT::SetParam(TTree* /*pDigitTree*/, int /*event*/)
629 // see header file for class documentation
630 // default implementation, we should never get here
631 // this function can only be called from the class itsself and
632 // is intended to be used with the New functions. If we get into
633 // the default implementation there is a class mismatch.
635 fLog.LoggingVarargs(kHLTLogFatal, "AliHLTOUT", "SetParam" , __FILE__ , __LINE__ , "severe internal error: class mismatch");
638 int AliHLTOUT::SelectDataBlock()
640 // see header file for class documentation
642 if (fCurrent>=fBlockDescList.size()) return 0;
643 fBlockDescList[fCurrent].Select(true);
644 EnableBlockSelection();
648 int AliHLTOUT::SelectDataBlocks(const AliHLTOUTHandlerListEntry* pHandlerDesc)
650 // see header file for class documentation
652 if (!pHandlerDesc) return 0;
654 AliHLTOUTBlockDescriptorVector::iterator element;
655 for (AliHLTOUTBlockDescriptorVector::iterator block=fBlockDescList.begin();
656 block!=fBlockDescList.end();
658 if (pHandlerDesc->HasIndex(block->GetIndex()))
661 block->Select(false);
663 EnableBlockSelection();
668 int AliHLTOUT::EnableBlockSelection()
670 // see header file for class documentation
671 SetStatusFlag(kBlockSelection);
675 int AliHLTOUT::DisableBlockSelection()
677 // see header file for class documentation
678 ClearStatusFlag(kBlockSelection);
682 int AliHLTOUT::ResetBlockSelection()
684 // see header file for class documentation
685 for (AliHLTOUTBlockDescriptorVector::iterator block=fBlockDescList.begin();
686 block!=fBlockDescList.end();
688 block->Select(false);
693 int AliHLTOUT::MarkDataBlockProcessed()
695 // see header file for class documentation
697 if (fCurrent>=fBlockDescList.size()) return 0;
698 fBlockDescList[fCurrent].MarkProcessed();
702 int AliHLTOUT::MarkDataBlocksProcessed(const AliHLTOUTHandlerListEntry* pHandlerDesc)
704 // see header file for class documentation
706 if (!pHandlerDesc) return 0;
708 AliHLTOUTBlockDescriptorVector::iterator element;
709 for (AliHLTOUTBlockDescriptorVector::iterator block=fBlockDescList.begin();
710 block!=fBlockDescList.end();
712 if (pHandlerDesc->HasIndex(block->GetIndex()))
713 block->MarkProcessed();
719 int AliHLTOUT::AddSubCollection(AliHLTOUT* pCollection)
721 // see header file for class documentation
723 if (!pCollection) return 0;
726 for (index=pCollection->SelectFirstDataBlock();
728 index=pCollection->SelectNextDataBlock()) {
729 AliHLTComponentDataType dt=kAliHLTVoidDataType;
730 AliHLTUInt32_t spec=kAliHLTVoidDataSpec;
731 pCollection->GetDataBlockDescription(dt, spec);
732 AliHLTOUTBlockDescriptor desc(dt, spec, index, pCollection);
733 AddBlockDescriptor(desc);
737 pCollection->SetStatusFlag(kIsSubCollection);
743 int AliHLTOUT::ReleaseSubCollection(AliHLTOUT* pCollection)
745 // see header file for class documentation
747 if (!pCollection) return 0;
749 AliHLTOUTBlockDescriptorVector::iterator block=fBlockDescList.begin();
750 while (block!=fBlockDescList.end()) {
751 if ((*block)==pCollection) {
752 block=fBlockDescList.erase(block);
761 int AliHLTOUT::Reset()
763 // see header file for class documentation
765 AliHLTOUTPVector subCollections;
766 AliHLTOUTBlockDescriptorVector::iterator block=fBlockDescList.begin();
767 while (block!=fBlockDescList.end()) {
768 if ((*block)==this) {
769 AliHLTOUTPVector::iterator collection=subCollections.begin();
770 for (; collection!=subCollections.end(); collection++)
771 if((*block)==*collection) break;
772 if (collection==subCollections.end())
773 subCollections.push_back(block->GetCollection());
775 block=fBlockDescList.erase(block);
778 for (AliHLTOUTPVector::iterator collection=subCollections.begin();
779 collection!=subCollections.end(); collection++)
780 (*collection)->Reset();
787 int AliHLTOUT::ResetInput()
789 // default implementation, nothing to do