Alsi made minor fixes to HLT error messages.
return sizeof(DataBlockType) + Nentries() * sizeof(DataElementType);
}
- AliHLTUInt32_t BufferSize() { return fSize; }
+ AliHLTUInt32_t BufferSize() const { return fSize; }
private:
--- /dev/null
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * All rights reserved. *
+ * *
+ * Primary Authors: *
+ * Artur Szostak <artursz@iafrica.com> *
+ * *
+ * 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. *
+ **************************************************************************/
+
+/* $Id: $ */
+
+///
+/// @file AliHLTMUONProcessor.cxx
+/// @author Artur Szostak <artursz@iafrica.com>
+/// @date 2007-12-12
+/// @brief Implementation of the abstract base dHLT processor component.
+///
+/// This component is the abstract base class of dHLT specific components.
+/// It implements some common methods used by all the dHLT components.
+///
+
+#include "AliHLTMUONProcessor.h"
+
+ClassImp(AliHLTMUONProcessor)
+
--- /dev/null
+#ifndef ALIHLTMUONPROCESSOR_H
+#define ALIHLTMUONPROCESSOR_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 */
+
+/* $Id: $ */
+
+///
+/// @file AliHLTMUONProcessor.h
+/// @author Artur Szostak <artursz@iafrica.com>
+/// @date 2007-12-12
+/// @brief Declaration of a common processor component abstract interface for dHLT components.
+///
+
+#include "AliHLTProcessor.h"
+#include "AliHLTMUONDataBlockReader.h"
+#include "AliHLTMUONUtils.h"
+
+/**
+ * @class AliHLTMUONProcessor
+ * This component class is an abstract base class for dHLT components.
+ * Some common methods useful to all dHLT specific components are implemented
+ * by this class.
+ */
+class AliHLTMUONProcessor : public AliHLTProcessor
+{
+public:
+ /// Default constructor.
+ AliHLTMUONProcessor() : AliHLTProcessor() {}
+ /// Default destructor.
+ virtual ~AliHLTMUONProcessor() {}
+
+protected:
+
+ /**
+ * Method to check the block structure and log appropriate error messages.
+ * If a problem is found with the data block then an appropriate HLT error
+ * message is logged and the method returns false.
+ * \param block The lightweight block reader whose data block should be checked.
+ * \param name A string containing a descriptive name of the data block
+ * type. This name is used in the logged error messages.
+ * \returns true if the structure of the block looks OK and false otherwise.
+ * \note The BlockType should be a class deriving from AliHLTMUONDataBlockReader.
+ */
+ template <class BlockType>
+ bool BlockStructureOk(const BlockType& block, const char* name) const;
+
+ /// Checks the structure of a trigger records data block.
+ bool BlockStructureOk(const AliHLTMUONTriggerRecordsBlockReader& block) const
+ {
+ return BlockStructureOk(block, "trigger records");
+ }
+
+ /// Checks the structure of a trigger records debug information data block.
+ bool BlockStructureOk(const AliHLTMUONTrigRecsDebugBlockReader& block) const
+ {
+ return BlockStructureOk(block, "trigger records debug information");
+ }
+
+ /// Checks the structure of a reconstructed hits data block.
+ bool BlockStructureOk(const AliHLTMUONRecHitsBlockReader& block) const
+ {
+ return BlockStructureOk(block, "reconstructed hits");
+ }
+
+ /// Checks the structure of a clusters data block.
+ bool BlockStructureOk(const AliHLTMUONClustersBlockReader& block) const
+ {
+ return BlockStructureOk(block, "clusters");
+ }
+
+ /// Checks the structure of a ADC channels data block.
+ bool BlockStructureOk(const AliHLTMUONChannelsBlockReader& block) const
+ {
+ return BlockStructureOk(block, "channels");
+ }
+
+ /// Checks the structure of a Manso tracks data block.
+ bool BlockStructureOk(const AliHLTMUONMansoTracksBlockReader& block) const
+ {
+ return BlockStructureOk(block, "Manso tracks");
+ }
+
+ /// Checks the structure of a Manso track candidates data block.
+ bool BlockStructureOk(const AliHLTMUONMansoCandidatesBlockReader& block) const
+ {
+ return BlockStructureOk(block, "Manso track candidates");
+ }
+
+ /// Checks the structure of a single track trigger decision data block.
+ bool BlockStructureOk(const AliHLTMUONSinglesDecisionBlockReader& block) const
+ {
+ return BlockStructureOk(block, "singles decision");
+ }
+
+ /// Checks the structure of a track pairs trigger decision data block.
+ bool BlockStructureOk(const AliHLTMUONPairsDecisionBlockReader& block) const
+ {
+ return BlockStructureOk(block, "pairs decision");
+ }
+
+private:
+
+ // Do not allow copying of this class.
+ AliHLTMUONProcessor(const AliHLTMUONProcessor& /*obj*/);
+ AliHLTMUONProcessor& operator = (const AliHLTMUONProcessor& /*obj*/);
+
+ ClassDef(AliHLTMUONProcessor, 0) // Abstract base class for dHLT specific components.
+};
+
+//______________________________________________________________________________
+
+template <class BlockType>
+bool AliHLTMUONProcessor::BlockStructureOk(const BlockType& block, const char* name) const
+{
+ /// Performs basic checks to see if the input data block structure is OK,
+ /// that it is not corrupt, too short etc...
+
+ if (not block.BufferSizeOk())
+ {
+ size_t headerSize = sizeof(typename BlockType::HeaderType);
+ if (block.BufferSize() < headerSize)
+ {
+ HLTError("Received a %s data block with a size of %d bytes,"
+ " which is smaller than the minimum valid header size of %d bytes."
+ " The block must be corrupt.",
+ name, block.BufferSize(), headerSize
+ );
+ return false;
+ }
+
+ size_t expectedWidth = sizeof(typename BlockType::ElementType);
+ if (block.CommonBlockHeader().fRecordWidth != expectedWidth)
+ {
+ HLTError("Received a %s data block with a record"
+ " width of %d bytes, but the expected value is %d bytes."
+ " The block might be corrupt.",
+ name,
+ block.CommonBlockHeader().fRecordWidth,
+ expectedWidth
+ );
+ return false;
+ }
+
+ HLTError("Received a %s data block with a size of %d bytes,"
+ " but the block header claims the block should be %d bytes."
+ " The block might be corrupt.",
+ name, block.BufferSize(), block.BytesUsed()
+ );
+ return false;
+ }
+
+ AliHLTMUONUtils::WhyNotValid reason;
+ if (not AliHLTMUONUtils::HeaderOk(block.BlockHeader(), &reason))
+ {
+ HLTError("Received a %s data block which might be corrupt. %s",
+ name, AliHLTMUONUtils::FailureReasonToMessage(reason)
+ );
+ return false;
+ }
+
+ return true;
+}
+
+#endif // ALIHLTMUONPROCESSOR_H
/// @file HLTMUONLinkDef.h
/// @author Artur Szostak <artursz@iafrica.com>
/// @date 29 May 2007
-/// @brief The linkdef file for rootcint to build a ROOT dictionary of
-/// the dimuon HLT classes exposed to AliRoot.
+/// @brief Linkdef file for dHLT.
+///
+/// The linkdef file for rootcint to build a ROOT dictionary of the dimuon
+/// HLT classes exposed to AliRoot.
///
#ifdef __CINT__
#pragma link C++ nestedfunction;
#pragma link C++ class AliHLTMUONAgent+;
+#pragma link C++ class AliHLTMUONProcessor+;
#pragma link C++ class AliHLTMUONTriggerRecordsSource+;
#pragma link C++ class AliHLTMUONRecHitsSource+;
#pragma link C++ class AliHLTMUONTriggerReconstructorComponent+;
#include "AliHLTMUONEvent.h"
#include "AliHLTMUONConstants.h"
#include "AliHLTMUONUtils.h"
-#include "AliHLTMUONDataBlockReader.h"
#include "AliHLTMUONRecHit.h"
#include "AliHLTMUONTriggerRecord.h"
#include "AliHLTMUONMansoTrack.h"
AliHLTMUONRootifierComponent::AliHLTMUONRootifierComponent() :
- AliHLTProcessor(),
+ AliHLTMUONProcessor(),
fWarnForUnexpecedBlock(false)
{
///
AliHLTUInt8_t* ptr = reinterpret_cast<AliHLTUInt8_t*>(block->fPtr);
ptr += block->fOffset;
AliHLTMUONRecHitsBlockReader inblock(ptr, block->fSize);
- if (not inblock.BufferSizeOk())
- {
- size_t headerSize = sizeof(AliHLTMUONRecHitsBlockReader::HeaderType);
- if (block->fSize < headerSize)
- {
- HLTError("Received a reconstructed hits data block with a size of %d bytes,"
- " which is smaller than the minimum valid header size of %d bytes."
- " The block must be corrupt.",
- block->fSize, headerSize
- );
- continue;
- }
-
- size_t expectedWidth = sizeof(AliHLTMUONRecHitsBlockReader::ElementType);
- if (inblock.CommonBlockHeader().fRecordWidth != expectedWidth)
- {
- HLTError("Received a reconstructed hits data block with a record"
- " width of %d bytes, but the expected value is %d bytes."
- " The block might be corrupt.",
- block->fSize, headerSize
- );
- continue;
- }
-
- HLTError("Received a reconstructed hits data block with a size of %d bytes,"
- " but the block header claims the block should be %d bytes."
- " The block might be corrupt.",
- block->fSize, inblock.BytesUsed()
- );
- continue;
- }
+ if (not BlockStructureOk(inblock)) continue;
// Decode the source DDL from the specification bits.
Int_t sourceDDL = -1;
AliHLTUInt8_t* ptr = reinterpret_cast<AliHLTUInt8_t*>(block->fPtr);
ptr += block->fOffset;
AliHLTMUONTriggerRecordsBlockReader inblock(ptr, block->fSize);
- if (not inblock.BufferSizeOk())
- {
- size_t headerSize = sizeof(AliHLTMUONTriggerRecordsBlockReader::HeaderType);
- if (block->fSize < headerSize)
- {
- HLTError("Received a trigger records data block with a size of %d bytes,"
- " which is smaller than the minimum valid header size of %d bytes."
- " The block must be corrupt.",
- block->fSize, headerSize
- );
- continue;
- }
-
- size_t expectedWidth = sizeof(AliHLTMUONTriggerRecordsBlockReader::ElementType);
- if (inblock.CommonBlockHeader().fRecordWidth != expectedWidth)
- {
- HLTError("Received a trigger records data block with a record"
- " width of %d bytes, but the expected value is %d bytes."
- " The block might be corrupt.",
- block->fSize, headerSize
- );
- continue;
- }
-
- HLTError("Received a trigger records data block with a size of %d bytes,"
- " but the block header claims the block should be %d bytes."
- " The block might be corrupt.",
- block->fSize, inblock.BytesUsed()
- );
- continue;
- }
+ if (not BlockStructureOk(inblock)) continue;
// Decode the source DDL from the specification bits.
Int_t sourceDDL = -1;
AliHLTUInt8_t* ptr = reinterpret_cast<AliHLTUInt8_t*>(block->fPtr);
ptr += block->fOffset;
AliHLTMUONMansoTracksBlockReader inblock(ptr, block->fSize);
- if (not inblock.BufferSizeOk())
- {
- size_t headerSize = sizeof(AliHLTMUONMansoTracksBlockReader::HeaderType);
- if (block->fSize < headerSize)
- {
- HLTError("Received a Manso tracks data block with a size of %d bytes,"
- " which is smaller than the minimum valid header size of %d bytes."
- " The block must be corrupt.",
- block->fSize, headerSize
- );
- continue;
- }
-
- size_t expectedWidth = sizeof(AliHLTMUONMansoTracksBlockReader::ElementType);
- if (inblock.CommonBlockHeader().fRecordWidth != expectedWidth)
- {
- HLTError("Received a Manso tracks data block with a record"
- " width of %d bytes, but the expected value is %d bytes."
- " The block might be corrupt.",
- block->fSize, headerSize
- );
- continue;
- }
-
- HLTError("Received a Manso tracks data block with a size of %d bytes,"
- " but the block header claims the block should be %d bytes."
- " The block might be corrupt.",
- block->fSize, inblock.BytesUsed()
- );
- continue;
- }
+ if (not BlockStructureOk(inblock)) continue;
for (AliHLTUInt32_t n = 0; n < inblock.Nentries(); n++)
{
AliHLTUInt8_t* ptr = reinterpret_cast<AliHLTUInt8_t*>(block->fPtr);
ptr += block->fOffset;
AliHLTMUONSinglesDecisionBlockReader inblock(ptr, block->fSize);
- if (not inblock.BufferSizeOk())
- {
- size_t headerSize = sizeof(AliHLTMUONSinglesDecisionBlockReader::HeaderType);
- if (block->fSize < headerSize)
- {
- HLTError("Received a single tracks trigger decision data block with a size of %d bytes,"
- " which is smaller than the minimum valid header size of %d bytes."
- " The block must be corrupt.",
- block->fSize, headerSize
- );
- continue;
- }
-
- size_t expectedWidth = sizeof(AliHLTMUONSinglesDecisionBlockReader::ElementType);
- if (inblock.CommonBlockHeader().fRecordWidth != expectedWidth)
- {
- HLTError("Received a single tracks trigger decision data block with a record"
- " width of %d bytes, but the expected value is %d bytes."
- " The block might be corrupt.",
- block->fSize, headerSize
- );
- continue;
- }
-
- HLTError("Received a single tracks trigger decision data block with a size of %d bytes,"
- " but the block header claims the block should be %d bytes."
- " The block might be corrupt.",
- block->fSize, inblock.BytesUsed()
- );
- continue;
- }
+ if (not BlockStructureOk(inblock)) continue;
numLowPt += inblock.BlockHeader().fNlowPt;
numHighPt += inblock.BlockHeader().fNhighPt;
AliHLTUInt8_t* ptr = reinterpret_cast<AliHLTUInt8_t*>(block->fPtr);
ptr += block->fOffset;
AliHLTMUONPairsDecisionBlockReader inblock(ptr, block->fSize);
- if (not inblock.BufferSizeOk())
- {
- size_t headerSize = sizeof(AliHLTMUONPairsDecisionBlockReader::HeaderType);
- if (block->fSize < headerSize)
- {
- HLTError("Received a track pairs trigger decision data block with a size of %d bytes,"
- " which is smaller than the minimum valid header size of %d bytes."
- " The block must be corrupt.",
- block->fSize, headerSize
- );
- continue;
- }
-
- size_t expectedWidth = sizeof(AliHLTMUONPairsDecisionBlockReader::ElementType);
- if (inblock.CommonBlockHeader().fRecordWidth != expectedWidth)
- {
- HLTError("Received a track pairs trigger decision data block with a record"
- " width of %d bytes, but the expected value is %d bytes."
- " The block might be corrupt.",
- block->fSize, headerSize
- );
- continue;
- }
-
- HLTError("Received a track pairs trigger decision data block with a size of %d bytes,"
- " but the block header claims the block should be %d bytes."
- " The block might be corrupt.",
- block->fSize, inblock.BytesUsed()
- );
- continue;
- }
+ if (not BlockStructureOk(inblock)) continue;
numUnlikeAnyPt += inblock.BlockHeader().fNunlikeAnyPt;
numUnlikeLowPt += inblock.BlockHeader().fNunlikeLowPt;
/// @brief Component for converting dHLT raw data into ROOT objects.
///
-#include "AliHLTProcessor.h"
+#include "AliHLTMUONProcessor.h"
/**
* Converts dHLT raw data blocks into ROOT objects.
*/
-class AliHLTMUONRootifierComponent : public AliHLTProcessor
+class AliHLTMUONRootifierComponent : public AliHLTMUONProcessor
{
public:
AliHLTMUONDecisionComponent::AliHLTMUONDecisionComponent() :
- AliHLTProcessor(),
+ AliHLTMUONProcessor(),
fMaxTracks(1),
fTrackCount(0),
fTracks(new AliHLTMUONMansoTrackStructP[fMaxTracks]),
specification |= blocks[n].fSpecification;
AliHLTMUONMansoTracksBlockReader inblock(blocks[n].fPtr, blocks[n].fSize);
- if (not inblock.BufferSizeOk())
- {
- size_t headerSize = sizeof(AliHLTMUONMansoTracksBlockReader::HeaderType);
- if (blocks[n].fSize < headerSize)
- {
- HLTError("Received a manso tracks data block with a size of %d bytes,"
- " which is smaller than the minimum valid header size of %d bytes."
- " The block must be corrupt.",
- blocks[n].fSize, headerSize
- );
- continue;
- }
-
- size_t expectedWidth = sizeof(AliHLTMUONMansoTracksBlockReader::ElementType);
- if (inblock.CommonBlockHeader().fRecordWidth != expectedWidth)
- {
- HLTError("Received a manso tracks data block with a record"
- " width of %d bytes, but the expected value is %d bytes."
- " The block might be corrupt.",
- inblock.CommonBlockHeader().fRecordWidth, expectedWidth
- );
- continue;
- }
-
- HLTError("Received a manso tracks data block with a size of %d bytes,"
- " but the block header claims the block should be %d bytes."
- " The block might be corrupt.",
- blocks[n].fSize, inblock.BytesUsed()
- );
- continue;
- }
+ if (not BlockStructureOk(inblock)) continue;
for (AliHLTUInt32_t i = 0; i < inblock.Nentries(); i++)
{
/// @brief Declares the decision component for dimuon HLT triggering.
///
-#include "AliHLTProcessor.h"
+#include "AliHLTMUONProcessor.h"
#include "AliHLTMUONDataTypes.h"
#include <vector>
* counted. The results are encoded into two data blocks, one for trigger decisions
* for single tracks and another for the track pairs.
*/
-class AliHLTMUONDecisionComponent : public AliHLTProcessor
+class AliHLTMUONDecisionComponent : public AliHLTMUONProcessor
{
public:
AliHLTMUONDecisionComponent();
AliHLTMUONHitReconstructorComponent::AliHLTMUONHitReconstructorComponent() :
- AliHLTProcessor(),
+ AliHLTMUONProcessor(),
fHitRec(NULL),
fDDL(-1),
fLutSize(0),
if (not fHitRec->Run(buffer, ddlRawDataSize, block.GetArray(), nofHit))
{
- HLTError("Error while processing of hit reconstruction algorithm.");
+ HLTError("Error while processing the hit reconstruction algorithm.");
size = totalSize; // Must tell the framework how much buffer space was used.
return -EIO;
}
/// @brief Hit Reconstruction processing component for the dimuon HLT.
///
-#include "AliHLTProcessor.h"
+#include "AliHLTMUONProcessor.h"
#include "AliHLTMUONHitReconstructor.h"
#if __GNUC__ && __GNUC__ < 3
extern "C" struct AliHLTMUONHitRecoLutRow;
-class AliHLTMUONHitReconstructorComponent : public AliHLTProcessor
+class AliHLTMUONHitReconstructorComponent : public AliHLTMUONProcessor
{
public:
AliHLTMUONHitReconstructorComponent();
AliHLTMUONMansoTrackerFSMComponent::AliHLTMUONMansoTrackerFSMComponent() :
- AliHLTProcessor(),
+ AliHLTMUONProcessor(),
AliHLTMUONMansoTrackerFSMCallback(),
fTracker(NULL),
fTrackCount(0),
specification |= blocks[n].fSpecification;
AliHLTMUONRecHitsBlockReader inblock(blocks[n].fPtr, blocks[n].fSize);
- if (not inblock.BufferSizeOk())
- {
- size_t headerSize = sizeof(AliHLTMUONRecHitsBlockReader::HeaderType);
- if (blocks[n].fSize < headerSize)
- {
- HLTError("Received a reconstructed hits data block with a size of %d bytes,"
- " which is smaller than the minimum valid header size of %d bytes."
- " The block must be corrupt.",
- blocks[n].fSize, headerSize
- );
- continue;
- }
-
- size_t expectedWidth = sizeof(AliHLTMUONRecHitsBlockReader::ElementType);
- if (inblock.CommonBlockHeader().fRecordWidth != expectedWidth)
- {
- HLTError("Received a reconstructed hits data block with a record"
- " width of %d bytes, but the expected value is %d bytes."
- " The block might be corrupt.",
- inblock.CommonBlockHeader().fRecordWidth, expectedWidth
- );
- continue;
- }
-
- HLTError("Received a reconstructed hits data block with a size of %d bytes,"
- " but the block header claims the block should be %d bytes."
- " The block might be corrupt.",
- blocks[n].fSize, inblock.BytesUsed()
- );
- continue;
- }
+ if (not BlockStructureOk(inblock)) continue;
if (inblock.Nentries() != 0)
AddRecHits(blocks[n].fSpecification, inblock.GetArray(), inblock.Nentries());
continue;
AliHLTMUONTriggerRecordsBlockReader inblock(blocks[n].fPtr, blocks[n].fSize);
- if (not inblock.BufferSizeOk())
- {
- size_t headerSize = sizeof(AliHLTMUONTriggerRecordsBlockReader::HeaderType);
- if (blocks[n].fSize < headerSize)
- {
- HLTError("Received a trigger records data block with a size of %d bytes,"
- " which is smaller than the minimum valid header size of %d bytes."
- " The block must be corrupt.",
- blocks[n].fSize, headerSize
- );
- continue;
- }
-
- size_t expectedWidth = sizeof(AliHLTMUONTriggerRecordsBlockReader::ElementType);
- if (inblock.CommonBlockHeader().fRecordWidth != expectedWidth)
- {
- HLTError("Received a trigger records data block with a record"
- " width of %d bytes, but the expected value is %d bytes."
- " The block might be corrupt.",
- inblock.CommonBlockHeader().fRecordWidth, expectedWidth
- );
- continue;
- }
-
- HLTError("Received a trigger records data block with a size of %d bytes,"
- " but the block header claims the block should be %d bytes."
- " The block might be corrupt.",
- blocks[n].fSize, inblock.BytesUsed()
- );
- continue;
- }
+ if (not BlockStructureOk(inblock)) continue;
+
DebugTrace("Processing a trigger block with "
<< inblock.Nentries() << " entries."
);
/// implemented as a finite state machine.
///
-#include "AliHLTProcessor.h"
+#include "AliHLTMUONProcessor.h"
#include "AliHLTMUONDataTypes.h"
#include "AliHLTMUONMansoTrackerFSMCallback.h"
#include <vector>
* implemented as a finite state machine.
*/
class AliHLTMUONMansoTrackerFSMComponent
- : public AliHLTProcessor, public AliHLTMUONMansoTrackerFSMCallback
+ : public AliHLTMUONProcessor, public AliHLTMUONMansoTrackerFSMCallback
{
public:
AliHLTMUONMansoTrackerFSMComponent();
AliHLTMUONTriggerReconstructorComponent::AliHLTMUONTriggerReconstructorComponent() :
- AliHLTProcessor(),
+ AliHLTMUONProcessor(),
fTrigRec(NULL),
fDDL(-1),
fWarnForUnexpecedBlock(false),
);
if (not runOk)
{
- HLTError("Error while processing of trigger DDL reconstruction algorithm.");
+ HLTError("Error while processing the trigger DDL reconstruction algorithm.");
size = totalSize; // Must tell the framework how much buffer space was used.
return -EIO;
}
/// @brief A processing component for the dHLT trigger DDL reconstruction.
///
-#include "AliHLTProcessor.h"
+#include "AliHLTMUONProcessor.h"
#include "AliHLTMUONDataTypes.h"
#if __GNUC__ && __GNUC__ < 3
* @class AliHLTMUONTriggerReconstructorComponent
* @brief A processing component for the dHLT trigger DDL reconstruction.
*/
-class AliHLTMUONTriggerReconstructorComponent : public AliHLTProcessor
+class AliHLTMUONTriggerReconstructorComponent : public AliHLTMUONProcessor
{
public:
AliHLTMUONTriggerReconstructorComponent();
///
#include "AliHLTMUONEmptyEventFilterComponent.h"
-#include "AliHLTMUONRecHitsBlockStruct.h"
-#include "AliHLTMUONTriggerRecordsBlockStruct.h"
-#include "AliHLTMUONMansoTracksBlockStruct.h"
#include "AliHLTMUONConstants.h"
#include "AliHLTLogging.h"
#include "AliHLTSystem.h"
AliHLTMUONEmptyEventFilterComponent::AliHLTMUONEmptyEventFilterComponent() :
- AliHLTProcessor(),
+ AliHLTMUONProcessor(),
fSendOnEmpty(false)
{
///
for (AliHLTUInt32_t n = 0; n < evtData.fBlockCnt; n++)
{
-#ifdef __DEBUG
- char id[kAliHLTComponentDataTypefIDsize+1];
- for (int i = 0; i < kAliHLTComponentDataTypefIDsize; i++)
- id[i] = blocks[n].fDataType.fID[i];
- id[kAliHLTComponentDataTypefIDsize] = '\0';
- char origin[kAliHLTComponentDataTypefOriginSize+1];
- for (int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++)
- origin[i] = blocks[n].fDataType.fOrigin[i];
- origin[kAliHLTComponentDataTypefOriginSize] = '\0';
-#endif // __DEBUG
- HLTDebug("Handling block: %u, with fDataType.fID = '%s',"
- " fDataType.fID = '%s', fPtr = %p and fSize = %u bytes.",
- n, static_cast<char*>(id), static_cast<char*>(origin),
- blocks[n].fPtr, blocks[n].fSize
+ HLTDebug("Handling block: %u, with fDataType = '%s', fPtr = %p and fSize = %u bytes.",
+ i, DataType2Text(blocks[n].fDataType).c_str(), blocks[n].fPtr, blocks[n].fSize
);
if (blocks[n].fDataType == AliHLTMUONConstants::TriggerRecordsBlockDataType())
{
AliHLTMUONTriggerRecordsBlockReader inblock(blocks[n].fPtr, blocks[n].fSize);
- if (not BlockStructureOk(inblock, blocks[n].fSize)) continue;
+ if (not BlockStructureOk(inblock)) continue;
if (inblock.Nentries() != 0) emptyEvent = false;
}
else if (blocks[n].fDataType == AliHLTMUONConstants::RecHitsBlockDataType())
{
AliHLTMUONRecHitsBlockReader inblock(blocks[n].fPtr, blocks[n].fSize);
- if (not BlockStructureOk(inblock, blocks[n].fSize)) continue;
+ if (not BlockStructureOk(inblock)) continue;
if (inblock.Nentries() != 0) emptyEvent = false;
}
else if (blocks[n].fDataType == AliHLTMUONConstants::MansoTracksBlockDataType())
{
AliHLTMUONMansoTracksBlockReader inblock(blocks[n].fPtr, blocks[n].fSize);
- if (not BlockStructureOk(inblock, blocks[n].fSize)) continue;
+ if (not BlockStructureOk(inblock)) continue;
if (inblock.Nentries() != 0) emptyEvent = false;
}
else if (blocks[n].fDataType == AliHLTMUONConstants::SinglesDecisionBlockDataType())
{
AliHLTMUONSinglesDecisionBlockReader inblock(blocks[n].fPtr, blocks[n].fSize);
- if (not BlockStructureOk(inblock, blocks[n].fSize)) continue;
+ if (not BlockStructureOk(inblock)) continue;
if (inblock.Nentries() != 0) emptyEvent = false;
}
else if (blocks[n].fDataType == AliHLTMUONConstants::PairsDecisionBlockDataType())
{
AliHLTMUONPairsDecisionBlockReader inblock(blocks[n].fPtr, blocks[n].fSize);
- if (not BlockStructureOk(inblock, blocks[n].fSize)) continue;
+ if (not BlockStructureOk(inblock)) continue;
if (inblock.Nentries() != 0) emptyEvent = false;
}
}
return 0;
}
-
-template <class BlockType>
-bool AliHLTMUONEmptyEventFilterComponent::BlockStructureOk(
- const BlockType& inblock,
- const char* blockName,
- AliHLTUInt32_t blockBufferSize
- ) const
-{
- /// Performs basic checks to see if the input data block structure is OK,
- /// that is that it is not corrupt, too short etc...
-
- if (not inblock.BufferSizeOk())
- {
- size_t headerSize = sizeof(typename BlockType::HeaderType);
- if (blockBufferSize < headerSize)
- {
- HLTError("Received a %s data block with a size of %d bytes,"
- " which is smaller than the minimum valid header size of %d bytes."
- " The block must be corrupt.",
- blockName, blockBufferSize, headerSize
- );
- return false;
- }
-
- size_t expectedWidth = sizeof(typename BlockType::ElementType);
- if (inblock.CommonBlockHeader().fRecordWidth != expectedWidth)
- {
- HLTError("Received a %s data block with a record"
- " width of %d bytes, but the expected value is %d bytes."
- " The block might be corrupt.",
- blockName,
- inblock.CommonBlockHeader().fRecordWidth,
- expectedWidth
- );
- return false;
- }
-
- HLTError("Received a %s data block with a size of %d bytes,"
- " but the block header claims the block should be %d bytes."
- " The block might be corrupt.",
- blockName, blockBufferSize, inblock.BytesUsed()
- );
- return false;
- }
-
- return true;
-}
-
/// @brief Declaration of the empty event filter component.
///
-#include "AliHLTProcessor.h"
-#include "AliHLTMUONDataBlockReader.h"
+#include "AliHLTMUONProcessor.h"
#if __GNUC__ && __GNUC__ < 3
#define std
* blocks were empty. This is useful for collecting those events where dHLT
* is not finding anything but perhaps it should.
*/
-class AliHLTMUONEmptyEventFilterComponent : public AliHLTProcessor
+class AliHLTMUONEmptyEventFilterComponent : public AliHLTMUONProcessor
{
public:
AliHLTMUONEmptyEventFilterComponent();
virtual AliHLTComponent* Spawn();
protected:
-
- // Method to check the block structure and log appropriate error messages.
- template <class BlockType>
- bool BlockStructureOk(
- const BlockType& inblock,
- const char* blockName,
- AliHLTUInt32_t blockBufferSize
- ) const;
-
- bool BlockStructureOk(
- const AliHLTMUONRecHitsBlockReader& inblock,
- AliHLTUInt32_t blockBufferSize
- ) const
- {
- return BlockStructureOk(inblock, "reconstructed hits", blockBufferSize);
- }
-
- bool BlockStructureOk(
- const AliHLTMUONTriggerRecordsBlockReader& inblock,
- AliHLTUInt32_t blockBufferSize
- ) const
- {
- return BlockStructureOk(inblock, "trigger records", blockBufferSize);
- }
-
- bool BlockStructureOk(
- const AliHLTMUONMansoTracksBlockReader& inblock,
- AliHLTUInt32_t blockBufferSize
- ) const
- {
- return BlockStructureOk(inblock, "manso tracks", blockBufferSize);
- }
-
- bool BlockStructureOk(
- const AliHLTMUONSinglesDecisionBlockReader& inblock,
- AliHLTUInt32_t blockBufferSize
- ) const
- {
- return BlockStructureOk(inblock, "singles decision", blockBufferSize);
- }
-
- bool BlockStructureOk(
- const AliHLTMUONPairsDecisionBlockReader& inblock,
- AliHLTUInt32_t blockBufferSize
- ) const
- {
- return BlockStructureOk(inblock, "pairs decision", blockBufferSize);
- }
// Protected functions to implement AliHLTComponent's interface.
// These functions provide initialization as well as the actual processing
bool fSendOnEmpty; //! Flag indicating if we should implement the inverse filter and only send everything if dHLT internal data blocks are empty.
- ClassDef(AliHLTMUONEmptyEventFilterComponent, 0)
+ ClassDef(AliHLTMUONEmptyEventFilterComponent, 0) // Filter component for empty dHLT events.
};
#endif // ALIHLTMUONEMPTYEVENTFILTERCOMPONENT_H
OnlineAnalysis/AliHLTMUONMansoTrackerFSMComponent.h \
OnlineAnalysis/AliHLTMUONDecisionComponent.h \
utils/AliHLTMUONEmptyEventFilterComponent.h \
+ AliHLTMUONProcessor.h \
AliHLTMUONRecHit.h \
AliHLTMUONTriggerRecord.h \
AliHLTMUONMansoTrack.h \