]>
Commit | Line | Data |
---|---|---|
3cde846d | 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 | /** | |
4fdaad1e | 23 | * @class AliHLTTPCEsdWriterComponent |
24 | * This class translates incoming track segments structures from the TPC | |
25 | * conformal mapping tracker into the ESD fromat and writes it to a ROOT | |
26 | * file. | |
27 | * Arguments: <br> | |
28 | * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating --> | |
29 | * \li -datafile <i> filename </i> <br> | |
30 | * file name base | |
31 | * \li -directory <i> directory </i> <br> | |
32 | * target directory | |
33 | * | |
6014e33a | 34 | * <pre> |
35 | * Example usage (HLT configuration file): | |
36 | * \<Proc ID="EsdWriter" type="prc"> | |
37 | * \<Cmd>AliRootWrapperSubscriber -eventmodulo 1 | |
38 | * -componentid TPCEsdWriter | |
39 | * -componentlibrary libAliHLTTPC.so | |
40 | * -componentargs "-datafile AliESDs.root" | |
41 | * \</Cmd> | |
42 | * | |
43 | * \<Parent>TR0-SC\</Parent> | |
44 | * \<Node>master\</Node> | |
45 | * \<Shm blocksize="1k" blockcount="1" type="sysv"/> | |
46 | * \</Proc> | |
47 | * </pre> | |
48 | * | |
4fdaad1e | 49 | * @see AliHLTFileWriter and AliHLTRootFileWriterComponent for more parameters |
3cde846d | 50 | */ |
51 | class AliHLTTPCEsdWriterComponent : public AliHLTRootFileWriterComponent | |
52 | { | |
53 | public: | |
54 | /** standard constructor */ | |
55 | AliHLTTPCEsdWriterComponent(); | |
56 | /** destructor */ | |
57 | ~AliHLTTPCEsdWriterComponent(); | |
58 | ||
59 | /** | |
60 | * The id of the component. | |
61 | * @return component id (string) | |
62 | */ | |
63 | const char* GetComponentID() {return "TPCEsdWriter";}; | |
64 | ||
65 | /** | |
66 | * Spawn function. | |
67 | * @return new class instance | |
68 | */ | |
69 | AliHLTComponent* Spawn() {return new AliHLTTPCEsdWriterComponent;} | |
70 | ||
71 | protected: | |
72 | /** | |
73 | * Data processing method for the component. | |
74 | * The function can be overloaded by specific ROOT file writer | |
75 | * components. | |
76 | * @param evtData event data structure | |
77 | * @param blocks input data block descriptors | |
78 | * @param trigData trigger data structure | |
79 | */ | |
80 | virtual int DumpEvent( const AliHLTComponentEventData& evtData, | |
81 | const AliHLTComponentBlockData* blocks, | |
82 | AliHLTComponentTriggerData& trigData ); | |
83 | ||
84 | /** | |
85 | * Scan one argument and adjacent parameters. | |
86 | * @param argc size of the argument array | |
87 | * @param argv agument array for component initialization | |
88 | * @return number of processed members of the argv <br> | |
89 | * -EINVAL unknown argument <br> | |
90 | * -EPROTO parameter for argument missing <br> | |
91 | */ | |
92 | int ScanArgument(int argc, const char** argv); | |
93 | ||
94 | private: | |
95 | /** | |
96 | * Init the writer. | |
97 | * The DoInit function is not available for this child class. InitWriter is the | |
98 | * corresponding function for classes derived from AliHLTFileWriter. | |
99 | */ | |
100 | int InitWriter(); | |
101 | ||
102 | /** | |
103 | * Init the writer. | |
104 | * The DoDeinit function is not available for this child class. CloseWriter is the | |
105 | * corresponding function for classes derived from AliHLTFileWriter. | |
106 | */ | |
107 | int CloseWriter(); | |
108 | ||
109 | /** | |
110 | * Covert tracks to AliTPCtracks (AliKalmanTracks) and add them to ESD. | |
111 | * @param pTracks array of tracks | |
112 | * @param pESD pointer to ESD | |
113 | * @return neg. error code if failed | |
114 | */ | |
115 | int Tracks2ESD(AliHLTTPCTrackArray* pTracks, AliESD* pESD); | |
116 | ||
117 | /** the ESD tree */ | |
118 | TTree* fTree; //! transient value | |
119 | ||
120 | /** the ESD */ | |
121 | AliESD* fESD; //! transient value | |
122 | ||
123 | ClassDef(AliHLTTPCEsdWriterComponent, 0) | |
124 | }; | |
125 | #endif |