]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/util/AliHLTEsdCollectorComponent.h
added new helper components to libAliHLTUtil (EsdCollector and AliHLTOUTPublisher...
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTEsdCollectorComponent.h
1 // -*- Mode: C++ -*-
2 // $Id$
3
4 #ifndef ALIHLTESDCOLLECTORCOMPONENT_H
5 #define ALIHLTESDCOLLECTORCOMPONENT_H
6 //* This file is property of and copyright by the ALICE HLT Project        * 
7 //* ALICE Experiment at CERN, All rights reserved.                         *
8 //* See cxx source for full Copyright notice                               *
9
10 /** @file   AliHLTEsdCollectorComponent.h
11     @author Matthias Richter
12     @date   
13     @brief  Collect ESDs of multiple events and write toi file
14 */
15
16 #include "AliHLTFileWriter.h"
17
18 class AliHLTEsdManager;
19
20 /**
21  * @class AliHLTEsdCollectorComponent
22  * The EsdCollector component merges ESDs from multiple events into one
23  * ESD file per origin using the AliHLTEsdManager class.
24  * \b Note: The component just merges ESDs of the same type/origin from
25  * multiple events into one file. It does not implement merging of ESDs
26  * from one event but several origins.
27  *
28  * Component ID: \b EsdCollector <br>
29  * Library: \b libAliHLTUtil.so
30  *
31  * Mandatory arguments: <br>
32  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
33  *
34  * Optional arguments: <br>
35  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
36  * The only AliHLTFileWriter argument of relevance is the -directory argument.
37  *
38  * See AliHLTFileWriter for full list of arguments.
39  */
40 class AliHLTEsdCollectorComponent : public AliHLTFileWriter
41 {
42  public:
43   /** standard constructor */
44   AliHLTEsdCollectorComponent();
45   /** destructor */
46   virtual ~AliHLTEsdCollectorComponent();
47
48   /**
49    * The id of the component.
50    * @return component id (string)
51    */
52   const char* GetComponentID() {return "EsdCollector";};
53
54   /**
55    * Spawn function.
56    * @return new class instance
57    */
58   AliHLTComponent* Spawn() {return new AliHLTEsdCollectorComponent;}
59
60  protected:
61   // interface functions
62   int InitWriter();
63   int CloseWriter();
64   int DumpEvent( const AliHLTComponentEventData& evtData,
65                  const AliHLTComponentBlockData* blocks, 
66                  AliHLTComponentTriggerData& trigData );
67   
68   using AliHLTFileWriter::DumpEvent;
69   int ScanArgument(int argc, const char** argv);
70
71 private:
72   /** copy constructor prohibited */
73   AliHLTEsdCollectorComponent(const AliHLTEsdCollectorComponent&);
74   /** assignment operator prohibited */
75   AliHLTEsdCollectorComponent& operator=(const AliHLTEsdCollectorComponent&);
76
77   /** the ESD manager instance writes the ESDs */
78   AliHLTEsdManager* fpManager; //! transient
79
80   ClassDef(AliHLTEsdCollectorComponent, 0)
81 };
82 #endif