* provided "as is" without express or implied warranty. *
**************************************************************************/
-/* $Id: $ */
+// $Id: $
///
/// @file AliHLTMUONRawDataHistoComponent.cxx
/// @date 30 April 2008
/// @brief Implementation of the raw data histogramming component for dHLT.
///
-/// The class implements
+/// The class implements a component for checking basic statistics and errors in
+/// raw data from the muon spectrometer. It is useful for basic monitoring.
#include "AliHLTMUONRawDataHistoComponent.h"
#include "AliHLTMUONConstants.h"
fTriggerDecoder(),
fLastPublishTime(-1),
fCurrentEventTime(-1),
- fPublishDelay(1),
+ fPublishDelay(0),
fSuppressEmptyHists(false),
- fProcessDataEventsOnly(false)
+ fProcessDataEventsOnly(false),
+ fClearAfterPublish(false)
{
/// Default constructor initialises all histogram object pointers to NULL.
{
/// Inherited from AliHLTComponent. Returns an estimate of the expected output data size.
- constBase = sizeof(TH1D) * 1024*1024;
+ constBase = (sizeof(TH1D)+50*sizeof(double))*22 + (sizeof(TH1D)+1024*4*sizeof(double))*20*2;
inputMultiplier = 0;
}
if (result != 0) return result;
fLastPublishTime = fCurrentEventTime = -1;
- fPublishDelay = 1;
+ fPublishDelay = 0;
bool pubDelaySet = false;
fSuppressEmptyHists = false;
fProcessDataEventsOnly = false;
+ fClearAfterPublish = false;
fTrackerDecoder.TryRecover(false);
fTriggerDecoder.TryRecover(false);
continue;
}
+ if (strcmp(argv[i], "-clearafterpub") == 0)
+ {
+ fClearAfterPublish = true;
+ continue;
+ }
+
if (strcmp(argv[i], "-tryrecover") == 0)
{
fTrackerDecoder.TryRecover(true);
int AliHLTMUONRawDataHistoComponent::DoEvent(
- const AliHLTComponentEventData& /*evtData*/,
- AliHLTComponentTriggerData& /*trigData*/
+ const AliHLTComponentEventData& evtData,
+ AliHLTComponentTriggerData& trigData
)
{
/// Inherited from AliHLTProcessor.
if (AliHLTMUONUtils::IsTrackerDDL(block->fSpecification))
{
- ProcessTrackerDDL(block);
+ bool decodeOk = ProcessTrackerDDL(block);
+ if (not decodeOk and DumpDataOnError())
+ {
+ DumpEvent(evtData, trigData);
+ return -EIO;
+ }
}
else if (AliHLTMUONUtils::IsTriggerDDL(block->fSpecification))
{
- ProcessTriggerDDL(block);
+ bool decodeOk = ProcessTriggerDDL(block);
+ if (not decodeOk and DumpDataOnError())
+ {
+ DumpEvent(evtData, trigData);
+ return -EIO;
+ }
}
else
{
AliHLTMUONConstants::HistogramDataType(),
AliHLTMUONUtils::DDLNumberToSpec(i)
);
+ // If requested, clear histogram when published.
+ if (fClearAfterPublish) fErrorHist[i]->Reset("M");
}
for (int i = 0; i < 20; i++)
{
if (not (fSuppressEmptyHists and fManuHist[i]->GetEntries() == 0))
{
PushBack(fManuHist[i], AliHLTMUONConstants::HistogramDataType(), spec);
+ if (fClearAfterPublish) fManuHist[i]->Reset("M");
}
if (not (fSuppressEmptyHists and fSignalHist[i]->GetEntries() == 0))
{
PushBack(fSignalHist[i], AliHLTMUONConstants::HistogramDataType(), spec);
+ if (fClearAfterPublish) fSignalHist[i]->Reset("M");
}
}
fLastPublishTime = fCurrentEventTime;
}
-void AliHLTMUONRawDataHistoComponent::ProcessTrackerDDL(const AliHLTComponentBlockData* block)
+bool AliHLTMUONRawDataHistoComponent::ProcessTrackerDDL(const AliHLTComponentBlockData* block)
{
/// Processes a raw data block from the tracker stations.
AliHLTUInt8_t* payload = reinterpret_cast<AliHLTUInt8_t*>(block->fPtr)
+ sizeof(AliRawDataHeader);
UInt_t payloadSize = UInt_t(block->fSize) - sizeof(AliRawDataHeader);
- fTrackerDecoder.Decode(payload, payloadSize);
+ return fTrackerDecoder.Decode(payload, payloadSize);
}
else
{
);
fErrorHist[ddl]->Fill(40);
}
+ return false;
}
-void AliHLTMUONRawDataHistoComponent::ProcessTriggerDDL(const AliHLTComponentBlockData* block)
+bool AliHLTMUONRawDataHistoComponent::ProcessTriggerDDL(const AliHLTComponentBlockData* block)
{
/// Processes a raw data block from the trigger stations.
AliHLTUInt8_t* payload = reinterpret_cast<AliHLTUInt8_t*>(header+1);
UInt_t payloadSize = UInt_t(block->fSize) - sizeof(AliRawDataHeader);
bool scalarEvent = ((header->GetL1TriggerMessage() & 0x1) == 0x1);
- fTriggerDecoder.Decode(payload, payloadSize, scalarEvent);
+ return fTriggerDecoder.Decode(payload, payloadSize, scalarEvent);
}
else
{
);
fErrorHist[ddl]->Fill(40);
}
+ return false;
}