]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCEsdWriterComponent.h
- improvements in AliHLTFilePublisher/Writer
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCEsdWriterComponent.h
1 // @(#) $Id$
2
3 #ifndef ALIHLTTPCESDWRITERCOMPONENT_H
4 #define ALIHLTTPCESDWRITERCOMPONENT_H
5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6  * See cxx source for full Copyright notice                               */
7
8 /** @file   AliHLTTPCEsdWriterComponent.h
9     @author Matthias Richter
10     @date   
11     @brief  Writer component to store tracks of the HLT TPC conformal
12             mapping tracker in the AliESD format
13
14                                                                           */
15 #include "AliHLTRootFileWriterComponent.h"
16
17 // forward declarations
18 class TTree;
19 class AliESD;
20 class AliHLTTPCTrackArray;
21
22 /**
23  * @class AliHLTRootFileWriterComponent
24  * @see AliHLTFileWriter for parameters
25  */
26 class AliHLTTPCEsdWriterComponent : public AliHLTRootFileWriterComponent
27 {
28  public:
29   /** standard constructor */
30   AliHLTTPCEsdWriterComponent();
31   /** destructor */
32   ~AliHLTTPCEsdWriterComponent();
33
34   /**
35    * The id of the component.
36    * @return component id (string)
37    */
38   const char* GetComponentID() {return "TPCEsdWriter";};
39
40   /**
41    * Spawn function.
42    * @return new class instance
43    */
44   AliHLTComponent* Spawn() {return new AliHLTTPCEsdWriterComponent;}
45
46  protected:
47   /**
48    * Data processing method for the component.
49    * The function can be overloaded by specific ROOT file writer
50    * components.
51    * @param evtData       event data structure
52    * @param blocks        input data block descriptors
53    * @param trigData      trigger data structure
54    */
55   virtual int DumpEvent( const AliHLTComponentEventData& evtData,
56                          const AliHLTComponentBlockData* blocks, 
57                          AliHLTComponentTriggerData& trigData );
58
59   /**
60    * Scan one argument and adjacent parameters.
61    * @param argc           size of the argument array
62    * @param argv           agument array for component initialization
63    * @return number of processed members of the argv <br>
64    *         -EINVAL unknown argument <br>
65    *         -EPROTO parameter for argument missing <br>
66    */
67   int ScanArgument(int argc, const char** argv);
68
69  private:
70   /**
71    * Init the writer.
72    * The DoInit function is not available for this child class. InitWriter is the
73    * corresponding function for classes derived from AliHLTFileWriter.
74    */
75   int InitWriter();
76
77   /**
78    * Init the writer.
79    * The DoDeinit function is not available for this child class. CloseWriter is the
80    * corresponding function for classes derived from AliHLTFileWriter.
81    */
82   int CloseWriter();
83
84   /**
85    * Covert tracks to AliTPCtracks (AliKalmanTracks) and add them to ESD.
86    * @param pTracks  array of tracks
87    * @param pESD     pointer to ESD
88    * @return neg. error code if failed
89    */
90   int Tracks2ESD(AliHLTTPCTrackArray* pTracks, AliESD* pESD);
91
92   /** the ESD tree */
93   TTree* fTree; //! transient value
94
95   /** the ESD */
96   AliESD* fESD; //! transient value
97
98   ClassDef(AliHLTTPCEsdWriterComponent, 0)
99 };
100 #endif