From c512382464cdd8bfcef9d34c7134cd9d9376f9f5 Mon Sep 17 00:00:00 2001 From: richterm Date: Wed, 9 Apr 2008 00:54:41 +0000 Subject: [PATCH] - HLT simulation writes digit data in addition to raw data - bugfix AliHLTOUTComponent: wrong byte swap suppressed data origin in homer descriptor - AliHLTEsdManager added: merging and writing of HLT ESDs - HLTOUT treatment: AliHLTOUTHomerCollection abstract interface for digits/raw data added - AliHLTOUTDigitReader added: reading of simulated HLT digit data - AliHLTOUTRawReader: common functionality moved to AliHLTOUTHomerCollection - TPCDigitPublisher enhanced: encode digits to raw data - AltroData Generator: encoding on channel level - corrections in documentation --- HLT/BASE/AliHLTComponent.cxx | 8 +- HLT/BASE/AliHLTDataBuffer.cxx | 40 +- HLT/BASE/AliHLTModuleAgent.cxx | 2 + HLT/BASE/AliHLTModuleAgent.h | 4 + HLT/BASE/AliHLTOUT.cxx | 45 ++- HLT/BASE/AliHLTOUT.h | 348 ++++++++++-------- HLT/BASE/AliHLTOUTHomerBuffer.cxx | 2 +- HLT/BASE/AliHLTOfflineDataSink.h | 8 + HLT/BASE/AliHLTOfflineInterface.cxx | 2 +- HLT/BASE/AliHLTSystem.cxx | 144 ++++++-- HLT/BASE/AliHLTSystem.h | 29 +- HLT/BASE/Makefile.am | 2 +- .../interface/AliHLTExternalInterface.cxx | 16 + HLT/BASE/interface/AliHLTExternalInterface.h | 13 + HLT/RCU/AliHLTAltroGenerator.cxx | 8 +- HLT/SampleLib/AliHLTSamplePreprocessor.h | 6 +- HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx | 38 +- HLT/TPCLib/AliHLTTPCFileHandler.cxx | 84 +++++ HLT/TPCLib/AliHLTTPCFileHandler.h | 9 +- HLT/TPCLib/macros/dumpTPCDigits.C | 141 +++++++ HLT/TPCLib/macros/sim-hlt-tpc.C | 2 +- HLT/libHLTrec.pkg | 5 +- HLT/rec/AliHLTEsdManager.cxx | 269 ++++++++++++++ HLT/rec/AliHLTEsdManager.h | 108 ++++++ HLT/rec/AliHLTOUTDigitReader.cxx | 213 +++++++++++ HLT/rec/AliHLTOUTDigitReader.h | 89 +++++ HLT/rec/AliHLTOUTHomerCollection.cxx | 203 ++++++++++ HLT/rec/AliHLTOUTHomerCollection.h | 126 +++++++ HLT/rec/AliHLTOUTRawReader.cxx | 200 +++------- HLT/rec/AliHLTOUTRawReader.h | 61 +-- HLT/rec/AliHLTReconstructor.cxx | 137 +++++-- HLT/rec/AliHLTReconstructor.h | 53 ++- HLT/rec/Makefile.am | 2 +- HLT/sim/AliHLTOUTComponent.cxx | 129 +++++-- HLT/sim/AliHLTOUTComponent.h | 32 +- HLT/sim/AliHLTSimulation.cxx | 34 +- 36 files changed, 2054 insertions(+), 558 deletions(-) create mode 100644 HLT/TPCLib/macros/dumpTPCDigits.C create mode 100644 HLT/rec/AliHLTEsdManager.cxx create mode 100644 HLT/rec/AliHLTEsdManager.h create mode 100644 HLT/rec/AliHLTOUTDigitReader.cxx create mode 100644 HLT/rec/AliHLTOUTDigitReader.h create mode 100644 HLT/rec/AliHLTOUTHomerCollection.cxx create mode 100644 HLT/rec/AliHLTOUTHomerCollection.h diff --git a/HLT/BASE/AliHLTComponent.cxx b/HLT/BASE/AliHLTComponent.cxx index 9f68abb7a91..ea786d1246b 100644 --- a/HLT/BASE/AliHLTComponent.cxx +++ b/HLT/BASE/AliHLTComponent.cxx @@ -652,7 +652,7 @@ TObject* AliHLTComponent::CreateInputObject(int idx, int bForce) } //} else { } else if (bForce!=0) { - HLTError("size missmatch: block size %d, indicated %d", fpInputBlocks[idx].fSize, firstWord+sizeof(AliHLTUInt32_t)); + HLTError("size mismatch: block size %d, indicated %d", fpInputBlocks[idx].fSize, firstWord+sizeof(AliHLTUInt32_t)); } } else { HLTFatal("block descriptor empty"); @@ -1192,7 +1192,7 @@ int AliHLTComponent::ProcessEvent( const AliHLTComponentEventData& evtData, AliHLTRunDesc rundesc; if ((iResult=CopyStruct(&rundesc, sizeof(AliHLTRunDesc), indexEOREvent, "AliHLTRunDesc", "SOR"))>0) { if (fpRunDesc->fRunNo!=rundesc.fRunNo) { - HLTWarning("run no missmatch: SOR %d, EOR %d", fpRunDesc->fRunNo, rundesc.fRunNo); + HLTWarning("run no mismatch: SOR %d, EOR %d", fpRunDesc->fRunNo, rundesc.fRunNo); } else { HLTDebug("EOR run no %d", fpRunDesc->fRunNo); } @@ -1414,11 +1414,11 @@ int AliHLTComponent::CopyStruct(void* pStruct, unsigned int iStructSize, unsigne if (fpInputBlocks[iBlockNo].fPtr && fpInputBlocks[iBlockNo].fSize) { AliHLTUInt32_t copy=*((AliHLTUInt32_t*)fpInputBlocks[iBlockNo].fPtr); if (fpInputBlocks[iBlockNo].fSize!=copy) { - HLTWarning("%s event: missmatch of block size (%d) and structure size (%d)", eventname, fpInputBlocks[iBlockNo].fSize, copy); + HLTWarning("%s event: mismatch of block size (%d) and structure size (%d)", eventname, fpInputBlocks[iBlockNo].fSize, copy); if (copy>fpInputBlocks[iBlockNo].fSize) copy=fpInputBlocks[iBlockNo].fSize; } if (copy!=iStructSize) { - HLTWarning("%s event: missmatch in %s version (data type version %d)", eventname, structname, ALIHLT_DATA_TYPES_VERSION); + HLTWarning("%s event: mismatch in %s version (data type version %d)", eventname, structname, ALIHLT_DATA_TYPES_VERSION); if (copy>iStructSize) { copy=iStructSize; } else { diff --git a/HLT/BASE/AliHLTDataBuffer.cxx b/HLT/BASE/AliHLTDataBuffer.cxx index 1f2fe78140b..d784d856032 100644 --- a/HLT/BASE/AliHLTDataBuffer.cxx +++ b/HLT/BASE/AliHLTDataBuffer.cxx @@ -1,20 +1,20 @@ // $Id$ -/************************************************************************** - * This file is property of and copyright by the ALICE HLT Project * - * ALICE Experiment at CERN, All rights reserved. * - * * - * Primary Authors: Matthias Richter * - * for The ALICE HLT Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTDataBuffer.cxx @author Matthias Richter @@ -22,12 +22,6 @@ @brief Handling of Data Buffers for HLT components. */ -// see header file for class documentation -// or -// refer to README to build package -// or -// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt - #if __GNUC__>= 3 using namespace std; #endif @@ -253,7 +247,7 @@ int AliHLTDataBuffer::Release(AliHLTComponentBlockData* pBlockDesc, AliHLTConsumerDescriptor* pDesc=FindConsumer(pConsumer, fActiveConsumers); if (pDesc) { if ((iResult=pDesc->CheckActiveDataSegment(AliHLTDataSegment(pBlockDesc->fPtr, pBlockDesc->fOffset, pBlockDesc->fSize)))!=1) { - HLTWarning("data segment missmatch, component %p has not subscribed to a segment with offset %#x and size %d", pConsumer, pBlockDesc->fOffset, pBlockDesc->fSize); + HLTWarning("data segment mismatch, component %p has not subscribed to a segment with offset %#x and size %d", pConsumer, pBlockDesc->fOffset, pBlockDesc->fSize); // TODO: appropriate error handling, but so far optional iResult=0; } else { @@ -382,7 +376,7 @@ int AliHLTDataBuffer::SetSegments(AliHLTUInt8_t* pTgt, AliHLTComponentBlockData* iResult=-EINVAL; } } else { - HLTFatal("internal data structur missmatch"); + HLTFatal("internal data structur mismatch"); iResult=-EFAULT; } } else { diff --git a/HLT/BASE/AliHLTModuleAgent.cxx b/HLT/BASE/AliHLTModuleAgent.cxx index c9e8316a022..169878eb187 100644 --- a/HLT/BASE/AliHLTModuleAgent.cxx +++ b/HLT/BASE/AliHLTModuleAgent.cxx @@ -49,6 +49,8 @@ AliHLTModuleAgent::AliHLTModuleAgent(const char* id) Register(this); } +const AliHLTModuleAgent::AliHLTOUTHandlerDesc AliHLTModuleAgent::fgkVoidHandlerDesc; + AliHLTModuleAgent::~AliHLTModuleAgent() { // see header file for function documentation diff --git a/HLT/BASE/AliHLTModuleAgent.h b/HLT/BASE/AliHLTModuleAgent.h index 0dedf769de2..1d89054e0ff 100644 --- a/HLT/BASE/AliHLTModuleAgent.h +++ b/HLT/BASE/AliHLTModuleAgent.h @@ -272,6 +272,8 @@ class AliHLTModuleAgent : public TObject, public AliHLTLogging { bool operator==(const AliHLTOUTHandlerType handlerType) const { return fHType==handlerType; } + operator AliHLTOUTHandlerType() {return fHType;} + operator AliHLTComponentDataType() {return fDt;} private: /** type of the handler */ @@ -282,6 +284,8 @@ class AliHLTModuleAgent : public TObject, public AliHLTLogging { TString fModule; //!transient }; + static const AliHLTOUTHandlerDesc fgkVoidHandlerDesc; //! initializer + /** * Get handler description for a data block. * @param dt [in] data type of the block diff --git a/HLT/BASE/AliHLTOUT.cxx b/HLT/BASE/AliHLTOUT.cxx index 3cca7304255..26826b157a3 100644 --- a/HLT/BASE/AliHLTOUT.cxx +++ b/HLT/BASE/AliHLTOUT.cxx @@ -109,7 +109,7 @@ int AliHLTOUT::FindAndSelectDataBlock() (fSearchHandlerType==AliHLTModuleAgent::kUnknownOutput || FindHandlerDesc(fCurrent->GetIndex())==fSearchHandlerType)) { iResult=fCurrent->GetIndex(); // TODO: check the byte order on the current system and the byte order of the - // data block, print warning when missmatch and user did not check + // data block, print warning when mismatch and user did not check //AliHLTOUTByteOrder blockBO=CheckByteOrder(); CheckByteOrder(); /* @@ -121,7 +121,7 @@ int AliHLTOUT::FindAndSelectDataBlock() ClearStatusFlag(kByteOrderChecked); // TODO: check the alignment on the current system and the alignment of the - // data block, print warning when missmatch and user did not check + // data block, print warning when mismatch and user did not check ClearStatusFlag(kAlignmentChecked); break; @@ -143,6 +143,20 @@ int AliHLTOUT::GetDataBlockDescription(AliHLTComponentDataType& dt, AliHLTUInt32 return iResult; } +const AliHLTOUT::AliHLTOUTHandlerListEntry& AliHLTOUT::GetDataBlockHandlerDesc() +{ + // see header file for class documentation + return FindHandlerDesc(GetDataBlockIndex()); +} + +AliHLTModuleAgent::AliHLTOUTHandlerType AliHLTOUT::GetDataBlockHandlerType() +{ + // see header file for class documentation + AliHLTModuleAgent::AliHLTOUTHandlerDesc desc=FindHandlerDesc(GetDataBlockIndex()); + AliHLTModuleAgent::AliHLTOUTHandlerType type=desc; + return type; +} + AliHLTUInt32_t AliHLTOUT::GetDataBlockIndex() { // see header file for class documentation @@ -176,6 +190,14 @@ int AliHLTOUT::ReleaseDataBuffer(const AliHLTUInt8_t* pBuffer) return iResult; } +AliHLTModuleAgent* AliHLTOUT::GetAgent() +{ + // see header file for class documentation + AliHLTModuleAgent* pAgent=NULL; + pAgent=FindHandlerDesc(GetDataBlockIndex()); + return pAgent; +} + AliHLTOUTHandler* AliHLTOUT::GetHandler() { // see header file for class documentation @@ -184,6 +206,13 @@ AliHLTOUTHandler* AliHLTOUT::GetHandler() return pHandler; } +int AliHLTOUT::WriteESD(const AliHLTUInt8_t* /*pBuffer*/, AliHLTUInt32_t /*size*/, AliHLTComponentDataType /*dt*/, AliESDEvent* /*tgtesd*/) const +{ + // see header file for class documentation + HLTWarning("method not implemented in base class"); + return -ENOSYS; +} + int AliHLTOUT::AddBlockDescriptor(const AliHLTOUTBlockDescriptor desc) { // see header file for class documentation @@ -231,7 +260,7 @@ int AliHLTOUT::InitHandlers() AliHLTModuleAgent::AliHLTOUTHandlerDesc handlerDesc; if (pAgent->GetHandlerDescription(dt, spec, handlerDesc)>0) { AliHLTOUTHandlerListEntry entry(pAgent->GetOutputHandler(dt, spec), handlerDesc, pAgent, GetDataBlockIndex()); - InsertHandler(entry); + InsertHandler(fDataHandlers, entry); remnants.pop_back(); break; } @@ -268,17 +297,17 @@ int AliHLTOUT::InitHandlers() return iResult; } -int AliHLTOUT::InsertHandler(const AliHLTOUTHandlerListEntry &entry) +int AliHLTOUT::InsertHandler(AliHLTOUTHandlerListEntryVector& list, const AliHLTOUTHandlerListEntry &entry) { // see header file for class documentation int iResult=0; - AliHLTOUTHandlerListEntryVector::iterator element=fDataHandlers.begin(); - while (element!=fDataHandlers.end()) { + AliHLTOUTHandlerListEntryVector::iterator element=list.begin(); + while (element!=list.end()) { if (entry==(*element)) break; element++; } - if (element==fDataHandlers.end()) { - fDataHandlers.push_back(entry); + if (element==list.end()) { + list.push_back(entry); } else { element->AddIndex(const_cast(entry)); } diff --git a/HLT/BASE/AliHLTOUT.h b/HLT/BASE/AliHLTOUT.h index 23bc252bffd..2e923b6c388 100644 --- a/HLT/BASE/AliHLTOUT.h +++ b/HLT/BASE/AliHLTOUT.h @@ -19,6 +19,8 @@ class AliHLTOUTHandler; class AliHLTOUTHandlerDesc; // AliHLTModuleAgent.h +class AliESDEvent; +class AliHLTReconstructor; #define AliHLTOUTInvalidIndex (~(AliHLTUInt32_t)0) @@ -40,76 +42,6 @@ class AliHLTOUT : public AliHLTLogging { /** standard destructor */ virtual ~AliHLTOUT(); - /** - * Init for processing. - * The HLTOUT is scanned for all available data blocks and the - * AliHLTOUTHandler objects for the data blocks are created according - * to the module agents (see AliHLTModuleAgent). - */ - int Init(); - - /** - * Get number of data blocks in the HLTOUT data - */ - int GetNofDataBlocks(); - - /** - * Select the first data block of a certain data type and specification. - * The selection criteria can be of kAliHLTAnyDataType and/or - * kAliHLTVoidDataSpec in order to be ignored and just match any data block. - * - * The search criteria can be combined with a handler type (e.g. kRawReader) - * @param dt [in] data type to match
- * @param spec [in] data specification to match
- * @param handlerType [in] type of the handler - * @return identifier >0 if success, 0 if no block found
- * neg. error code if failed
- * -EPERM if access denied (object locked) - */ - int SelectFirstDataBlock(AliHLTComponentDataType dt=kAliHLTAnyDataType, - AliHLTUInt32_t spec=kAliHLTVoidDataSpec, - AliHLTModuleAgent::AliHLTOUTHandlerType handlerType=AliHLTModuleAgent::kUnknownOutput); - - /** - * Select the next data block of data type and specification of the previous - * call to @ref SelectFirstDataBlock. - * @return identifier >0 if success, 0 if no block found
- * neg. error code if failed
- * -EPERM if access denied (object locked) - */ - int SelectNextDataBlock(); - - /** - * Get properties of the selected data block. - * @param dt [out] data type of the selected block - * @param spec [out] data specification of the selected block - */ - int GetDataBlockDescription(AliHLTComponentDataType& dt, AliHLTUInt32_t& spec); - - /** - * Get the index of the current data block. - * @return index, AliHLTOUTInvalidIndex if no block selected - */ - AliHLTUInt32_t GetDataBlockIndex(); - - /** - * Get buffer of the selected data block. - * @param pBuffer [out] buffer of the selected data block - * @param size [out] size of the selected data block - */ - int GetDataBuffer(const AliHLTUInt8_t* &pBuffer, AliHLTUInt32_t& size); - - /** - * Release buffer after use. - * @param pBuffer [in] buffer of the selected data block - */ - int ReleaseDataBuffer(const AliHLTUInt8_t* pBuffer); - - /** - * Get handler for the selected data block. - */ - AliHLTOUTHandler* GetHandler(); - /** * Locking guard for the AliHLTOUT object. * If the object is locked, the selection of data blocks can not be changed. @@ -199,6 +131,185 @@ class AliHLTOUT : public AliHLTLogging { AliHLTUInt32_t fIndex; //!transient }; + class AliHLTOUTHandlerListEntry { + public: + AliHLTOUTHandlerListEntry(AliHLTOUTHandler* pHandler, + AliHLTModuleAgent::AliHLTOUTHandlerDesc& handlerDesc, + AliHLTModuleAgent* pAgent, + AliHLTUInt32_t index); + + /** copy constructor for vector handling */ + AliHLTOUTHandlerListEntry(const AliHLTOUTHandlerListEntry& src); + + /** assignment operator for vector handling */ + AliHLTOUTHandlerListEntry& operator=(const AliHLTOUTHandlerListEntry& src); + + ~AliHLTOUTHandlerListEntry(); + + static const AliHLTOUTHandlerListEntry fgkVoidHandlerListEntry; //! initializer + + operator AliHLTOUTHandler*() const {return fpHandler;} + + // please note that fpHandlerDesc is really a pointer and is created + // in the constructor. Thats why it is dereferenced here. The pointer + // type is on purpose, even though it is a bit confusing with the + // argument by reference in the AliHLTOUTHandlerListEntry constructor. + operator const AliHLTModuleAgent::AliHLTOUTHandlerDesc&() const + {return fpHandlerDesc?*fpHandlerDesc:AliHLTModuleAgent::fgkVoidHandlerDesc;} + operator AliHLTModuleAgent*() const {return fpAgent;} + + /** + * Two list entries are considered to be equal if the handlers + * are equal. + */ + bool operator==(const AliHLTOUTHandlerListEntry& entry) const; + + bool operator==(const AliHLTModuleAgent::AliHLTOUTHandlerType handlerType) const; + + AliHLTUInt32_t operator[](int i) const; + + /** + * Add a block index to this descriptor. + * One descriptor can serve multiple blocks if the agent returns the + * same handler for all of the blocks. Instead of creating a new entry + * the block index ist just added + */ + void AddIndex(AliHLTUInt32_t index); + + /** + * Add all indexes of the descriptor. + */ + void AddIndex(AliHLTOUTHandlerListEntry &desc); + + /** + * Check if an index is served by this descriptor. + * @return true if the index is in the table + */ + bool HasIndex(AliHLTUInt32_t index); + + private: + /** standard constructor prohibited */ + AliHLTOUTHandlerListEntry(); + + /** pointer to the handler */ + AliHLTOUTHandler* fpHandler; //! transient + + /** pointer to handler description */ + AliHLTModuleAgent::AliHLTOUTHandlerDesc* fpHandlerDesc; //! transient + + /** pointer to module agent */ + AliHLTModuleAgent* fpAgent; //! transient + + /** list of block indexes */ + AliHLTOUTIndexList fBlocks; //!transient + }; + + typedef vector AliHLTOUTHandlerListEntryVector; + typedef vector AliHLTOUTBlockDescriptorVector; + + /** + * Init for processing. + * The HLTOUT is scanned for all available data blocks and the + * AliHLTOUTHandler objects for the data blocks are created according + * to the module agents (see AliHLTModuleAgent). + */ + int Init(); + + /** + * Get number of data blocks in the HLTOUT data + */ + int GetNofDataBlocks(); + + /** + * Select the first data block of a certain data type and specification. + * The selection criteria can be of kAliHLTAnyDataType and/or + * kAliHLTVoidDataSpec in order to be ignored and just match any data block. + * + * The search criteria can be combined with a handler type (e.g. kRawReader) + * @param dt [in] data type to match
+ * @param spec [in] data specification to match
+ * @param handlerType [in] type of the handler + * @return identifier >0 if success, 0 if no block found
+ * neg. error code if failed
+ * -EPERM if access denied (object locked) + */ + int SelectFirstDataBlock(AliHLTComponentDataType dt=kAliHLTAnyDataType, + AliHLTUInt32_t spec=kAliHLTVoidDataSpec, + AliHLTModuleAgent::AliHLTOUTHandlerType handlerType=AliHLTModuleAgent::kUnknownOutput); + + /** + * Select the next data block of data type and specification of the previous + * call to @ref SelectFirstDataBlock. + * @return identifier >0 if success, 0 if no block found
+ * neg. error code if failed
+ * -EPERM if access denied (object locked) + */ + int SelectNextDataBlock(); + + /** + * Get properties of the selected data block. + * @param dt [out] data type of the selected block + * @param spec [out] data specification of the selected block + */ + int GetDataBlockDescription(AliHLTComponentDataType& dt, AliHLTUInt32_t& spec); + + /** + * Get handler description of the current data block. + */ + const AliHLTOUTHandlerListEntry& GetDataBlockHandlerDesc(); + + /** + * Get handler type of the selected data block. + * @return handler type for the selected data block + */ + AliHLTModuleAgent::AliHLTOUTHandlerType GetDataBlockHandlerType(); + + /** + * Get the index of the current data block. + * @return index, AliHLTOUTInvalidIndex if no block selected + */ + AliHLTUInt32_t GetDataBlockIndex(); + + /** + * Get buffer of the selected data block. + * @param pBuffer [out] buffer of the selected data block + * @param size [out] size of the selected data block + */ + int GetDataBuffer(const AliHLTUInt8_t* &pBuffer, AliHLTUInt32_t& size); + + /** + * Release buffer after use. + * @param pBuffer [in] buffer of the selected data block + */ + int ReleaseDataBuffer(const AliHLTUInt8_t* pBuffer); + + /** + * Get module agent for the selected data block. + */ + AliHLTModuleAgent* GetAgent(); + + /** + * Get handler for the selected data block. + */ + AliHLTOUTHandler* GetHandler(); + + /** + * Convert data buffer to ESD. + * The buffer is supposed to describe a streamed AliESDEvent object. + * If no target object is specified, the ESD is written to a file AliHLTdetESDs.root, + * where 'det' is derived from the data type origin. Each time the function is invoked + * a new event is created. Dummy events are added if the previous events did not contain + * + * The function needs AliRoot and might not be implemented by all AliHLTOUT + * implementations. + * a data block of this specification. + * @param pBuffer [in] the data buffer + * @param size [in] data buffer size + * @param dt [in] data type of the block + * @param tgtesd [out] optional target + */ + virtual int WriteESD(const AliHLTUInt8_t* pBuffer, AliHLTUInt32_t size, AliHLTComponentDataType dt, AliESDEvent* tgtesd=NULL) const; + enum AliHLTOUTByteOrder { /** no data block selected */ kInvalidByteOrder=-1, @@ -236,6 +347,17 @@ class AliHLTOUT : public AliHLTLogging { */ static AliHLTUInt32_t ByteSwap32(AliHLTUInt32_t src); + /** + * Insert a handler item. + * The current list entries are checked if the handler is already in + * the list. It is added if not in the list, otherwise the block index + * is added to the existing entry. + * @param entry handler list entry + * @return 0 if added, EEXIST (non negative!) if merged with existing entry
+ * neg. error code if failed + */ + static int InsertHandler(AliHLTOUTHandlerListEntryVector& list, const AliHLTOUTHandlerListEntry &entry); + protected: /** * Add a block descriptor. @@ -280,78 +402,6 @@ class AliHLTOUT : public AliHLTLogging { kAlignmentWarning = 0x20 }; - class AliHLTOUTHandlerListEntry { - public: - AliHLTOUTHandlerListEntry(AliHLTOUTHandler* pHandler, - AliHLTModuleAgent::AliHLTOUTHandlerDesc& handlerDesc, - AliHLTModuleAgent* pAgent, - AliHLTUInt32_t index); - - /** copy constructor for vector handling */ - AliHLTOUTHandlerListEntry(const AliHLTOUTHandlerListEntry& src); - - /** assignment operator for vector handling */ - AliHLTOUTHandlerListEntry& operator=(const AliHLTOUTHandlerListEntry& src); - - ~AliHLTOUTHandlerListEntry(); - - static const AliHLTOUTHandlerListEntry fgkVoidHandlerListEntry; //! initializer - - operator AliHLTOUTHandler*() const {return fpHandler;} - - // please note that fpHandlerDesc is really a pointer and is created - // in the constructor. Thats why it is dereferenced here. The pointer - // type is on purpose, even though it is a bit confusing with the - // argument by reference in the AliHLTOUTHandlerListEntry constructor. - operator AliHLTModuleAgent::AliHLTOUTHandlerDesc&() const {return *fpHandlerDesc;} - operator AliHLTModuleAgent*() const {return fpAgent;} - - /** - * Two list entries are considered to be equal if the handlers - * are equal. - */ - bool operator==(const AliHLTOUTHandlerListEntry& entry) const; - - bool operator==(const AliHLTModuleAgent::AliHLTOUTHandlerType handlerType) const; - - AliHLTUInt32_t operator[](int i) const; - - /** - * Add a block index to this descriptor. - * One descriptor can serve multiple blocks if the agent returns the - * same handler for all of the blocks. Instead of creating a new entry - * the block index ist just added - */ - void AddIndex(AliHLTUInt32_t index); - - /** - * Add all indexes of the descriptor. - */ - void AddIndex(AliHLTOUTHandlerListEntry &desc); - - /** - * Check if an index is served by this descriptor. - * @return true if the index is in the table - */ - bool HasIndex(AliHLTUInt32_t index); - - private: - /** standard constructor prohibited */ - AliHLTOUTHandlerListEntry(); - - /** pointer to the handler */ - AliHLTOUTHandler* fpHandler; //! transient - - /** pointer to handler description */ - AliHLTModuleAgent::AliHLTOUTHandlerDesc* fpHandlerDesc; //! transient - - /** pointer to module agent */ - AliHLTModuleAgent* fpAgent; //! transient - - /** list of block indexes */ - AliHLTOUTIndexList fBlocks; //!transient - }; - /** * Generate the index of the HLTOUT data. * Must be implemented by the child classes. @@ -416,17 +466,6 @@ class AliHLTOUT : public AliHLTLogging { */ int CheckStatusFlag(unsigned int flag) const {return (fFlags&flag)==flag;} - /** - * Insert a handler item. - * The current list entries are checked if the handler is already in - * the list. It is added if not in the list, otherwise the block index - * is added to the existing entry. - * @param entry handler list entry - * @return 0 if added, EEXIST (non negative!) if merged with existing entry
- * neg. error code if failed - */ - int InsertHandler(const AliHLTOUTHandlerListEntry &entry); - /** * Find handler description for a certain block index. */ @@ -444,9 +483,6 @@ class AliHLTOUT : public AliHLTLogging { /** instance flags: locked, collecting, ... */ unsigned int fFlags; //!transient - typedef vector AliHLTOUTHandlerListEntryVector; - typedef vector AliHLTOUTBlockDescriptorVector; - /** list of block descriptors */ AliHLTOUTBlockDescriptorVector fBlockDescList; //!transient diff --git a/HLT/BASE/AliHLTOUTHomerBuffer.cxx b/HLT/BASE/AliHLTOUTHomerBuffer.cxx index 8bc6b0a23d7..789d5006ec0 100644 --- a/HLT/BASE/AliHLTOUTHomerBuffer.cxx +++ b/HLT/BASE/AliHLTOUTHomerBuffer.cxx @@ -126,7 +126,7 @@ int AliHLTOUTHomerBuffer::ScanReader(AliHLTMonitoringReader* pReader, AliHLTUInt // first check if the offset allows to add all data blocks without exceeding the // range - while (nofBlocks0) { + while (nofBlocks>tmp1 && tmp2>0) { if (tmp2&0x1) { HLTError("index range %#x exceeded for %d data blocks", nofBlocks, offset); iResult=-ERANGE; diff --git a/HLT/BASE/AliHLTOfflineDataSink.h b/HLT/BASE/AliHLTOfflineDataSink.h index f52067887f8..ee3b15d6546 100644 --- a/HLT/BASE/AliHLTOfflineDataSink.h +++ b/HLT/BASE/AliHLTOfflineDataSink.h @@ -38,6 +38,14 @@ * * @note This class is only used for the @ref alihlt_system. * + * @note This class is very likely to be deprecated. According to the new + * reconstruction scheme, the esd is no longer filled by components in the + * reconstruction chain, but added to the HLTOUT data. The HLTOUT is + * processed during AliReconstruction at the end of the HLT event processing, + * literally during the FillESD method of the AliRoot reconstruction + * interface. The HLT module must implement HLTOUT handlers and provide + * those through the module agent. + * * @ingroup alihlt_system */ class AliHLTOfflineDataSink diff --git a/HLT/BASE/AliHLTOfflineInterface.cxx b/HLT/BASE/AliHLTOfflineInterface.cxx index 84f7fcca9c9..5d89811e783 100644 --- a/HLT/BASE/AliHLTOfflineInterface.cxx +++ b/HLT/BASE/AliHLTOfflineInterface.cxx @@ -160,7 +160,7 @@ int AliHLTOfflineInterface::FillComponentESDs(int eventNo, AliRunLoader* runLoad if (pCurrent) { pCurrent->SetESD(eventNo, esd); if (pCurrent->GetRunLoader()!=runLoader) { - //HLTWarning("runLoader missmatch: component %p was reconstructed with runLoader %p, but got %p now", pCurrent, pCurrent->GetRunLoader(), runLoader); + //HLTWarning("runLoader mismatch: component %p was reconstructed with runLoader %p, but got %p now", pCurrent, pCurrent->GetRunLoader(), runLoader); } iLocal=pCurrent->FillESD(eventNo, runLoader, esd); } diff --git a/HLT/BASE/AliHLTSystem.cxx b/HLT/BASE/AliHLTSystem.cxx index f4286bd846f..f53c463f7a7 100644 --- a/HLT/BASE/AliHLTSystem.cxx +++ b/HLT/BASE/AliHLTSystem.cxx @@ -1,20 +1,20 @@ // $Id$ -/************************************************************************** - * This file is property of and copyright by the ALICE HLT Project * - * ALICE Experiment at CERN, All rights reserved. * - * * - * Primary Authors: Matthias Richter * - * for The ALICE HLT Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTSystem.cxx @author Matthias Richter @@ -22,12 +22,6 @@ @brief Implementation of HLT module management. */ -// see header file for class documentation -// or -// refer to README to build package -// or -// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt - #if __GNUC__>= 3 using namespace std; #endif @@ -43,6 +37,8 @@ using namespace std; #include "AliHLTModuleAgent.h" #include "AliHLTOfflineInterface.h" #include "AliHLTDataSource.h" +#include "AliHLTOUT.h" +#include "AliHLTOUTHandler.h" #include #include #include @@ -59,6 +55,7 @@ const char* AliHLTSystem::fgkHLTDefaultLibs[]= { //"libAliHLTPHOS.so", //"libAliHLTMUON.so", "libAliHLTTRD.so", + "libAliHLTTrigger.so", NULL }; @@ -199,7 +196,7 @@ int AliHLTSystem::BuildTaskList(AliHLTConfiguration* pConf) AliHLTTask* pTask=NULL; if ((pTask=FindTask(pConf->GetName()))!=NULL) { if (pTask->GetConf()!=pConf) { - HLTError("configuration missmatch, there is already a task with configuration name \"%s\", but it is different. Most likely configuration %p is not registered properly", pConf->GetName(), pConf); + HLTError("configuration mismatch, there is already a task with configuration name \"%s\", but it is different. Most likely configuration %p is not registered properly", pConf->GetName(), pConf); iResult=-EEXIST; } // task for this configuration exists, terminate @@ -702,6 +699,109 @@ int AliHLTSystem::FillESD(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd return iResult; } +int AliHLTSystem::ProcessHLTOUT(AliHLTOUT* pHLTOUT, AliESDEvent* esd) +{ + // see header file for class documentation + int iResult=0; + if (!pHLTOUT) return -EINVAL; + + HLTDebug("processing %d HLT data blocks", pHLTOUT->GetNofDataBlocks()); + AliHLTOUT::AliHLTOUTHandlerListEntryVector esdHandlers; + for (iResult=pHLTOUT->SelectFirstDataBlock(); + iResult>=0; + iResult=pHLTOUT->SelectNextDataBlock()) { + AliHLTComponentDataType dt=kAliHLTVoidDataType; + AliHLTUInt32_t spec=kAliHLTVoidDataSpec; + pHLTOUT->GetDataBlockDescription(dt, spec); + AliHLTOUTHandler* pHandler=pHLTOUT->GetHandler(); + AliHLTModuleAgent::AliHLTOUTHandlerType handlerType=pHLTOUT->GetDataBlockHandlerType(); + if (!pHandler && (dt!=kAliHLTDataTypeESDObject || dt!=kAliHLTDataTypeESDTree)) { + handlerType=AliHLTModuleAgent::kEsd; + } + const char* pMsg="invalid"; + switch (handlerType) { + case AliHLTModuleAgent::kEsd: + { + if (pHandler) { + // preprocess and write later + AliHLTOUT::AliHLTOUTLockGuard g(pHLTOUT); + pHandler->ProcessData(pHLTOUT); + pHLTOUT->InsertHandler(esdHandlers, pHLTOUT->GetDataBlockHandlerDesc()); + } else { + // write directly + const AliHLTUInt8_t* pBuffer=NULL; + AliHLTUInt32_t size=0; + if (pHLTOUT->GetDataBuffer(pBuffer, size)>=0) { + pHLTOUT->WriteESD(pBuffer, size, dt); + pHLTOUT->ReleaseDataBuffer(pBuffer); + } + } + } + break; + case AliHLTModuleAgent::kRawReader: + // handled in the AliRawReaderHLT + break; + case AliHLTModuleAgent::kRawStream: + HLTWarning("HLTOUT handler type 'kRawStream' not yet implemented: agent %s, data type %s, specification %#x", + pMsg, pHLTOUT->GetAgent()?pHLTOUT->GetAgent()->GetModuleId():"invalid", + AliHLTComponent::DataType2Text(dt).c_str(), spec); + break; + case AliHLTModuleAgent::kChain: + HLTWarning("HLTOUT handler type 'kChain' not yet implemented: agent %s, data type %s, specification %#x", + pMsg, pHLTOUT->GetAgent()?pHLTOUT->GetAgent()->GetModuleId():"invalid", + AliHLTComponent::DataType2Text(dt).c_str(), spec); + break; + case AliHLTModuleAgent::kProprietary: + HLTDebug("processing proprietary data: agent %s, data type %s, specification %#x", + pMsg, pHLTOUT->GetAgent()?pHLTOUT->GetAgent()->GetModuleId():"invalid", + AliHLTComponent::DataType2Text(dt).c_str(), spec); + if (pHandler) { + AliHLTOUT::AliHLTOUTLockGuard g(pHLTOUT); + int res=pHandler->ProcessData(pHLTOUT); + if (res<0) { + HLTWarning("processing proprietary data failed (%d): agent %s, data type %s, specification %#x", + res, pMsg, pHLTOUT->GetAgent()?pHLTOUT->GetAgent()->GetModuleId():"invalid", + AliHLTComponent::DataType2Text(dt).c_str(), spec); + } + } + break; + case AliHLTModuleAgent::kUnknownOutput: + pMsg="unknown"; + // fall trough intended + default: + HLTWarning("%s handler type: agent %s, data type %s, specification %#x, ... skipping data block", + pMsg, pHLTOUT->GetAgent()?pHLTOUT->GetAgent()->GetModuleId():"invalid", + AliHLTComponent::DataType2Text(dt).c_str(), spec); + } + } + // TODO: the return value of SelectFirst/NextDataBlock must be + // changed in order to avoid this check + if (iResult==-ENOENT) iResult=0; + + AliHLTOUT::AliHLTOUTHandlerListEntryVector::iterator esdHandler; + // write all postponed esd data blocks + // first come first serve: the ESD of the first handler is also filled into + // the main ESD. Has to be changed later. + AliESDEvent* pMasterESD=esd; + for (esdHandler=esdHandlers.begin(); esdHandler!=esdHandlers.end() && iResult>=0; esdHandler++) { + AliHLTOUTHandler* pHandler=*esdHandler; + const AliHLTUInt8_t* pBuffer=NULL; + AliHLTUInt32_t size=0; + if ((size=pHandler->GetProcessedData(pBuffer))>0) { + AliHLTModuleAgent::AliHLTOUTHandlerDesc desc=*esdHandler; + AliHLTComponentDataType dt=desc; + pHLTOUT->WriteESD(pBuffer, size, dt); + if (pMasterESD) { + pHLTOUT->WriteESD(pBuffer, size, dt, pMasterESD); + pMasterESD=NULL; + } + pHandler->ReleaseProcessedData(pBuffer, size); + } + } + + return iResult; +} + int AliHLTSystem::LoadComponentLibraries(const char* libraries) { // see header file for class documentation diff --git a/HLT/BASE/AliHLTSystem.h b/HLT/BASE/AliHLTSystem.h index 530da6074e6..dc92866e885 100644 --- a/HLT/BASE/AliHLTSystem.h +++ b/HLT/BASE/AliHLTSystem.h @@ -3,8 +3,9 @@ #ifndef ALIHLTSYSTEM_H #define ALIHLTSYSTEM_H -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * /** @file AliHLTSystem.h @author Matthias Richter @@ -13,12 +14,6 @@ @note The class is used in Offline (AliRoot) context */ -// see below for class documentation -// or -// refer to README to build package -// or -// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt - /** * @defgroup alihlt_system HLT integration into AliRoot * This section describes the HLT integration into AliRoot. @@ -32,6 +27,7 @@ class AliHLTComponentHandler; class AliHLTConfiguration; class AliHLTConfigurationHandler; class AliHLTTask; +class AliHLTOUT; class AliRunLoader; class AliRawReader; class AliESDEvent; @@ -251,6 +247,18 @@ class AliHLTSystem : public AliHLTLogging { * Fill ESD for one event. * To be called by the AliHLTReconstructor plugin during the event loop * and FillESD method of the AliRoot reconstruction. + * + * The method is most likely deprecated as the scheme has been slightly + * changed. The ESD is filled by the HLTOUT handlers u=implemented by the + * HLT modules rather than by components within the reconstruction chain. + * Still, HLT reconstruction chains can be run during the AliRoot + * reconstruction, data produced by such chains is automatically added + * to the HLTOUT stream in order to be equivalent to the online HLT. + * The HLTOUT is processed during AliReconstruction at the end of the + * HLT event processing, literally during the FillESD method of the AliRoot + * reconstruction interface. The HLT module must implement HLTOUT handlers + * and provide those through the module agent. + * * This method is called on event basis, and thus must copy the previously * reconstructed data of the event from the 'ESD' recorder. The FillESD * method of all active AliHLTOfflineDataSink's is called. @@ -263,6 +271,11 @@ class AliHLTSystem : public AliHLTLogging { */ int FillESD(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd); + /** + * Process the HLTOUT data. + */ + int ProcessHLTOUT(AliHLTOUT* pHLTOUT, AliESDEvent* esd); + /** * Load component libraries. * @param libs string of blank separated library names diff --git a/HLT/BASE/Makefile.am b/HLT/BASE/Makefile.am index 7bd78ebb433..dd88de9e983 100644 --- a/HLT/BASE/Makefile.am +++ b/HLT/BASE/Makefile.am @@ -22,7 +22,7 @@ bin_SCRIPTS = setenv.sh setenv.csh lib_LTLIBRARIES = libHLTbase.la # version info for the library -LIBRARY_VERSION = '4:0:1' +LIBRARY_VERSION = '5:0:2' # MODDIR is set by the AliRoot build system and denotes the topdir # of the module, we must set it since the package definition libHLTbase.pkg diff --git a/HLT/BASE/interface/AliHLTExternalInterface.cxx b/HLT/BASE/interface/AliHLTExternalInterface.cxx index 747ff688aba..ff3f91596d0 100644 --- a/HLT/BASE/interface/AliHLTExternalInterface.cxx +++ b/HLT/BASE/interface/AliHLTExternalInterface.cxx @@ -140,3 +140,19 @@ int AliHLTSystemSetOptions(AliHLTSystem* pInstance, const char* options) } return iResult; } + +int AliHLTSystemProcessHLTOUT(AliHLTSystem* pInstance, AliHLTOUT* pHLTOUT, AliESDEvent* esd) +{ + int iResult=0; + if (pInstance) { + AliHLTSystem* pSystem=reinterpret_cast(pInstance); + if (pSystem) { + iResult=pSystem->ProcessHLTOUT(pHLTOUT, esd); + } else { + iResult=-EFAULT; + } + } else { + iResult=-EINVAL; + } + return iResult; +} diff --git a/HLT/BASE/interface/AliHLTExternalInterface.h b/HLT/BASE/interface/AliHLTExternalInterface.h index 44789fa768a..4d499ffc5c0 100644 --- a/HLT/BASE/interface/AliHLTExternalInterface.h +++ b/HLT/BASE/interface/AliHLTExternalInterface.h @@ -14,6 +14,8 @@ #include class AliHLTSystem; +class AliHLTOUT; +class AliESDEvent; #ifdef __cplusplus extern "C" { #endif @@ -158,6 +160,17 @@ int AliHLT_C_GetOutputSize( AliHLTComponentHandle, unsigned long* constBase, dou */ int AliHLTSystemSetOptions(AliHLTSystem*, const char*); +/** + * Process the HLTOUT data with the specified system instance. + * The function is introduced for the sake of backward compatibility. + * Called from AliHLTReconstructor, which loads the function dynamically. + * @return neg. error code if failed
+ * -EFAULT type cast failed
+ * -EINVAL invalid parameter + * @ingroup alihlt_system_interface + */ +int AliHLTSystemProcessHLTOUT(AliHLTSystem* pInstance, AliHLTOUT* pHLTOUT, AliESDEvent* esd); + #ifdef __cplusplus } #endif diff --git a/HLT/RCU/AliHLTAltroGenerator.cxx b/HLT/RCU/AliHLTAltroGenerator.cxx index ea7c5626139..1f146c8b17c 100644 --- a/HLT/RCU/AliHLTAltroGenerator.cxx +++ b/HLT/RCU/AliHLTAltroGenerator.cxx @@ -344,8 +344,8 @@ int AliHLTAltroGenerator::EncodeData(AliHLTUInt8_t* pBuffer, int size) int startTime=fpSimData->At(dataPos++); int time=startTime; for (; timeAt(dataPos++), time); - iResult=encoder.AddChannelSignal(fpSimData->At(dataPos++), time, channelAddress); + iResult=encoder.AddSignal(fpSimData->At(dataPos++), time); + //iResult=encoder.AddChannelSignal(fpSimData->At(dataPos++), time, channelAddress); } assert(time-1==fpSimData->At(dataPos)); dataPos++; // DO NOT PUT INTO ASSERT @@ -359,10 +359,10 @@ int AliHLTAltroGenerator::EncodeData(AliHLTUInt8_t* pBuffer, int size) assert(channelAddress==fpSimData->At(dataPos)); dataPos++; // DO NOT PUT INTO ASSERT } - //encoder.SetChannel(channelAddress); + encoder.SetChannel(channelAddress); } if (iResult>=0 && channelAddress>=0) { - encoder.SetChannel(channelAddress); + //encoder.SetChannel(channelAddress); } if (iResult>=0) { diff --git a/HLT/SampleLib/AliHLTSamplePreprocessor.h b/HLT/SampleLib/AliHLTSamplePreprocessor.h index acf56c8632d..f51102d4307 100644 --- a/HLT/SampleLib/AliHLTSamplePreprocessor.h +++ b/HLT/SampleLib/AliHLTSamplePreprocessor.h @@ -11,7 +11,7 @@ * @file AliHLTSamplePreprocessor.h * @author Kenneth Aamodt, Sebastian Bablok * @date 2007-12-06 - * @brief HLT Preprocessor plugin for the AliHLTComp library + * @brief HLT Preprocessor plugin for the AliHLTSample library */ // see below for class documentation @@ -24,9 +24,7 @@ /** * @class AliHLTSamplePreprocessor - * HLT preprocessor for the libAliHLTComp module. - * - * @author Jenny Wagner, Matthias Richter + * A sample HLT preprocessor. * * @date 2008-01-22 */ diff --git a/HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx b/HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx index 79722bb4a9d..4e0b5183202 100644 --- a/HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx +++ b/HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx @@ -1,28 +1,28 @@ // @(#) $Id$ -/************************************************************************** - * This file is property of and copyright by the ALICE HLT Project * - * ALICE Experiment at CERN, All rights reserved. * - * * - * Primary Authors: Matthias Richter * - * for The ALICE HLT Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTTPCEsdWriterComponent.cxx @author Matthias Richter @date @brief Writer component to store tracks of the HLT TPC conformal mapping tracker in the AliESD format +*/ - */ // see header file for class documentation // or // refer to README to build package @@ -179,7 +179,7 @@ int AliHLTTPCEsdWriterComponent::ProcessBlocks(TTree* pTree, AliESDEvent* pESD, if (minslice >=-1 && minslicefPtr; @@ -226,7 +226,7 @@ int AliHLTTPCEsdWriterComponent::Tracks2ESD(AliHLTTPCTrackArray* pTracks, AliESD HLTError("conversion to AliKalmanTrack failed for track %d of %d", i, pTracks->GetNTracks()); } } else { - HLTError("internal missmatch in array"); + HLTError("internal mismatch in array"); iResult=-EFAULT; } } @@ -273,7 +273,7 @@ void AliHLTTPCEsdWriterComponent::AliConverter::GetOutputDataSize(unsigned long& { // see header file for class documentation constBase=1000000; - inputMultiplier=1.0; + inputMultiplier=5.0; } int AliHLTTPCEsdWriterComponent::AliConverter::DoInit(int argc, const char** argv) diff --git a/HLT/TPCLib/AliHLTTPCFileHandler.cxx b/HLT/TPCLib/AliHLTTPCFileHandler.cxx index 96f39a9b044..e91d8b704b6 100644 --- a/HLT/TPCLib/AliHLTTPCFileHandler.cxx +++ b/HLT/TPCLib/AliHLTTPCFileHandler.cxx @@ -54,6 +54,8 @@ #include "AliHLTTPCSpacePointData.h" //#include "AliHLTTPCTrackArray.h" #include "AliHLTTPCFileHandler.h" +#include "AliHLTTPCMapping.h" +#include "AliHLTAltroEncoder.h" #if __GNUC__ >= 3 using namespace std; @@ -621,6 +623,88 @@ AliHLTTPCDigitRowData * AliHLTTPCFileHandler::AliDigits2Memory(UInt_t & nrow,Int return data; } +int AliHLTTPCFileHandler::AliDigits2Altro(Int_t event, Byte_t* tgtBuffer, UInt_t tgtSize) +{ + //Read data from AliROOT file into memory, and store it in the ALTRO data format + //in the provided buffer + //Returns: size of the encoded data in bytes + int iResult=0; + + if(!fInAli){ + LOG(AliHLTTPCLog::kWarning,"AliHLTTPCFileHandler::AliDigits2Altro","File") + <<"No Input avalible: Pointer to fInAli == NULL"<=0;r++){ + Int_t n=fIndex[fSlice][r]; + + Int_t row=0; + Int_t rowOffset=0; + AliHLTTPCTransform::Slice2Sector(fSlice,r,sector,row); + AliHLTTPCTransform::Slice2Sector(fSlice,AliHLTTPCTransform::GetFirstRow(fPatch),sector,rowOffset); + + if(n!=-1){//data on that row + Int_t lslice,lrow; + fDigitsTree->GetEvent(n); + fParam->AdjustSectorRow(fDigits->GetID(),sector,row); + AliHLTTPCTransform::Sector2Slice(lslice,lrow,sector,row); + if(lrow!=r){ + LOG(AliHLTTPCLog::kError,"AliHLTTPCFileHandler::AliDigits2Altro","Row") + <First(); + do { + time=fDigits->CurrentRow(); + pad=fDigits->CurrentColumn(); + dig = fDigits->GetDigit(time,pad); + if (dig <= fParam->GetZeroSup()) continue; + if(dig >= AliHLTTPCTransform::GetADCSat()) + dig = AliHLTTPCTransform::GetADCSat(); + + channelAddress=mapper.GetHwAddress(row-rowOffset, pad); + iResult=encoder.AddChannelSignal(dig, time, channelAddress); + } while (fDigits->Next() && iResult>=0); + if (iResult>=0 && channelAddress>=0) { + iResult=encoder.SetChannel(channelAddress); + } + } + } + + if (iResult>=0) { + iResult=(encoder.GetTotal40bitWords()*5)/4; + } + + return iResult; +} + AliHLTTPCDigitRowData * AliHLTTPCFileHandler::AliAltroDigits2Memory(UInt_t & nrow,Int_t event,Bool_t eventmerge) { //Read data from AliROOT file into memory, and store it in the HLT data format. diff --git a/HLT/TPCLib/AliHLTTPCFileHandler.h b/HLT/TPCLib/AliHLTTPCFileHandler.h index b95e190666c..9ec32d3a38f 100644 --- a/HLT/TPCLib/AliHLTTPCFileHandler.h +++ b/HLT/TPCLib/AliHLTTPCFileHandler.h @@ -101,18 +101,23 @@ class AliHLTTPCFileHandler:public AliHLTTPCMemHandler { } /** - * Convert and filetr AliDigits from AliRoot file to HLT Digit data in memory. + * Convert and filter AliDigits from AliRoot file to HLT Digit data in memory. * This functions is the same as @ref AliDigits2Memory but in addition it * filters out single timebins, which is noise. The timebins which * are removed are timebins which have the 4 zero neighbours; * (pad-1,time),(pad+1,time),(pad,time-1),(pad,time+1). * - * This is legacy code, the two function contain big portions of identical code + * This is legacy code, the two functions contain big portions of identical code * will be merged. * See @ref AliDigits2Memory for detailed description. */ AliHLTTPCDigitRowData *AliAltroDigits2Memory(UInt_t & nrow,Int_t event=0,Bool_t eventmerge=kFALSE); + /** + * Convert AliDigits from AliRoot file to Altro data format in memory. + */ + int AliDigits2Altro(Int_t event, Byte_t* tgtBuffer, UInt_t size); + /** * Write AliDigits from AliRoot file to binary file. * @param event event no diff --git a/HLT/TPCLib/macros/dumpTPCDigits.C b/HLT/TPCLib/macros/dumpTPCDigits.C new file mode 100644 index 00000000000..4279d7e6de8 --- /dev/null +++ b/HLT/TPCLib/macros/dumpTPCDigits.C @@ -0,0 +1,141 @@ +// $Id$ + +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** + +/** + * @file dumpTPCDigits.C + * @author Matthias.Richter@ift.uib.no + * @date + * @brief Convert TPC digit info to ascii and print to stdout. + * + * The macro reads the simulated TPC digits from the RunLoader and + * prints the digit info to stout. + * + * aliroot -b -q dumpTPCDigits.C | tee digits.log + * + * The macro asumes the data to be already simulated. + */ + +#ifndef __CINT__ +#include "TSystem.h" +#include "TTree.h" +#include "AliRunLoader.h" +#include "AliSimDigits.h" +#endif //__CINT__ + +int dumpDigits(AliRunLoader* runloader, int event); + +int dumpTPCDigits() +{ + const char* galice_file="galice.root"; + TString param=galice_file; + param+="?filetype=raw"; + TFile file(param); + if (file.IsZombie()) { + cerr << "can not open file " << galice_name << ", skipping test" << endl; + return 0; + } + + AliRunLoader* rl=AliRunLoader::Open(galice_file); + if (!rl) { + cerr << "can not open RunLoader" << endl; + return -1; + } + + gSystem->Load("libAliHLTTPC.so"); + + dumpDigits(rl, 0); + + return 0; +} + +int dumpDigits(AliRunLoader* runloader, int event) +{ + int iResult=0; + AliLoader* tpcLoader = runloader->GetLoader("TPCLoader"); + if(!tpcLoader){ + cerr << "error: can not get TPC loader" << endl; + return -1; + } + + runloader->GetEvent(event); + tpcLoader->LoadDigits(); + + TTree *digitsTree = tpcLoader->TreeD(); + if(!digitsTree) { + cerr << "error: can not get digits tree for event no " << event << endl; + return -1; + } + + AliSimDigits *digits; + digitsTree->GetBranch("Segment")->SetAddress(&digits); + + AliTPCParam *tpcParam; + runloader->CdGAFile(); + tpcParam = (AliTPCParam*)gFile->Get("75x40_100x60_150x60"); + if(!tpcParam){ + cerr << "error: can not retrieve parameters" << endl; + } + + Int_t iPrintedSlice=-1; + Int_t iPrintedPart=-1; + + for(Int_t n=0; nGetEntries(); n++) { + Int_t sector, row; // coordinates of the simualted data + Int_t lslice,lrow; // local coordinates + digitsTree->GetEvent(n); + tpcParam->AdjustSectorRow(digits->GetID(),sector,row); + if(!AliHLTTPCTransform::Sector2Slice(lslice,lrow,sector,row)){ + cerr << "error: conversion of coordinates sector/row " << sector << "/" << row << "failed" << endl; + return -1; + } + + Int_t part=AliHLTTPCTransform::GetPatch(lrow); + + if (iPrintedSlice!=lslice || iPrintedPart!=part) { + iPrintedSlice=lslice; + iPrintedPart=part; + cout << "====================================================================" << endl; + cout << " Slice: " << iPrintedSlice << " Partition: " << iPrintedPart << " digit tree entry " << n << endl; + } + + cout << "--------------------------------------------------------------------" << endl; + cout << "Row: " << lrow << endl; + + digits->First(); + Int_t lasttime=-1; + Int_t lastpad=-1; + do { + Int_t time=digits->CurrentRow(); + Int_t pad=digits->CurrentColumn(); + Int_t dig = digits->GetDigit(time,pad); + if (lastpad!=pad) { + if (lastpad!=-1) cout << " -> " << lasttime << endl; + lastpad=pad; + cout << "Row: " << lrow << " Pad: " << lastpad << endl; + lasttime=-1; + } + if (lasttime!=time+1 && lasttime!=time-1 ) { + if (lasttime!=-1) cout << " -> " << lasttime << endl; + cout << " Time " << time << ": "; + } + lasttime=time; + cout << " " << dig; + } while (digits->Next()); + if (lasttime) cout << " -> " << lasttime << endl; + } +} diff --git a/HLT/TPCLib/macros/sim-hlt-tpc.C b/HLT/TPCLib/macros/sim-hlt-tpc.C index c82c6a1f175..814926270c7 100644 --- a/HLT/TPCLib/macros/sim-hlt-tpc.C +++ b/HLT/TPCLib/macros/sim-hlt-tpc.C @@ -8,7 +8,7 @@ * The chain to be run is defined by the macro given to the parameter * 'config=' * - * The makro asumes the data to be already simulated. If it should run + * The macro asumes the data to be already simulated. If it should run * within the initial simulation, comment the corresponding functions * below (SetRunGeneration etc.) * diff --git a/HLT/libHLTrec.pkg b/HLT/libHLTrec.pkg index 7bef44a5ee5..9cb2887c358 100644 --- a/HLT/libHLTrec.pkg +++ b/HLT/libHLTrec.pkg @@ -3,10 +3,13 @@ include $(MODDIR)/hlt.conf -LIBHLTREC_VERSION := 0 +LIBHLTREC_VERSION := 1 CLASS_HDRS:= AliHLTReconstructor.h \ AliRawReaderHLT.h \ + AliHLTOUTHomerCollection.h \ + AliHLTEsdManager.h \ + AliHLTOUTDigitReader.h \ AliHLTOUTRawReader.h MODULE_SRCS:= AliHLTDynamicAliLog.cxx \ diff --git a/HLT/rec/AliHLTEsdManager.cxx b/HLT/rec/AliHLTEsdManager.cxx new file mode 100644 index 00000000000..66049b8cfb0 --- /dev/null +++ b/HLT/rec/AliHLTEsdManager.cxx @@ -0,0 +1,269 @@ +// $Id$ + +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** + +/** @file AliHLTEsdManager.cxx + @author Matthias Richter + @date + @brief Manager for merging and writing of HLT ESDs +*/ + +#include "AliHLTEsdManager.h" +#include "AliHLTComponent.h" +#include "AliESDEvent.h" +#include "AliHLTMessage.h" +#include "AliESDEvent.h" +#include "TFile.h" +#include "TTree.h" +#include "TClass.h" +#include "TObject.h" + +/** ROOT macro for the implementation of ROOT specific class methods */ +ClassImp(AliHLTEsdManager) + +AliHLTEsdManager::AliHLTEsdManager() + : + fESDs() +{ + // see header file for class documentation + // or + // refer to README to build package + // or + // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt +} + +AliHLTEsdManager::~AliHLTEsdManager() +{ + // see header file for class documentation +} + +AliHLTEsdManager::AliHLTEsdListEntry* AliHLTEsdManager::Find(AliHLTComponentDataType dt) const +{ + // see header file for class documentation + AliHLTEsdListEntry* pEntry=NULL; + for (unsigned int i=0; i(&fESDs[i]); + } + } + return pEntry; +} + +int AliHLTEsdManager::WriteESD(const AliHLTUInt8_t* pBuffer, AliHLTUInt32_t size, + AliHLTComponentDataType dt, AliESDEvent* tgtesd, int eventno) +{ + // see header file for class documentation + if (!pBuffer && size<=0) return -EINVAL; + int iResult=0; + AliHLTUInt32_t firstWord=*((AliHLTUInt32_t*)pBuffer); + if (firstWord==size-sizeof(AliHLTUInt32_t)) { + HLTDebug("create object from block %s size %d", AliHLTComponent::DataType2Text(dt).c_str(), size); + AliHLTMessage msg(const_cast(pBuffer), size); + TClass* objclass=msg.GetClass(); + TObject* pObj=msg.ReadObject(objclass); + if (pObj && objclass) { + HLTDebug("object %p type %s created", pObj, objclass->GetName()); + AliESDEvent* pESD=dynamic_cast(pObj); + TTree* pTree=NULL; + if (!pESD) { + pTree=dynamic_cast(pObj); + if (pTree) { + pESD=new AliESDEvent; + pESD->CreateStdContent(); + if (pTree->GetEntries()>0) { + if (pTree->GetEntries()>1) { + HLTWarning("only one entry allowed for ESD embedded into tree, data block %s contains tree with %d entires, taking first entry", + AliHLTComponent::DataType2Text(dt).c_str(), pTree->GetEntries()); + } + pESD->ReadFromTree(pTree); + pTree->GetEvent(0); + } + } else { + HLTWarning("tree of data block %s has no events, skipping data block", AliHLTComponent::DataType2Text(dt).c_str()); + } + } + if (pESD) { + AliHLTEsdListEntry* entry=Find(dt); + if (!entry) { + AliHLTEsdListEntry newEntry(dt); + fESDs.push_back(newEntry); + } + if (tgtesd) { + } + entry=Find(dt); + if (entry) { + entry->WriteESD(pESD, eventno); + } else { + HLTError("internal mismatch, can not create list entry"); + iResult=-ENOMEM; + } + } else { + HLTWarning("data block %s is not of class type AliESDEvent, ignoring ...", AliHLTComponent::DataType2Text(dt).c_str()); + } + if (pTree) { + // ESD has been created and must be cleaned up + delete pESD; + pESD=NULL; + } + delete pObj; + pObj=NULL; + } else { + } + } + return iResult; +} + +AliHLTEsdManager::AliHLTEsdListEntry::AliHLTEsdListEntry(AliHLTComponentDataType dt) + : + fName(), + fpFile(NULL), + fpTree(NULL), + fpEsd(NULL), + fDt(dt) +{ + // see header file for class documentation +} + +AliHLTEsdManager::AliHLTEsdListEntry::AliHLTEsdListEntry(const AliHLTEsdListEntry& src) + : + AliHLTLogging(), + fName(src.fName), + fpFile(src.fpFile), + fpTree(src.fpTree), + fpEsd(src.fpEsd), + fDt(src.fDt) +{ + // copy constructor copies everything including pointers +} + +AliHLTEsdManager::AliHLTEsdListEntry& AliHLTEsdManager::AliHLTEsdListEntry::operator=(const AliHLTEsdListEntry& src) +{ + // assignment operator copies everything including pointers + fName=src.fName; + fpFile=src.fpFile; + fpTree=src.fpTree; + fpEsd=src.fpEsd; + fDt=src.fDt; + return *this; +} + +AliHLTEsdManager::AliHLTEsdListEntry::~AliHLTEsdListEntry() +{ + // see header file for class documentation + if (fpTree) { + delete fpTree; + fpTree=NULL; + } + + if (fpEsd) { + delete fpEsd; + fpEsd=NULL; + } + + if (fpFile) { + fpFile->Close(); + delete fpFile; + fpFile=NULL; + } +} + +bool AliHLTEsdManager::AliHLTEsdListEntry::operator==(AliHLTComponentDataType dt) const +{ + // see header file for class documentation + return fDt==dt; +} + +int AliHLTEsdManager::AliHLTEsdListEntry::WriteESD(AliESDEvent* pESD, int eventno) +{ + // see header file for class documentation + if (!pESD) return -EINVAL; + int iResult=0; + if (!fpFile) { + TString origin; + origin.Insert(0, fDt.fOrigin, kAliHLTComponentDataTypefOriginSize); + origin.Remove(TString::kTrailing, ' '); + origin.ToUpper(); + fName="AliHLT"; fName+=origin; + if (fDt!=kAliHLTDataTypeESDObject && + fDt!=kAliHLTDataTypeESDTree) { + + HLTWarning("non-standard ESD type %s", AliHLTComponent::DataType2Text(fDt).c_str()); + TString id; + id.Insert(0, fDt.fID, kAliHLTComponentDataTypefIDsize); + id.Remove(TString::kTrailing, ' '); + id.ToUpper(); + fName+="_"; fName+=id; fName+=".root"; + } else { + fName+="ESDs.root"; + fpFile=new TFile(fName, "RECREATE"); + } + } + if (fpFile && !fpFile->IsZombie() && iResult>=0) { + if (!fpTree) { + fpTree=new TTree("esdTree", "Tree with HLT ESD objects"); + if (!fpTree) { + iResult=-ENOMEM; + } + } + if (fpTree && iResult>=0) { + if (!fpEsd) { + // create the ESD structure for filling into the tree + fpEsd=new AliESDEvent; + if (fpEsd) { + fpEsd->CreateStdContent(); + fpEsd->WriteToTree(fpTree); + } else { + iResult=-ENOMEM; + } + } else { + fpEsd->ResetStdContent(); + } + if (eventno>=0) { + // synchronize and add empty events + for (int i=fpTree->GetEntries(); iFill(); + } + if (fpTree->GetEntries()>eventno) { + HLTWarning("event %d ESD of type %s already written, skipping additional data block", eventno, AliHLTComponent::DataType2Text(fDt).c_str()); + } + } + if (fpEsd) { + // we need to copy the ESD, I did not find an approptiate + // method, the workaround is to save the ESD in a temporary + // tree, read the content back into the ESD structure + // used for filling + TTree* dummy=new TTree("dummy","dummy"); + if (dummy) { + pESD->WriteToTree(dummy); + dummy->Fill(); + fpEsd->ReadFromTree(dummy); + dummy->GetEvent(0); + fpTree->Fill(); + delete dummy; + } else { + iResult=-ENOMEM; + } + } else { + iResult=-ENOMEM; + } + if (iResult>=0) { + fpTree->Write("",TObject::kOverwrite); + } + } + } + return iResult; +} diff --git a/HLT/rec/AliHLTEsdManager.h b/HLT/rec/AliHLTEsdManager.h new file mode 100644 index 00000000000..f1469beac8b --- /dev/null +++ b/HLT/rec/AliHLTEsdManager.h @@ -0,0 +1,108 @@ +//-*- Mode: C++ -*- +// $Id$ + +#ifndef ALIHLTESDMANAGER_H +#define ALIHLTESDMANAGER_H +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * + +/** @file AliHLTEsdManager.h + @author Matthias Richter + @date + @brief Manager for merging and writing of HLT ESDs +*/ + +#include "AliHLTDataTypes.h" +#include "AliHLTLogging.h" +#include + +class AliESDEvent; +class TTree; +class TFile; + +/** + * @class AliHLTEsdManager + */ +class AliHLTEsdManager : public AliHLTLogging { + public: + /** constructor */ + AliHLTEsdManager(); + /** destructor */ + virtual ~AliHLTEsdManager(); + + /** + * Convert data buffer to ESD. + * The buffer is supposed to describe a streamed AliESDEvent object. + * If no target object is specified, the ESD is written to a file AliHLTdetESDs.root, + * where 'det' is derived from the data type origin. Each time the function is invoked + * a new event is created. Dummy events are added if the previous events did not contain + * + * @param pBuffer [in] the data buffer + * @param size [in] data buffer size + * @param dt [in] data type of the block + * @param tgtesd [out] optional target + * @param eventno [in] optional event no + */ + int WriteESD(const AliHLTUInt8_t* pBuffer, AliHLTUInt32_t size, AliHLTComponentDataType dt, + AliESDEvent* tgtesd=NULL, int eventno=-1); + + protected: + + private: + /** copy constructor prohibited */ + AliHLTEsdManager(const AliHLTEsdManager&); + /** assignment operator prohibited */ + AliHLTEsdManager& operator=(const AliHLTEsdManager&); + + class AliHLTEsdListEntry : public AliHLTLogging { + public: + /** constructor */ + AliHLTEsdListEntry(AliHLTComponentDataType dt); + /** copy constructor */ + AliHLTEsdListEntry(const AliHLTEsdListEntry& src); + /** assignment operator */ + AliHLTEsdListEntry& operator=(const AliHLTEsdListEntry& src); + /** destructor */ + ~AliHLTEsdListEntry(); + + /** + * Write the ESD to the corresponding file. + * The tree is first synchronized with the eventno and additional empty + * events might be inserted if there was a gap. Since we are writing + * several files in parallel, we have to make sure that those files contain + * the same number of events. + * @param pESD ESD to write + * @param eventno optional event no for tree synchronization + */ + int WriteESD(AliESDEvent* pESD, int eventno=-1); + + bool operator==(AliHLTComponentDataType dt) const; + + private: + + /** root file name */ + TString fName; //!transient + /** the root file for this esd */ + TFile* fpFile; //!transient + /** the tree for this esd */ + TTree* fpTree; //!transient + /** the esd to fill into the tree */ + AliESDEvent* fpEsd; //!transient + /** data type of the corresponding block */ + AliHLTComponentDataType fDt; //!transient + }; + + typedef vector AliHLTEsdList; + + /** + * Find list entry for given data type + */ + AliHLTEsdListEntry* Find(AliHLTComponentDataType dt) const; + + /** the list of the ESDs */ + AliHLTEsdList fESDs; //!transient + + ClassDef(AliHLTEsdManager, 0) +}; +#endif diff --git a/HLT/rec/AliHLTOUTDigitReader.cxx b/HLT/rec/AliHLTOUTDigitReader.cxx new file mode 100644 index 00000000000..b5323c95cd7 --- /dev/null +++ b/HLT/rec/AliHLTOUTDigitReader.cxx @@ -0,0 +1,213 @@ +// $Id$ + +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** + +/** @file AliHLTOUTDigitReader.cxx + @author Matthias Richter + @date + @brief HLTOUT data wrapper for simulated AliRoot HLT digit data. +*/ + +#include "AliHLTOUTDigitReader.h" +#include "AliRawDataHeader.h" +#include "AliDAQ.h" +#include "TTree.h" +#include "TFile.h" +#include "TArrayC.h" +#include "TBranch.h" +#include "TString.h" +#include + +/** ROOT macro for the implementation of ROOT specific class methods */ +ClassImp(AliHLTOUTDigitReader) + +AliHLTOUTDigitReader::AliHLTOUTDigitReader(int event, AliHLTEsdManager* pEsdManager) + : + AliHLTOUTHomerCollection(event, pEsdManager), + fpDigitFile(NULL), + fpDigitTree(NULL), + fMinDDL(-1), + fMaxDDL(-1), + fppDigitArrays(NULL), + fpEquipments(NULL), + fNofDDLs(0), + fCurrent(-1) +{ + // see header file for class documentation + // or + // refer to README to build package + // or + // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt +} + +AliHLTOUTDigitReader::~AliHLTOUTDigitReader() +{ + // see header file for class documentation + CloseTree(); + + if (fpDigitFile) { + fpDigitFile->Close(); + delete fpDigitFile; + fpDigitFile=NULL; + } +} + +Bool_t AliHLTOUTDigitReader::ReadNextData(UChar_t*& data) +{ + // see header file for class documentation + if (!fppDigitArrays && (!ReadArrays() || !fppDigitArrays)) + return kFALSE; + + if (fCurrent>=fNofDDLs) + return kFALSE; + + while (++fCurrent-1 && fMinDDL>fpEquipments[fCurrent]) continue; + if (fMaxDDL>-1 && fMaxDDLGetSize()>(int)sizeof(AliRawDataHeader)) { + data=reinterpret_cast(fppDigitArrays[fCurrent]->GetArray()); + data+=sizeof(AliRawDataHeader); + return kTRUE; + } + } + return kFALSE; +} + +int AliHLTOUTDigitReader::Reset() +{ + // see header file for class documentation + fCurrent=-1; + return 0; +} + +int AliHLTOUTDigitReader::GetDataSize() +{ + // see header file for class documentation + if (fCurrent>=0 && fCurrentGetSize()-sizeof(AliRawDataHeader); + } + return 0; +} + +const AliRawDataHeader* AliHLTOUTDigitReader::GetDataHeader() +{ + // see header file for class documentation + if (fCurrent>=0 && fCurrent(fppDigitArrays[fCurrent]->GetArray()); + } + return NULL; +} + +void AliHLTOUTDigitReader::SelectEquipment(int /*equipmentType*/, int minEquipmentId, int maxEquipmentId) +{ + // see header file for class documentation + fMinDDL=minEquipmentId; + fMaxDDL=maxEquipmentId; +} + +int AliHLTOUTDigitReader::GetEquipmentId() +{ + // see header file for class documentation + if (fCurrent>=0 && fCurrentIsZombie()) return false; + + fpDigitFile->GetObject("rawhltout", fpDigitTree); + if (!fpDigitTree) { + return false; + } + + vector equipments; + int iTotal=0; + TIter iter(fpDigitTree->GetListOfBranches()); + while (TBranch* br=(TBranch *)iter.Next()) { + iTotal++; + TString bname=br->GetName(); + if (bname.BeginsWith("HLT_") && bname.EndsWith(".ddl")) { + bname.ReplaceAll("HLT_", ""); + bname.ReplaceAll(".ddl", ""); + if (bname.IsDigit()) { + int equipment=bname.Atoi(); + int index=equipment-AliDAQ::DdlIDOffset("HLT"); + if (index>=0 && strcmp(br->GetName(), AliDAQ::DdlFileName("HLT", index))==0) { + equipments.push_back(equipment); + } else { + HLTWarning("equipment mismatch: skipping id %d (out of range of HLT equipments)", equipment); + } + } + } + } + HLTDebug("found %d HLT branche(s) out of %d", equipments.size(), iTotal); + + if (equipments.size()>0) { + fNofDDLs=equipments.size(); + fpEquipments=new int[fNofDDLs]; + fppDigitArrays=new TArrayC*[fNofDDLs]; + if (fpEquipments && fppDigitArrays) { + memcpy(fpEquipments, &equipments[0], fNofDDLs*sizeof(int)); + int i=0; + for (i=0; iSetBranchAddress(AliDAQ::DdlFileName("HLT", fpEquipments[i]-AliDAQ::DdlIDOffset("HLT")), &fppDigitArrays[i]); + } + fpDigitTree->GetEvent(GetCurrentEventNo()); + for (i=0; i size of the arrays */ + int fNofDDLs; //!transient + + /** current position in the array */ + int fCurrent; //!transient + + ClassDef(AliHLTOUTDigitReader, 0) +}; +#endif diff --git a/HLT/rec/AliHLTOUTHomerCollection.cxx b/HLT/rec/AliHLTOUTHomerCollection.cxx new file mode 100644 index 00000000000..88ef869f07a --- /dev/null +++ b/HLT/rec/AliHLTOUTHomerCollection.cxx @@ -0,0 +1,203 @@ +// $Id$ + +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** + +/** @file AliHLTOUTHomerCollection.cxx + @author Matthias Richter + @date + @brief General HLTOUT data collection. +*/ + +#include "AliHLTOUTHomerCollection.h" +#include "AliHLTHOMERLibManager.h" +#include "AliHLTHOMERReader.h" +#include "AliRawDataHeader.h" +#include "AliHLTEsdManager.h" + +/** ROOT macro for the implementation of ROOT specific class methods */ +ClassImp(AliHLTOUTHomerCollection) + +AliHLTOUTHomerCollection::AliHLTOUTHomerCollection(int event, AliHLTEsdManager* pEsdManager) + : + AliHLTOUTHomerBuffer(NULL, 0), + fpCurrent(NULL), + fEvent(event), + fpEsdManager(pEsdManager) +{ + // see header file for class documentation + // or + // refer to README to build package + // or + // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt +} + +const int AliHLTOUTHomerCollection::fgkIdShift=16; + +AliHLTOUTHomerCollection::~AliHLTOUTHomerCollection() +{ + // see header file for class documentation + if (fpManager) { + if (fpCurrent) fpManager->DeleteReader(fpCurrent); + fpCurrent=NULL; + } +} + +int AliHLTOUTHomerCollection::GenerateIndex() +{ + // see header file for class documentation + // step through all HLT ddls, create HOMER readers and + // scan data block + int iResult=0; + if (fpManager) { + Reset(); + // there was a bug in AliDAQ returning the wrong equipment id + // for the HLT links. It has been fixed in the trunk on Feb 5th 2008 + // and from v4-10-Release (Rev-02). For the moment we select directly + // to support older AliRoot versions + //Select("HLT"); + SelectEquipment(0,7680, 7689); + UChar_t* pSrc=NULL; + while (ReadNextData(pSrc) && pSrc!=NULL && iResult>=0) { + AliHLTUInt32_t id=(GetEquipmentId()); + unsigned int size=GetDataSize(); + + AliHLTHOMERReader* pReader=OpenReader(pSrc, size); + + // we use the equipment id to identify the different homer blocks + id<<=fgkIdShift; + if (pReader) { + iResult=ScanReader(pReader, id); + fpManager->DeleteReader(pReader); + } + } + } else { + iResult=-ENODEV; + } + return iResult; +} + +int AliHLTOUTHomerCollection::GetDataBuffer(AliHLTUInt32_t index, const AliHLTUInt8_t* &pBuffer, + AliHLTUInt32_t& size) +{ + // see header file for class documentation + int iResult=0; + pBuffer=NULL; + size=0; + if (fpManager) { + Int_t id = Int_t(index>>fgkIdShift); + AliHLTUInt32_t blockNo=index&((0x1<DeleteReader(fpCurrent); + fpCurrent=NULL; + } + + // open ddl for equipment id and create HOMER reader + if (!fpCurrent) { + Reset(); + SelectEquipment(-1, id, id); + UChar_t* pSrc=NULL; + if (ReadNextData(pSrc) && pSrc!=NULL) { + int srcSize=GetDataSize(); + fpCurrent=OpenReader(pSrc, srcSize); + if (fpCurrent && fpCurrent->ReadNextEvent()!=0) { + iResult=-ENODATA; + } + } else { + iResult=-ENOSYS; + } + } + + // get data + if (fpCurrent) { + AliHLTMonitoringReader* pReader=fpCurrent; + if ((pBuffer=static_cast(pReader->GetBlockData(blockNo)))!=NULL) { + size=pReader->GetBlockDataLength(blockNo); + } else { + iResult=-ENOENT; + } + } + } else { + iResult=-ENODEV; + } + return iResult; +} + +AliHLTHOMERReader* AliHLTOUTHomerCollection::OpenReader(UChar_t* pSrc, unsigned int size) +{ + // see header file for class documentation + unsigned int offset=sizeof(AliHLTOUTEventHeader); + const AliRawDataHeader* pCDH=GetDataHeader(); + AliHLTUInt32_t id=(GetEquipmentId()); + AliHLTUInt32_t statusFlags=pCDH->GetStatus(); + AliHLTOUTEventHeader* pHLTHeader=reinterpret_cast(pSrc); + + // consistency check for the block size + if (pHLTHeader->fLength!=size) { + HLTWarning("can not treat HLT data block %d: size mismatch, header %d, but buffer is %d", id, pHLTHeader->fLength, size); + return NULL; + } + + // determine the offset of the homer block + // the HLT header is mandatory, HLT decision and HLT + // payload are optional. HLT decision is always before HLT + // payload if existent. + if (statusFlags&(0x1<(pSrc+offset); + if ((*pDecisionLen)*sizeof(AliHLTUInt32_t)+offset +1 for this length word + offset+=((*pDecisionLen)+1)*sizeof(AliHLTUInt32_t); + } else { + HLTWarning("size mismatch: HLT decision block bigger than total block length, skipping ..."); + return NULL; + } + } + + // check if there is payload + if (!(statusFlags&(0x1<=size) { + HLTWarning("no HLT payload available, but bit is set, skipping ..."); + return NULL; + } + + // check for the HOME descriptor type id + AliHLTUInt64_t* pHomerDesc=reinterpret_cast(pSrc+offset); + if (*(pHomerDesc+kID_64b_Offset) != HOMER_BLOCK_DESCRIPTOR_TYPEID && + ByteSwap64(*(pHomerDesc+kID_64b_Offset)) != HOMER_BLOCK_DESCRIPTOR_TYPEID) { + HLTWarning("format error: can not find HOMER block descriptor typid, skipping this data block"); + return NULL; + } + + return fpManager->OpenReaderBuffer(pSrc+offset, size-offset); +} + +int AliHLTOUTHomerCollection::WriteESD(const AliHLTUInt8_t* pBuffer, AliHLTUInt32_t size, AliHLTComponentDataType dt, AliESDEvent* tgtesd) const +{ + // see header file for class documentation + if (!pBuffer && size<=0) return -EINVAL; + int iResult=0; + if (fpEsdManager) { + fpEsdManager->WriteESD(pBuffer, size, dt, tgtesd, GetCurrentEventNo()); + } + return iResult; +} diff --git a/HLT/rec/AliHLTOUTHomerCollection.h b/HLT/rec/AliHLTOUTHomerCollection.h new file mode 100644 index 00000000000..e5e62c3cceb --- /dev/null +++ b/HLT/rec/AliHLTOUTHomerCollection.h @@ -0,0 +1,126 @@ +//-*- Mode: C++ -*- +// $Id$ + +#ifndef ALIHLTOUTHOMERCOLLECTION_H +#define ALIHLTOUTHOMERCOLLECTION_H +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * + +/** @file AliHLTOUTHomerCollection.h + @author Matthias Richter + @date + @brief General HLTOUT data collection. + */ +#include "AliHLTOUTHomerBuffer.h" + +class AliHLTHOMERReader; +class AliRawDataHeader; +class AliHLTEsdManager; + +/** + * @class AliHLTOUTHomerCollection + * Handler of HLTOUT data, base class for specific handlers for + * RawReader or Digit data. + */ +class AliHLTOUTHomerCollection : public AliHLTOUTHomerBuffer { + public: + /** constructor */ + AliHLTOUTHomerCollection(int event=-1, AliHLTEsdManager* pEsdManager=NULL); + /** destructor */ + virtual ~AliHLTOUTHomerCollection(); + + protected: + /** + * Read next data form the data source. + */ + virtual Bool_t ReadNextData(UChar_t*& data)=0; + + /** + * Reset data stream position. + * Reeading of data starts with the first data block. + */ + virtual int Reset()=0; + + /** + * Get size of the current data block. + */ + virtual int GetDataSize()=0; + + /** + * Get the header of the current data block + */ + virtual const AliRawDataHeader* GetDataHeader()=0; + + /** + * Select equipment for data readout. + */ + virtual void SelectEquipment(int equipmentType, + int minEquipmentId = -1, + int maxEquipmentId = -1)=0; + + /** + * Get equipment id of the current data block. + */ + virtual int GetEquipmentId()=0; + + /** + * Get the current event no. + * The event no is set during creation of the HLTOUT object. + * For the reconstruction it is taken from the ESD provided by the + * AliReconstruction framework AliESDEvent::GetEventNumberInFile + * @return event no or -1 if not set + */ + int GetCurrentEventNo() const {return fEvent;} + + // interface function of AliHLTOUT + int WriteESD(const AliHLTUInt8_t* pBuffer, AliHLTUInt32_t size, AliHLTComponentDataType dt, AliESDEvent* tgtesd=NULL) const; + + private: + /** copy constructor prohibited */ + AliHLTOUTHomerCollection(const AliHLTOUTHomerCollection&); + /** assignment operator prohibited */ + AliHLTOUTHomerCollection& operator=(const AliHLTOUTHomerCollection&); + + /** + * Generate the index of the HLTOUT data from the data buffer. + */ + int GenerateIndex(); + + /** + * Get the data buffer + * @param index [in] index of the block + * @param pBuffer [out] buffer of the selected data block + * @param size [out] size of the selected data block + */ + int GetDataBuffer(AliHLTUInt32_t index, const AliHLTUInt8_t* &pBuffer, + AliHLTUInt32_t& size); + + /** + * Open HOMER reader for the data buffer. + * The function expects the data buffer including all headers (CDH + * and HLTOUT header). The offset for the HLT payload is determined from + * the headers and the optional HLT decision data. + * @param pSrc data buffer + * @param size size of the buffer in byte + * @return instance of HOMER reader + */ + AliHLTHOMERReader* OpenReader(UChar_t* pSrc, unsigned int size); + + /** current instance of the HOMER reader */ + AliHLTHOMERReader* fpCurrent; //!transient + + /** current event no */ + int fEvent; //!transient + + /** instance of the ESD manager for writing and merging */ + AliHLTEsdManager* fpEsdManager; //!transient + + /** DDL id offset shift for index + * bit 16-31: DDL id, bit 0-15 block no + */ + static const int fgkIdShift; //!transient + + ClassDef(AliHLTOUTHomerCollection, 0) +}; +#endif diff --git a/HLT/rec/AliHLTOUTRawReader.cxx b/HLT/rec/AliHLTOUTRawReader.cxx index 89821bff485..e63b0e8383d 100644 --- a/HLT/rec/AliHLTOUTRawReader.cxx +++ b/HLT/rec/AliHLTOUTRawReader.cxx @@ -1,45 +1,37 @@ // $Id$ -/************************************************************************** - * This file is property of and copyright by the ALICE HLT Project * - * ALICE Experiment at CERN, All rights reserved. * - * * - * Primary Authors: Matthias Richter * - * for The ALICE HLT Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTOUTRawReader.cxx @author Matthias Richter @date - @brief HLTOUT data wrapper for AliRawReader. */ - -// see header file for class documentation -// or -// refer to README to build package -// or -// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt + @brief HLTOUT data wrapper for AliRawReader. +*/ #include "AliHLTOUTRawReader.h" -#include "AliHLTHOMERLibManager.h" #include "AliRawReader.h" -#include "AliHLTHOMERReader.h" /** ROOT macro for the implementation of ROOT specific class methods */ ClassImp(AliHLTOUTRawReader) -AliHLTOUTRawReader::AliHLTOUTRawReader(AliRawReader* pRawreader) +AliHLTOUTRawReader::AliHLTOUTRawReader(AliRawReader* pRawreader, int event, AliHLTEsdManager* pEsdManager) : - AliHLTOUTHomerBuffer(NULL, 0), - fpRawreader(pRawreader), - fpCurrent(NULL) + AliHLTOUTHomerCollection(event, pEsdManager), + fpRawreader(pRawreader) { // see header file for class documentation // or @@ -48,148 +40,48 @@ AliHLTOUTRawReader::AliHLTOUTRawReader(AliRawReader* pRawreader) // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt } -const int AliHLTOUTRawReader::fgkIdShift=16; - AliHLTOUTRawReader::~AliHLTOUTRawReader() { // see header file for class documentation - if (fpManager) { - if (fpCurrent) fpManager->DeleteReader(fpCurrent); - fpCurrent=NULL; - } } -int AliHLTOUTRawReader::GenerateIndex() +Bool_t AliHLTOUTRawReader::ReadNextData(UChar_t*& data) { // see header file for class documentation - // step through all HLT ddls, create HOMER readers and - // scan data block - int iResult=0; - if (fpRawreader && fpManager) { - fpRawreader->Reset(); - // there was a bug in AliDAQ returning the wrong equipment id - // for the HLT links. It has been fixed in the trunk on Feb 5th 2008 - // and from v4-10-Release (Rev-02). For the moment we select directly - // to support older AliRoot versions - //fpRawreader->Select("HLT"); - fpRawreader->SelectEquipment(0,7680, 7689); - UChar_t* pSrc=NULL; - while (fpRawreader->ReadNextData(pSrc) && pSrc!=NULL && iResult>=0) { - AliHLTUInt32_t id=(fpRawreader->GetEquipmentId()); - unsigned int size=fpRawreader->GetDataSize(); - - AliHLTHOMERReader* pReader=OpenReader(pSrc, size); - - // we use the equipment id to identify the different homer blocks - id<<=fgkIdShift; - if (pReader) { - iResult=ScanReader(pReader, id); - fpManager->DeleteReader(pReader); - } - } - } else { - iResult=-ENODEV; - } - return iResult; + if (!fpRawreader) return kFALSE; + return fpRawreader->ReadNextData(data); } -int AliHLTOUTRawReader::GetDataBuffer(AliHLTUInt32_t index, const AliHLTUInt8_t* &pBuffer, - AliHLTUInt32_t& size) +int AliHLTOUTRawReader::Reset() { // see header file for class documentation - int iResult=0; - pBuffer=NULL; - size=0; - if (fpManager) { - Int_t id = Int_t(index>>fgkIdShift); - AliHLTUInt32_t blockNo=index&((0x1<GetEquipmentId()!=id) { - fpManager->DeleteReader(fpCurrent); - fpCurrent=NULL; - } - - // open ddl for equipment id and create HOMER reader - if (!fpCurrent) { - fpRawreader->Reset(); - fpRawreader->SelectEquipment(-1, id, id); - UChar_t* pSrc=NULL; - if (fpRawreader->ReadNextData(pSrc) && pSrc!=NULL) { - int srcSize=fpRawreader->GetDataSize(); - fpCurrent=OpenReader(pSrc, srcSize); - if (fpCurrent && fpCurrent->ReadNextEvent()!=0) { - iResult=-ENODATA; - } - } else { - iResult=-ENOSYS; - } - } - - // get data - if (fpCurrent) { - AliHLTMonitoringReader* pReader=fpCurrent; - if ((pBuffer=static_cast(pReader->GetBlockData(blockNo)))!=NULL) { - size=pReader->GetBlockDataLength(blockNo); - } else { - iResult=-ENOENT; - } - } - } else { - iResult=-ENODEV; - } - return iResult; + if (fpRawreader) return fpRawreader->Reset(); + return 0; } -AliHLTHOMERReader* AliHLTOUTRawReader::OpenReader(UChar_t* pSrc, unsigned int size) +int AliHLTOUTRawReader::GetDataSize() { // see header file for class documentation - unsigned int offset=sizeof(AliHLTOUTEventHeader); - const AliRawDataHeader* pCDH=fpRawreader->GetDataHeader(); - AliHLTUInt32_t id=(fpRawreader->GetEquipmentId()); - AliHLTUInt32_t statusFlags=pCDH->GetStatus(); - AliHLTOUTEventHeader* pHLTHeader=reinterpret_cast(pSrc); - - // consistency check for the block size - if (pHLTHeader->fLength!=size) { - HLTWarning("can not treat HLT data block %d: size missmatch, header %d, but buffer is %d", id, pHLTHeader->fLength, size); - return NULL; - } - - // determine the offset of the homer block - // the HLT header is mandatory, HLT decision and HLT - // payload are optional. HLT decision is always before HLT - // payload if existent. - if (statusFlags&(0x1<(pSrc+offset); - if ((*pDecisionLen)*sizeof(AliHLTUInt32_t)+offset +1 for this length word - offset+=((*pDecisionLen)+1)*sizeof(AliHLTUInt32_t); - } else { - HLTWarning("size missmatch: HLT decision block bigger than total block length, skipping ..."); - return NULL; - } - } - - // check if there is payload - if (!(statusFlags&(0x1<GetDataSize(); + return 0; +} - // continue if there is no data left in the buffer - if (offset>=size) { - HLTWarning("no HLT payload available, but bit is set, skipping ..."); - return NULL; - } +const AliRawDataHeader* AliHLTOUTRawReader::GetDataHeader() +{ + // see header file for class documentation + if (fpRawreader) return fpRawreader->GetDataHeader(); + return NULL; +} - // check for the HOME descriptor type id - AliHLTUInt64_t* pHomerDesc=reinterpret_cast(pSrc+offset); - if (*(pHomerDesc+kID_64b_Offset) != HOMER_BLOCK_DESCRIPTOR_TYPEID && - ByteSwap64(*(pHomerDesc+kID_64b_Offset)) != HOMER_BLOCK_DESCRIPTOR_TYPEID) { - HLTWarning("format error: can not find HOMER block descriptor typid, skipping this data block"); - return NULL; - } +void AliHLTOUTRawReader::SelectEquipment(int equipmentType, int minEquipmentId, int maxEquipmentId) +{ + // see header file for class documentation + if (fpRawreader) fpRawreader->SelectEquipment(equipmentType, minEquipmentId, maxEquipmentId); +} - return fpManager->OpenReaderBuffer(pSrc+offset, size-offset); +int AliHLTOUTRawReader::GetEquipmentId() +{ + // see header file for class documentation + if (fpRawreader) return fpRawreader->GetEquipmentId(); + return -1; } diff --git a/HLT/rec/AliHLTOUTRawReader.h b/HLT/rec/AliHLTOUTRawReader.h index bc0b6302e65..27dc223d5f5 100644 --- a/HLT/rec/AliHLTOUTRawReader.h +++ b/HLT/rec/AliHLTOUTRawReader.h @@ -3,22 +3,17 @@ #ifndef ALIHLTOUTRAWREADER_H #define ALIHLTOUTRAWREADER_H -/* This file is property of and copyright by the ALICE HLT Project * - * ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice */ /** @file AliHLTOUTRawReader.h @author Matthias Richter @date @brief HLTOUT data wrapper for AliRawReader. - */ -// see below for class documentation -// or -// refer to README to build package -// or -// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt +*/ -#include "AliHLTOUTHomerBuffer.h" +#include "AliHLTOUTHomerCollection.h" class AliRawReader; class AliHLTHOMERReader; @@ -27,14 +22,21 @@ class AliHLTHOMERReader; * @class AliHLTOUTRawReader * Handler of HLTOUT data for AliRawReader input. */ -class AliHLTOUTRawReader : public AliHLTOUTHomerBuffer { +class AliHLTOUTRawReader : public AliHLTOUTHomerCollection { public: /** constructor */ - AliHLTOUTRawReader(AliRawReader* pRawReader); + AliHLTOUTRawReader(AliRawReader* pRawReader, int event=-1, AliHLTEsdManager* pEsdManager=NULL); /** destructor */ virtual ~AliHLTOUTRawReader(); protected: + // interface functions of AliHLTOUTHomerCollection + Bool_t ReadNextData(UChar_t*& data); + int Reset(); + int GetDataSize(); + const AliRawDataHeader* GetDataHeader(); + void SelectEquipment(int equipmentType, int minEquipmentId = -1, int maxEquipmentId = -1); + int GetEquipmentId(); private: /** standard constructor prohibited */ @@ -44,42 +46,9 @@ class AliHLTOUTRawReader : public AliHLTOUTHomerBuffer { /** assignment operator prohibited */ AliHLTOUTRawReader& operator=(const AliHLTOUTRawReader&); - /** - * Generate the index of the HLTOUT data from the data buffer. - */ - int GenerateIndex(); - - /** - * Get the data buffer - * @param index [in] index of the block - * @param pBuffer [out] buffer of the selected data block - * @param size [out] size of the selected data block - */ - int GetDataBuffer(AliHLTUInt32_t index, const AliHLTUInt8_t* &pBuffer, - AliHLTUInt32_t& size); - - /** - * Open HOMER reader for the data buffer. - * The function expects the data buffer including all headers (CDH - * and HLTOUT header). The offset for the HLT payload is determined from - * the headers and the optional HLT decision data. - * @param pSrc data buffer - * @param size size of the buffer in byte - * @return instance of HOMER reader - */ - AliHLTHOMERReader* OpenReader(UChar_t* pSrc, unsigned int size); - /** the rawreader */ AliRawReader* fpRawreader; //!transient - /** current instance of the HOMER reader */ - AliHLTHOMERReader* fpCurrent; //!transient - - /** DDL id offset shift for index - * bit 16-31: DDL id, bit 0-15 block no - */ - static const int fgkIdShift; //!transient - - ClassDef(AliHLTOUTRawReader, 0) + ClassDef(AliHLTOUTRawReader, 1) }; #endif diff --git a/HLT/rec/AliHLTReconstructor.cxx b/HLT/rec/AliHLTReconstructor.cxx index 59d0623895f..ea1036bfd9b 100644 --- a/HLT/rec/AliHLTReconstructor.cxx +++ b/HLT/rec/AliHLTReconstructor.cxx @@ -1,20 +1,20 @@ // $Id$ -/************************************************************************** - * This file is property of and copyright by the ALICE HLT Project * - * ALICE Experiment at CERN, All rights reserved. * - * * - * Primary Authors: Matthias Richter * - * for The ALICE HLT Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTReconstructor.cxx @author Matthias Richter @@ -25,14 +25,20 @@ #include #include "AliHLTReconstructor.h" #include "AliLog.h" +#include "AliESDEvent.h" #include "AliHLTSystem.h" +#include "AliHLTOUTRawReader.h" +#include "AliHLTOUTDigitReader.h" +#include "AliHLTEsdManager.h" ClassImp(AliHLTReconstructor) AliHLTReconstructor::AliHLTReconstructor() : AliReconstructor(), - AliHLTReconstructorBase() + AliHLTReconstructorBase(), + fFctProcessHLTOUT(NULL), + fpEsdManager(NULL) { //constructor } @@ -49,6 +55,9 @@ AliHLTReconstructor::~AliHLTReconstructor() pSystem->Reconstruct(0, NULL, NULL); } } + + if (fpEsdManager) delete fpEsdManager; + fpEsdManager=NULL; } void AliHLTReconstructor::Init() @@ -125,28 +134,33 @@ void AliHLTReconstructor::Init() return; } } + + gSystem->Load("libHLTinterface.so"); + fFctProcessHLTOUT=gSystem->DynFindSymbol("libHLTinterface.so", "AliHLTSystemProcessHLTOUT"); + + fpEsdManager=new AliHLTEsdManager; } void AliHLTReconstructor::Reconstruct(AliRawReader* /*rawReader*/, TTree* /*clustersTree*/) const { // reconstruction of real data without writing of ESD - - // all reconstruction has been moved to FillESD -// int iResult=0; -// if (fpSystem) { -// if (fpSystem->CheckStatus(AliHLTSystem::kError)) { -// AliError("HLT system in error state"); -// return; -// } -// if ((iResult=fpSystem->Reconstruct(1, NULL, rawReader))>=0) { -// } -// } + // For each event, HLT reconstruction chains can be executed and + // added to the existing HLTOUT data + // The HLTOUT data is finally processed in FillESD + AliHLTSystem* pSystem=GetInstance(); } void AliHLTReconstructor::FillESD(AliRawReader* rawReader, TTree* /*clustersTree*/, AliESDEvent* esd) const { // reconstruct real data and fill ESD + if (!rawReader || !esd) { + AliError("missing raw reader or esd object"); + return; + } + + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // code needs to be moved back to Reconstruct as soon es HLT loader is implemented int iResult=0; AliHLTSystem* pSystem=GetInstance(); if (pSystem) { @@ -159,7 +173,26 @@ void AliHLTReconstructor::FillESD(AliRawReader* rawReader, TTree* /*clustersTree return; } if ((iResult=pSystem->Reconstruct(1, NULL, rawReader))>=0) { - pSystem->FillESD(-1, NULL, esd); + } + } + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + if (pSystem) { + if (pSystem->CheckStatus(AliHLTSystem::kError)) { + AliError("HLT system in error state"); + return; + } + if (!pSystem->CheckStatus(AliHLTSystem::kReady)) { + AliError("HLT system in wrong state"); + return; + } + pSystem->FillESD(-1, NULL, esd); + + AliHLTOUTRawReader* pHLTOUT=new AliHLTOUTRawReader(rawReader, esd->GetEventNumberInFile(), fpEsdManager); + if (pHLTOUT) { + ProcessHLTOUT(pHLTOUT, esd); + } else { + AliError("error creating HLTOUT handler"); } } } @@ -172,7 +205,7 @@ void AliHLTReconstructor::Reconstruct(TTree* /*digitsTree*/, TTree* /*clustersTr //AliReconstructor::Reconstruct(digitsTree,clustersTree); } -void AliHLTReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree, AliESDEvent* esd) const +void AliHLTReconstructor::FillESD(TTree* /*digitsTree*/, TTree* /*clustersTree*/, AliESDEvent* esd) const { // reconstruct simulated data and fill ESD @@ -180,7 +213,8 @@ void AliHLTReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree, AliESD // for now it's only an user failure condition as he tries to run HLT reconstruction // on simulated data TString option = GetOption(); - if (!option.IsNull()) { + if (!option.IsNull() && + (option.Contains("config=") || option.Contains("chains="))) { AliWarning(Form("HLT reconstruction of simulated data takes place in AliSimulation\n" " /*** run macro *****************************************/\n" " AliSimulation sim;\n" @@ -192,5 +226,46 @@ void AliHLTReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree, AliESD " sim.Run();\n" " /*********************************************************/", option.Data())); } - AliReconstructor::FillESD(digitsTree,clustersTree,esd); + AliHLTSystem* pSystem=GetInstance(); + if (pSystem) { + if (pSystem->CheckStatus(AliHLTSystem::kError)) { + AliError("HLT system in error state"); + return; + } + if (!pSystem->CheckStatus(AliHLTSystem::kReady)) { + AliError("HLT system in wrong state"); + return; + } + + AliHLTOUTDigitReader* pHLTOUT=new AliHLTOUTDigitReader(esd->GetEventNumberInFile(), fpEsdManager); + if (pHLTOUT) { + ProcessHLTOUT(pHLTOUT, esd); + } else { + AliError("error creating HLTOUT handler"); + } + } +} + +void AliHLTReconstructor::ProcessHLTOUT(AliHLTOUT* pHLTOUT, AliESDEvent* esd) const +{ + // treatmen of simulated or real HLTOUT data + if (!pHLTOUT) return; + AliHLTSystem* pSystem=GetInstance(); + if (!pSystem) { + AliError("error getting HLT system instance"); + return; + } + + if (pHLTOUT->Init()<0) { + AliError("error : initialization of HLTOUT handler failed"); + return; + } + + if (fFctProcessHLTOUT) { + typedef int (*AliHLTSystemProcessHLTOUT)(AliHLTSystem* pInstance, AliHLTOUT* pHLTOUT, AliESDEvent* esd); + AliHLTSystemProcessHLTOUT pFunc=(AliHLTSystemProcessHLTOUT)fFctProcessHLTOUT; + if ((pFunc)(pSystem, pHLTOUT, esd)<0) { + AliError("error processing HLTOUT"); + } + } } diff --git a/HLT/rec/AliHLTReconstructor.h b/HLT/rec/AliHLTReconstructor.h index c423a152396..3fad1a6fb32 100644 --- a/HLT/rec/AliHLTReconstructor.h +++ b/HLT/rec/AliHLTReconstructor.h @@ -2,21 +2,15 @@ #ifndef ALIHLTRECONSTRUCTOR_H #define ALIHLTRECONSTRUCTOR_H -/* This file is property of and copyright by the ALICE HLT Project * - * ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * /** @file AliHLTReconstructor.h @author Matthias Richter @date @brief Binding class for HLT simulation in AliRoot - -// see below for class documentation -// or -// refer to README to build package -// or -// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt - */ +*/ #include "AliReconstructor.h" #include "AliHLTReconstructorBase.h" @@ -24,6 +18,8 @@ class AliHLTSystem; class AliRawReader; class AliESDEvent; +class AliHLTOUT; +class AliHLTEsdManager; /** * @class AliHLTReconstructor @@ -70,6 +66,9 @@ public: * The function forwards to the default bahavior of AliReconstructor but gives * a warning if there were options set, i.e. the user runs customized * reconstruction. + * + * @note HLT reconstruction on simulated data is processed at the end of + * simulation.
*/ void Reconstruct(TTree* digitsTree, TTree* clustersTree) const; @@ -81,29 +80,43 @@ public: void Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const; /** - * This function is purely for simulated data and not applicable for HLT. - * HLT reconstruction on simulated data is processed at the end of - * simulation.
- * The function forwards to the default bahavior of AliReconstructor but gives - * a warning if there were options set, i.e. the user runs customized - * reconstruction. + * This function treats the simulated HLTOUT data. + * Opens a handler for simulated HLTOUT data and forwards to ::ProcessHLTOUT. */ void FillESD(TTree* digitsTree, TTree* clustersTree, AliESDEvent* esd) const; /** - * Fill the ESD from RAW data. - * This is the main entry for HLT reconstruction of RAW data. It performs both - * the analysis by the defined chains and the filling of the ESD. + * Process the raw HLTOUT data and fill ESD. + * Opens a handler for raw HLTOUT data and forwards to ::ProcessHLTOUT. */ void FillESD(AliRawReader* rawReader, TTree* clustersTree, AliESDEvent* esd) const; + /** + * Process HLTOUT data and fill ESD. + * This is the final treatment of the HLTOUT data, either simulated or real. + * HLTOUT data is stored in HOMER format, the AliHLTOUT object provides the interface + * to the individual data blocks. + * + * During reconstruction (::Reconstruct), module or user defined chains can be + * processed and may add additional data to the HLTOUT object. This data is then + * treated in the same way. + */ + void ProcessHLTOUT(AliHLTOUT* pHLTOUT, AliESDEvent* esd) const; + private: /** copy constructor prohibited */ AliHLTReconstructor(const AliHLTReconstructor& src); /** assignment operator prohibited */ AliHLTReconstructor& operator=(const AliHLTReconstructor& src); - ClassDef(AliHLTReconstructor, 4) // class for the HLT reconstruction + /** function pointer: processing of HLTOUT data */ + void* fFctProcessHLTOUT; //!transient + + /** ESD manger instance for this reconstruction */ + AliHLTEsdManager* fpEsdManager; //!transient + + ClassDef(AliHLTReconstructor, 5) // class for the HLT reconstruction + }; typedef AliHLTReconstructor AliL3Reconstructor; // for backward compatibility diff --git a/HLT/rec/Makefile.am b/HLT/rec/Makefile.am index eab95e31bd0..5d43774b473 100644 --- a/HLT/rec/Makefile.am +++ b/HLT/rec/Makefile.am @@ -11,7 +11,7 @@ EXTRA_DIST = lib_LTLIBRARIES = libHLTrec.la # version info for the library -LIBRARY_VERSION = "$(LIBHLTREC_VERSION):0:0" +LIBRARY_VERSION = "$(LIBHLTREC_VERSION):0:1" # MODDIR is set by the AliRoot build system and denotes the topdir # of the module, we must set it since the package definition libHLTrec.pkg diff --git a/HLT/sim/AliHLTOUTComponent.cxx b/HLT/sim/AliHLTOUTComponent.cxx index dabafe58472..fb3c306c013 100644 --- a/HLT/sim/AliHLTOUTComponent.cxx +++ b/HLT/sim/AliHLTOUTComponent.cxx @@ -1,20 +1,20 @@ // $Id$ -/************************************************************************** - * This file is property of and copyright by the ALICE HLT Project * - * ALICE Experiment at CERN, All rights reserved. * - * * - * Primary Authors: Matthias Richter * - * for The ALICE HLT Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTOUTComponent.cxx @author Matthias Richter @@ -22,12 +22,6 @@ @brief The HLTOUT data sink component similar to HLTOUT nodes */ -// see header file for class documentation -// or -// refer to README to build package -// or -// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt - #if __GNUC__>= 3 using namespace std; #endif @@ -42,6 +36,9 @@ using namespace std; #include "AliRawDataHeader.h" // Common Data Header #include // seed for TRandom #include // random int generation for DDL no +#include +#include +#include /** ROOT macro for the implementation of ROOT specific class methods */ ClassImp(AliHLTOUTComponent) @@ -53,7 +50,10 @@ AliHLTOUTComponent::AliHLTOUTComponent() fNofDDLs(10), fIdFirstDDL(7680), // 0x1e<<8 fBuffer(), - fpLibManager(NULL) + fpLibManager(NULL), + fpDigitFile(NULL), + fpDigitTree(NULL), + fppDigitArrays(NULL) { // see header file for class documentation // or @@ -142,7 +142,7 @@ int AliHLTOUTComponent::DoInit( int argc, const char** argv ) HLTDebug("HOMER writer %p added", pWriter); fWriters.push_back(pWriter); } else { - HLTError("can nor open HOMER writer"); + HLTError("can not open HOMER writer"); iResult=-ENODEV; break; } @@ -170,6 +170,25 @@ int AliHLTOUTComponent::DoDeinit() element=fWriters.erase(element); } } + + if (fpDigitTree) { + delete fpDigitTree; + fpDigitTree=NULL; + } + + if (fpDigitFile) { + fpDigitFile->Close(); + delete fpDigitFile; + fpDigitFile=NULL; + } + + if (fppDigitArrays) { + for (int i=0; i0) { - if (fgOptions&kWriteDigits) WriteDigits(eventNo, runLoader, *ddlno, pBuffer, bufferSize); + if (fgOptions&kWriteDigits) WriteDigitArray(*ddlno, pBuffer, bufferSize); if (fgOptions&kWriteRawFiles) WriteRawFile(eventNo, runLoader, *ddlno, pBuffer, bufferSize); } fWriters[*ddlno]->Clear(); ddlno++; } + if (fgOptions&kWriteDigits) WriteDigits(eventNo, runLoader); return iResult; } @@ -334,10 +354,67 @@ int AliHLTOUTComponent::FillOutputBuffer(int eventNo, AliHLTMonitoringWriter* pW return iResult; } -int AliHLTOUTComponent::WriteDigits(int /*eventNo*/, AliRunLoader* /*runLoader*/, int /*hltddl*/, const AliHLTUInt8_t* /*pBuffer*/, unsigned int /*bufferSize*/) +int AliHLTOUTComponent::WriteDigitArray(int hltddl, const AliHLTUInt8_t* pBuffer, unsigned int bufferSize) +{ + // see header file for class documentation + int iResult=0; + assert(hltddl=fNofDDLs) return -ERANGE; + + if (!fppDigitArrays) { + fppDigitArrays=new TArrayC*[fNofDDLs]; + if (fppDigitArrays) { + for (int i=0; iSet(bufferSize, reinterpret_cast(pBuffer)); + } else { + iResult=-ENOMEM; + } + return iResult; +} + +int AliHLTOUTComponent::WriteDigits(int /*eventNo*/, AliRunLoader* /*runLoader*/) { // see header file for class documentation int iResult=0; + const char* digitFileName="HLT.Digits.root"; + if (!fpDigitFile) { + fpDigitFile=new TFile(digitFileName, "RECREATE"); + } + if (fpDigitFile && !fpDigitFile->IsZombie()) { + if (!fpDigitTree) { + fpDigitTree=new TTree("rawhltout","HLTOUT raw data"); + if (fpDigitTree && fppDigitArrays) { + for (int i=0; iBranch(branchName, "TArrayC", &fppDigitArrays[i], 32000/*just as the default*/, 0); + } + } + } + if (fpDigitTree) { + int res=fpDigitTree->Fill(); + HLTDebug("writing digit tree: %d", res); + fpDigitFile->cd(); + res=fpDigitTree->Write("",TObject::kOverwrite); + HLTDebug("writing digit tree: %d", res); + if (fppDigitArrays) for (int i=0; iSet(0); + } + } + } else { + const char* errorMsg=""; + if (GetEventCount()==5) { + errorMsg=" (suppressing further error messages)"; + } + if (GetEventCount()<5) { + HLTError("can not open HLT digit file %s%s", digitFileName, errorMsg); + } + iResult=-EBADF; + } return iResult; } diff --git a/HLT/sim/AliHLTOUTComponent.h b/HLT/sim/AliHLTOUTComponent.h index 408f9452687..b81eee90ce5 100644 --- a/HLT/sim/AliHLTOUTComponent.h +++ b/HLT/sim/AliHLTOUTComponent.h @@ -2,9 +2,9 @@ #ifndef ALIHLTOUTCOMPONENT_H #define ALIHLTOUTCOMPONENT_H -/* This file is property of and copyright by the ALICE HLT Project * - * ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * /** @file AliHLTOUTComponent.h @author Matthias Richter @@ -22,6 +22,8 @@ class AliHLTHOMERLibManager; class AliHLTMonitoringWriter; +class TFile; +class TTree; typedef vector AliHLTMonitoringWriterPVector; /** @@ -151,16 +153,21 @@ class AliHLTOUTComponent : public AliHLTOfflineDataSink { */ int FillOutputBuffer(int eventNo, AliHLTMonitoringWriter* pWriter, const AliHLTUInt8_t* &pBuffer); + /** + * Write data for a DDL link. + * @param hltddl Number of DDL link within the range of HLT + * @param pBuffer buffer to write + * @param bufferSize size of the buffer + */ + int WriteDigitArray(int hltddl, const AliHLTUInt8_t* pBuffer, unsigned int bufferSize); + /** * Write the digits for one DDL * @param eventNo number of the event * @param runLoader AliRoot run loader instance - * @param hltddl Number of DDL link within the range of HLT - * @param pBuffer buffer to write - * @param size size of the buffer * @return neg. error if failed */ - int WriteDigits(int eventNo, AliRunLoader* runLoader, int hltddl, const AliHLTUInt8_t* pBuffer, unsigned int size); + int WriteDigits(int eventNo, AliRunLoader* runLoader); /** * Write the raw file for one DDL @@ -191,6 +198,15 @@ class AliHLTOUTComponent : public AliHLTOfflineDataSink { /** global options for all instances */ static int fgOptions; //! transient - ClassDef(AliHLTOUTComponent, 1) + /** the root file for the HLT 'digit' output */ + TFile* fpDigitFile; //!transient + + /** the tree for the HLT 'digit' output */ + TTree* fpDigitTree; //!transient + + /** array of TArrayC output buffers and branches */ + TArrayC** fppDigitArrays; //!transient + + ClassDef(AliHLTOUTComponent, 2) }; #endif diff --git a/HLT/sim/AliHLTSimulation.cxx b/HLT/sim/AliHLTSimulation.cxx index ebb196cc2b5..252a8903d96 100644 --- a/HLT/sim/AliHLTSimulation.cxx +++ b/HLT/sim/AliHLTSimulation.cxx @@ -1,20 +1,20 @@ // $Id$ -/************************************************************************** - * This file is property of and copyright by the ALICE HLT Project * - * ALICE Experiment at CERN, All rights reserved. * - * * - * Primary Authors: Matthias Richter * - * for The ALICE HLT Project. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** /** @file AliHLTSimulation.cxx @author Matthias Richter @@ -122,7 +122,7 @@ int AliHLTSimulation::Init(AliRunLoader* pRunLoader, const char* options) int count=0; for (; fpRawReader->NextEvent(); count++); if (count!=pRunLoader->GetNumberOfEvents()) { - AliError(Form("missmatch in event count: runloader %d, rawreader %d; ignoring rawreader", + AliError(Form("mismatch in event count: runloader %d, rawreader %d; ignoring rawreader", pRunLoader->GetNumberOfEvents(), count)); count=0; } @@ -184,7 +184,7 @@ int AliHLTSimulation::Run(AliRunLoader* pRunLoader) fpSystem->FillESD(0, pRunLoader, NULL); for (int i=1; iNextEvent()) { - AliError("missmatch in event count, rawreader corrupted"); + AliError("mismatch in event count, rawreader corrupted"); break; } fpSystem->Reconstruct(1, pRunLoader, fpRawReader); -- 2.43.0