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 */
8 /** @file AliHLTTPCEsdWriterComponent.h
9 @author Matthias Richter
11 @brief Writer component to store tracks of the HLT TPC conformal
12 mapping tracker in the AliESD format
15 #include "AliHLTRootFileWriterComponent.h"
16 #include "AliHLTProcessor.h"
18 // forward declarations
21 class AliHLTTPCTrackArray;
24 * @class AliHLTTPCEsdWriterComponent
25 * This class translates incoming track segments structures from the TPC
26 * conformal mapping tracker (datatype TRAKSEGS/TPC) or tracks in global
27 * coordinates from the AliHLTTPCGlobalMergerComponent (TRACKS/TPC) into
30 * The \em TPCEsdWriter writes it to a ROOT file, the \em TPCEsdConverter
31 * to a TTree and sends the whole object to the output stream with data
32 * type @ref kAliHLTDataTypeESDTree and origin TPC.
34 * In case of TRAKSEGS, the component can only process data block containing
35 * data of one slice, but it can read an unlimeted number of data blocks.
37 * componentid: \b TPCEsdWriter <br>
38 * componentid: \b TPCEsdConverter <br>
39 * componentlibrary: \b libAliHLTTPC.so <br>
40 * Arguments TPCEsdWriter: <br>
41 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating -->
42 * \li -datafile <i> filename </i> <br>
44 * \li -directory <i> directory </i> <br>
47 * Arguments TPCEsdConverter: <br>
48 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating -->
52 * Example usage (HLT configuration file):
53 * \<Proc ID="EsdWriter" type="prc">
54 * \<Cmd>AliRootWrapperSubscriber -eventmodulo 1
55 * -componentid TPCEsdWriter
56 * -componentlibrary libAliHLTTPC.so
57 * -componentargs "-datafile AliESDs.root"
60 * \<Parent>TR0-SC\</Parent>
61 * \<Node>master\</Node>
62 * \<Shm blocksize="1k" blockcount="1" type="sysv"/>
66 * @see AliHLTFileWriter and AliHLTRootFileWriterComponent for more parameters
68 class AliHLTTPCEsdWriterComponent : public AliHLTLogging
71 /** standard constructor */
72 AliHLTTPCEsdWriterComponent();
74 ~AliHLTTPCEsdWriterComponent();
77 * class AliHLTTPCEsdWriterComponent::AliWriter
78 * The writer component of the AliHLTTPCEsdWriterComponent.
80 class AliWriter : public AliHLTRootFileWriterComponent
83 /** standard constructor */
89 * The id of the component.
90 * @return component id (string)
92 const char* GetComponentID() {return "TPCEsdWriter";};
94 void GetInputDataTypes(AliHLTComponentDataTypeList& list);
98 * @return new class instance
100 AliHLTComponent* Spawn() {return new AliHLTTPCEsdWriterComponent::AliWriter;}
104 * Data processing method for the component.
105 * The function can be overloaded by specific ROOT file writer
107 * @param evtData event data structure
108 * @param blocks input data block descriptors
109 * @param trigData trigger data structure
111 virtual int DumpEvent( const AliHLTComponentEventData& evtData,
112 const AliHLTComponentBlockData* blocks,
113 AliHLTComponentTriggerData& trigData );
115 using AliHLTRootFileWriterComponent::DumpEvent;
118 * Scan one argument and adjacent parameters.
119 * @param argc size of the argument array
120 * @param argv agument array for component initialization
121 * @return number of processed members of the argv <br>
122 * -EINVAL unknown argument <br>
123 * -EPROTO parameter for argument missing <br>
125 int ScanArgument(int argc, const char** argv);
127 /** copy constructor prohibited */
128 AliWriter(const AliWriter&);
129 /** assignment operator prohibited */
130 AliWriter& operator=(const AliWriter&);
134 * The DoInit function is not available for this child class. InitWriter is the
135 * corresponding function for classes derived from AliHLTFileWriter.
141 * The DoDeinit function is not available for this child class. CloseWriter is the
142 * corresponding function for classes derived from AliHLTFileWriter.
147 TTree* fTree; //! transient value
150 AliESDEvent* fESD; //! transient value
152 /** pointer to the basic ESD conversion methods */
153 AliHLTTPCEsdWriterComponent* fBase; //! transient value
157 * class AliHLTTPCEsdWriterComponent::AliConverter
158 * The converter component of the AliHLTTPCEsdWriterComponent.
161 class AliConverter : public AliHLTProcessor
164 /** standard constructor */
169 // interface methods of base class
170 const char* GetComponentID() {return "TPCEsdConverter";};
171 void GetInputDataTypes(AliHLTComponentDataTypeList& list);
172 AliHLTComponentDataType GetOutputDataType();
173 void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
174 AliHLTComponent* Spawn() {return new AliHLTTPCEsdWriterComponent::AliConverter;}
177 // interface methods of base class
178 int DoInit(int argc, const char** argv);
180 int DoEvent(const AliHLTComponentEventData& evtData,
181 const AliHLTComponentBlockData* blocks,
182 AliHLTComponentTriggerData& trigData,
183 AliHLTUInt8_t* outputPtr,
184 AliHLTUInt32_t& size,
185 AliHLTComponentBlockDataList& outputBlocks );
187 using AliHLTProcessor::DoEvent;
190 /** copy constructor prohibited */
191 AliConverter(const AliConverter&);
192 /** assignment operator prohibited */
193 AliConverter& operator=(const AliConverter&);
195 /** pointer to the basic ESD conversion methods */
196 AliHLTTPCEsdWriterComponent* fBase; //! transient value
202 * Process the input data blocks.
203 * @param pTree tree to be filled
204 * @param pESD ESD to be filled
205 * @param blocks data block descriptor array
206 * @param nBlocks size of the array
207 * @param pMinSize [OUT] receives the minimum slice no
208 * @param pMaxSize [OUT] receives the maximum slice no
209 * @return neg. error code if failed
211 int ProcessBlocks(TTree* pTree, AliESDEvent* pESD, const AliHLTComponentBlockData* blocks,
212 int nBlocks, int* pMinSlice=NULL, int* pMaxSlice=NULL);
215 * Covert tracks to AliTPCtracks (AliKalmanTracks) and add them to ESD.
216 * @param pTracks array of tracks
217 * @param pESD pointer to ESD
218 * @return neg. error code if failed
220 int Tracks2ESD(AliHLTTPCTrackArray* pTracks, AliESDEvent* pESD);
223 /** copy constructor prohibited */
224 AliHLTTPCEsdWriterComponent(const AliHLTTPCEsdWriterComponent&);
225 /** assignment operator prohibited */
226 AliHLTTPCEsdWriterComponent& operator=(const AliHLTTPCEsdWriterComponent&);
228 ClassDef(AliHLTTPCEsdWriterComponent, 1)