fExtension(""),
fDirectory(""),
fSubDirFormat(""),
- fIdFormat(""),
+ fIdFormat("_0x%08x"),
fSpecFormat(""),
fBlcknoFormat("_0x%02x"),
fCurrentFileName(""),
{
// see header file for class documentation
list.clear();
- list.push_back(kAliHLTAnyDataType);
+ list.push_back(kAliHLTAllDataTypes);
}
AliHLTComponent* AliHLTFileWriter::Spawn()
} else {
fSubDirFormat="event%03d";
}
+ // no additional eventno in the filename unless set again
+ // the sub dir contains the id
+ fIdFormat="";
// -idfmt
} else if (argument.BeginsWith("-idfmt")) {
fSpecFormat="_0x%08x";
}
- // -blcknofmt
- } else if (argument.BeginsWith("-blcknofmt")) {
+ // -blocknofmt
+ } else if (argument.BeginsWith("-blcknofmt") ||
+ argument.BeginsWith("-blocknofmt")) {
+ // for the sake of backward compatibility we consider also the
+ // old argument with typo for a while
argument.ReplaceAll("-blcknofmt", "");
+ argument.ReplaceAll("-blocknofmt", "");
if (argument.BeginsWith("=")) {
fBlcknoFormat=argument.Replace(0,1,"");
} else {
iResult=-EINVAL;
}
if (iResult>=0) {
- if (fIdFormat.IsNull() && fSubDirFormat.IsNull()) {
- // set the default format string for the id if it is not set and
- // no sub dirs set (the sub dir than contains the id)
- fIdFormat="_0x%08x";
- }
iResult=InitWriter();
}
return 0; // note: this doesn't mean 'error'
}
-int AliHLTFileWriter::ScanArgument(int argc, const char** argv)
+int AliHLTFileWriter::ScanArgument(int /*argc*/, const char** /*argv*/)
{
// see header file for class documentation
// there are no other arguments than the standard ones
- if (argc==0 && argv==NULL) {
- // this is just to get rid of the warning "unused parameter"
- }
// fCurrentFileName is used in dump event, just touched her to avoid
// coding convention violation RC11. The function can not be declared
// const since it is just the default implementation, overloaded
// const since it is just the default implementation, overloaded
// virtual function might not be const
fCurrentFileName="";
- return 0; // note: this doesn't mean 'error'
+ return 0;
}
int AliHLTFileWriter::DumpEvent( const AliHLTComponentEventData& evtData,
const AliHLTComponentBlockData* pDesc=NULL;
int blockno=0;
- for (pDesc=GetFirstInputBlock(kAliHLTAnyDataType); pDesc!=NULL; pDesc=GetNextInputBlock(), blockno++) {
+ for (pDesc=GetFirstInputBlock(); pDesc!=NULL; pDesc=GetNextInputBlock(), blockno++) {
HLTDebug("block %d out of %d", blockno, evtData.fBlockCnt);
TString filename;
HLTDebug("dataspec 0x%x", pDesc->fSpecification);
#ifndef ALIHLTFILEWRITER_H
#define ALIHLTFILEWRITER_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 AliHLTFileWriter.h
@author Matthias Richter
#include "AliHLTDataSink.h"
#include <TString.h>
-//#include <TList.h>
/**
* @class AliHLTFileWriter
* An HLT data sink component which writes data to file(s).
*
- * Component ID: \b FileWriter <br>
- * Library: \b libAliHLTUtil.so
+ * <h2>General properties:</h2>
*
- * Mandatory arguments: <br>
+ * Component ID: \b FileWriter <br>
+ * Library: \b libAliHLTUtil.so <br>
+ * Input Data Types: @ref kAliHLTAllDataTypes <br>
+ * Output Data Types: none <br>
+ *
+ * kAliHLTAllDataTypes contains both kAliHLTAnyDataType and kAliHLTVoidDataType
+ *
+ * <h2>Mandatory arguments:</h2>
* <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
*
- * Optional arguments: <br>
+ * <h2>Optional arguments:</h2>
* <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
* \li -datafile <i> filename </i> <br>
* file name base
* \li -directory <i> directory </i> <br>
* target directory
* \li -subdir[=pattern] <br>
- * create sub dir for each event, the format patern can contain printf
- * specifiers to print the evntn no into the dir name, default is
+ * create sub dir for each event, the format pattern can contain printf
+ * specifiers to print the event no into the dir name, default is
* 'event%03d' (-subdir w/o additional pattern)
+ * \b note: the idfmt string is reset since the subdir contains the id
* \li -idfmt[=pattern] <br>
* format specifier for the event id in the file name, <br>
* default: on, default pattern: '_0x%08x'
* the block no, and the block data type in the file name. Currently,
* this implies the -concatenate-blocks option.
*
+ * <h2>Configuration:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * no configuration
+ *
+ * <h2>Default CDB entries:</h2>
+ * The component loads no CDB entries.
+ *
+ * <h2>Performance:</h2>
+ * The component does not any event data processing.
+ *
+ * <h2>Memory consumption:</h2>
+ * The component does not any event data processing.
+ *
+ * <h2>Output size:</h2>
+ * The component has no output data.
+ *
+ *
* By default, file name is built from the basename, the event number, the
* block number and the data type in the format:
* <pre>
* <pre>
* -specfmt append specification
* -subdir=test_%d store in sub folders
- * -blcknofmt=_0x%x format block no in hex
+ * -blocknofmt=_0x%x format block no in hex
* -idfmt=_%04d print id in 4-digits decimal number
+ * -idfmt= print no id
* </pre>
*
* The class can be used as a base class for file writers. Additional
#ifndef ALIHLTLOADERPUBLISHERCOMPONENT_H
#define ALIHLTLOADERPUBLISHERCOMPONENT_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 AliHLTLoaderPublisherComponent.h
@author Matthias Richter
@brief A general tree publisher component for the AliLoader.
*/
-// see header file for class documentation
-// or
-// refer to README to build package
-// or
-// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-
#include "AliHLTOfflineDataSource.h"
class AliLoader;
* @class AliHLTLoaderPublisherComponent
* A general tree publisher component for the AliLoader.
*
+ * <h2>General properties:</h2>
+ *
* Component ID: \b AliLoaderPublisher <br>
* Library: \b libAliHLTUtil.
+ * Input Data Types: none <br>
+ * Output Data Types: according to parameter <br>
*
- * Mandatory arguments: <br>
+ * <h2>Mandatory arguments:</h2>
* <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
* \li -loader <i> loader name </i>
* e.g. <tt> -loader TPCLoader </tt>
+ *
+ * <h2>Optional arguments:</h2>
* \li -tree <i> tree name </i> : digits (default), clusters
* e.g. <tt> -tree digits </tt>
* \li -verbose<br>
* print out some more info messages, mainly for the sake of tutorials
* \li -datatype <i> datatype dataorigin </i> <br>
- * data type ID and origin, e.g. <tt>-datatype DIGITS TPC </tt>
+ * data type ID and origin, e.g. <tt>-datatype 'ALITREED' 'TPC ' </tt>
* \li -dataspec <i> specification </i> <br>
* data specification treated as decimal number or hex number if
* prepended by '0x'
*
- * Optional arguments:<br>
+ * <h2>Configuration:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * no configuration
+ *
+ * <h2>Default CDB entries:</h2>
+ * The component loads no CDB entries.
+ *
+ * <h2>Performance:</h2>
+ * The component does not any event data processing.
*
+ * <h2>Memory consumption:</h2>
+ * The component does not any event data processing.
+ *
+ * <h2>Output size:</h2>
+ *
*
* @ingroup alihlt_system
*/
list<int> processedIds;
while (pRawReader->ReadHeader() && (iResult>=0 || iResult==-ENOSPC)) {
const AliRawDataHeader* pHeader=pRawReader->GetDataHeader();
- assert(pHeader!=NULL);
- if (pHeader==NULL) continue;
+ if (pHeader==NULL) {
+ HLTError("can not get data header from RawReader, skipping data block ...");
+ continue;
+ }
unsigned int readSize=pRawReader->GetDataSize()+sizeof(AliRawDataHeader);
int id=pRawReader->GetEquipmentId();
AliInfo(Form("got header for id %d, size %d", id, readSize));
// @(#) $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 AliHLTRootFileStreamerComponent.cxx
@author Matthias Richter
{
// see header file for class documentation
list.clear();
- list.push_back(kAliHLTAnyDataType);
+ list.push_back(kAliHLTAllDataTypes);
}
AliHLTComponentDataType AliHLTRootFileStreamerComponent::GetOutputDataType()
int iResult=0;
AliHLTMemoryFile* pFile=CreateMemoryFile(fDataType,fSpecification);
if (pFile) {
- const TObject* pObj=GetFirstInputObject(kAliHLTAnyDataType);
int count=0;
- while (pObj && iResult>=0) {
+ for (const TObject* pObj=GetFirstInputObject();
+ pObj && iResult>=0;
+ pObj=GetNextInputObject()) {
iResult=Write(pFile, pObj);
if (iResult) {
count++;
HLTDebug("wrote object of class %s, data type %s", pObj->ClassName(), (DataType2Text(GetDataType(pObj)).c_str()));
}
- pObj=GetNextInputObject();
}
HLTInfo("wrote %d object(s) from %d input blocks to file", count, GetNumberOfInputBlocks());
iResult=CloseMemoryFile(pFile);
// @(#) $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 AliHLTRootFileWriterComponent.cxx
@author Matthias Richter
#include "TString.h"
#include "TObjectTable.h" // for root object validity
-/** the global object for component registration */
-AliHLTRootFileWriterComponent gAliHLTRootFileWriterComponent;
-
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTRootFileWriterComponent)
}
int AliHLTRootFileWriterComponent::DumpEvent( const AliHLTComponentEventData& evtData,
- const AliHLTComponentBlockData* blocks,
- AliHLTComponentTriggerData& trigData )
+ const AliHLTComponentBlockData* /*blocks*/,
+ AliHLTComponentTriggerData& /*trigData*/ )
{
// see header file for class documentation
int iResult=0;
- if (evtData.fStructSize==0 && blocks==NULL && trigData.fStructSize==0) {
- // this is just to get rid of the warning "unused parameter"
- }
- const TObject* pObj=GetFirstInputObject(kAliHLTAnyDataType);
- HLTDebug("got first object %p", pObj);
int count=0;
- while (pObj && iResult>=0) {
+ for (const TObject* pObj=GetFirstInputObject();
+ pObj && iResult>=0;
+ pObj=GetNextInputObject()) {
iResult=WriteObject(evtData.fEventID, pObj);
if (iResult == 0) {
count++;
HLTDebug("wrote object of class %s, data type %s", pObj->ClassName(), (DataType2Text(GetDataType(pObj)).c_str()));
}
- pObj=GetNextInputObject();
}
HLTDebug("wrote %d object(s) from %d input blocks to file", count, GetNumberOfInputBlocks());
return iResult;
}
-int AliHLTRootFileWriterComponent::ScanArgument(int argc, const char** argv)
+int AliHLTRootFileWriterComponent::ScanArgument(int /*argc*/, const char** /*argv*/)
{
// see header file for class documentation
// no other arguments known
- if (argc==0 && argv==NULL) {
- // this is just to get rid of the warning "unused parameter"
- }
int iResult=-EINVAL;
return iResult;
}