- 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
}
//} 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");
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);
}
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 {
// $Id$
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * ALICE Experiment at CERN, All rights reserved. *
- * *
- * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
- * 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 <Matthias.Richter@ift.uib.no> *
+//* 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
@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
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 {
iResult=-EINVAL;
}
} else {
- HLTFatal("internal data structur missmatch");
+ HLTFatal("internal data structur mismatch");
iResult=-EFAULT;
}
} else {
Register(this);
}
+const AliHLTModuleAgent::AliHLTOUTHandlerDesc AliHLTModuleAgent::fgkVoidHandlerDesc;
+
AliHLTModuleAgent::~AliHLTModuleAgent()
{
// see header file for function documentation
bool operator==(const AliHLTOUTHandlerType handlerType) const {
return fHType==handlerType;
}
+ operator AliHLTOUTHandlerType() {return fHType;}
+ operator AliHLTComponentDataType() {return fDt;}
private:
/** type of the handler */
TString fModule; //!transient
};
+ static const AliHLTOUTHandlerDesc fgkVoidHandlerDesc; //! initializer
+
/**
* Get handler description for a data block.
* @param dt [in] data type of the block
(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();
/*
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;
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
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
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
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;
}
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<AliHLTOUTHandlerListEntry&>(entry));
}
class AliHLTOUTHandler;
class AliHLTOUTHandlerDesc; // AliHLTModuleAgent.h
+class AliESDEvent;
+class AliHLTReconstructor;
#define AliHLTOUTInvalidIndex (~(AliHLTUInt32_t)0)
/** 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 <br>
- * @param spec [in] data specification to match <br>
- * @param handlerType [in] type of the handler
- * @return identifier >0 if success, 0 if no block found <br>
- * neg. error code if failed <br>
- * -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 <br>
- * neg. error code if failed <br>
- * -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.
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<AliHLTOUTHandlerListEntry> AliHLTOUTHandlerListEntryVector;
+ typedef vector<AliHLTOUTBlockDescriptor> 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 <br>
+ * @param spec [in] data specification to match <br>
+ * @param handlerType [in] type of the handler
+ * @return identifier >0 if success, 0 if no block found <br>
+ * neg. error code if failed <br>
+ * -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 <br>
+ * neg. error code if failed <br>
+ * -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,
*/
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 <br>
+ * neg. error code if failed
+ */
+ static int InsertHandler(AliHLTOUTHandlerListEntryVector& list, const AliHLTOUTHandlerListEntry &entry);
+
protected:
/**
* Add a block descriptor.
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.
*/
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 <br>
- * neg. error code if failed
- */
- int InsertHandler(const AliHLTOUTHandlerListEntry &entry);
-
/**
* Find handler description for a certain block index.
*/
/** instance flags: locked, collecting, ... */
unsigned int fFlags; //!transient
- typedef vector<AliHLTOUTHandlerListEntry> AliHLTOUTHandlerListEntryVector;
- typedef vector<AliHLTOUTBlockDescriptor> AliHLTOUTBlockDescriptorVector;
-
/** list of block descriptors */
AliHLTOUTBlockDescriptorVector fBlockDescList; //!transient
// first check if the offset allows to add all data blocks without exceeding the
// range
- while (nofBlocks<tmp1 && tmp2>0) {
+ while (nofBlocks>tmp1 && tmp2>0) {
if (tmp2&0x1) {
HLTError("index range %#x exceeded for %d data blocks", nofBlocks, offset);
iResult=-ERANGE;
*
* @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
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);
}
// $Id$
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * ALICE Experiment at CERN, All rights reserved. *
- * *
- * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
- * 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 <Matthias.Richter@ift.uib.no> *
+//* 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
@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
#include "AliHLTModuleAgent.h"
#include "AliHLTOfflineInterface.h"
#include "AliHLTDataSource.h"
+#include "AliHLTOUT.h"
+#include "AliHLTOUTHandler.h"
#include <TObjArray.h>
#include <TObjString.h>
#include <TStopwatch.h>
//"libAliHLTPHOS.so",
//"libAliHLTMUON.so",
"libAliHLTTRD.so",
+ "libAliHLTTrigger.so",
NULL
};
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
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
#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
@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.
class AliHLTConfiguration;
class AliHLTConfigurationHandler;
class AliHLTTask;
+class AliHLTOUT;
class AliRunLoader;
class AliRawReader;
class AliESDEvent;
* 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.
*/
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
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
}
return iResult;
}
+
+int AliHLTSystemProcessHLTOUT(AliHLTSystem* pInstance, AliHLTOUT* pHLTOUT, AliESDEvent* esd)
+{
+ int iResult=0;
+ if (pInstance) {
+ AliHLTSystem* pSystem=reinterpret_cast<AliHLTSystem*>(pInstance);
+ if (pSystem) {
+ iResult=pSystem->ProcessHLTOUT(pHLTOUT, esd);
+ } else {
+ iResult=-EFAULT;
+ }
+ } else {
+ iResult=-EINVAL;
+ }
+ return iResult;
+}
#include <AliHLTDataTypes.h>
class AliHLTSystem;
+class AliHLTOUT;
+class AliESDEvent;
#ifdef __cplusplus
extern "C" {
#endif
*/
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 <br>
+ * -EFAULT type cast failed <br>
+ * -EINVAL invalid parameter
+ * @ingroup alihlt_system_interface
+ */
+int AliHLTSystemProcessHLTOUT(AliHLTSystem* pInstance, AliHLTOUT* pHLTOUT, AliESDEvent* esd);
+
#ifdef __cplusplus
}
#endif
int startTime=fpSimData->At(dataPos++);
int time=startTime;
for (; time<startTime+bunchLength; time++) {
- //iResult=encoder.AddSignal(fpSimData->At(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
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) {
* @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
/**
* @class AliHLTSamplePreprocessor
- * HLT preprocessor for the libAliHLTComp module.
- *
- * @author Jenny Wagner, Matthias Richter
+ * A sample HLT preprocessor.
*
* @date 2008-01-22
*/
// @(#) $Id$
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * ALICE Experiment at CERN, All rights reserved. *
- * *
- * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
- * 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 <Matthias.Richter@ift.uib.no> *
+//* 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
if (minslice >=-1 && minslice<AliHLTTPCTransform::GetNSlice()) {
if (minslice!=maxslice) {
HLTWarning("data from multiple sectors in one block: "
- "possible missmatch in treatment of local coordinate system");
+ "possible mismatch in treatment of local coordinate system");
}
AliHLTTPCTrackArray tracks;
inPtr=(AliHLTTPCTrackletData*)iter->fPtr;
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;
}
}
{
// see header file for class documentation
constBase=1000000;
- inputMultiplier=1.0;
+ inputMultiplier=5.0;
}
int AliHLTTPCEsdWriterComponent::AliConverter::DoInit(int argc, const char** argv)
#include "AliHLTTPCSpacePointData.h"
//#include "AliHLTTPCTrackArray.h"
#include "AliHLTTPCFileHandler.h"
+#include "AliHLTTPCMapping.h"
+#include "AliHLTAltroEncoder.h"
#if __GNUC__ >= 3
using namespace std;
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"<<ENDLOG;
+ return 0;
+ }
+
+ if (!tgtBuffer) {
+ return -EINVAL;
+ }
+
+ if(!fDigitsTree)
+ if(!GetDigitsTree(event)) return 0;
+
+ UShort_t dig;
+ Int_t time=0;
+ Int_t pad=0;
+ Int_t sector=0;
+
+ AliHLTTPCMapping mapper(fPatch);
+ AliHLTAltroEncoder encoder;
+ encoder.SetBuffer(tgtBuffer, tgtSize);
+
+ // The digits of the current event have been indexed: all digits are organized in
+ // rows, all digits of one row are stored in a AliSimDigits object (fDigit) which
+ // are stored in the digit tree.
+ // The index map relates the AliSimDigits objects in the tree to dedicated pad rows
+ // in the TPC
+ // This loop filters the pad rows according to the slice no set via Init
+
+ assert(fRowMax<fgkNRow);
+ for(Int_t r=fRowMin;r<=fRowMax && r<fgkNRow && iResult>=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")
+ <<AliHLTTPCLog::kDec<<"Rows on slice " << fSlice << " dont match "<<lrow<<" "<<r<<ENDLOG;
+ continue;
+ }
+
+ Int_t channelAddress=-1;
+ fDigits->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.
}
/**
- * 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
--- /dev/null
+// $Id$
+
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* *
+//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
+//* 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; n<digitsTree->GetEntries(); 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;
+ }
+}
* 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.)
*
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 \
--- /dev/null
+// $Id$
+
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* *
+//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
+//* 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.size(); i++) {
+ if (fESDs[i]==dt) {
+ pEntry=const_cast<AliHLTEsdListEntry*>(&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<AliHLTUInt8_t*>(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<AliESDEvent*>(pObj);
+ TTree* pTree=NULL;
+ if (!pESD) {
+ pTree=dynamic_cast<TTree*>(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(); i<eventno; i++) {
+ fpTree->Fill();
+ }
+ 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;
+}
--- /dev/null
+//-*- 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 <vector>
+
+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<AliHLTEsdListEntry> 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
--- /dev/null
+// $Id$
+
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* *
+//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
+//* 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 <cassert>
+
+/** 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<fNofDDLs) {
+ if (fMinDDL>-1 && fMinDDL>fpEquipments[fCurrent]) continue;
+ if (fMaxDDL>-1 && fMaxDDL<fpEquipments[fCurrent]) continue;
+ if (fppDigitArrays[fCurrent]->GetSize()>(int)sizeof(AliRawDataHeader)) {
+ data=reinterpret_cast<UChar_t*>(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 && fCurrent<fNofDDLs && fppDigitArrays) {
+ return fppDigitArrays[fCurrent]->GetSize()-sizeof(AliRawDataHeader);
+ }
+ return 0;
+}
+
+const AliRawDataHeader* AliHLTOUTDigitReader::GetDataHeader()
+{
+ // see header file for class documentation
+ if (fCurrent>=0 && fCurrent<fNofDDLs && fppDigitArrays) {
+ return reinterpret_cast<AliRawDataHeader*>(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 && fCurrent<fNofDDLs && fpEquipments) {
+ return fpEquipments[fCurrent];
+ }
+ return -1;
+}
+
+bool AliHLTOUTDigitReader::ReadArrays()
+{
+ // see header file for class documentation
+ bool result=false;
+
+ if (GetCurrentEventNo()<0) {
+ HLTWarning("no event selected, no data available");
+ return false;
+ }
+
+ if (!fpDigitFile) {
+ fpDigitFile=new TFile("HLT.Digits.root");
+ }
+ if (!fpDigitFile) return false;
+ if (fpDigitFile->IsZombie()) return false;
+
+ fpDigitFile->GetObject("rawhltout", fpDigitTree);
+ if (!fpDigitTree) {
+ return false;
+ }
+
+ vector<int> 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; i<fNofDDLs; i++) {
+ fppDigitArrays[i]=NULL;
+ fpDigitTree->SetBranchAddress(AliDAQ::DdlFileName("HLT", fpEquipments[i]-AliDAQ::DdlIDOffset("HLT")), &fppDigitArrays[i]);
+ }
+ fpDigitTree->GetEvent(GetCurrentEventNo());
+ for (i=0; i<fNofDDLs; i++) {
+ if (fppDigitArrays[i]) {
+ HLTDebug("branch %s: %d byte(s)", AliDAQ::DdlFileName("HLT", fpEquipments[i]-AliDAQ::DdlIDOffset("HLT")), fppDigitArrays[i]);
+ }
+ }
+ result=true;
+ } else {
+ fNofDDLs=0;
+ }
+ }
+ return result;
+}
+
+int AliHLTOUTDigitReader::CloseTree()
+{
+ // see header file for class documentation
+ int iResult=0;
+ if (fppDigitArrays) delete[] fppDigitArrays;
+ fppDigitArrays=NULL;
+ if (fpEquipments) delete[] fpEquipments;
+ fpEquipments=NULL;
+ if (fpDigitTree) delete fpDigitTree;
+ fpDigitTree=NULL;
+ fNofDDLs=0;
+ fCurrent=-1;
+
+ return iResult;
+}
--- /dev/null
+//-*- Mode: C++ -*-
+// $Id$
+
+#ifndef ALIHLTOUTDIGITREADER_H
+#define ALIHLTOUTDIGITREADER_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 AliHLTOUTDigitReader.h
+ @author Matthias Richter
+ @date
+ @brief HLTOUT data wrapper for simulated AliRoot HLT digit data.
+*/
+
+#include "AliHLTOUTHomerCollection.h"
+
+class AliRawReader;
+class AliHLTHOMERReader;
+class TTree;
+class TFile;
+class TArrayC;
+
+/**
+ * @class AliHLTOUTDigitReader
+ * Handler of HLTOUT data for simulated HLT digit input.
+ */
+class AliHLTOUTDigitReader : public AliHLTOUTHomerCollection {
+ public:
+ /** standard constructor */
+ AliHLTOUTDigitReader(int event=-1, AliHLTEsdManager* pEsdManager=NULL);
+ /** destructor */
+ virtual ~AliHLTOUTDigitReader();
+
+ 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:
+ /** copy constructor prohibited */
+ AliHLTOUTDigitReader(const AliHLTOUTDigitReader&);
+ /** assignment operator prohibited */
+ AliHLTOUTDigitReader& operator=(const AliHLTOUTDigitReader&);
+
+ /**
+ * Read the data from the root file and HLTOUT raw tree.
+ * Retrieve the number of branches and allocate arrays acording
+ * to that. After initialization of the arrays and variables, the
+ * event fEnvent is read.
+ */
+ bool ReadArrays();
+
+ /**
+ * Cleanup tree and data arrays.
+ */
+ int CloseTree();
+
+ /** the root file for the HLT 'digit' output */
+ TFile* fpDigitFile; //!transient
+
+ /** the tree for the HLT 'digit' output */
+ TTree* fpDigitTree; //!transient
+
+ /** min DDL id for equipment selection */
+ int fMinDDL; //!transient
+
+ /** max DDL id for equipment selection */
+ int fMaxDDL; //!transient
+
+ /** array of digit data read from tree */
+ TArrayC** fppDigitArrays; //!transient
+
+ /** array of equipment ids for the corresponding data blocks in fppDigitArrays */
+ int* fpEquipments; //!transient
+
+ /** number of DDL objects -> size of the arrays */
+ int fNofDDLs; //!transient
+
+ /** current position in the array */
+ int fCurrent; //!transient
+
+ ClassDef(AliHLTOUTDigitReader, 0)
+};
+#endif
--- /dev/null
+// $Id$
+
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* *
+//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
+//* 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<<fgkIdShift)-1);
+
+ // block from the same ddl requested?
+ if (fpCurrent && GetEquipmentId()!=id) {
+ fpManager->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<const AliHLTUInt8_t*>(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<AliHLTOUTEventHeader*>(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<<kCDHFlagsHLTDecision)) {
+ // the block contains HLT decision data, this is just
+ // skipped here
+ AliHLTUInt32_t* pDecisionLen=reinterpret_cast<AliHLTUInt32_t*>(pSrc+offset);
+ if ((*pDecisionLen)*sizeof(AliHLTUInt32_t)+offset<size) {
+ // the first 32bit word specifies the number of 32bit words in the
+ // decision block -> +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<<kCDHFlagsHLTPayload))) return NULL;
+
+ // 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;
+ }
+
+ // check for the HOME descriptor type id
+ AliHLTUInt64_t* pHomerDesc=reinterpret_cast<AliHLTUInt64_t*>(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;
+}
--- /dev/null
+//-*- 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
// $Id$
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * ALICE Experiment at CERN, All rights reserved. *
- * *
- * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
- * 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 <Matthias.Richter@ift.uib.no> *
+//* 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
// 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<<fgkIdShift)-1);
-
- // block from the same ddl requested?
- if (fpCurrent && fpRawreader->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<const AliHLTUInt8_t*>(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<AliHLTOUTEventHeader*>(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<<kCDHFlagsHLTDecision)) {
- // the block contains HLT decision data, this is just
- // skipped here
- AliHLTUInt32_t* pDecisionLen=reinterpret_cast<AliHLTUInt32_t*>(pSrc+offset);
- if ((*pDecisionLen)*sizeof(AliHLTUInt32_t)+offset<size) {
- // the first 32bit word specifies the number of 32bit words in the
- // decision block -> +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<<kCDHFlagsHLTPayload))) return NULL;
+ if (fpRawreader) return fpRawreader->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<AliHLTUInt64_t*>(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;
}
#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;
* @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 */
/** 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
// $Id$
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * ALICE Experiment at CERN, All rights reserved. *
- * *
- * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
- * 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 <Matthias.Richter@ift.uib.no> *
+//* 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
#include <TObjString.h>
#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
}
pSystem->Reconstruct(0, NULL, NULL);
}
}
+
+ if (fpEsdManager) delete fpEsdManager;
+ fpEsdManager=NULL;
}
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) {
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");
}
}
}
//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
// 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"
" 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");
+ }
+ }
}
#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"
class AliHLTSystem;
class AliRawReader;
class AliESDEvent;
+class AliHLTOUT;
+class AliHLTEsdManager;
/**
* @class AliHLTReconstructor
* 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. <br>
*/
void Reconstruct(TTree* digitsTree, TTree* clustersTree) const;
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. <br>
- * 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
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
// $Id$
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * ALICE Experiment at CERN, All rights reserved. *
- * *
- * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
- * 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 <Matthias.Richter@ift.uib.no> *
+//* 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
@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
#include "AliRawDataHeader.h" // Common Data Header
#include <TDatime.h> // seed for TRandom
#include <TRandom.h> // random int generation for DDL no
+#include <TFile.h>
+#include <TTree.h>
+#include <TArrayC.h>
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(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
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;
}
element=fWriters.erase(element);
}
}
+
+ if (fpDigitTree) {
+ delete fpDigitTree;
+ fpDigitTree=NULL;
+ }
+
+ if (fpDigitFile) {
+ fpDigitFile->Close();
+ delete fpDigitFile;
+ fpDigitFile=NULL;
+ }
+
+ if (fppDigitArrays) {
+ for (int i=0; i<fNofDDLs; i++) {
+ if (fppDigitArrays[i]) delete fppDigitArrays[i];
+ }
+ delete[] fppDigitArrays;
+ fppDigitArrays=NULL;
+ }
return iResult;
}
memcpy(&id, blocks[n].fDataType.fID, sizeof(homer_uint64));
memcpy(((AliHLTUInt8_t*)&origin)+sizeof(homer_uint32), blocks[n].fDataType.fOrigin, sizeof(homer_uint32));
homerDescriptor.SetType(AliHLTOUT::ByteSwap64(id));
- homerDescriptor.SetSubType1(AliHLTOUT::ByteSwap32(origin));
+ homerDescriptor.SetSubType1(AliHLTOUT::ByteSwap64(origin));
homerDescriptor.SetSubType2(blocks[n].fSpecification);
homerDescriptor.SetBlockSize(blocks[n].fSize);
int writerNo=ShuffleWriters(fWriters, blocks[n].fSize);
int bufferSize=0;
if ((bufferSize=FillOutputBuffer(eventNo, fWriters[*ddlno], pBuffer))>0) {
- 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;
}
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);
+ if (hltddl>=fNofDDLs) return -ERANGE;
+
+ if (!fppDigitArrays) {
+ fppDigitArrays=new TArrayC*[fNofDDLs];
+ if (fppDigitArrays) {
+ for (int i=0; i<fNofDDLs; i++) {
+ fppDigitArrays[i]=new TArrayC(0);
+ }
+ }
+ }
+ if (fppDigitArrays && fppDigitArrays[hltddl]) {
+ fppDigitArrays[hltddl]->Set(bufferSize, reinterpret_cast<const Char_t*>(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; i<fNofDDLs; i++) {
+ const char* branchName=AliDAQ::DdlFileName("HLT", i);
+ if (fppDigitArrays[i]) fpDigitTree->Branch(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; i<fNofDDLs; i++) {
+ if (fppDigitArrays[i]) fppDigitArrays[i]->Set(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;
}
#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
class AliHLTHOMERLibManager;
class AliHLTMonitoringWriter;
+class TFile;
+class TTree;
typedef vector<AliHLTMonitoringWriter*> AliHLTMonitoringWriterPVector;
/**
*/
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
/** 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
// $Id$
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * ALICE Experiment at CERN, All rights reserved. *
- * *
- * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
- * 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 <Matthias.Richter@ift.uib.no> *
+//* 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
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;
}
fpSystem->FillESD(0, pRunLoader, NULL);
for (int i=1; i<nEvents; i++) {
if (fpRawReader && !fpRawReader->NextEvent()) {
- AliError("missmatch in event count, rawreader corrupted");
+ AliError("mismatch in event count, rawreader corrupted");
break;
}
fpSystem->Reconstruct(1, pRunLoader, fpRawReader);