//* provided "as is" without express or implied warranty. *
//**************************************************************************
-/** @file AliHLTOUTComponent.cxx
- @author Matthias Richter
- @date
- @brief The HLTOUT data sink component similar to HLTOUT nodes
-*/
+// @file AliHLTOUTComponent.cxx
+// @author Matthias Richter
+// @date
+// @brief The HLTOUT data sink component similar to HLTOUT nodes
+// @note Used in the AliRoot environment only.
#if __GNUC__>= 3
using namespace std;
ClassImp(AliHLTOUTComponent)
AliHLTOUTComponent::AliHLTOUTComponent()
- :
- AliHLTOfflineDataSink(),
- fWriters(),
- fNofDDLs(10),
- fIdFirstDDL(7680), // 0x1e<<8
- fBuffer(),
- fpLibManager(NULL),
- fpDigitFile(NULL),
- fpDigitTree(NULL),
- fppDigitArrays(NULL),
- fReservedWriter(-1),
- fReservedData(0)
+ : AliHLTOfflineDataSink()
+ , fWriters()
+ , fNofDDLs(10)
+ , fIdFirstDDL(7680) // 0x1e<<8
+ , fBuffer()
+ , fpLibManager(NULL)
+ , fDigitFileName("HLT.Digits.root")
+ , fpDigitFile(NULL)
+ , fpDigitTree(NULL)
+ , fppDigitArrays(NULL)
+ , fReservedWriter(-1)
+ , fReservedData(0)
{
// see header file for class documentation
// or
{
// see header file for class documentation
int iResult=0;
- TString argument="";
- int bMissingParam=0;
- for (int i=0; i<argc && iResult>=0; i++) {
- argument=argv[i];
- if (argument.IsNull()) continue;
-
- // -links
- if (argument.CompareTo("-links")==0) {
- if ((bMissingParam=(++i>=argc))) break;
- TString parameter(argv[i]);
- parameter.Remove(TString::kLeading, ' '); // remove all blanks
- if (parameter.IsDigit()) {
- fNofDDLs=parameter.Atoi();
- } else {
- HLTError("wrong parameter for argument %s, number expected", argument.Data());
- iResult=-EINVAL;
- }
- } else {
- HLTError("unknown argument %s", argument.Data());
- iResult=-EINVAL;
- break;
- }
- }
- if (bMissingParam) {
- HLTError("missing parameter for argument %s", argument.Data());
- iResult=-EINVAL;
- }
- if (iResult>=0) {
- }
+ if ((iResult=ScanConfigurationArgument(argc, argv))<0) return -iResult;
// Make sure there is no library manager before we try and create a new one.
if (fpLibManager) {
return iResult;
}
+int AliHLTOUTComponent::ScanConfigurationArgument(int argc, const char** argv)
+{
+ // see header file for class documentation
+ if (argc<=0) return 0;
+ int i=0;
+ TString argument=argv[i];
+ const char* key="";
+
+ // -links n
+ // specify number of ddl links
+ if (argument.CompareTo("-links")==0) {
+ if (++i>=argc) return -EPROTO;
+ TString parameter(argv[i]);
+ parameter.Remove(TString::kLeading, ' '); // remove all blanks
+ if (parameter.IsDigit()) {
+ fNofDDLs=parameter.Atoi();
+ } else {
+ HLTError("wrong parameter for argument %s, number expected", argument.Data());
+ return -EINVAL;
+ }
+
+ return 2;
+ }
+
+ // -digitfile name
+ if (argument.CompareTo("-digitfile")==0) {
+ if (++i>=argc) return -EPROTO;
+ fDigitFileName=argv[i];
+
+ return 2;
+ }
+
+ // -rawout
+ key="-rawout";
+ if (argument.Contains(key)) {
+ argument.ReplaceAll(key, "");
+ if (argument.IsNull()) {
+ fgOptions|=kWriteRawFiles;
+ } else if (argument.CompareTo("=off")==0) {
+ fgOptions&=~kWriteRawFiles;
+ } else if (argument.CompareTo("=on")==0) {
+ fgOptions|=kWriteRawFiles;
+ } else {
+ HLTError("invalid parameter for argument %s: possible %s=off/%s=on", key, key, key);
+ return -EPROTO;
+ }
+
+ return 1;
+ }
+
+ // -digitout
+ key="-digitout";
+ if (argument.Contains(key)) {
+ argument.ReplaceAll(key, "");
+ if (argument.IsNull()) {
+ fgOptions|=kWriteDigits;
+ } else if (argument.CompareTo("=off")==0) {
+ fgOptions&=~kWriteDigits;
+ } else if (argument.CompareTo("=on")==0) {
+ fgOptions|=kWriteDigits;
+ } else {
+ HLTError("invalid parameter for argument %s: possible %s=off/%s=on", key, key, key);
+ return -EPROTO;
+ }
+
+ return 1;
+ }
+
+ // unknown argument
+ return -EINVAL;
+}
+
int AliHLTOUTComponent::DoDeinit()
{
// see header file for class documentation
{
// see header file for class documentation
int iResult=0;
- const char* digitFileName="HLT.Digits.root";
if (!fpDigitFile) {
- fpDigitFile=new TFile(digitFileName, "RECREATE");
+ fpDigitFile=new TFile(fDigitFileName, "RECREATE");
}
if (fpDigitFile && !fpDigitFile->IsZombie()) {
if (!fpDigitTree) {
errorMsg=" (suppressing further error messages)";
}
if (GetEventCount()<5) {
- HLTError("can not open HLT digit file %s%s", digitFileName, errorMsg);
+ HLTError("can not open HLT digit file %s%s", fDigitFileName.Data(), errorMsg);
}
iResult=-EBADF;
}
-// @(#) $Id$
+//-*- Mode: C++ -*-
+// $Id$
#ifndef ALIHLTOUTCOMPONENT_H
#define ALIHLTOUTCOMPONENT_H
//* ALICE Experiment at CERN, All rights reserved. *
//* See cxx source for full Copyright notice *
-/** @file AliHLTOUTComponent.h
- @author Matthias Richter
- @date
- @brief The HLTOUT data sink component similar to HLTOUT nodes
-*/
+// @file AliHLTOUTComponent.h
+// @author Matthias Richter
+// @date
+// @brief The HLTOUT data sink component similar to HLTOUT nodes.
+// @note Used in the AliRoot environment only.
// see class description below
// or
* The HLTOUT data sink component which models the behavior of the HLTOUT
* nodes of the HLT cluster.
* <h2>General properties:</h2>
+ * The HLTOUT component is attached at the end of a chain. It stores all input
+ * block in the HOMER format, distributed over a number of DDL link. The data
+ * is stored in a digit file or in raw ddl files.
*
* Component ID: \b HLTOUT <br>
* Library: \b libHLTrec.so <br>
* <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
* \li -links <i> n </i> <br>
* number of output ddl links
+ * \li -digitfile <i> name </i> <br>
*
* <h2>Configuration:</h2>
* <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
*/
int DoInit( int argc, const char** argv );
+ /// inherited from AliHLTComponent, component specific argument scan
+ int ScanConfigurationArgument(int argc, const char** argv);
+
/**
* Deinit method.
*/
/** global options for all instances */
static int fgOptions; //! transient
+ /** digit file name */
+ TString fDigitFileName; //! transient
+
/** the root file for the HLT 'digit' output */
TFile* fpDigitFile; //!transient
/** Data size kept in the internal buffer */
int fReservedData; //!transient
- ClassDef(AliHLTOUTComponent, 3)
+ ClassDef(AliHLTOUTComponent, 4)
};
#endif