// -*- Mode: C++ -*-
// @(#) $Id$
#ifndef ALIHLTROOTFILEWRITERCOMPONENT_H
#define ALIHLTROOTFILEWRITERCOMPONENT_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 AliHLTRootFileWriterComponent.h
@author Matthias Richter
@date
@brief Base class for writer components to store data in a ROOT file
*/
#include "AliHLTFileWriter.h"
//#include "TObject.h"
class TFile;
/**
* @class AliHLTRootFileWriterComponent
* The RootFileWriter provides a stand alone component to write incoming
* TObject like structures into a Root file. Furthermore it functions as
* base class for customized writers.
*
* Component ID: \b ROOTFileWriter
* Library: \b libAliHLTUtil.so
*
* Mandatory arguments:
*
*
* Optional arguments:
*
*
* See AliHLTFileWriter for full list of arguments.
*/
class AliHLTRootFileWriterComponent : public AliHLTFileWriter
{
public:
/** standard constructor */
AliHLTRootFileWriterComponent();
/** destructor */
virtual ~AliHLTRootFileWriterComponent();
/**
* The id of the component.
* @return component id (string)
*/
virtual const char* GetComponentID() {return "ROOTFileWriter";};
/**
* Spawn function.
* @return new class instance
*/
virtual AliHLTComponent* Spawn() {return new AliHLTRootFileWriterComponent;}
protected:
// interface functions
int InitWriter();
int CloseWriter();
/**
* Data processing method for the component.
* The function can be overloaded by specific ROOT file writer
* components. The RootFileWriter processes only TObject like data
* structures of the input blocks and uses the
* @ref alihltcomponent-high-level-interface. Despite of that it implements
* the lox-level DumpEvent method in order to allow child classes to use the
* low-level method.
* @param evtData event data structure
* @param blocks input data block descriptors
* @param trigData trigger data structure
*/
virtual int DumpEvent( const AliHLTComponentEventData& evtData,
const AliHLTComponentBlockData* blocks,
AliHLTComponentTriggerData& trigData );
using AliHLTFileWriter::DumpEvent;
/**
* Scan one argument and adjacent parameters.
* \b IMPORTANT: if overloaded by child class, call this function
* as the default from the cutomized switch, e.g.
*
** @param argc size of the argument array * @param argv agument array for component initialization * @return number of processed members of the argv